linear-grab 0.27.2 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,29 +80,38 @@ Alternatively, you can use a provider module instead of the AI Gateway.
80
80
 
81
81
  Learn more: \x1B[34m${n}\x1B[0m
82
82
 
83
- `),{name:`GatewayAuthenticationError`})}function Gw(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:qw(e.inputTokens.total,e.outputTokens.total),raw:e.raw}}function Kw(){return{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0}}function qw(e,t){return e==null&&t==null?void 0:(e??0)+(t??0)}function Jw(){return(globalThis==null?void 0:globalThis.performance)?.now()??Date.now()}async function Yw(e){await Promise.all(Gp(e.callbacks).map(async t=>{try{await t?.(e.event)}catch{}}))}function Xw({error:e,exponentialBackoffDelay:t}){let n=ti.isInstance(e)?e.responseHeaders:ti.isInstance(e.cause)?e.cause.responseHeaders:void 0;if(!n)return t;let r,i=n[`retry-after-ms`];if(i){let e=parseFloat(i);Number.isNaN(e)||(r=e)}let a=n[`retry-after`];if(a&&r===void 0){let e=parseFloat(a);r=Number.isNaN(e)?Date.parse(a)-Date.now():e*1e3}return r!=null&&!Number.isNaN(r)&&0<=r&&(r<60*1e3||r<t)?r:t}function Zw({maxRetries:e,abortSignal:t}){if(e!=null){if(!Number.isInteger(e))throw new kT({parameter:`maxRetries`,value:e,message:`maxRetries must be an integer`});if(e<0)throw new kT({parameter:`maxRetries`,value:e,message:`maxRetries must be >= 0`})}let n=e??2;return{maxRetries:n,retry:GE({maxRetries:n,abortSignal:t})}}function Qw(e){let t=[`ROOT`],n=-1,r=null,i=0;function a(e){return e>=`0`&&e<=`9`||e>=`A`&&e<=`F`||e>=`a`&&e<=`f`}function o(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`);break}}function s(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop();break}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop();break}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case`ROOT`:o(u,l,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=l,t.pop();break}break;case`INSIDE_OBJECT_AFTER_COMMA`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break}break;case`INSIDE_OBJECT_KEY`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`);break}break;case`INSIDE_OBJECT_AFTER_KEY`:switch(u){case`:`:t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`);break}break;case`INSIDE_OBJECT_BEFORE_VALUE`:o(u,l,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:s(u,l);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=l;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=l}break;case`INSIDE_ARRAY_START`:switch(u){case`]`:n=l,t.pop();break;default:n=l,o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=l,t.pop();break;default:n=l;break}break;case`INSIDE_ARRAY_AFTER_COMMA`:o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),u===`u`?(i=0,t.push(`INSIDE_STRING_UNICODE_ESCAPE`)):n=l;break;case`INSIDE_STRING_UNICODE_ESCAPE`:a(u)&&(i++,i===4&&(t.pop(),n=l));break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=l;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l);break;default:t.pop();break}break;case`INSIDE_LITERAL`:{let i=e.substring(r,l+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?s(u,l):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l)):n=l;break}}}let l=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:l+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:l+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:l+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?l+=`true`.slice(t.length):`false`.startsWith(t)?l+=`false`.slice(t.length):`null`.startsWith(t)&&(l+=`null`.slice(t.length))}}return l}async function $w(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await Oh({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await Oh({text:Qw(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}function eT(...e){return async t=>{await Promise.allSettled(e.map(async e=>{await e?.(t)}))}}function tT(){return typeof process<`u`&&process.release?.name===`node`}async function nT(){if(tT())return $E??=Promise.resolve(rT(`node:diagnostics_channel`)),$E}function rT(e){let t=globalThis.process;try{return(t?.getBuiltinModule)?.call(t,e)}catch{return}}async function iT(e,t){let n=await nT(),r=(n?.tracingChannel)?.call(n,QE);if(r==null||r.hasSubscribers===!1)return await t();let i,a,o,s=!1,c=!1,l=()=>{try{i=Promise.resolve(t())}catch(e){i=Promise.reject(e)}return i=i.then(e=>(a=e,s=!0,e),e=>{throw o=e,c=!0,e}),i};try{return await r.tracePromise(l,e)}catch{if(c)throw o;return s?a:i==null?await t():await i}}function aT({message:e,completion:t}){if(!tT())return;let n=rT(`node:diagnostics_channel`),r=rT(`node:async_hooks`),i=(n?.tracingChannel)?.call(n,QE);if(i==null||i.hasSubscribers===!1||r==null){Promise.resolve(t).catch(()=>{});return}let a=e,o,s=!1,c=e=>{try{e()}catch{}},l=({result:e,error:t})=>{s||(s=!0,t!==void 0&&(a.error=t,c(()=>i.error.publish(a))),e!==void 0&&(a.result=e),c(()=>i.asyncEnd.publish(a)))};return c(()=>{i.start.runStores(a,()=>{o=new r.AsyncResource(`ai.telemetry`)})}),c(()=>i.end.publish(a)),Promise.resolve(t).then(e=>l({result:e}),e=>l({error:e})),{run:e=>o==null?e():o.runInAsyncScope(e)}}function oT(){return globalThis.AI_SDK_TELEMETRY_INTEGRATIONS??[]}function sT(e,t){return Object.assign(Object.create(Object.getPrototypeOf(e)),e,t)}function cT({telemetry:e}){if(e?.isEnabled===!1)return{};let t=e?.integrations,n=t==null?oT():Gp(t),r={recordInputs:e?.recordInputs,recordOutputs:e?.recordOutputs,functionId:e?.functionId},i=e=>{let t=eT(...n.map(t=>t[e]?.bind(t)).filter(Boolean).map(e=>t=>e(sT(t,r))));return async e=>{await t(e)}},a=n.map(e=>e.executeLanguageModelCall?.bind(e)).filter(Boolean),o=n.map(e=>e.executeTool?.bind(e)).filter(Boolean);return{runInTracingChannelSpan:async({type:e,event:t,execute:n})=>await iT({type:e,event:sT(t,r)},n),startTracingChannelContext:({type:e,event:t,completion:n})=>aT({message:{type:e,event:sT(t,r)},completion:n}),onStart:i(`onStart`),onStepStart:i(`onStepStart`),onLanguageModelCallStart:i(`onLanguageModelCallStart`),onLanguageModelCallEnd:i(`onLanguageModelCallEnd`),onToolExecutionStart:i(`onToolExecutionStart`),onToolExecutionEnd:i(`onToolExecutionEnd`),onStepEnd:eT(i(`onStepEnd`),i(`onStepFinish`)),onObjectStepStart:i(`onObjectStepStart`),onObjectStepEnd:i(`onObjectStepEnd`),onEmbedStart:i(`onEmbedStart`),onEmbedEnd:i(`onEmbedEnd`),onRerankStart:i(`onRerankStart`),onRerankEnd:i(`onRerankEnd`),onEnd:i(`onEnd`),onAbort:i(`onAbort`),onError:i(`onError`),executeLanguageModelCall:async({execute:e,...t})=>{let n=sT(t,r),i=e;for(let e of a){let t=i;i=()=>e({...n,execute:t})}return await iT({type:`languageModelCall`,event:n},i)},executeTool:async({execute:e,...t})=>{let n=sT(t,r),i=e;for(let e of o){let t=i;i=()=>e({...n,execute:t})}return await i()}}}function lT(e,t){let n=new Headers(e??{});for(let[e,r]of Object.entries(t))n.has(e)||n.set(e,r);return n}function uT({status:e,statusText:t,headers:n,stream:r}){return new Response(r.pipeThrough(new TextEncoderStream),{status:e??200,statusText:t,headers:lT(n,{"content-type":`text/plain; charset=utf-8`})})}function dT({response:e,status:t,statusText:n,headers:r,stream:i}){let a=t??200;n===void 0?e.writeHead(a,r):e.writeHead(a,n,r);let o=i.getReader();(async()=>{try{for(;;){let{done:t,value:n}=await o.read();if(t)break;let r=e.write(n),i=e.flush;typeof i==`function`&&i.call(e),r||await new Promise(t=>{e.once(`drain`,t)})}}catch(e){throw e}finally{e.end()}})()}function fT({response:e,status:t,statusText:n,headers:r,stream:i}){dT({response:e,status:t,statusText:n,headers:Object.fromEntries(lT(r,{"content-type":`text/plain; charset=utf-8`}).entries()),stream:i.pipeThrough(new TextEncoderStream)})}function pT(e){return mT(e.pipeThrough(new TransformStream))}function mT(e){return e[Symbol.asyncIterator]=function(){let e=this.getReader(),t=!1;async function n(n){if(!t){t=!0;try{n&&await e.cancel?.call(e)}finally{try{e.releaseLock()}catch{}}}}return{async next(){if(t)return{done:!0,value:void 0};let{done:r,value:i}=await e.read();return r?(await n(!0),{done:!0,value:void 0}):{done:!1,value:i}},async return(){return await n(!0),{done:!0,value:void 0}},async throw(e){throw await n(!0),e}}},e}function hT(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function gT(){let e=[],t=null,n=!1,r=hT(),i=()=>{n=!0,r.resolve(),e.forEach(e=>e.cancel()),e=[],t?.close()},a=async()=>{if(n&&e.length===0){t?.close();return}if(e.length===0)return r=hT(),await r.promise,await a();try{let{value:r,done:i}=await e[0].read();i?(e.shift(),e.length===0&&n?t?.close():await a()):t?.enqueue(r)}catch(n){t?.error(n),e.shift(),i()}};return{stream:new ReadableStream({start(e){t=e},pull:a,async cancel(){for(let t of e)await t.cancel();e=[],n=!0}}),addStream:t=>{if(n)throw Error(`Cannot add inner stream: outer stream is closed`);e.push(t.getReader()),r.resolve()},close:()=>{n=!0,r.resolve(),e.length===0&&t?.close()},terminate:i}}function _T({output:e,schema:t,enumValues:n}){switch(e){case`object`:return tD(bh(t));case`array`:return nD(bh(t));case`enum`:return rD(n);case`no-schema`:return eD;default:throw Error(`Unsupported output: ${e}`)}}async function vT(e,t,n){let r=await Oh({text:e});if(!r.success)throw new GT({message:`No object generated: could not parse the response.`,cause:r.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=await t.validateFinalResult(r.value,{text:e,response:n.response,usage:n.usage});if(!i.success)throw new GT({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.value}async function yT(e,t,n,r){try{return await vT(e,t,r)}catch(i){if(n!=null&&GT.isInstance(i)&&(ji.isInstance(i.cause)||la.isInstance(i.cause))){let a=await n({text:e,error:i.cause});if(a===null)throw i;return await vT(a,t,r)}throw i}}function bT({output:e,schema:t,schemaName:n,schemaDescription:r,enumValues:i}){if(e!=null&&e!==`object`&&e!==`array`&&e!==`enum`&&e!==`no-schema`)throw new kT({parameter:`output`,value:e,message:`Invalid output type.`});if(e===`no-schema`){if(t!=null)throw new kT({parameter:`schema`,value:t,message:`Schema is not supported for no-schema output.`});if(r!=null)throw new kT({parameter:`schemaDescription`,value:r,message:`Schema description is not supported for no-schema output.`});if(n!=null)throw new kT({parameter:`schemaName`,value:n,message:`Schema name is not supported for no-schema output.`});if(i!=null)throw new kT({parameter:`enumValues`,value:i,message:`Enum values are not supported for no-schema output.`})}if(e===`object`){if(t==null)throw new kT({parameter:`schema`,value:t,message:`Schema is required for object output.`});if(i!=null)throw new kT({parameter:`enumValues`,value:i,message:`Enum values are not supported for object output.`})}if(e===`array`){if(t==null)throw new kT({parameter:`schema`,value:t,message:`Element schema is required for array output.`});if(i!=null)throw new kT({parameter:`enumValues`,value:i,message:`Enum values are not supported for array output.`})}if(e===`enum`){if(t!=null)throw new kT({parameter:`schema`,value:t,message:`Schema is not supported for enum output.`});if(r!=null)throw new kT({parameter:`schemaDescription`,value:r,message:`Schema description is not supported for enum output.`});if(n!=null)throw new kT({parameter:`schemaName`,value:n,message:`Schema name is not supported for enum output.`});if(i==null)throw new kT({parameter:`enumValues`,value:i,message:`Enum values are required for enum output.`});for(let e of i)if(typeof e!=`string`)throw new kT({parameter:`enumValues`,value:e,message:`Enum values must be strings.`})}}function xT(e,t){if(e===t)return!0;if(e==null||t==null)return!1;if(typeof e!=`object`&&typeof t!=`object`)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!xT(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!xT(e[i],t[i]))return!1;return!0}function ST(e){let{model:t,output:n=`object`,instructions:r,system:i,prompt:a,messages:o,allowSystemInMessages:s,maxRetries:c,abortSignal:l,headers:u,experimental_repairText:d,experimental_telemetry:f,telemetry:p=f,experimental_download:m,providerOptions:h,onStart:g,experimental_onStart:_,onStepStart:v,experimental_onStepStart:y,onStepEnd:b,onStepFinish:x,onError:S=({error:e})=>{console.error(e)},onFinish:C,_internal:{generateId:w=iD,currentDate:T=()=>new Date,now:E=Jw}={},...D}=e,O=`enum`in e&&e.enum?e.enum:void 0,{schema:k,schemaDescription:ee,schemaName:te}=`schema`in e?e:{};return bT({output:n,schema:k,schemaName:te,schemaDescription:ee,enumValues:O}),new aD({model:t,telemetry:p,headers:u,settings:D,maxRetries:c,abortSignal:l,outputStrategy:_T({output:n,schema:k,enumValues:O}),instructions:r,system:i,prompt:a,messages:o,allowSystemInMessages:s,schemaName:te,schemaDescription:ee,providerOptions:h,repairText:d,onStart:g??_,onStepStart:v??y,onStepFinish:b??x,onError:S,onFinish:C,download:m,generateId:w,currentDate:T,now:E})}var CT,wT,TT,ET,DT,OT,kT,AT,jT,MT,NT,PT,FT,IT,LT,RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T,eE,tE,nE,rE,iE,aE,oE,sE,cE,lE,uE,dE,fE,pE,mE,hE,gE,_E,vE,yE,bE,xE,SE,CE,wE,TE,EE,DE,OE,kE,AE,jE,ME,NE,PE,FE,IE,LE,RE,zE,BE,VE,HE,UE,WE,GE,KE,qE,JE,YE,XE,ZE,QE,$E,eD,tD,nD,rD,iD,aD,oD,sD=t((()=>{$g(),ga(),cw(),Fd(),CT=Object.defineProperty,wT=(e,t)=>{for(var n in t)CT(e,n,{get:t[n],enumerable:!0})},TT=`AI_InvalidArgumentError`,ET=`vercel.ai.error.${TT}`,DT=Symbol.for(ET),kT=class extends Yr{constructor({parameter:e,value:t,message:n}){super({name:TT,message:`Invalid argument for parameter ${e}: ${n}`}),this[OT]=!0,this.parameter=e,this.value=t}static isInstance(e){return Yr.hasMarker(e,ET)}},OT=DT,AT=`AI_InvalidStreamPartError`,`${AT}`,jT=`AI_InvalidToolApprovalError`,`${jT}`,MT=`AI_InvalidToolApprovalSignatureError`,`${MT}`,NT=`AI_InvalidToolInputError`,`${NT}`,PT=`AI_ToolCallNotFoundForApprovalError`,`${PT}`,FT=`AI_MissingToolResultsError`,IT=`vercel.ai.error.${FT}`,LT=Symbol.for(IT),zT=class extends Yr{constructor({toolCallIds:e}){super({name:FT,message:`Tool result${e.length>1?`s are`:` is`} missing for tool call${e.length>1?`s`:``} ${e.join(`, `)}.`}),this[RT]=!0,this.toolCallIds=e}static isInstance(e){return Yr.hasMarker(e,IT)}},RT=LT,BT=`AI_NoImageGeneratedError`,`${BT}`,VT=`AI_NoObjectGeneratedError`,HT=`vercel.ai.error.${VT}`,UT=Symbol.for(HT),GT=class extends Yr{constructor({message:e=`No object generated.`,cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:VT,message:e,cause:t}),this[WT]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return Yr.hasMarker(e,HT)}},WT=UT,KT=`AI_NoOutputGeneratedError`,`${KT}`,qT=`AI_NoSpeechGeneratedError`,`${qT}`,JT=`AI_NoTranscriptGeneratedError`,`${JT}`,YT=`AI_NoVideoGeneratedError`,`${YT}`,XT=`AI_NoSuchToolError`,`${XT}`,ZT=`AI_ToolCallRepairError`,`${ZT}`,QT=class extends Yr{constructor(e){super({name:`AI_UnsupportedModelVersionError`,message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},$T=`AI_UIMessageStreamError`,`${$T}`,eE=`AI_InvalidDataContentError`,tE=`vercel.ai.error.${eE}`,nE=Symbol.for(tE),iE=class extends Yr{constructor({content:e,cause:t,message:n=`Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ${typeof e}.`}){super({name:eE,message:n,cause:t}),this[rE]=!0,this.content=e}static isInstance(e){return Yr.hasMarker(e,tE)}},rE=nE,aE=`AI_InvalidMessageRoleError`,oE=`vercel.ai.error.${aE}`,sE=Symbol.for(oE),lE=class extends Yr{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:aE,message:t}),this[cE]=!0,this.role=e}static isInstance(e){return Yr.hasMarker(e,oE)}},cE=sE,uE=`AI_MessageConversionError`,`${uE}`,dE=`AI_RetryError`,fE=`vercel.ai.error.${dE}`,pE=Symbol.for(fE),hE=class extends Yr{constructor({message:e,reason:t,errors:n}){super({name:dE,message:e}),this[mE]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return Yr.hasMarker(e,fE)}},mE=pE,gE=`AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.`,_E=!1,vE=e=>{if(e.warnings.length===0)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t==`function`){t(e);return}_E||(_E=!0,console.info(gE));for(let t of e.warnings){let n=lw({warning:t,provider:e.provider,model:e.model});typeof process<`u`&&typeof process.emitWarning==`function`?process.emitWarning(n,{type:t.type===`deprecated`?`DeprecationWarning`:`Warning`}):console.warn(n)}}},yE=`7.0.22`,bE=async({url:e,maxBytes:t,abortSignal:n})=>{let r=e.toString();try{let e=await pm({url:r,headers:Sm({},`ai-sdk/${yE}`,bm()),abortSignal:n});if(!e.ok)throw await om(e),new sg({url:r,statusCode:e.status,statusText:e.statusText});return{data:await mm({response:e,url:r,maxBytes:t??lg}),mediaType:e.headers.get(`content-type`)??void 0}}catch(e){throw sg.isInstance(e)?e:new sg({url:r,cause:e})}},xE=(e=bE)=>t=>Promise.all(t.map(async t=>t.isUrlSupportedByModel?null:await e(t))),SE={jpg:`image/jpeg`,jpeg:`image/jpeg`,png:`image/png`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,avif:`image/avif`,heic:`image/heic`,bmp:`image/bmp`,tiff:`image/tiff`,tif:`image/tiff`,pdf:`application/pdf`,mp4:`video/mp4`,webm:`video/webm`,mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`},CE=Du(()=>B([lu(),I(),L(),cu(),_u(I(),CE.optional()),R(CE)])),wE=_u(I(),_u(I(),CE.optional())),TE=B([I(),Mu(Uint8Array),Mu(ArrayBuffer),ku(Cm,{message:`Must be a Buffer`})]),EE=_u(I(),I()),DE=z({type:H(`text`),text:I(),providerOptions:wE.optional()}),OE=z({type:H(`image`),image:B([TE,Mu(URL),EE]),mediaType:I().optional(),providerOptions:wE.optional()}),kE=mu(`type`,[z({type:H(`data`),data:TE}),z({type:H(`url`),url:Mu(URL)}),z({type:H(`reference`),reference:EE}),z({type:H(`text`),text:I()})]),AE=mu(`type`,[z({type:H(`data`),data:TE}),z({type:H(`url`),url:Mu(URL)})]),jE=z({type:H(`file`),data:B([kE,TE,Mu(URL),EE]),filename:I().optional(),mediaType:I(),providerOptions:wE.optional()}),ME=z({type:H(`reasoning`),text:I(),providerOptions:wE.optional()}),NE=z({type:H(`custom`),kind:I().transform(e=>e),providerOptions:wE.optional()}),PE=z({type:H(`reasoning-file`),data:B([AE,TE,Mu(URL)]),mediaType:I(),providerOptions:wE.optional()}),FE=z({type:H(`tool-call`),toolCallId:I(),toolName:I(),input:du(),providerOptions:wE.optional(),providerExecuted:cu().optional()}),IE=mu(`type`,[z({type:H(`text`),value:I(),providerOptions:wE.optional()}),z({type:H(`json`),value:CE,providerOptions:wE.optional()}),z({type:H(`execution-denied`),reason:I().optional(),providerOptions:wE.optional()}),z({type:H(`error-text`),value:I(),providerOptions:wE.optional()}),z({type:H(`error-json`),value:CE,providerOptions:wE.optional()}),z({type:H(`content`),value:R(B([z({type:H(`text`),text:I(),providerOptions:wE.optional()}),z({type:H(`file`),data:kE,mediaType:I(),filename:I().optional(),providerOptions:wE.optional()}),z({type:H(`file-data`),data:I(),mediaType:I(),filename:I().optional(),providerOptions:wE.optional()}),z({type:H(`file-url`),url:I(),mediaType:I().optional(),providerOptions:wE.optional()}),z({type:H(`file-id`),fileId:B([I(),_u(I(),I())]),providerOptions:wE.optional()}),z({type:H(`file-reference`),providerReference:_u(I(),I()),providerOptions:wE.optional()}),z({type:H(`image-data`),data:I(),mediaType:I(),providerOptions:wE.optional()}),z({type:H(`image-url`),url:I(),providerOptions:wE.optional()}),z({type:H(`image-file-id`),fileId:B([I(),_u(I(),I())]),providerOptions:wE.optional()}),z({type:H(`image-file-reference`),providerReference:_u(I(),I()),providerOptions:wE.optional()}),z({type:H(`custom`),providerOptions:wE.optional()})]))})]),LE=z({type:H(`tool-result`),toolCallId:I(),toolName:I(),output:IE,providerOptions:wE.optional()}),RE=z({type:H(`tool-approval-request`),approvalId:I(),toolCallId:I()}),zE=z({type:H(`tool-approval-response`),approvalId:I(),approved:cu(),reason:I().optional()}),BE=z({role:H(`system`),content:I(),providerOptions:wE.optional()}),VE=z({role:H(`user`),content:B([I(),R(B([DE,OE,jE]))]),providerOptions:wE.optional()}),HE=z({role:H(`assistant`),content:B([I(),R(B([DE,NE,jE,ME,PE,FE,LE,RE]))]),providerOptions:wE.optional()}),UE=z({role:H(`tool`),content:R(B([LE,zE])),providerOptions:wE.optional()}),WE=B([BE,VE,HE,UE]),GE=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:r}={})=>Gg({maxRetries:e,initialDelayInMs:t,backoffFactor:n,abortSignal:r,shouldRetry:e=>e instanceof Error&&(ti.isInstance(e)&&e.isRetryable===!0||uS.isInstance(e)&&e.isRetryable===!0),getDelayInMs:({error:e,exponentialBackoffDelay:t})=>Xw({error:e,exponentialBackoffDelay:t}),createRetryError:({message:e,reason:t,errors:n})=>new hE({message:e,reason:t,errors:n})}),KE={},wT(KE,{array:()=>YE,choice:()=>XE,json:()=>ZE,object:()=>JE,text:()=>qE}),qE=()=>({name:`text`,responseFormat:Promise.resolve({type:`text`}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),JE=({schema:e,name:t,description:n})=>{let r=bh(e);return{name:`object`,responseFormat:Fh(r.jsonSchema).then(e=>({type:`json`,schema:e,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:e},t){let n=await Oh({text:e});if(!n.success)throw new GT({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=await Eh({value:n.value,schema:r});if(!i.success)throw new GT({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return i.value},async parsePartialOutput({text:e}){let t=await $w(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return{partial:t.value}}},createElementStreamTransform(){}}},YE=({element:e,name:t,description:n})=>{let r=bh(e);return{name:`array`,responseFormat:Fh(r.jsonSchema).then(e=>{let{$schema:r,...i}=e;return{type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{elements:{type:`array`,items:i}},required:[`elements`],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:e},t){let n=await Oh({text:e});if(!n.success)throw new GT({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=n.value;if(typeof i!=`object`||!i||!(`elements`in i)||!Array.isArray(i.elements))throw new GT({message:`No object generated: response did not match schema.`,cause:new la({value:i,cause:`response must be an object with an elements array`}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=[];for(let n of i.elements){let i=await Eh({value:n,schema:r});if(!i.success)throw new GT({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});a.push(i.value)}return a},async parsePartialOutput({text:e}){let t=await $w(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let e=t.value;if(typeof e!=`object`||!e||!(`elements`in e)||!Array.isArray(e.elements))return;let n=t.state===`repaired-parse`&&e.elements.length>0?e.elements.slice(0,-1):e.elements,i=[];for(let e of n){let t=await Eh({value:e,schema:r});t.success&&i.push(t.value)}return{partial:i}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(t!=null)for(;e<t.length;e++)n.enqueue(t[e])}})}}},XE=({options:e,name:t,description:n})=>({name:`choice`,responseFormat:Promise.resolve({type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{result:{type:`string`,enum:e}},required:[`result`],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:t},n){let r=await Oh({text:t});if(!r.success)throw new GT({message:`No object generated: could not parse the response.`,cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=r.value;if(typeof i!=`object`||!i||!(`result`in i)||typeof i.result!=`string`||!e.includes(i.result))throw new GT({message:`No object generated: response did not match schema.`,cause:new la({value:i,cause:`response must be an object that contains a choice value.`}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.result},async parsePartialOutput({text:t}){let n=await $w(t);switch(n.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let t=n.value;if(typeof t!=`object`||!t||!(`result`in t)||typeof t.result!=`string`)return;let r=e.filter(e=>e.startsWith(t.result));return n.state===`successful-parse`?r.includes(t.result)?{partial:t.result}:void 0:r.length===1?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),ZE=({name:e,description:t}={})=>({name:`json`,responseFormat:Promise.resolve({type:`json`,...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:e},t){let n=await Oh({text:e});if(!n.success)throw new GT({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await $w(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return t.value===void 0?void 0:{partial:t.value}}},createElementStreamTransform(){}}),QE=`ai:telemetry`,new TextEncoder,new TextEncoder,ug({prefix:`aitxt`,size:24}),ug({prefix:`call`,size:24}),TransformStream,_u(I(),CE.optional()),ug({prefix:`aitxt`,size:24}),ug({prefix:`call`,size:24}),ug({prefix:`aitxt`,size:24}),ug({prefix:`call`,size:24}),_u(I(),CE.optional()),_u(I(),I()),ug({prefix:`call`,size:24}),ug({prefix:`call`,size:24}),eD={type:`no-schema`,jsonSchema:async()=>void 0,async validatePartialResult({value:e,textDelta:t}){return{success:!0,value:{partial:e,textDelta:t}}},async validateFinalResult(e,t){return e===void 0?{success:!1,error:new GT({message:`No object generated: response did not match schema.`,text:t.text,response:t.response,usage:t.usage,finishReason:t.finishReason})}:{success:!0,value:e}},createElementStream(){throw new ha({functionality:`element streams in no-schema mode`})}},tD=e=>({type:`object`,jsonSchema:async()=>await e.jsonSchema,async validatePartialResult({value:e,textDelta:t}){return{success:!0,value:{partial:e,textDelta:t}}},async validateFinalResult(t){return Eh({value:t,schema:e})},createElementStream(){throw new ha({functionality:`element streams in object mode`})}}),nD=e=>({type:`array`,jsonSchema:async()=>{let{$schema:t,...n}=await e.jsonSchema;return{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{elements:{type:`array`,items:n}},required:[`elements`],additionalProperties:!1}},async validatePartialResult({value:t,latestObject:n,isFirstDelta:r,isFinalDelta:i}){if(!Wr(t)||!Ur(t.elements))return{success:!1,error:new la({value:t,cause:`value must be an object that contains an array of elements`})};let a=t.elements,o=[];for(let t=0;t<a.length;t++){let n=a[t],r=await Eh({value:n,schema:e});if(!(t===a.length-1&&!i)){if(!r.success)return r;o.push(r.value)}}let s=n?.length??0,c=``;return r&&(c+=`[`),s>0&&(c+=`,`),c+=o.slice(s).map(e=>JSON.stringify(e)).join(`,`),i&&(c+=`]`),{success:!0,value:{partial:o,textDelta:c}}},async validateFinalResult(t){if(!Wr(t)||!Ur(t.elements))return{success:!1,error:new la({value:t,cause:`value must be an object that contains an array of elements`})};let n=t.elements,r=[];for(let t of n){let n=await Eh({value:t,schema:e});if(!n.success)return n;r.push(n.value)}return{success:!0,value:r}},createElementStream(e){let t=0;return pT(e.pipeThrough(new TransformStream({transform(e,n){switch(e.type){case`object`:{let r=e.object;for(;t<r.length;t++)n.enqueue(r[t]);break}case`text-delta`:case`finish`:case`error`:break;default:throw Error(`Unsupported chunk type: ${e}`)}}})))}}),rD=e=>({type:`enum`,jsonSchema:async()=>({$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{result:{type:`string`,enum:e}},required:[`result`],additionalProperties:!1}),async validateFinalResult(t){if(!Wr(t)||typeof t.result!=`string`)return{success:!1,error:new la({value:t,cause:`value must be an object that contains a string in the "result" property.`})};let n=t.result;return e.includes(n)?{success:!0,value:n}:{success:!1,error:new la({value:t,cause:`value must be a string in the enum`})}},async validatePartialResult({value:t,textDelta:n}){if(!Wr(t)||typeof t.result!=`string`)return{success:!1,error:new la({value:t,cause:`value must be an object that contains a string in the "result" property.`})};let r=t.result,i=e.filter(e=>e.startsWith(r));return t.result.length===0||i.length===0?{success:!1,error:new la({value:t,cause:`value must be a string in the enum`})}:{success:!0,value:{partial:i.length>1?r:i[0],textDelta:n}}},createElementStream(){throw new ha({functionality:`element streams in enum mode`})}}),ug({prefix:`aiobj`,size:24}),iD=ug({prefix:`aiobj`,size:24}),aD=class{constructor({model:e,headers:t,telemetry:n,settings:r,maxRetries:i,abortSignal:a,outputStrategy:o,instructions:s,system:c,prompt:l,messages:u,allowSystemInMessages:d,schemaName:f,schemaDescription:p,providerOptions:m,repairText:h,onStart:g,onStepStart:_,onStepFinish:v,onError:y,onFinish:b,download:x,generateId:S,currentDate:C,now:w}){this._object=new Yh,this._usage=new Yh,this._providerMetadata=new Yh,this._warnings=new Yh,this._request=new Yh,this._response=new Yh,this._finishReason=new Yh;let T=Dw(e),{maxRetries:E,retry:D}=Zw({maxRetries:i,abortSignal:a}),O=Hw(r),k=cT({telemetry:n}),ee=this,te=gT(),A=new TransformStream({transform(e,t){t.enqueue(e),e.type===`error`&&y({error:Ww(e.error)})}});this.baseStream=te.stream.pipeThrough(A);let ne=S();(async()=>{let e=await o.jsonSchema();await Yw({event:{callId:ne,operationId:`ai.streamObject`,provider:T.provider,modelId:T.modelId,system:s??c,prompt:l,messages:u,maxOutputTokens:O.maxOutputTokens,temperature:O.temperature,topP:O.topP,topK:O.topK,presencePenalty:O.presencePenalty,frequencyPenalty:O.frequencyPenalty,seed:O.seed,maxRetries:E,headers:t,providerOptions:m,output:o.type,schema:e,schemaName:f,schemaDescription:p},callbacks:[g,k.onStart]});let n=await Uw({instructions:s,system:c,prompt:l,messages:u,allowSystemInMessages:d}),i={responseFormat:{type:`json`,schema:e,name:f,description:p},...Hw(r),prompt:await Pw({prompt:n,supportedUrls:await T.supportedUrls,download:x,provider:T.provider.split(`.`)[0]}),providerOptions:m,abortSignal:a,headers:t,includeRawChunks:!1};await Yw({event:{callId:ne,stepNumber:0,provider:T.provider,modelId:T.modelId,providerOptions:m,headers:t,promptMessages:i.prompt},callbacks:[_,k.onObjectStepStart]});let y={transform:(e,t)=>{switch(e.type){case`text-delta`:t.enqueue(e.delta);break;case`response-metadata`:case`finish`:case`error`:case`stream-start`:t.enqueue(e);break}}},A=w(),{stream:re,response:ie,request:ae}=await D(()=>T.doStream(i));ee._request.resolve(ae??{});let oe,se=Kw(),ce,le,ue,de,fe,pe=``,me=``,he={id:S(),timestamp:C(),modelId:T.modelId},ge,_e,ve=!0,ye=!0,be=re.pipeThrough(new TransformStream(y)).pipeThrough(new TransformStream({async transform(e,t){if(typeof e==`object`&&e.type===`stream-start`){oe=e.warnings;return}if(ve&&=(fe=w()-A,!1),typeof e==`string`){pe+=e,me+=e;let{value:n,state:r}=await $w(pe);if(n!==void 0&&!xT(ge,n)){let e=await o.validatePartialResult({value:n,textDelta:me,latestObject:_e,isFirstDelta:ye,isFinalDelta:r===`successful-parse`});e.success&&!xT(_e,e.value.partial)&&(ge=n,_e=e.value.partial,t.enqueue({type:`object`,object:_e}),t.enqueue({type:`text-delta`,textDelta:e.value.textDelta}),me=``,ye=!1)}return}switch(e.type){case`response-metadata`:he={id:e.id??he.id,timestamp:e.timestamp??he.timestamp,modelId:e.modelId??he.modelId};break;case`finish`:me!==``&&t.enqueue({type:`text-delta`,textDelta:me}),ce=e.finishReason.unified,se=Gw(e.usage),le=e.providerMetadata,t.enqueue({...e,finishReason:e.finishReason.unified,usage:se,response:he}),vE({warnings:oe??[],provider:T.provider,model:T.modelId}),ee._usage.resolve(se),ee._providerMetadata.resolve(le),ee._warnings.resolve(oe),ee._response.resolve({...he,headers:ie?.headers}),ee._finishReason.resolve(ce??`other`);try{ue=await yT(pe,o,h,{response:he,usage:se,finishReason:ce}),ee._object.resolve(ue)}catch(e){de=e,ee._object.reject(e)}break;default:t.enqueue(e);break}},async flush(e){try{let e=se??{promptTokens:NaN,completionTokens:NaN,totalTokens:NaN};await Yw({event:{callId:ne,stepNumber:0,provider:T.provider,modelId:T.modelId,finishReason:ce??`other`,usage:e,objectText:pe,msToFirstChunk:fe,reasoning:void 0,warnings:oe,request:ae??{},response:{...he,headers:ie?.headers},providerMetadata:le},callbacks:[v,k.onObjectStepEnd]}),await Yw({event:{callId:ne,object:ue,error:de,reasoning:void 0,finishReason:ce??`other`,usage:e,warnings:oe,request:ae??{},response:{...he,headers:ie?.headers},providerMetadata:le},callbacks:[b,k.onEnd]})}catch(t){e.enqueue({type:`error`,error:t})}}}));te.addStream(be)})().catch(async e=>{await k.onError?.call(k,{callId:ne,error:e}),te.addStream(new ReadableStream({start(t){t.enqueue({type:`error`,error:e}),t.close()}}))}).finally(()=>{te.close()}),this.outputStrategy=o}get object(){return this._object.promise}get usage(){return this._usage.promise}get providerMetadata(){return this._providerMetadata.promise}get warnings(){return this._warnings.promise}get request(){return this._request.promise}get response(){return this._response.promise}get finishReason(){return this._finishReason.promise}get partialObjectStream(){return pT(this.baseStream.pipeThrough(new TransformStream({transform(e,t){switch(e.type){case`object`:t.enqueue(e.object);break;case`text-delta`:case`finish`:case`error`:break;default:throw Error(`Unsupported chunk type: ${e}`)}}})))}get elementStream(){return this.outputStrategy.createElementStream(this.baseStream)}get textStream(){return pT(this.baseStream.pipeThrough(new TransformStream({transform(e,t){switch(e.type){case`text-delta`:t.enqueue(e.textDelta);break;case`object`:case`finish`:case`error`:break;default:throw Error(`Unsupported chunk type: ${e}`)}}})))}get fullStream(){return pT(this.baseStream)}pipeTextStreamToResponse(e,t){fT({response:e,stream:this.textStream,...t})}toTextStreamResponse(e){return uT({stream:this.textStream,...e})}},oD=`AI_NoSuchProviderError`,`${oD}`,ug({prefix:`call`,size:24})})),cD=t((()=>{kp(),kp()})),lD,uD=t((()=>{cD(),lD=Dp({title:wp().describe(`Concise, specific issue title. Imperative or descriptive, no trailing period.`),description:wp().describe(`Issue body in Linear markdown: a short problem summary and relevant context. Do NOT include repro steps, expected/actual, or source location — those are separate fields.`),reproSteps:Ep(wp()).describe(`Ordered reproduction steps, each a single action.`),expected:wp().describe(`Expected behavior, one or two sentences.`),actual:wp().describe(`Actual (buggy) behavior, one or two sentences.`),impact:wp().describe(`Who/what is affected and how badly, 1-2 sentences (e.g. "Cosmetic/UX polish issue — doesn't block anything but feels glitchy.").`),analysisNotes:wp().describe(`Markdown bullet list ("- …") of likely root-cause analysis based on the source context. Empty string when there is nothing substantive to say.`),suggestedNextSteps:wp().describe(`Markdown bullet list of concrete, actionable fix suggestions the coding agent should consider first.`),priority:Tp().int().min(0).max(4).describe(`Linear priority: 0 none, 1 urgent, 2 high, 3 medium, 4 low.`),suggestedLabels:Ep(wp()).describe(`0-3 suggested label names, e.g. "Bug", "UI".`)})}));function dD(e){let t=[e.issueTemplate?.trim()||_D],n=(e.skillPaths??``).split(`
84
- `).map(e=>e.trim()).filter(Boolean);if(n.length&&t.push(`**Project skills & memory MANDATORY reading before implementing.** This repo ships maintained skills/memory files. Read each of these paths in your checkout and treat their guidance as authoritative for design, style, and architectural decisions:\n${n.map(e=>`- \`${e}\``).join(`
85
- `)}`),e.githubAssetsRepo?.trim()){let n=e.githubAssetsRepo.trim(),r=e.githubToken?.trim()?` Your environment's git identity may lack push access to this repo — use this fine-grained token (scoped to the assets repo only): \`${e.githubToken.trim()}\`. Push via \`https://x-access-token:<token>@github.com/${n}.git\` or \`gh api\` with it.`:``;t.push(`**Demo media hosting:** commit demo GIFs/videos to the PUBLIC assets repo \`${n}\` under \`linear-grab/\` (clone it or use \`gh api\`), and embed the raw.githubusercontent.com URL in BOTH the Linear comment and the PR body. Prefer GIF for short demos — it renders inline everywhere (Linear, GitHub, the panel); Linear-hosted uploads do NOT render on GitHub.${r}`)}e.shareLinearKey&&e.linearApiKey?.trim()&&t.push(`**Linear access — close out this issue YOURSELF via the raw GraphQL API** (do not rely on a Linear MCP; it is not authenticated in your environment):
83
+ `),{name:`GatewayAuthenticationError`})}function Gw(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:qw(e.inputTokens.total,e.outputTokens.total),raw:e.raw}}function Kw(){return{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0}}function qw(e,t){return e==null&&t==null?void 0:(e??0)+(t??0)}function Jw(){return(globalThis==null?void 0:globalThis.performance)?.now()??Date.now()}async function Yw(e){await Promise.all(Gp(e.callbacks).map(async t=>{try{await t?.(e.event)}catch{}}))}function Xw({error:e,exponentialBackoffDelay:t}){let n=ti.isInstance(e)?e.responseHeaders:ti.isInstance(e.cause)?e.cause.responseHeaders:void 0;if(!n)return t;let r,i=n[`retry-after-ms`];if(i){let e=parseFloat(i);Number.isNaN(e)||(r=e)}let a=n[`retry-after`];if(a&&r===void 0){let e=parseFloat(a);r=Number.isNaN(e)?Date.parse(a)-Date.now():e*1e3}return r!=null&&!Number.isNaN(r)&&0<=r&&(r<60*1e3||r<t)?r:t}function Zw({maxRetries:e,abortSignal:t}){if(e!=null){if(!Number.isInteger(e))throw new kT({parameter:`maxRetries`,value:e,message:`maxRetries must be an integer`});if(e<0)throw new kT({parameter:`maxRetries`,value:e,message:`maxRetries must be >= 0`})}let n=e??2;return{maxRetries:n,retry:GE({maxRetries:n,abortSignal:t})}}function Qw(e){let t=[`ROOT`],n=-1,r=null,i=0;function a(e){return e>=`0`&&e<=`9`||e>=`A`&&e<=`F`||e>=`a`&&e<=`f`}function o(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`);break}}function s(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop();break}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop();break}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case`ROOT`:o(u,l,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=l,t.pop();break}break;case`INSIDE_OBJECT_AFTER_COMMA`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break}break;case`INSIDE_OBJECT_KEY`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`);break}break;case`INSIDE_OBJECT_AFTER_KEY`:switch(u){case`:`:t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`);break}break;case`INSIDE_OBJECT_BEFORE_VALUE`:o(u,l,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:s(u,l);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=l;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=l}break;case`INSIDE_ARRAY_START`:switch(u){case`]`:n=l,t.pop();break;default:n=l,o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=l,t.pop();break;default:n=l;break}break;case`INSIDE_ARRAY_AFTER_COMMA`:o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),u===`u`?(i=0,t.push(`INSIDE_STRING_UNICODE_ESCAPE`)):n=l;break;case`INSIDE_STRING_UNICODE_ESCAPE`:a(u)&&(i++,i===4&&(t.pop(),n=l));break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=l;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l);break;default:t.pop();break}break;case`INSIDE_LITERAL`:{let i=e.substring(r,l+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?s(u,l):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l)):n=l;break}}}let l=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:l+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:l+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:l+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?l+=`true`.slice(t.length):`false`.startsWith(t)?l+=`false`.slice(t.length):`null`.startsWith(t)&&(l+=`null`.slice(t.length))}}return l}async function $w(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await Oh({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await Oh({text:Qw(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}function eT(...e){return async t=>{await Promise.allSettled(e.map(async e=>{await e?.(t)}))}}function tT(){return typeof process<`u`&&process.release?.name===`node`}async function nT(){if(tT())return $E??=Promise.resolve(rT(`node:diagnostics_channel`)),$E}function rT(e){let t=globalThis.process;try{return(t?.getBuiltinModule)?.call(t,e)}catch{return}}async function iT(e,t){let n=await nT(),r=(n?.tracingChannel)?.call(n,QE);if(r==null||r.hasSubscribers===!1)return await t();let i,a,o,s=!1,c=!1,l=()=>{try{i=Promise.resolve(t())}catch(e){i=Promise.reject(e)}return i=i.then(e=>(a=e,s=!0,e),e=>{throw o=e,c=!0,e}),i};try{return await r.tracePromise(l,e)}catch{if(c)throw o;return s?a:i==null?await t():await i}}function aT({message:e,completion:t}){if(!tT())return;let n=rT(`node:diagnostics_channel`),r=rT(`node:async_hooks`),i=(n?.tracingChannel)?.call(n,QE);if(i==null||i.hasSubscribers===!1||r==null){Promise.resolve(t).catch(()=>{});return}let a=e,o,s=!1,c=e=>{try{e()}catch{}},l=({result:e,error:t})=>{s||(s=!0,t!==void 0&&(a.error=t,c(()=>i.error.publish(a))),e!==void 0&&(a.result=e),c(()=>i.asyncEnd.publish(a)))};return c(()=>{i.start.runStores(a,()=>{o=new r.AsyncResource(`ai.telemetry`)})}),c(()=>i.end.publish(a)),Promise.resolve(t).then(e=>l({result:e}),e=>l({error:e})),{run:e=>o==null?e():o.runInAsyncScope(e)}}function oT(){return globalThis.AI_SDK_TELEMETRY_INTEGRATIONS??[]}function sT(e,t){return Object.assign(Object.create(Object.getPrototypeOf(e)),e,t)}function cT({telemetry:e}){if(e?.isEnabled===!1)return{};let t=e?.integrations,n=t==null?oT():Gp(t),r={recordInputs:e?.recordInputs,recordOutputs:e?.recordOutputs,functionId:e?.functionId},i=e=>{let t=eT(...n.map(t=>t[e]?.bind(t)).filter(Boolean).map(e=>t=>e(sT(t,r))));return async e=>{await t(e)}},a=n.map(e=>e.executeLanguageModelCall?.bind(e)).filter(Boolean),o=n.map(e=>e.executeTool?.bind(e)).filter(Boolean);return{runInTracingChannelSpan:async({type:e,event:t,execute:n})=>await iT({type:e,event:sT(t,r)},n),startTracingChannelContext:({type:e,event:t,completion:n})=>aT({message:{type:e,event:sT(t,r)},completion:n}),onStart:i(`onStart`),onStepStart:i(`onStepStart`),onLanguageModelCallStart:i(`onLanguageModelCallStart`),onLanguageModelCallEnd:i(`onLanguageModelCallEnd`),onToolExecutionStart:i(`onToolExecutionStart`),onToolExecutionEnd:i(`onToolExecutionEnd`),onStepEnd:eT(i(`onStepEnd`),i(`onStepFinish`)),onObjectStepStart:i(`onObjectStepStart`),onObjectStepEnd:i(`onObjectStepEnd`),onEmbedStart:i(`onEmbedStart`),onEmbedEnd:i(`onEmbedEnd`),onRerankStart:i(`onRerankStart`),onRerankEnd:i(`onRerankEnd`),onEnd:i(`onEnd`),onAbort:i(`onAbort`),onError:i(`onError`),executeLanguageModelCall:async({execute:e,...t})=>{let n=sT(t,r),i=e;for(let e of a){let t=i;i=()=>e({...n,execute:t})}return await iT({type:`languageModelCall`,event:n},i)},executeTool:async({execute:e,...t})=>{let n=sT(t,r),i=e;for(let e of o){let t=i;i=()=>e({...n,execute:t})}return await i()}}}function lT(e,t){let n=new Headers(e??{});for(let[e,r]of Object.entries(t))n.has(e)||n.set(e,r);return n}function uT({status:e,statusText:t,headers:n,stream:r}){return new Response(r.pipeThrough(new TextEncoderStream),{status:e??200,statusText:t,headers:lT(n,{"content-type":`text/plain; charset=utf-8`})})}function dT({response:e,status:t,statusText:n,headers:r,stream:i}){let a=t??200;n===void 0?e.writeHead(a,r):e.writeHead(a,n,r);let o=i.getReader();(async()=>{try{for(;;){let{done:t,value:n}=await o.read();if(t)break;let r=e.write(n),i=e.flush;typeof i==`function`&&i.call(e),r||await new Promise(t=>{e.once(`drain`,t)})}}catch(e){throw e}finally{e.end()}})()}function fT({response:e,status:t,statusText:n,headers:r,stream:i}){dT({response:e,status:t,statusText:n,headers:Object.fromEntries(lT(r,{"content-type":`text/plain; charset=utf-8`}).entries()),stream:i.pipeThrough(new TextEncoderStream)})}function pT(e){return mT(e.pipeThrough(new TransformStream))}function mT(e){return e[Symbol.asyncIterator]=function(){let e=this.getReader(),t=!1;async function n(n){if(!t){t=!0;try{n&&await e.cancel?.call(e)}finally{try{e.releaseLock()}catch{}}}}return{async next(){if(t)return{done:!0,value:void 0};let{done:r,value:i}=await e.read();return r?(await n(!0),{done:!0,value:void 0}):{done:!1,value:i}},async return(){return await n(!0),{done:!0,value:void 0}},async throw(e){throw await n(!0),e}}},e}function hT(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function gT(){let e=[],t=null,n=!1,r=hT(),i=()=>{n=!0,r.resolve(),e.forEach(e=>e.cancel()),e=[],t?.close()},a=async()=>{if(n&&e.length===0){t?.close();return}if(e.length===0)return r=hT(),await r.promise,await a();try{let{value:r,done:i}=await e[0].read();i?(e.shift(),e.length===0&&n?t?.close():await a()):t?.enqueue(r)}catch(n){t?.error(n),e.shift(),i()}};return{stream:new ReadableStream({start(e){t=e},pull:a,async cancel(){for(let t of e)await t.cancel();e=[],n=!0}}),addStream:t=>{if(n)throw Error(`Cannot add inner stream: outer stream is closed`);e.push(t.getReader()),r.resolve()},close:()=>{n=!0,r.resolve(),e.length===0&&t?.close()},terminate:i}}function _T({output:e,schema:t,enumValues:n}){switch(e){case`object`:return tD(bh(t));case`array`:return nD(bh(t));case`enum`:return rD(n);case`no-schema`:return eD;default:throw Error(`Unsupported output: ${e}`)}}async function vT(e,t,n){let r=await Oh({text:e});if(!r.success)throw new GT({message:`No object generated: could not parse the response.`,cause:r.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=await t.validateFinalResult(r.value,{text:e,response:n.response,usage:n.usage});if(!i.success)throw new GT({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.value}async function yT(e,t,n,r){try{return await vT(e,t,r)}catch(i){if(n!=null&&GT.isInstance(i)&&(ji.isInstance(i.cause)||la.isInstance(i.cause))){let a=await n({text:e,error:i.cause});if(a===null)throw i;return await vT(a,t,r)}throw i}}function bT({output:e,schema:t,schemaName:n,schemaDescription:r,enumValues:i}){if(e!=null&&e!==`object`&&e!==`array`&&e!==`enum`&&e!==`no-schema`)throw new kT({parameter:`output`,value:e,message:`Invalid output type.`});if(e===`no-schema`){if(t!=null)throw new kT({parameter:`schema`,value:t,message:`Schema is not supported for no-schema output.`});if(r!=null)throw new kT({parameter:`schemaDescription`,value:r,message:`Schema description is not supported for no-schema output.`});if(n!=null)throw new kT({parameter:`schemaName`,value:n,message:`Schema name is not supported for no-schema output.`});if(i!=null)throw new kT({parameter:`enumValues`,value:i,message:`Enum values are not supported for no-schema output.`})}if(e===`object`){if(t==null)throw new kT({parameter:`schema`,value:t,message:`Schema is required for object output.`});if(i!=null)throw new kT({parameter:`enumValues`,value:i,message:`Enum values are not supported for object output.`})}if(e===`array`){if(t==null)throw new kT({parameter:`schema`,value:t,message:`Element schema is required for array output.`});if(i!=null)throw new kT({parameter:`enumValues`,value:i,message:`Enum values are not supported for array output.`})}if(e===`enum`){if(t!=null)throw new kT({parameter:`schema`,value:t,message:`Schema is not supported for enum output.`});if(r!=null)throw new kT({parameter:`schemaDescription`,value:r,message:`Schema description is not supported for enum output.`});if(n!=null)throw new kT({parameter:`schemaName`,value:n,message:`Schema name is not supported for enum output.`});if(i==null)throw new kT({parameter:`enumValues`,value:i,message:`Enum values are required for enum output.`});for(let e of i)if(typeof e!=`string`)throw new kT({parameter:`enumValues`,value:e,message:`Enum values must be strings.`})}}function xT(e,t){if(e===t)return!0;if(e==null||t==null)return!1;if(typeof e!=`object`&&typeof t!=`object`)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!xT(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!xT(e[i],t[i]))return!1;return!0}function ST(e){let{model:t,output:n=`object`,instructions:r,system:i,prompt:a,messages:o,allowSystemInMessages:s,maxRetries:c,abortSignal:l,headers:u,experimental_repairText:d,experimental_telemetry:f,telemetry:p=f,experimental_download:m,providerOptions:h,onStart:g,experimental_onStart:_,onStepStart:v,experimental_onStepStart:y,onStepEnd:b,onStepFinish:x,onError:S=({error:e})=>{console.error(e)},onFinish:C,_internal:{generateId:w=iD,currentDate:T=()=>new Date,now:E=Jw}={},...D}=e,O=`enum`in e&&e.enum?e.enum:void 0,{schema:k,schemaDescription:ee,schemaName:te}=`schema`in e?e:{};return bT({output:n,schema:k,schemaName:te,schemaDescription:ee,enumValues:O}),new aD({model:t,telemetry:p,headers:u,settings:D,maxRetries:c,abortSignal:l,outputStrategy:_T({output:n,schema:k,enumValues:O}),instructions:r,system:i,prompt:a,messages:o,allowSystemInMessages:s,schemaName:te,schemaDescription:ee,providerOptions:h,repairText:d,onStart:g??_,onStepStart:v??y,onStepFinish:b??x,onError:S,onFinish:C,download:m,generateId:w,currentDate:T,now:E})}var CT,wT,TT,ET,DT,OT,kT,AT,jT,MT,NT,PT,FT,IT,LT,RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T,eE,tE,nE,rE,iE,aE,oE,sE,cE,lE,uE,dE,fE,pE,mE,hE,gE,_E,vE,yE,bE,xE,SE,CE,wE,TE,EE,DE,OE,kE,AE,jE,ME,NE,PE,FE,IE,LE,RE,zE,BE,VE,HE,UE,WE,GE,KE,qE,JE,YE,XE,ZE,QE,$E,eD,tD,nD,rD,iD,aD,oD,sD=t((()=>{$g(),ga(),cw(),Fd(),CT=Object.defineProperty,wT=(e,t)=>{for(var n in t)CT(e,n,{get:t[n],enumerable:!0})},TT=`AI_InvalidArgumentError`,ET=`vercel.ai.error.${TT}`,DT=Symbol.for(ET),kT=class extends Yr{constructor({parameter:e,value:t,message:n}){super({name:TT,message:`Invalid argument for parameter ${e}: ${n}`}),this[OT]=!0,this.parameter=e,this.value=t}static isInstance(e){return Yr.hasMarker(e,ET)}},OT=DT,AT=`AI_InvalidStreamPartError`,`${AT}`,jT=`AI_InvalidToolApprovalError`,`${jT}`,MT=`AI_InvalidToolApprovalSignatureError`,`${MT}`,NT=`AI_InvalidToolInputError`,`${NT}`,PT=`AI_ToolCallNotFoundForApprovalError`,`${PT}`,FT=`AI_MissingToolResultsError`,IT=`vercel.ai.error.${FT}`,LT=Symbol.for(IT),zT=class extends Yr{constructor({toolCallIds:e}){super({name:FT,message:`Tool result${e.length>1?`s are`:` is`} missing for tool call${e.length>1?`s`:``} ${e.join(`, `)}.`}),this[RT]=!0,this.toolCallIds=e}static isInstance(e){return Yr.hasMarker(e,IT)}},RT=LT,BT=`AI_NoImageGeneratedError`,`${BT}`,VT=`AI_NoObjectGeneratedError`,HT=`vercel.ai.error.${VT}`,UT=Symbol.for(HT),GT=class extends Yr{constructor({message:e=`No object generated.`,cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:VT,message:e,cause:t}),this[WT]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return Yr.hasMarker(e,HT)}},WT=UT,KT=`AI_NoOutputGeneratedError`,`${KT}`,qT=`AI_NoSpeechGeneratedError`,`${qT}`,JT=`AI_NoTranscriptGeneratedError`,`${JT}`,YT=`AI_NoVideoGeneratedError`,`${YT}`,XT=`AI_NoSuchToolError`,`${XT}`,ZT=`AI_ToolCallRepairError`,`${ZT}`,QT=class extends Yr{constructor(e){super({name:`AI_UnsupportedModelVersionError`,message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},$T=`AI_UIMessageStreamError`,`${$T}`,eE=`AI_InvalidDataContentError`,tE=`vercel.ai.error.${eE}`,nE=Symbol.for(tE),iE=class extends Yr{constructor({content:e,cause:t,message:n=`Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ${typeof e}.`}){super({name:eE,message:n,cause:t}),this[rE]=!0,this.content=e}static isInstance(e){return Yr.hasMarker(e,tE)}},rE=nE,aE=`AI_InvalidMessageRoleError`,oE=`vercel.ai.error.${aE}`,sE=Symbol.for(oE),lE=class extends Yr{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:aE,message:t}),this[cE]=!0,this.role=e}static isInstance(e){return Yr.hasMarker(e,oE)}},cE=sE,uE=`AI_MessageConversionError`,`${uE}`,dE=`AI_RetryError`,fE=`vercel.ai.error.${dE}`,pE=Symbol.for(fE),hE=class extends Yr{constructor({message:e,reason:t,errors:n}){super({name:dE,message:e}),this[mE]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return Yr.hasMarker(e,fE)}},mE=pE,gE=`AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.`,_E=!1,vE=e=>{if(e.warnings.length===0)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t==`function`){t(e);return}_E||(_E=!0,console.info(gE));for(let t of e.warnings){let n=lw({warning:t,provider:e.provider,model:e.model});typeof process<`u`&&typeof process.emitWarning==`function`?process.emitWarning(n,{type:t.type===`deprecated`?`DeprecationWarning`:`Warning`}):console.warn(n)}}},yE=`7.0.22`,bE=async({url:e,maxBytes:t,abortSignal:n})=>{let r=e.toString();try{let e=await pm({url:r,headers:Sm({},`ai-sdk/${yE}`,bm()),abortSignal:n});if(!e.ok)throw await om(e),new sg({url:r,statusCode:e.status,statusText:e.statusText});return{data:await mm({response:e,url:r,maxBytes:t??lg}),mediaType:e.headers.get(`content-type`)??void 0}}catch(e){throw sg.isInstance(e)?e:new sg({url:r,cause:e})}},xE=(e=bE)=>t=>Promise.all(t.map(async t=>t.isUrlSupportedByModel?null:await e(t))),SE={jpg:`image/jpeg`,jpeg:`image/jpeg`,png:`image/png`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,avif:`image/avif`,heic:`image/heic`,bmp:`image/bmp`,tiff:`image/tiff`,tif:`image/tiff`,pdf:`application/pdf`,mp4:`video/mp4`,webm:`video/webm`,mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`},CE=Du(()=>B([lu(),I(),L(),cu(),_u(I(),CE.optional()),R(CE)])),wE=_u(I(),_u(I(),CE.optional())),TE=B([I(),Mu(Uint8Array),Mu(ArrayBuffer),ku(Cm,{message:`Must be a Buffer`})]),EE=_u(I(),I()),DE=z({type:H(`text`),text:I(),providerOptions:wE.optional()}),OE=z({type:H(`image`),image:B([TE,Mu(URL),EE]),mediaType:I().optional(),providerOptions:wE.optional()}),kE=mu(`type`,[z({type:H(`data`),data:TE}),z({type:H(`url`),url:Mu(URL)}),z({type:H(`reference`),reference:EE}),z({type:H(`text`),text:I()})]),AE=mu(`type`,[z({type:H(`data`),data:TE}),z({type:H(`url`),url:Mu(URL)})]),jE=z({type:H(`file`),data:B([kE,TE,Mu(URL),EE]),filename:I().optional(),mediaType:I(),providerOptions:wE.optional()}),ME=z({type:H(`reasoning`),text:I(),providerOptions:wE.optional()}),NE=z({type:H(`custom`),kind:I().transform(e=>e),providerOptions:wE.optional()}),PE=z({type:H(`reasoning-file`),data:B([AE,TE,Mu(URL)]),mediaType:I(),providerOptions:wE.optional()}),FE=z({type:H(`tool-call`),toolCallId:I(),toolName:I(),input:du(),providerOptions:wE.optional(),providerExecuted:cu().optional()}),IE=mu(`type`,[z({type:H(`text`),value:I(),providerOptions:wE.optional()}),z({type:H(`json`),value:CE,providerOptions:wE.optional()}),z({type:H(`execution-denied`),reason:I().optional(),providerOptions:wE.optional()}),z({type:H(`error-text`),value:I(),providerOptions:wE.optional()}),z({type:H(`error-json`),value:CE,providerOptions:wE.optional()}),z({type:H(`content`),value:R(B([z({type:H(`text`),text:I(),providerOptions:wE.optional()}),z({type:H(`file`),data:kE,mediaType:I(),filename:I().optional(),providerOptions:wE.optional()}),z({type:H(`file-data`),data:I(),mediaType:I(),filename:I().optional(),providerOptions:wE.optional()}),z({type:H(`file-url`),url:I(),mediaType:I().optional(),providerOptions:wE.optional()}),z({type:H(`file-id`),fileId:B([I(),_u(I(),I())]),providerOptions:wE.optional()}),z({type:H(`file-reference`),providerReference:_u(I(),I()),providerOptions:wE.optional()}),z({type:H(`image-data`),data:I(),mediaType:I(),providerOptions:wE.optional()}),z({type:H(`image-url`),url:I(),providerOptions:wE.optional()}),z({type:H(`image-file-id`),fileId:B([I(),_u(I(),I())]),providerOptions:wE.optional()}),z({type:H(`image-file-reference`),providerReference:_u(I(),I()),providerOptions:wE.optional()}),z({type:H(`custom`),providerOptions:wE.optional()})]))})]),LE=z({type:H(`tool-result`),toolCallId:I(),toolName:I(),output:IE,providerOptions:wE.optional()}),RE=z({type:H(`tool-approval-request`),approvalId:I(),toolCallId:I()}),zE=z({type:H(`tool-approval-response`),approvalId:I(),approved:cu(),reason:I().optional()}),BE=z({role:H(`system`),content:I(),providerOptions:wE.optional()}),VE=z({role:H(`user`),content:B([I(),R(B([DE,OE,jE]))]),providerOptions:wE.optional()}),HE=z({role:H(`assistant`),content:B([I(),R(B([DE,NE,jE,ME,PE,FE,LE,RE]))]),providerOptions:wE.optional()}),UE=z({role:H(`tool`),content:R(B([LE,zE])),providerOptions:wE.optional()}),WE=B([BE,VE,HE,UE]),GE=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:r}={})=>Gg({maxRetries:e,initialDelayInMs:t,backoffFactor:n,abortSignal:r,shouldRetry:e=>e instanceof Error&&(ti.isInstance(e)&&e.isRetryable===!0||uS.isInstance(e)&&e.isRetryable===!0),getDelayInMs:({error:e,exponentialBackoffDelay:t})=>Xw({error:e,exponentialBackoffDelay:t}),createRetryError:({message:e,reason:t,errors:n})=>new hE({message:e,reason:t,errors:n})}),KE={},wT(KE,{array:()=>YE,choice:()=>XE,json:()=>ZE,object:()=>JE,text:()=>qE}),qE=()=>({name:`text`,responseFormat:Promise.resolve({type:`text`}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),JE=({schema:e,name:t,description:n})=>{let r=bh(e);return{name:`object`,responseFormat:Fh(r.jsonSchema).then(e=>({type:`json`,schema:e,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:e},t){let n=await Oh({text:e});if(!n.success)throw new GT({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=await Eh({value:n.value,schema:r});if(!i.success)throw new GT({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return i.value},async parsePartialOutput({text:e}){let t=await $w(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return{partial:t.value}}},createElementStreamTransform(){}}},YE=({element:e,name:t,description:n})=>{let r=bh(e);return{name:`array`,responseFormat:Fh(r.jsonSchema).then(e=>{let{$schema:r,...i}=e;return{type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{elements:{type:`array`,items:i}},required:[`elements`],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:e},t){let n=await Oh({text:e});if(!n.success)throw new GT({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=n.value;if(typeof i!=`object`||!i||!(`elements`in i)||!Array.isArray(i.elements))throw new GT({message:`No object generated: response did not match schema.`,cause:new la({value:i,cause:`response must be an object with an elements array`}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=[];for(let n of i.elements){let i=await Eh({value:n,schema:r});if(!i.success)throw new GT({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});a.push(i.value)}return a},async parsePartialOutput({text:e}){let t=await $w(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let e=t.value;if(typeof e!=`object`||!e||!(`elements`in e)||!Array.isArray(e.elements))return;let n=t.state===`repaired-parse`&&e.elements.length>0?e.elements.slice(0,-1):e.elements,i=[];for(let e of n){let t=await Eh({value:e,schema:r});t.success&&i.push(t.value)}return{partial:i}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(t!=null)for(;e<t.length;e++)n.enqueue(t[e])}})}}},XE=({options:e,name:t,description:n})=>({name:`choice`,responseFormat:Promise.resolve({type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{result:{type:`string`,enum:e}},required:[`result`],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:t},n){let r=await Oh({text:t});if(!r.success)throw new GT({message:`No object generated: could not parse the response.`,cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=r.value;if(typeof i!=`object`||!i||!(`result`in i)||typeof i.result!=`string`||!e.includes(i.result))throw new GT({message:`No object generated: response did not match schema.`,cause:new la({value:i,cause:`response must be an object that contains a choice value.`}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.result},async parsePartialOutput({text:t}){let n=await $w(t);switch(n.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let t=n.value;if(typeof t!=`object`||!t||!(`result`in t)||typeof t.result!=`string`)return;let r=e.filter(e=>e.startsWith(t.result));return n.state===`successful-parse`?r.includes(t.result)?{partial:t.result}:void 0:r.length===1?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),ZE=({name:e,description:t}={})=>({name:`json`,responseFormat:Promise.resolve({type:`json`,...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:e},t){let n=await Oh({text:e});if(!n.success)throw new GT({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await $w(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return t.value===void 0?void 0:{partial:t.value}}},createElementStreamTransform(){}}),QE=`ai:telemetry`,new TextEncoder,new TextEncoder,ug({prefix:`aitxt`,size:24}),ug({prefix:`call`,size:24}),TransformStream,_u(I(),CE.optional()),ug({prefix:`aitxt`,size:24}),ug({prefix:`call`,size:24}),ug({prefix:`aitxt`,size:24}),ug({prefix:`call`,size:24}),_u(I(),CE.optional()),_u(I(),I()),ug({prefix:`call`,size:24}),ug({prefix:`call`,size:24}),eD={type:`no-schema`,jsonSchema:async()=>void 0,async validatePartialResult({value:e,textDelta:t}){return{success:!0,value:{partial:e,textDelta:t}}},async validateFinalResult(e,t){return e===void 0?{success:!1,error:new GT({message:`No object generated: response did not match schema.`,text:t.text,response:t.response,usage:t.usage,finishReason:t.finishReason})}:{success:!0,value:e}},createElementStream(){throw new ha({functionality:`element streams in no-schema mode`})}},tD=e=>({type:`object`,jsonSchema:async()=>await e.jsonSchema,async validatePartialResult({value:e,textDelta:t}){return{success:!0,value:{partial:e,textDelta:t}}},async validateFinalResult(t){return Eh({value:t,schema:e})},createElementStream(){throw new ha({functionality:`element streams in object mode`})}}),nD=e=>({type:`array`,jsonSchema:async()=>{let{$schema:t,...n}=await e.jsonSchema;return{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{elements:{type:`array`,items:n}},required:[`elements`],additionalProperties:!1}},async validatePartialResult({value:t,latestObject:n,isFirstDelta:r,isFinalDelta:i}){if(!Wr(t)||!Ur(t.elements))return{success:!1,error:new la({value:t,cause:`value must be an object that contains an array of elements`})};let a=t.elements,o=[];for(let t=0;t<a.length;t++){let n=a[t],r=await Eh({value:n,schema:e});if(!(t===a.length-1&&!i)){if(!r.success)return r;o.push(r.value)}}let s=n?.length??0,c=``;return r&&(c+=`[`),s>0&&(c+=`,`),c+=o.slice(s).map(e=>JSON.stringify(e)).join(`,`),i&&(c+=`]`),{success:!0,value:{partial:o,textDelta:c}}},async validateFinalResult(t){if(!Wr(t)||!Ur(t.elements))return{success:!1,error:new la({value:t,cause:`value must be an object that contains an array of elements`})};let n=t.elements,r=[];for(let t of n){let n=await Eh({value:t,schema:e});if(!n.success)return n;r.push(n.value)}return{success:!0,value:r}},createElementStream(e){let t=0;return pT(e.pipeThrough(new TransformStream({transform(e,n){switch(e.type){case`object`:{let r=e.object;for(;t<r.length;t++)n.enqueue(r[t]);break}case`text-delta`:case`finish`:case`error`:break;default:throw Error(`Unsupported chunk type: ${e}`)}}})))}}),rD=e=>({type:`enum`,jsonSchema:async()=>({$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{result:{type:`string`,enum:e}},required:[`result`],additionalProperties:!1}),async validateFinalResult(t){if(!Wr(t)||typeof t.result!=`string`)return{success:!1,error:new la({value:t,cause:`value must be an object that contains a string in the "result" property.`})};let n=t.result;return e.includes(n)?{success:!0,value:n}:{success:!1,error:new la({value:t,cause:`value must be a string in the enum`})}},async validatePartialResult({value:t,textDelta:n}){if(!Wr(t)||typeof t.result!=`string`)return{success:!1,error:new la({value:t,cause:`value must be an object that contains a string in the "result" property.`})};let r=t.result,i=e.filter(e=>e.startsWith(r));return t.result.length===0||i.length===0?{success:!1,error:new la({value:t,cause:`value must be a string in the enum`})}:{success:!0,value:{partial:i.length>1?r:i[0],textDelta:n}}},createElementStream(){throw new ha({functionality:`element streams in enum mode`})}}),ug({prefix:`aiobj`,size:24}),iD=ug({prefix:`aiobj`,size:24}),aD=class{constructor({model:e,headers:t,telemetry:n,settings:r,maxRetries:i,abortSignal:a,outputStrategy:o,instructions:s,system:c,prompt:l,messages:u,allowSystemInMessages:d,schemaName:f,schemaDescription:p,providerOptions:m,repairText:h,onStart:g,onStepStart:_,onStepFinish:v,onError:y,onFinish:b,download:x,generateId:S,currentDate:C,now:w}){this._object=new Yh,this._usage=new Yh,this._providerMetadata=new Yh,this._warnings=new Yh,this._request=new Yh,this._response=new Yh,this._finishReason=new Yh;let T=Dw(e),{maxRetries:E,retry:D}=Zw({maxRetries:i,abortSignal:a}),O=Hw(r),k=cT({telemetry:n}),ee=this,te=gT(),A=new TransformStream({transform(e,t){t.enqueue(e),e.type===`error`&&y({error:Ww(e.error)})}});this.baseStream=te.stream.pipeThrough(A);let ne=S();(async()=>{let e=await o.jsonSchema();await Yw({event:{callId:ne,operationId:`ai.streamObject`,provider:T.provider,modelId:T.modelId,system:s??c,prompt:l,messages:u,maxOutputTokens:O.maxOutputTokens,temperature:O.temperature,topP:O.topP,topK:O.topK,presencePenalty:O.presencePenalty,frequencyPenalty:O.frequencyPenalty,seed:O.seed,maxRetries:E,headers:t,providerOptions:m,output:o.type,schema:e,schemaName:f,schemaDescription:p},callbacks:[g,k.onStart]});let n=await Uw({instructions:s,system:c,prompt:l,messages:u,allowSystemInMessages:d}),i={responseFormat:{type:`json`,schema:e,name:f,description:p},...Hw(r),prompt:await Pw({prompt:n,supportedUrls:await T.supportedUrls,download:x,provider:T.provider.split(`.`)[0]}),providerOptions:m,abortSignal:a,headers:t,includeRawChunks:!1};await Yw({event:{callId:ne,stepNumber:0,provider:T.provider,modelId:T.modelId,providerOptions:m,headers:t,promptMessages:i.prompt},callbacks:[_,k.onObjectStepStart]});let y={transform:(e,t)=>{switch(e.type){case`text-delta`:t.enqueue(e.delta);break;case`response-metadata`:case`finish`:case`error`:case`stream-start`:t.enqueue(e);break}}},A=w(),{stream:re,response:ie,request:ae}=await D(()=>T.doStream(i));ee._request.resolve(ae??{});let oe,se=Kw(),ce,le,ue,de,fe,pe=``,me=``,he={id:S(),timestamp:C(),modelId:T.modelId},ge,_e,ve=!0,ye=!0,be=re.pipeThrough(new TransformStream(y)).pipeThrough(new TransformStream({async transform(e,t){if(typeof e==`object`&&e.type===`stream-start`){oe=e.warnings;return}if(ve&&=(fe=w()-A,!1),typeof e==`string`){pe+=e,me+=e;let{value:n,state:r}=await $w(pe);if(n!==void 0&&!xT(ge,n)){let e=await o.validatePartialResult({value:n,textDelta:me,latestObject:_e,isFirstDelta:ye,isFinalDelta:r===`successful-parse`});e.success&&!xT(_e,e.value.partial)&&(ge=n,_e=e.value.partial,t.enqueue({type:`object`,object:_e}),t.enqueue({type:`text-delta`,textDelta:e.value.textDelta}),me=``,ye=!1)}return}switch(e.type){case`response-metadata`:he={id:e.id??he.id,timestamp:e.timestamp??he.timestamp,modelId:e.modelId??he.modelId};break;case`finish`:me!==``&&t.enqueue({type:`text-delta`,textDelta:me}),ce=e.finishReason.unified,se=Gw(e.usage),le=e.providerMetadata,t.enqueue({...e,finishReason:e.finishReason.unified,usage:se,response:he}),vE({warnings:oe??[],provider:T.provider,model:T.modelId}),ee._usage.resolve(se),ee._providerMetadata.resolve(le),ee._warnings.resolve(oe),ee._response.resolve({...he,headers:ie?.headers}),ee._finishReason.resolve(ce??`other`);try{ue=await yT(pe,o,h,{response:he,usage:se,finishReason:ce}),ee._object.resolve(ue)}catch(e){de=e,ee._object.reject(e)}break;default:t.enqueue(e);break}},async flush(e){try{let e=se??{promptTokens:NaN,completionTokens:NaN,totalTokens:NaN};await Yw({event:{callId:ne,stepNumber:0,provider:T.provider,modelId:T.modelId,finishReason:ce??`other`,usage:e,objectText:pe,msToFirstChunk:fe,reasoning:void 0,warnings:oe,request:ae??{},response:{...he,headers:ie?.headers},providerMetadata:le},callbacks:[v,k.onObjectStepEnd]}),await Yw({event:{callId:ne,object:ue,error:de,reasoning:void 0,finishReason:ce??`other`,usage:e,warnings:oe,request:ae??{},response:{...he,headers:ie?.headers},providerMetadata:le},callbacks:[b,k.onEnd]})}catch(t){e.enqueue({type:`error`,error:t})}}}));te.addStream(be)})().catch(async e=>{await k.onError?.call(k,{callId:ne,error:e}),te.addStream(new ReadableStream({start(t){t.enqueue({type:`error`,error:e}),t.close()}}))}).finally(()=>{te.close()}),this.outputStrategy=o}get object(){return this._object.promise}get usage(){return this._usage.promise}get providerMetadata(){return this._providerMetadata.promise}get warnings(){return this._warnings.promise}get request(){return this._request.promise}get response(){return this._response.promise}get finishReason(){return this._finishReason.promise}get partialObjectStream(){return pT(this.baseStream.pipeThrough(new TransformStream({transform(e,t){switch(e.type){case`object`:t.enqueue(e.object);break;case`text-delta`:case`finish`:case`error`:break;default:throw Error(`Unsupported chunk type: ${e}`)}}})))}get elementStream(){return this.outputStrategy.createElementStream(this.baseStream)}get textStream(){return pT(this.baseStream.pipeThrough(new TransformStream({transform(e,t){switch(e.type){case`text-delta`:t.enqueue(e.textDelta);break;case`object`:case`finish`:case`error`:break;default:throw Error(`Unsupported chunk type: ${e}`)}}})))}get fullStream(){return pT(this.baseStream)}pipeTextStreamToResponse(e,t){fT({response:e,stream:this.textStream,...t})}toTextStreamResponse(e){return uT({stream:this.textStream,...e})}},oD=`AI_NoSuchProviderError`,`${oD}`,ug({prefix:`call`,size:24})})),cD=t((()=>{kp(),kp()})),lD,uD=t((()=>{cD(),lD=Dp({title:wp().describe(`Concise, specific issue title. Imperative or descriptive, no trailing period.`),description:wp().describe(`Issue body in Linear markdown: a short problem summary and relevant context. Do NOT include repro steps, expected/actual, or source location — those are separate fields.`),reproSteps:Ep(wp()).describe(`Ordered reproduction steps, each a single action.`),expected:wp().describe(`Expected behavior, one or two sentences.`),actual:wp().describe(`Actual (buggy) behavior, one or two sentences.`),impact:wp().describe(`Who/what is affected and how badly, 1-2 sentences (e.g. "Cosmetic/UX polish issue — doesn't block anything but feels glitchy.").`),analysisNotes:wp().describe(`Markdown bullet list ("- …") of likely root-cause analysis based on the source context. Empty string when there is nothing substantive to say.`),suggestedNextSteps:wp().describe(`Markdown bullet list of concrete, actionable fix suggestions the coding agent should consider first.`),priority:Tp().int().min(0).max(4).describe(`Linear priority: 0 none, 1 urgent, 2 high, 3 medium, 4 low.`),suggestedLabels:Ep(wp()).describe(`0-3 suggested label names, e.g. "Bug", "UI".`)})}));function dD(e){return`- FIRST, self-orient in the repo checkout (skip any path that doesn't exist):
84
+ 1. Read \`CLAUDE.md\` and \`AGENTS.md\` at the repo root the master map of product rules, architecture, and memory/skill pointers.
85
+ 2. Skim \`.claude/memory/MEMORY.md\` (the index) to learn what project memory exists; load the specific \`.claude/memory/*.md\` files the map names for the surface you're touching.
86
+ 3. Load the matching \`.claude/skills/<name>/SKILL.md\` files before designing, building UI, or animating (if skills are symlinked, follow them into \`.agents/skills/\`).
87
+ Treat all of this as authoritative — it overrides your defaults.
88
+ - Live render telemetry (react-scan → linear-grab bridge): if \`.lineargrab/scan.ndjson\` exists in the repo, it holds the user's REAL interaction slowdowns — component render counts, self-times, change causes (\`prop:x\`/\`state:i\`/\`context:y\`), and interaction latencies, newest last. \`curl -s http://127.0.0.1:4577/scan/report\` returns an aggregated view. For any re-render/performance issue: read it BEFORE fixing (the evidence) and AFTER (the proof), and cite before→after numbers in your closeout.
89
+ - Keep going until the code works and you're happy with the implementation.
90
+ - MANDATORY COMPLETION GATE — the task is NOT complete (and you may not call it complete) until every step below is done, in order. Skipping any step silently is a FAILED task:
91
+ ${[`RUN the app and TEST your change hands-on (computer use / a real browser against the running app). Code reading alone does not count as verification.`,...e===`none`?[]:[vD[e]],`Open the PR, babysit it for the first set of review comments, and address them. If the repo has preview deployments (e.g. Vercel), wait for the preview to go green and include its URL — deep-linked to the changed page — in the PR body, the Linear closeout, and the announcement.`,`CLOSE OUT THE LINEAR ISSUE: post a completion comment (one-line fix summary + PR link), ${e===`none`?``:`attach the evidence to the ISSUE itself (not only the PR), `}and move the issue to its review/done state.`].map((e,t)=>` ${t+1}. ${e}`).join(`
92
+ `)}`}function fD(e,t){let n=t?.evidence??`video`,r=[e.issueTemplate?.trim()||dD(n)];e.issueTemplate?.trim()&&n!==`video`&&r.push(n===`spec`?"**Evidence override for THIS issue: no demo video.** Skip any video/GIF-recording steps in the instructions above. Instead produce 1:1 evidence with the spec-crawler MCP: capture the reference and your fixed build (`capture_component` / `capture_css_spec`, plus `force_state` / `crawl_overlays` / `capture_drag` for stateful surfaces), compare computed styles 1:1, and paste the before → after diff — citing the `spec-bundle/frames/<id>.html` paths — in your closeout comment.":`**Evidence override for THIS issue: no demo video or recorded evidence required.** Skip any video/GIF-recording steps in the instructions above; hands-on testing in the running app is still mandatory.`);let i=(e.skillPaths??``).split(`
93
+ `).map(e=>e.trim()).filter(Boolean);if(i.length&&r.push(`**Project skills & memory — MANDATORY reading before implementing.** This repo ships maintained skills/memory files. Read each of these paths in your checkout and treat their guidance as authoritative for design, style, and architectural decisions:\n${i.map(e=>`- \`${e}\``).join(`
94
+ `)}`),n===`video`&&e.githubAssetsRepo?.trim()){let t=e.githubAssetsRepo.trim(),n=e.githubToken?.trim()?` Your environment's git identity may lack push access to this repo — use this fine-grained token (scoped to the assets repo only): \`${e.githubToken.trim()}\`. Push via \`https://x-access-token:<token>@github.com/${t}.git\` or \`gh api\` with it.`:``;r.push(`**Demo media hosting:** commit demo GIFs/videos to the PUBLIC assets repo \`${t}\` under \`linear-grab/\` (clone it or use \`gh api\`), and embed the raw.githubusercontent.com URL in BOTH the Linear comment and the PR body. Prefer GIF for short demos — it renders inline everywhere (Linear, GitHub, the panel); Linear-hosted uploads do NOT render on GitHub.${n}`)}e.shareLinearKey&&e.linearApiKey?.trim()&&r.push(`**Linear access — close out this issue YOURSELF via the raw GraphQL API** (do not rely on a Linear MCP; it is not authenticated in your environment):
86
95
  - Endpoint: \`POST https://api.linear.app/graphql\` with headers \`Authorization: ${e.linearApiKey.trim()}\` and \`Content-Type: application/json\`.
87
96
  - Resolve this issue's UUID: \`{"query":"query { issue(id: \\"<IDENTIFIER>\\") { id team { id } } }"}\` (the human identifier like ABC-12 works as input).
88
97
  - Post the closeout comment (the Definition of Done checklist): \`issueCreate\`-style mutation \`commentCreate(input: {issueId, body})\`.
89
98
  - Move to review: query \`team(id).states { nodes { id name type } }\`, pick the state you were asked to move to, then \`issueUpdate(id, input: {stateId})\`.
90
- - Embed demo media in the comment body as markdown — prefer the assets-repo GIF url (\`![demo](raw.githubusercontent.com/...gif)\` renders inline in Linear); mp4 links render as links.`);let r=[];e.testUsername?.trim()&&r.push(`- Username / email: \`${e.testUsername.trim()}\``),e.testPassword?.trim()&&r.push(`- Password: \`${e.testPassword.trim()}\``),r.length&&t.push(`**Test account — log into the app with this while testing:**\n${r.join(`
91
- `)}`);let i=[];e.slackToken&&e.slackChannelId&&i.push(`- Slack: bot token \`${e.slackToken}\`, channel \`${e.slackChannelId}\`${e.slackChannelName?` (#${e.slackChannelName})`:``}. Use \`chat.postMessage\` for the message. For the demo video use the EXTERNAL upload flow — \`files.upload\` is REMOVED and \`files.uploadV2\` is SDK-only: 1) \`files.getUploadURLExternal\` (filename + length) → 2) POST the bytes to the returned URL → 3) \`files.completeUploadExternal\` with \`{files:[{id,title}], channel_id}\`. If that fails, post the raw.githubusercontent media URL in the message text — Slack unfurls it.`),e.telegramToken&&e.telegramChatId&&i.push(`- Telegram: bot token \`${e.telegramToken}\`, chat id \`${e.telegramChatId}\`. Use \`sendMessage\` and \`sendVideo\` (multipart upload of the demo file).`),i.length&&t.push(`**When the fix is complete and the PR is open, announce it yourself:**\n${i.join(`
92
- `)}\n\nMessage format — keep it short: what was broken → what you changed (one-line fix summary) → links to the Linear issue, the PR, and your agent run → attach/upload the demo video → end with the CTA "👉 Review the PR". You may also use these tokens to send yourself intermediate test notifications while verifying the integration works.`);let a=[`- [ ] Tested the change hands-on in the RUNNING app (state what you exercised)`,`- [ ] Demo media captured — GIF/video preferred; if recording is impossible in your environment, before/after screenshots + the stated reason`];return e.githubAssetsRepo?.trim()&&a.push(`- [ ] Demo media committed to \`${e.githubAssetsRepo.trim()}\` and embedded via raw.githubusercontent.com URL in the Linear comment AND the PR body`),a.push(`- [ ] Demo media attached to the Linear ISSUE itself (not only the PR)`,`- [ ] PR opened and linked here`,`- [ ] Deploy-preview URL included, deep-linked to the changed page (if the repo has preview deployments, e.g. Vercel; otherwise state that it does not)`,`- [ ] Issue moved to its review/done state`),i.length&&a.push(`- [ ] Announcement posted to the configured channel(s) with the demo attached`),t.push(`**DEFINITION OF DONE — acceptance checklist.** Copy this checklist VERBATIM into your Linear closeout comment and tick each box (\`- [x]\`) with a link or one-line evidence next to it. Any unchecked box means the work is NOT ACCEPTED — leave it unchecked and explain the blocker rather than omitting it:\n${a.join(`
93
- `)}`),t.join(`
99
+ - Embed demo media in the comment body as markdown — prefer the assets-repo GIF url (\`![demo](raw.githubusercontent.com/...gif)\` renders inline in Linear); mp4 links render as links.`);let a=[];n!==`none`&&e.testUsername?.trim()&&a.push(`- Username / email: \`${e.testUsername.trim()}\``),n!==`none`&&e.testPassword?.trim()&&a.push(`- Password: \`${e.testPassword.trim()}\``),a.length&&r.push(`**Test account — log into the app with this while testing:**\n${a.join(`
100
+ `)}`);let o=[];e.slackToken&&e.slackChannelId&&o.push(`- Slack: bot token \`${e.slackToken}\`, channel \`${e.slackChannelId}\`${e.slackChannelName?` (#${e.slackChannelName})`:``}. Use \`chat.postMessage\` for the message. For the demo video use the EXTERNAL upload flow — \`files.upload\` is REMOVED and \`files.uploadV2\` is SDK-only: 1) \`files.getUploadURLExternal\` (filename + length) → 2) POST the bytes to the returned URL → 3) \`files.completeUploadExternal\` with \`{files:[{id,title}], channel_id}\`. If that fails, post the raw.githubusercontent media URL in the message text — Slack unfurls it.`),e.telegramToken&&e.telegramChatId&&o.push(`- Telegram: bot token \`${e.telegramToken}\`, chat id \`${e.telegramChatId}\`. Use \`sendMessage\` and \`sendVideo\` (multipart upload of the demo file).`),o.length&&r.push(`**When the fix is complete and the PR is open, announce it yourself:**\n${o.join(`
101
+ `)}\n\nMessage format — keep it short: what was broken → what you changed (one-line fix summary) → links to the Linear issue, the PR, and your agent run${n===`video`?` → attach/upload the demo video`:n===`spec`?`include the 1:1 spec-crawler evidence summary`:``} → end with the CTA "👉 Review the PR". You may also use these tokens to send yourself intermediate test notifications while verifying the integration works.`);let s=[`- [ ] Tested the change hands-on in the RUNNING app (state what you exercised)`];return n===`video`?(s.push(`- [ ] Demo media captured — GIF/video preferred; if recording is impossible in your environment, before/after screenshots + the stated reason`),e.githubAssetsRepo?.trim()&&s.push(`- [ ] Demo media committed to \`${e.githubAssetsRepo.trim()}\` and embedded via raw.githubusercontent.com URL in the Linear comment AND the PR body`),s.push(`- [ ] Demo media attached to the Linear ISSUE itself (not only the PR)`)):n===`spec`&&s.push("- [ ] 1:1 evidence produced with the spec-crawler MCP — reference vs fixed build computed-style comparison, `spec-bundle/frames/<id>.html` paths cited, before → after diff pasted in the closeout comment"),s.push(`- [ ] PR opened and linked here`,`- [ ] Deploy-preview URL included, deep-linked to the changed page (if the repo has preview deployments, e.g. Vercel; otherwise state that it does not)`,`- [ ] Issue moved to its review/done state`),o.length&&s.push(`- [ ] Announcement posted to the configured channel(s) with the demo attached`),r.push(`**DEFINITION OF DONE — acceptance checklist.** Copy this checklist VERBATIM into your Linear closeout comment and tick each box (\`- [x]\`) with a link or one-line evidence next to it. Any unchecked box means the work is NOT ACCEPTED — leave it unchecked and explain the blocker rather than omitting it:\n${s.join(`
102
+ `)}`),r.join(`
94
103
 
95
- `)}function fD(e){let t=[];if(e.componentName&&t.push(`Component: <${e.componentName}>`),e.tagName&&t.push(`DOM element: <${e.tagName}>`),e.source?.filePath){let n=e.source.lineNumber==null?``:`:${e.source.lineNumber}`;t.push(`Source: ${e.source.filePath}${n}`)}return e.stackContext&&t.push(`Component stack:\n${e.stackContext}`),e.content&&t.push(`Element context:\n${e.content}`),t.push(`Page URL: ${e.pageUrl}`),t.join(`
96
- `)}function pD(e){let t=[];t.push(`Reporter note:\n${e.note.trim()||`(none — infer from the element context)`}`);let n=e.grabbedList?.length?e.grabbedList:e.grabbed?[e.grabbed]:[];return n.slice(0,3).forEach((e,r)=>{t.push(`Captured element ${n.length>1?`${r+1}/${Math.min(n.length,3)} `:``}(via the Linear Grab picker):\n${fD(e)}`)}),e.teamName&&t.push(`Target team: ${e.teamName}`),e.template?.trim()&&t.push(`Standing agent instructions the team appends to every issue (context only — do NOT repeat them in your description, they are added automatically):\n${e.template.trim()}`),e.logs?.trim()&&t.push(`Recent dev server logs (tail — use for Analysis/Notes when relevant, do not paste wholesale):\n\`\`\`\n${e.logs.trim()}\n\`\`\``),t.push(`Draft the issue now.`),t.join(`
104
+ `)}function pD(e){let t=[];if(e.componentName&&t.push(`Component: <${e.componentName}>`),e.tagName&&t.push(`DOM element: <${e.tagName}>`),e.source?.filePath){let n=e.source.lineNumber==null?``:`:${e.source.lineNumber}`;t.push(`Source: ${e.source.filePath}${n}`)}return e.stackContext&&t.push(`Component stack:\n${e.stackContext}`),e.content&&t.push(`Element context:\n${e.content}`),t.push(`Page URL: ${e.pageUrl}`),t.join(`
105
+ `)}function mD(e){let t=[];t.push(`Reporter note:\n${e.note.trim()||`(none — infer from the element context)`}`);let n=e.grabbedList?.length?e.grabbedList:e.grabbed?[e.grabbed]:[];return n.slice(0,3).forEach((e,r)=>{t.push(`Captured element ${n.length>1?`${r+1}/${Math.min(n.length,3)} `:``}(via the Linear Grab picker):\n${pD(e)}`)}),e.teamName&&t.push(`Target team: ${e.teamName}`),e.template?.trim()&&t.push(`Standing agent instructions the team appends to every issue (context only — do NOT repeat them in your description, they are added automatically):\n${e.template.trim()}`),e.logs?.trim()&&t.push(`Recent dev server logs (tail — use for Analysis/Notes when relevant, do not paste wholesale):\n\`\`\`\n${e.logs.trim()}\n\`\`\``),t.push(`Draft the issue now.`),t.join(`
97
106
 
98
- `)}function mD(e,t,n){let r=[`## UI element context (Linear Grab)`];if(e.componentName&&r.push(`Component: \`<${e.componentName}>\``),e.source?.filePath){let t=e.source.lineNumber==null?``:`:${e.source.lineNumber}`;r.push(`Source: \`${e.source.filePath}${t}\``)}e.tagName&&r.push(`DOM element: \`<${e.tagName}>\``),r.push(`Page: ${e.pageUrl}`),e.stackContext&&r.push(`\nComponent stack:\n\`\`\`\n${e.stackContext}\n\`\`\``);let i=(t.skillPaths??``).split(`
107
+ `)}function hD(e,t,n){let r=[`## UI element context (Linear Grab)`];if(e.componentName&&r.push(`Component: \`<${e.componentName}>\``),e.source?.filePath){let t=e.source.lineNumber==null?``:`:${e.source.lineNumber}`;r.push(`Source: \`${e.source.filePath}${t}\``)}e.tagName&&r.push(`DOM element: \`<${e.tagName}>\``),r.push(`Page: ${e.pageUrl}`),e.stackContext&&r.push(`\nComponent stack:\n\`\`\`\n${e.stackContext}\n\`\`\``);let i=(t.skillPaths??``).split(`
99
108
  `).map(e=>e.trim()).filter(Boolean);return i.length&&r.push(`\nRead these project skills/memory files first and treat them as authoritative:\n${i.map(e=>`- \`${e}\``).join(`
100
109
  `)}`),n?.trim()&&r.push(`\nTask:\n${n.trim()}`),r.join(`
101
- `)}function hD(e){let t=[];e.description.trim()&&t.push(`### Summary\n${e.description.trim()}`);let n=e.reproSteps.map(e=>e.trim()).filter(Boolean);n.length&&t.push(`### Steps to Reproduce\n${n.map((e,t)=>`${t+1}. ${e}`).join(`
110
+ `)}function gD(e){let t=[];e.description.trim()&&t.push(`### Summary\n${e.description.trim()}`);let n=e.reproSteps.map(e=>e.trim()).filter(Boolean);n.length&&t.push(`### Steps to Reproduce\n${n.map((e,t)=>`${t+1}. ${e}`).join(`
102
111
  `)}`),e.expected.trim()&&t.push(`### Expected Behavior\n${e.expected.trim()}`),e.actual.trim()&&t.push(`### Actual Behavior\n${e.actual.trim()}`),e.impact?.trim()&&t.push(`### Impact\n${e.impact.trim()}`),e.analysisNotes?.trim()&&t.push(`### Analysis / Notes\n${e.analysisNotes.trim()}`),e.suggestedNextSteps?.trim()&&t.push(`### Suggested Next Steps\n${e.suggestedNextSteps.trim()}`);let r=(e.grabs??[]).filter(e=>e.source?.filePath||e.componentName);if(r.length){let e=r.map(e=>{let t=e.source?.filePath?`\`${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}\``:null;return`- ${[e.componentName?`\`<${e.componentName}>\``:null,t].filter(Boolean).join(` — `)}`}),n=r[0];n.stackContext&&e.push(`\n\`\`\`\n${n.stackContext}\n\`\`\``),e.push(`\nCaptured on ${n.pageUrl}`),t.push(`### Source${r.length>1?` (${r.length} elements)`:``}\n${e.join(`
103
112
  `)}`)}e.agentInstructions?.trim()&&t.push(`### Agent instructions\n${e.agentInstructions.trim()}`);let i=[e.repo?.trim()?`[repo=${e.repo.trim()}]`:null,e.model?.trim()?`[model=${e.model.trim()}]`:null].filter(Boolean);return i.length&&t.push(i.join(` `)),t.join(`
104
113
 
105
- `)}var gD,_D,vD=t((()=>{gD=`You are an expert engineer drafting a Linear issue for a development team.
114
+ `)}var _D,vD,yD,bD=t((()=>{_D=`You are an expert engineer drafting a Linear issue for a development team.
106
115
  You are given a rough note from the reporter and, when available, the exact React source
107
116
  location of the UI element the issue is about (captured from a running dev build).
108
117
 
@@ -117,11 +126,11 @@ Summary (description field) → Steps to Reproduce (reproSteps) → Expected Beh
117
126
  (analysisNotes, markdown bullets grounded in the provided source context) →
118
127
  Suggested Next Steps (suggestedNextSteps, markdown bullets with concrete fixes).
119
128
  The Summary is a short plain-prose paragraph — no headings inside it, no repetition
120
- of the other sections.`,_D="- FIRST, self-orient in the repo checkout (skip any path that doesn't exist):\n 1. Read `CLAUDE.md` and `AGENTS.md` at the repo root — the master map of product rules, architecture, and memory/skill pointers.\n 2. Skim `.claude/memory/MEMORY.md` (the index) to learn what project memory exists; load the specific `.claude/memory/*.md` files the map names for the surface you're touching.\n 3. Load the matching `.claude/skills/<name>/SKILL.md` files before designing, building UI, or animating (if skills are symlinked, follow them into `.agents/skills/`).\n Treat all of this as authoritative — it overrides your defaults.\n- Live render telemetry (react-scan → linear-grab bridge): if `.lineargrab/scan.ndjson` exists in the repo, it holds the user's REAL interaction slowdowns — component render counts, self-times, change causes (`prop:x`/`state:i`/`context:y`), and interaction latencies, newest last. `curl -s http://127.0.0.1:4577/scan/report` returns an aggregated view. For any re-render/performance issue: read it BEFORE fixing (the evidence) and AFTER (the proof), and cite before→after numbers in your closeout.\n- Keep going until the code works and you're happy with the implementation.\n- MANDATORY COMPLETION GATE — the task is NOT complete (and you may not call it complete) until every step below is done, in order. Skipping any step silently is a FAILED task:\n 1. RUN the app and TEST your change hands-on (computer use / a real browser against the running app). Code reading alone does not count as verification.\n 2. RECORD a demo video or GIF showing the fix working (before → after where possible). If your environment genuinely cannot record media, capture before/after screenshots instead AND state explicitly in your closeout comment why video was not possible — never just omit the demo.\n 3. Open the PR, babysit it for the first set of review comments, and address them. If the repo has preview deployments (e.g. Vercel), wait for the preview to go green and include its URL — deep-linked to the changed page — in the PR body, the Linear closeout, and the announcement.\n 4. CLOSE OUT THE LINEAR ISSUE: post a completion comment (one-line fix summary + PR link), attach the demo media to the ISSUE itself (not only the PR), and move the issue to its review/done state."})),yD=r({describeAiError:()=>SD,executeDraft:()=>bD});async function bD(e,t,n){let r=await Nx(e.tier);try{return await xD(r,e,t,n,!1)}catch(i){if(n.aborted)throw i;let a=await Px(r.provider,e.tier);if(!a)throw Error(SD(i));try{return await xD(a,e,t,n,!0)}catch(e){throw Error(SD(e))}}}async function xD(e,t,n,r,i){let a=ST({model:e.model,schema:lD,system:gD,prompt:pD(t),abortSignal:r});for await(let e of a.partialObjectStream)n(e);return{draft:await a.object,provider:e.provider,modelId:e.modelId,fellBack:i}}function SD(e){let t=e instanceof Error?e.message:String(e);return/401|unauthorized|invalid.*key/i.test(t)?`AI provider rejected the API key.`:/429|rate/i.test(t)?`AI provider rate limit hit — try again shortly.`:`Draft failed: ${t}`}var CD=t((()=>{sD(),uD(),vD(),Lx()}));Sr(),Lx();function wD(e,t){return xr?TD(e,t):ED(e,t)}function TD(e,t){let n=chrome.runtime.connect({name:`ai-draft`}),r=!1;return n.onMessage.addListener(e=>{e.type===`partial`?t.onPartial(e.draft):e.type===`done`?(r=!0,t.onDone(e),n.disconnect()):e.type===`error`&&(r=!0,t.onError(e.message,e.code===`no-provider`?`no-provider`:`unknown`),n.disconnect())}),n.onDisconnect.addListener(()=>{r||t.onError(`Draft stream disconnected.`)}),n.postMessage({type:`start`,input:e}),()=>{try{n.disconnect()}catch{}}}function ED(e,t){let n=new AbortController;return(async()=>{let{executeDraft:r}=await Promise.resolve().then(()=>(CD(),yD));try{let i=await r(e,t.onPartial,n.signal);n.signal.aborted||t.onDone(i)}catch(e){if(n.signal.aborted)return;t.onError(e instanceof Error?e.message:String(e),e instanceof Ix?`no-provider`:`unknown`)}})(),()=>n.abort()}var DD=n((e=>{var t=Object.defineProperty;(e=>t(e,`__esModule`,{value:!0}))(e),((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(e,{GIFEncoder:()=>ee,applyPalette:()=>S,default:()=>le,nearestColor:()=>k,nearestColorIndex:()=>D,nearestColorIndexWithDistance:()=>O,prequantize:()=>x,quantize:()=>_,snapColorsToPalette:()=>T});var n={signature:`GIF`,version:`89a`,trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function r(e=256){let t=0,n=new Uint8Array(e);return{get buffer(){return n.buffer},reset(){t=0},bytesView(){return n.subarray(0,t)},bytes(){return n.slice(0,t)},writeByte(e){r(t+1),n[t]=e,t++},writeBytes(e,i=0,a=e.length){r(t+a);for(let r=0;r<a;r++)n[t++]=e[r+i]},writeBytesView(e,i=0,a=e.byteLength){r(t+a),n.set(e.subarray(i,i+a),t),t+=a}};function r(e){var r=n.length;if(r>=e)return;e=Math.max(e,r*(r<1024*1024?2:1.125)>>>0),r!=0&&(e=Math.max(e,256));let i=n;n=new Uint8Array(e),t>0&&n.set(i.subarray(0,t),0)}}var i=12,a=5003,o=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function s(e,t,n,s,c=r(512),l=new Uint8Array(256),u=new Int32Array(a),d=new Int32Array(a)){let f=u.length,p=Math.max(2,s);l.fill(0),d.fill(0),u.fill(-1);let m=0,h=0,g=p+1,_=g,v=!1,y=_,b=(1<<y)-1,x=1<<g-1,S=x+1,C=x+2,w=0,T=n[0],E=0;for(let e=f;e<65536;e*=2)++E;E=8-E,c.writeByte(p),O(x);let D=n.length;for(let e=1;e<D;e++)next_block:{let t=n[e],r=(t<<i)+T,a=t<<E^T;if(u[a]===r){T=d[a];break next_block}let o=a===0?1:f-a;for(;u[a]>=0;)if(a-=o,a<0&&(a+=f),u[a]===r){T=d[a];break next_block}O(T),T=t,C<1<<i?(d[a]=C++,u[a]=r):(u.fill(-1),C=x+2,v=!0,O(x))}return O(T),O(S),c.writeByte(0),c.bytesView();function O(e){for(m&=o[h],h>0?m|=e<<h:m=e,h+=y;h>=8;)l[w++]=m&255,w>=254&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0),m>>=8,h-=8;if((C>b||v)&&(v?(y=_,b=(1<<y)-1,v=!1):(++y,b=y===i?1<<y:(1<<y)-1)),e==S){for(;h>0;)l[w++]=m&255,w>=254&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0),m>>=8,h-=8;w>0&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0)}}}var c=s;function l(e,t,n){return e<<8&63488|t<<2&992|n>>3}function u(e,t,n,r){return e>>4|t&240|(n&240)<<4|(r&240)<<8}function d(e,t,n){return e>>4<<8|t&240|n>>4}function f(e,t,n){return e<t?t:e>n?n:e}function p(e){return e*e}function m(e,t,n){var r=0,i=1e100;let a=e[t],o=a.cnt,s=a.ac,c=a.rc,l=a.gc,u=a.bc;for(var d=a.fw;d!=0;d=e[d].fw){let t=e[d],a=t.cnt,m=o*a/(o+a);if(!(m>=i)){var f=0;n&&(f+=m*p(t.ac-s),f>=i)||(f+=m*p(t.rc-c),!(f>=i)&&(f+=m*p(t.gc-l),!(f>=i)&&(f+=m*p(t.bc-u),!(f>=i)&&(i=f,r=d))))}}a.err=i,a.nn=r}function h(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function g(e,t){let n=Array(t===`rgb444`?4096:65536),r=e.length;if(t===`rgba4444`)for(let t=0;t<r;++t){let r=e[t],i=r>>24&255,a=r>>16&255,o=r>>8&255,s=r&255,c=u(s,o,a,i),l=c in n?n[c]:n[c]=h();l.rc+=s,l.gc+=o,l.bc+=a,l.ac+=i,l.cnt++}else if(t===`rgb444`)for(let t=0;t<r;++t){let r=e[t],i=r>>16&255,a=r>>8&255,o=r&255,s=d(o,a,i),c=s in n?n[s]:n[s]=h();c.rc+=o,c.gc+=a,c.bc+=i,c.cnt++}else for(let t=0;t<r;++t){let r=e[t],i=r>>16&255,a=r>>8&255,o=r&255,s=l(o,a,i),c=s in n?n[s]:n[s]=h();c.rc+=o,c.gc+=a,c.bc+=i,c.cnt++}return n}function _(e,t,n={}){let{format:r=`rgb565`,clearAlpha:i=!0,clearAlphaColor:a=0,clearAlphaThreshold:o=0,oneBitAlpha:s=!1}=n;if(!e||!e.buffer||!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw Error(`quantize() expected RGBA Uint8Array data`);let c=new Uint32Array(e.buffer),l=n.useSqrt!==!1,u=r===`rgba4444`,d=g(c,r),h=d.length,_=h-1,y=new Uint32Array(h+1);for(var b=0,x=0;x<h;++x){let e=d[x];if(e!=null){var S=1/e.cnt;u&&(e.ac*=S),e.rc*=S,e.gc*=S,e.bc*=S,d[b++]=e}}p(t)/b<.022&&(l=!1);for(var x=0;x<b-1;++x)d[x].fw=x+1,d[x+1].bk=x,l&&(d[x].cnt=Math.sqrt(d[x].cnt));l&&(d[x].cnt=Math.sqrt(d[x].cnt));var C,w,T;for(x=0;x<b;++x){m(d,x,!1);var E=d[x].err;for(w=++y[0];w>1&&(T=w>>1,!(d[C=y[T]].err<=E));w=T)y[w]=C;y[w]=x}var D=b-t;for(x=0;x<D;){for(var O;;){var k=y[1];if(O=d[k],O.tm>=O.mtm&&d[O.nn].mtm<=O.tm)break;O.mtm==_?k=y[1]=y[y[0]--]:(m(d,k,!1),O.tm=x);var E=d[k].err;for(w=1;(T=w+w)<=y[0]&&(T<y[0]&&d[y[T]].err>d[y[T+1]].err&&T++,!(E<=d[C=y[T]].err));w=T)y[w]=C;y[w]=k}var ee=d[O.nn],te=O.cnt,A=ee.cnt,S=1/(te+A);u&&(O.ac=S*(te*O.ac+A*ee.ac)),O.rc=S*(te*O.rc+A*ee.rc),O.gc=S*(te*O.gc+A*ee.gc),O.bc=S*(te*O.bc+A*ee.bc),O.cnt+=ee.cnt,O.mtm=++x,d[ee.bk].fw=ee.fw,d[ee.fw].bk=ee.bk,ee.mtm=_}let ne=[];var re=0;for(x=0;;++re){let e=f(Math.round(d[x].rc),0,255),t=f(Math.round(d[x].gc),0,255),n=f(Math.round(d[x].bc),0,255),r=255;u&&(r=f(Math.round(d[x].ac),0,255),s&&(r=r<=(typeof s==`number`?s:127)?0:255),i&&r<=o&&(e=t=n=a,r=0));let c=u?[e,t,n,r]:[e,t,n];if(v(ne,c)||ne.push(c),(x=d[x].fw)==0)break}return ne}function v(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2],a=r.length>=4&&t.length>=4?r[3]===t[3]:!0;if(i&&a)return!0}return!1}function y(e,t){var n=0,r;for(r=0;r<e.length;r++){let i=e[r]-t[r];n+=i*i}return n}function b(e,t){return t>1?Math.round(e/t)*t:e}function x(e,{roundRGB:t=5,roundAlpha:n=10,oneBitAlpha:r=null}={}){let i=new Uint32Array(e.buffer);for(let e=0;e<i.length;e++){let a=i[e],o=a>>24&255,s=a>>16&255,c=a>>8&255,l=a&255;o=b(o,n),r&&(o=o<=(typeof r==`number`?r:127)?0:255),l=b(l,t),c=b(c,t),s=b(s,t),i[e]=o<<24|s<<16|c<<8|l<<0}}function S(e,t,n=`rgb565`){if(!e||!e.buffer||!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw Error(`quantize() expected RGBA Uint8Array data`);if(t.length>256)throw Error(`applyPalette() only works with 256 colors or less`);let r=new Uint32Array(e.buffer),i=r.length,a=n===`rgb444`?4096:65536,o=new Uint8Array(i),s=Array(a);if(n===`rgba4444`)for(let e=0;e<i;e++){let n=r[e],i=n>>24&255,a=n>>16&255,c=n>>8&255,l=n&255,d=u(l,c,a,i);o[e]=d in s?s[d]:s[d]=C(l,c,a,i,t)}else{let e=n===`rgb444`?d:l;for(let n=0;n<i;n++){let i=r[n],a=i>>16&255,c=i>>8&255,l=i&255,u=e(l,c,a);o[n]=u in s?s[u]:s[u]=w(l,c,a,t)}}return o}function C(e,t,n,r,i){let a=0,o=1e100;for(let s=0;s<i.length;s++){let c=i[s],l=c[3],u=E(l-r);if(u>o)continue;let d=c[0];if(u+=E(d-e),u>o)continue;let f=c[1];if(u+=E(f-t),u>o)continue;let p=c[2];u+=E(p-n),!(u>o)&&(o=u,a=s)}return a}function w(e,t,n,r){let i=0,a=1e100;for(let o=0;o<r.length;o++){let s=r[o],c=s[0],l=E(c-e);if(l>a)continue;let u=s[1];if(l+=E(u-t),l>a)continue;let d=s[2];l+=E(d-n),!(l>a)&&(a=l,i=o)}return i}function T(e,t,n=5){if(!e.length||!t.length)return;let r=e.map(e=>e.slice(0,3)),i=n*n,a=e[0].length;for(let n=0;n<t.length;n++){let o=t[n];o=o.length<a?[o[0],o[1],o[2],255]:o.length>a?o.slice(0,3):o.slice();let s=O(r,o.slice(0,3),y),c=s[0],l=s[1];l>0&&l<=i&&(e[c]=o)}}function E(e){return e*e}function D(e,t,n=y){let r=1/0,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=n(t,o);s<r&&(r=s,i=a)}return i}function O(e,t,n=y){let r=1/0,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=n(t,o);s<r&&(r=s,i=a)}return[i,r]}function k(e,t,n=y){return e[D(e,t,n)]}function ee(e={}){let{initialCapacity:t=4096,auto:i=!0}=e,a=r(t),o=5003,s=new Uint8Array(256),c=new Int32Array(o),l=new Int32Array(o),u=!1;return{reset(){a.reset(),u=!1},finish(){a.writeByte(n.trailer)},bytes(){return a.bytes()},bytesView(){return a.bytesView()},get buffer(){return a.buffer},get stream(){return a},writeHeader:d,writeFrame(e,t,n,r={}){let{transparent:o=!1,transparentIndex:f=0,delay:p=0,palette:m=null,repeat:h=0,colorDepth:g=8,dispose:_=-1}=r,v=!1;if(i?u||=(v=!0,d(),!0):v=!!r.first,t=Math.max(0,Math.floor(t)),n=Math.max(0,Math.floor(n)),v){if(!m)throw Error(`First frame must include a { palette } option`);A(a,t,n,m,g),re(a,m),h>=0&&ne(a,h)}let y=Math.round(p/10);te(a,_,y,o,f);let b=!!m&&!v;ie(a,t,n,b?m:null),b&&re(a,m),ae(a,e,t,n,g,s,c,l)}};function d(){se(a,`GIF89a`)}}function te(e,t,n,r,i){e.writeByte(33),e.writeByte(249),e.writeByte(4),i<0&&(i=0,r=!1);var a,o;r?(a=1,o=2):(a=0,o=0),t>=0&&(o=t&7),o<<=2,e.writeByte(o|0|a),oe(e,n),e.writeByte(i||0),e.writeByte(0)}function A(e,t,n,r,i=8){let a=ce(r.length)-1,o=i-1<<4|128|a;oe(e,t),oe(e,n),e.writeBytes([o,0,0])}function ne(e,t){e.writeByte(33),e.writeByte(255),e.writeByte(11),se(e,`NETSCAPE2.0`),e.writeByte(3),e.writeByte(1),oe(e,t),e.writeByte(0)}function re(e,t){let n=1<<ce(t.length);for(let r=0;r<n;r++){let n=[0,0,0];r<t.length&&(n=t[r]),e.writeByte(n[0]),e.writeByte(n[1]),e.writeByte(n[2])}}function ie(e,t,n,r){if(e.writeByte(44),oe(e,0),oe(e,0),oe(e,t),oe(e,n),r){let t=ce(r.length)-1;e.writeByte(128|t)}else e.writeByte(0)}function ae(e,t,n,r,i=8,a,o,s){c(n,r,t,i,e,a,o,s)}function oe(e,t){e.writeByte(t&255),e.writeByte(t>>8&255)}function se(e,t){for(var n=0;n<t.length;n++)e.writeByte(t.charCodeAt(n))}function ce(e){return Math.max(Math.ceil(Math.log2(e)),1)}var le=ee}))(),OD="(function(){var e=((e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports))((e=>{var t=Object.defineProperty;(e=>t(e,`__esModule`,{value:!0}))(e),((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(e,{GIFEncoder:()=>A,applyPalette:()=>S,default:()=>B,nearestColor:()=>k,nearestColorIndex:()=>D,nearestColorIndexWithDistance:()=>O,prequantize:()=>x,quantize:()=>_,snapColorsToPalette:()=>T});var n={signature:`GIF`,version:`89a`,trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function r(e=256){let t=0,n=new Uint8Array(e);return{get buffer(){return n.buffer},reset(){t=0},bytesView(){return n.subarray(0,t)},bytes(){return n.slice(0,t)},writeByte(e){r(t+1),n[t]=e,t++},writeBytes(e,i=0,a=e.length){r(t+a);for(let r=0;r<a;r++)n[t++]=e[r+i]},writeBytesView(e,i=0,a=e.byteLength){r(t+a),n.set(e.subarray(i,i+a),t),t+=a}};function r(e){var r=n.length;if(r>=e)return;e=Math.max(e,r*(r<1024*1024?2:1.125)>>>0),r!=0&&(e=Math.max(e,256));let i=n;n=new Uint8Array(e),t>0&&n.set(i.subarray(0,t),0)}}var i=12,a=5003,o=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function s(e,t,n,s,c=r(512),l=new Uint8Array(256),u=new Int32Array(a),d=new Int32Array(a)){let f=u.length,p=Math.max(2,s);l.fill(0),d.fill(0),u.fill(-1);let m=0,h=0,g=p+1,_=g,v=!1,y=_,b=(1<<y)-1,x=1<<g-1,S=x+1,C=x+2,w=0,T=n[0],E=0;for(let e=f;e<65536;e*=2)++E;E=8-E,c.writeByte(p),O(x);let D=n.length;for(let e=1;e<D;e++)next_block:{let t=n[e],r=(t<<i)+T,a=t<<E^T;if(u[a]===r){T=d[a];break next_block}let o=a===0?1:f-a;for(;u[a]>=0;)if(a-=o,a<0&&(a+=f),u[a]===r){T=d[a];break next_block}O(T),T=t,C<1<<i?(d[a]=C++,u[a]=r):(u.fill(-1),C=x+2,v=!0,O(x))}return O(T),O(S),c.writeByte(0),c.bytesView();function O(e){for(m&=o[h],h>0?m|=e<<h:m=e,h+=y;h>=8;)l[w++]=m&255,w>=254&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0),m>>=8,h-=8;if((C>b||v)&&(v?(y=_,b=(1<<y)-1,v=!1):(++y,b=y===i?1<<y:(1<<y)-1)),e==S){for(;h>0;)l[w++]=m&255,w>=254&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0),m>>=8,h-=8;w>0&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0)}}}var c=s;function l(e,t,n){return e<<8&63488|t<<2&992|n>>3}function u(e,t,n,r){return e>>4|t&240|(n&240)<<4|(r&240)<<8}function d(e,t,n){return e>>4<<8|t&240|n>>4}function f(e,t,n){return e<t?t:e>n?n:e}function p(e){return e*e}function m(e,t,n){var r=0,i=1e100;let a=e[t],o=a.cnt,s=a.ac,c=a.rc,l=a.gc,u=a.bc;for(var d=a.fw;d!=0;d=e[d].fw){let t=e[d],a=t.cnt,m=o*a/(o+a);if(!(m>=i)){var f=0;n&&(f+=m*p(t.ac-s),f>=i)||(f+=m*p(t.rc-c),!(f>=i)&&(f+=m*p(t.gc-l),!(f>=i)&&(f+=m*p(t.bc-u),!(f>=i)&&(i=f,r=d))))}}a.err=i,a.nn=r}function h(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function g(e,t){let n=Array(t===`rgb444`?4096:65536),r=e.length;if(t===`rgba4444`)for(let t=0;t<r;++t){let r=e[t],i=r>>24&255,a=r>>16&255,o=r>>8&255,s=r&255,c=u(s,o,a,i),l=c in n?n[c]:n[c]=h();l.rc+=s,l.gc+=o,l.bc+=a,l.ac+=i,l.cnt++}else if(t===`rgb444`)for(let t=0;t<r;++t){let r=e[t],i=r>>16&255,a=r>>8&255,o=r&255,s=d(o,a,i),c=s in n?n[s]:n[s]=h();c.rc+=o,c.gc+=a,c.bc+=i,c.cnt++}else for(let t=0;t<r;++t){let r=e[t],i=r>>16&255,a=r>>8&255,o=r&255,s=l(o,a,i),c=s in n?n[s]:n[s]=h();c.rc+=o,c.gc+=a,c.bc+=i,c.cnt++}return n}function _(e,t,n={}){let{format:r=`rgb565`,clearAlpha:i=!0,clearAlphaColor:a=0,clearAlphaThreshold:o=0,oneBitAlpha:s=!1}=n;if(!e||!e.buffer||!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw Error(`quantize() expected RGBA Uint8Array data`);let c=new Uint32Array(e.buffer),l=n.useSqrt!==!1,u=r===`rgba4444`,d=g(c,r),h=d.length,_=h-1,y=new Uint32Array(h+1);for(var b=0,x=0;x<h;++x){let e=d[x];if(e!=null){var S=1/e.cnt;u&&(e.ac*=S),e.rc*=S,e.gc*=S,e.bc*=S,d[b++]=e}}p(t)/b<.022&&(l=!1);for(var x=0;x<b-1;++x)d[x].fw=x+1,d[x+1].bk=x,l&&(d[x].cnt=Math.sqrt(d[x].cnt));l&&(d[x].cnt=Math.sqrt(d[x].cnt));var C,w,T;for(x=0;x<b;++x){m(d,x,!1);var E=d[x].err;for(w=++y[0];w>1&&(T=w>>1,!(d[C=y[T]].err<=E));w=T)y[w]=C;y[w]=x}var D=b-t;for(x=0;x<D;){for(var O;;){var k=y[1];if(O=d[k],O.tm>=O.mtm&&d[O.nn].mtm<=O.tm)break;O.mtm==_?k=y[1]=y[y[0]--]:(m(d,k,!1),O.tm=x);var E=d[k].err;for(w=1;(T=w+w)<=y[0]&&(T<y[0]&&d[y[T]].err>d[y[T+1]].err&&T++,!(E<=d[C=y[T]].err));w=T)y[w]=C;y[w]=k}var A=d[O.nn],j=O.cnt,M=A.cnt,S=1/(j+M);u&&(O.ac=S*(j*O.ac+M*A.ac)),O.rc=S*(j*O.rc+M*A.rc),O.gc=S*(j*O.gc+M*A.gc),O.bc=S*(j*O.bc+M*A.bc),O.cnt+=A.cnt,O.mtm=++x,d[A.bk].fw=A.fw,d[A.fw].bk=A.bk,A.mtm=_}let N=[];var P=0;for(x=0;;++P){let e=f(Math.round(d[x].rc),0,255),t=f(Math.round(d[x].gc),0,255),n=f(Math.round(d[x].bc),0,255),r=255;u&&(r=f(Math.round(d[x].ac),0,255),s&&(r=r<=(typeof s==`number`?s:127)?0:255),i&&r<=o&&(e=t=n=a,r=0));let c=u?[e,t,n,r]:[e,t,n];if(v(N,c)||N.push(c),(x=d[x].fw)==0)break}return N}function v(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2],a=r.length>=4&&t.length>=4?r[3]===t[3]:!0;if(i&&a)return!0}return!1}function y(e,t){var n=0,r;for(r=0;r<e.length;r++){let i=e[r]-t[r];n+=i*i}return n}function b(e,t){return t>1?Math.round(e/t)*t:e}function x(e,{roundRGB:t=5,roundAlpha:n=10,oneBitAlpha:r=null}={}){let i=new Uint32Array(e.buffer);for(let e=0;e<i.length;e++){let a=i[e],o=a>>24&255,s=a>>16&255,c=a>>8&255,l=a&255;o=b(o,n),r&&(o=o<=(typeof r==`number`?r:127)?0:255),l=b(l,t),c=b(c,t),s=b(s,t),i[e]=o<<24|s<<16|c<<8|l<<0}}function S(e,t,n=`rgb565`){if(!e||!e.buffer||!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw Error(`quantize() expected RGBA Uint8Array data`);if(t.length>256)throw Error(`applyPalette() only works with 256 colors or less`);let r=new Uint32Array(e.buffer),i=r.length,a=n===`rgb444`?4096:65536,o=new Uint8Array(i),s=Array(a);if(n===`rgba4444`)for(let e=0;e<i;e++){let n=r[e],i=n>>24&255,a=n>>16&255,c=n>>8&255,l=n&255,d=u(l,c,a,i);o[e]=d in s?s[d]:s[d]=C(l,c,a,i,t)}else{let e=n===`rgb444`?d:l;for(let n=0;n<i;n++){let i=r[n],a=i>>16&255,c=i>>8&255,l=i&255,u=e(l,c,a);o[n]=u in s?s[u]:s[u]=w(l,c,a,t)}}return o}function C(e,t,n,r,i){let a=0,o=1e100;for(let s=0;s<i.length;s++){let c=i[s],l=c[3],u=E(l-r);if(u>o)continue;let d=c[0];if(u+=E(d-e),u>o)continue;let f=c[1];if(u+=E(f-t),u>o)continue;let p=c[2];u+=E(p-n),!(u>o)&&(o=u,a=s)}return a}function w(e,t,n,r){let i=0,a=1e100;for(let o=0;o<r.length;o++){let s=r[o],c=s[0],l=E(c-e);if(l>a)continue;let u=s[1];if(l+=E(u-t),l>a)continue;let d=s[2];l+=E(d-n),!(l>a)&&(a=l,i=o)}return i}function T(e,t,n=5){if(!e.length||!t.length)return;let r=e.map(e=>e.slice(0,3)),i=n*n,a=e[0].length;for(let n=0;n<t.length;n++){let o=t[n];o=o.length<a?[o[0],o[1],o[2],255]:o.length>a?o.slice(0,3):o.slice();let s=O(r,o.slice(0,3),y),c=s[0],l=s[1];l>0&&l<=i&&(e[c]=o)}}function E(e){return e*e}function D(e,t,n=y){let r=1/0,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=n(t,o);s<r&&(r=s,i=a)}return i}function O(e,t,n=y){let r=1/0,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=n(t,o);s<r&&(r=s,i=a)}return[i,r]}function k(e,t,n=y){return e[D(e,t,n)]}function A(e={}){let{initialCapacity:t=4096,auto:i=!0}=e,a=r(t),o=5003,s=new Uint8Array(256),c=new Int32Array(o),l=new Int32Array(o),u=!1;return{reset(){a.reset(),u=!1},finish(){a.writeByte(n.trailer)},bytes(){return a.bytes()},bytesView(){return a.bytesView()},get buffer(){return a.buffer},get stream(){return a},writeHeader:d,writeFrame(e,t,n,r={}){let{transparent:o=!1,transparentIndex:f=0,delay:p=0,palette:m=null,repeat:h=0,colorDepth:g=8,dispose:_=-1}=r,v=!1;if(i?u||=(v=!0,d(),!0):v=!!r.first,t=Math.max(0,Math.floor(t)),n=Math.max(0,Math.floor(n)),v){if(!m)throw Error(`First frame must include a { palette } option`);M(a,t,n,m,g),P(a,m),h>=0&&N(a,h)}let y=Math.round(p/10);j(a,_,y,o,f);let b=!!m&&!v;F(a,t,n,b?m:null),b&&P(a,m),I(a,e,t,n,g,s,c,l)}};function d(){R(a,`GIF89a`)}}function j(e,t,n,r,i){e.writeByte(33),e.writeByte(249),e.writeByte(4),i<0&&(i=0,r=!1);var a,o;r?(a=1,o=2):(a=0,o=0),t>=0&&(o=t&7),o<<=2,e.writeByte(o|0|a),L(e,n),e.writeByte(i||0),e.writeByte(0)}function M(e,t,n,r,i=8){let a=z(r.length)-1,o=i-1<<4|128|a;L(e,t),L(e,n),e.writeBytes([o,0,0])}function N(e,t){e.writeByte(33),e.writeByte(255),e.writeByte(11),R(e,`NETSCAPE2.0`),e.writeByte(3),e.writeByte(1),L(e,t),e.writeByte(0)}function P(e,t){let n=1<<z(t.length);for(let r=0;r<n;r++){let n=[0,0,0];r<t.length&&(n=t[r]),e.writeByte(n[0]),e.writeByte(n[1]),e.writeByte(n[2])}}function F(e,t,n,r){if(e.writeByte(44),L(e,0),L(e,0),L(e,t),L(e,n),r){let t=z(r.length)-1;e.writeByte(128|t)}else e.writeByte(0)}function I(e,t,n,r,i=8,a,o,s){c(n,r,t,i,e,a,o,s)}function L(e,t){e.writeByte(t&255),e.writeByte(t>>8&255)}function R(e,t){for(var n=0;n<t.length;n++)e.writeByte(t.charCodeAt(n))}function z(e){return Math.max(Math.ceil(Math.log2(e)),1)}var B=A}))();let t=null,n=!0;self.onmessage=e=>{r(e.data).catch(t=>{e.data?.id!=null&&self.postMessage({id:e.data.id,type:`error`,message:t instanceof Error?t.message:String(t)})})};async function r(r){let a=(e,t=[])=>self.postMessage({id:r.id,...e},t);switch(r.type){case`encode-png`:{let e=r.bitmap,t=new OffscreenCanvas(e.width,e.height),n=t.getContext(`2d`);if(!n)throw Error(`OffscreenCanvas 2d unavailable`);n.drawImage(e,0,0),e.close();let o=await t.convertToBlob({type:`image/png`});o.size>18e5&&(o=await t.convertToBlob({type:`image/jpeg`,quality:.85})),a({type:`png`,dataUrl:await i(o)});return}case`gif-init`:t=(0,e.GIFEncoder)(),n=!0,a({type:`ok`});return;case`gif-frame`:{if(!t)return;let i=new Uint8ClampedArray(r.buffer),a=(0,e.quantize)(i,256,{format:`rgb565`}),o=(0,e.applyPalette)(i,a,`rgb565`);t.writeFrame(o,r.width,r.height,{palette:a,delay:r.delay,first:n,repeat:0}),n=!1;return}case`gif-finish`:{if(!t)throw Error(`No active GIF session`);t.finish();let e=t.bytes();t=null,a({type:`gif`,buffer:e.buffer},[e.buffer]);return}case`gif-abort`:t=null;return}}function i(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}})();",kD=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,OD],{type:`text/javascript;charset=utf-8`});function AD(e){let t;try{if(t=kD&&(self.URL||self.webkitURL).createObjectURL(kD),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(OD),{name:e?.name})}}var jD,MD=1,ND=new Map;function PD(){if(jD!==void 0)return jD;try{jD=new AD,jD.onmessage=e=>{let t=e.data?.id;if(t==null)return;let n=ND.get(t);n&&(ND.delete(t),e.data.type===`error`?n.reject(Error(e.data.message??`Worker error`)):n.resolve(e.data))},jD.onerror=()=>{for(let e of ND.values())e.reject(Error(`Image worker crashed`));ND.clear()}}catch{jD=null}return jD}function FD(e,t=[]){let n=PD();if(!n)return Promise.reject(Error(`Image worker unavailable`));let r=MD++;return new Promise((i,a)=>{ND.set(r,{resolve:i,reject:a}),n.postMessage({...e,id:r},t)})}function ID(e,t=[]){let n=PD();return n?(n.postMessage(e,t),!0):!1}var LD=6,RD=Math.round(1e3/LD),zD=3e4,BD=640,VD={phase:`idle`,startedAt:null,result:null,error:null,attachOnCreate:!0},HD=new Set;function UD(e){VD={...VD,...e};for(let e of HD)e(VD)}function WD(){return VD}function GD(e){return HD.add(e),()=>HD.delete(e)}var KD=null,qD=null,JD=null,YD=null,XD=null,ZD=null,QD=!1,$D=0,eO=!0;async function tO(){if(VD.phase===`recording`||VD.phase===`processing`)return;rO();try{KD=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:LD},audio:!1,preferCurrentTab:!0,selfBrowserSurface:`include`,surfaceSwitching:`exclude`,monitorTypeSurfaces:`exclude`,systemAudio:`exclude`})}catch{UD({phase:`error`,error:`Screen capture was denied or cancelled.`});return}let e=KD.getVideoTracks()[0];if(!e){UD({phase:`error`,error:`No video track available.`}),oO();return}e.addEventListener(`ended`,()=>void nO()),qD=document.createElement(`video`),qD.muted=!0,qD.playsInline=!0,qD.srcObject=KD,await qD.play().catch(()=>{});let t=Date.now()+3e3;for(;!qD.videoWidth&&Date.now()<t;)await new Promise(e=>setTimeout(e,50));if(!qD.videoWidth){UD({phase:`error`,error:`Could not read the capture stream.`}),oO();return}let n=Math.min(1,BD/qD.videoWidth),r=Math.round(qD.videoWidth*n),i=Math.round(qD.videoHeight*n);if(JD=document.createElement(`canvas`),JD.width=r,JD.height=i,YD=JD.getContext(`2d`,{willReadFrequently:!0}),!YD){UD({phase:`error`,error:`Canvas is unavailable.`}),oO();return}QD=await FD({type:`gif-init`}).then(()=>!0,()=>!1),ZD=QD?null:(0,DD.GIFEncoder)(),$D=0,eO=!0,UD({phase:`recording`,startedAt:Date.now(),error:null,result:null}),XD=setInterval(()=>{if(!YD||!qD||!JD)return;let e=VD.startedAt??Date.now();if(Date.now()-e>=zD){nO();return}try{YD.drawImage(qD,0,0,JD.width,JD.height);let{data:e}=YD.getImageData(0,0,JD.width,JD.height);if(QD)ID({type:`gif-frame`,buffer:e.buffer,width:JD.width,height:JD.height,delay:RD},[e.buffer]);else if(ZD){let t=(0,DD.quantize)(e,256,{format:`rgb565`}),n=(0,DD.applyPalette)(e,t,`rgb565`);ZD.writeFrame(n,JD.width,JD.height,{palette:t,delay:RD,first:eO,repeat:0}),eO=!1}$D++}catch{}},RD)}async function nO(){if(VD.phase!==`recording`)return;let e=VD.startedAt??Date.now();UD({phase:`processing`}),XD&&=(clearInterval(XD),null);let t=JD?.width??0,n=JD?.height??0,r=$D,i=ZD,a=QD;if(ZD=null,QD=!1,oO(),!i&&!a||r===0){UD({phase:`error`,error:`Nothing was captured.`});return}try{let o;if(a){let e=await FD({type:`gif-finish`});o=new Uint8Array(e.buffer)}else i.finish(),o=i.bytes();let s=new Blob([o.buffer],{type:`image/gif`});UD({phase:`ready`,result:{blob:s,url:URL.createObjectURL(s),width:t,height:n,frameCount:r,durationMs:Date.now()-e}})}catch(e){UD({phase:`error`,error:e instanceof Error?e.message:`GIF encoding failed.`})}}function rO(){VD.result?.url&&URL.revokeObjectURL(VD.result.url),oO(),XD&&=(clearInterval(XD),null),QD&&ID({type:`gif-abort`}),QD=!1,ZD=null,$D=0,UD({phase:`idle`,startedAt:null,result:null,error:null,attachOnCreate:!0})}function iO(e){UD({attachOnCreate:e})}function aO(e){VD.result&&UD({result:{...VD.result,assetUrl:e}})}function oO(){KD?.getTracks().forEach(e=>e.stop()),KD=null,qD&&=(qD.srcObject=null,null),JD=null,YD=null}Br();var sO=`https://api.linear.app/graphql`,cO=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`LinearError`}},lO=class extends cO{constructor(){super(`Not connected to Linear. Add an API key or connect OAuth in Settings.`),this.name=`LinearNotConnectedError`}};async function uO(e,t){let{linearApiKey:n,linearAccessToken:r}=await Tr(),i=r?`Bearer ${r}`:n;if(!i)throw new lO;let a=await fetch(sO,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:i},body:JSON.stringify({query:e,variables:t})}),o=await a.json().catch(()=>null);if(!a.ok)throw new cO(o?.errors?.[0]?.message??`Linear request failed (${a.status})`,a.status);if(o?.errors?.length)throw new cO(o.errors[0].message);if(!o?.data)throw new cO(`Empty response from Linear`);return o.data}async function dO(){return(await uO(`query { viewer { id name email } }`)).viewer}async function fO(){return(await uO(`query { teams(first: 50) { nodes { id key name } } }`)).teams.nodes}async function pO(){return(await uO(`query {
129
+ of the other sections.`,vD={video:`RECORD a demo video or GIF showing the fix working (before → after where possible). If your environment genuinely cannot record media, capture before/after screenshots instead AND state explicitly in your closeout comment why video was not possible — never just omit the demo.`,spec:"PRODUCE 1:1 EVIDENCE with the spec-crawler MCP instead of a demo video: capture the reference and your fixed build with `capture_component` / `capture_css_spec` (plus `force_state` / `crawl_overlays` / `capture_drag` for stateful surfaces), compare computed styles 1:1, and paste the before → after diff — citing the `spec-bundle/frames/<id>.html` file paths — in your closeout comment. No video is required."},yD=dD(`video`)})),xD=r({describeAiError:()=>wD,executeDraft:()=>SD});async function SD(e,t,n){let r=await Nx(e.tier);try{return await CD(r,e,t,n,!1)}catch(i){if(n.aborted)throw i;let a=await Px(r.provider,e.tier);if(!a)throw Error(wD(i));try{return await CD(a,e,t,n,!0)}catch(e){throw Error(wD(e))}}}async function CD(e,t,n,r,i){let a=ST({model:e.model,schema:lD,system:_D,prompt:mD(t),abortSignal:r});for await(let e of a.partialObjectStream)n(e);return{draft:await a.object,provider:e.provider,modelId:e.modelId,fellBack:i}}function wD(e){let t=e instanceof Error?e.message:String(e);return/401|unauthorized|invalid.*key/i.test(t)?`AI provider rejected the API key.`:/429|rate/i.test(t)?`AI provider rate limit hit — try again shortly.`:`Draft failed: ${t}`}var TD=t((()=>{sD(),uD(),bD(),Lx()}));Sr(),Lx();function ED(e,t){return xr?DD(e,t):OD(e,t)}function DD(e,t){let n=chrome.runtime.connect({name:`ai-draft`}),r=!1;return n.onMessage.addListener(e=>{e.type===`partial`?t.onPartial(e.draft):e.type===`done`?(r=!0,t.onDone(e),n.disconnect()):e.type===`error`&&(r=!0,t.onError(e.message,e.code===`no-provider`?`no-provider`:`unknown`),n.disconnect())}),n.onDisconnect.addListener(()=>{r||t.onError(`Draft stream disconnected.`)}),n.postMessage({type:`start`,input:e}),()=>{try{n.disconnect()}catch{}}}function OD(e,t){let n=new AbortController;return(async()=>{let{executeDraft:r}=await Promise.resolve().then(()=>(TD(),xD));try{let i=await r(e,t.onPartial,n.signal);n.signal.aborted||t.onDone(i)}catch(e){if(n.signal.aborted)return;t.onError(e instanceof Error?e.message:String(e),e instanceof Ix?`no-provider`:`unknown`)}})(),()=>n.abort()}var kD=n((e=>{var t=Object.defineProperty;(e=>t(e,`__esModule`,{value:!0}))(e),((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(e,{GIFEncoder:()=>ee,applyPalette:()=>S,default:()=>le,nearestColor:()=>k,nearestColorIndex:()=>D,nearestColorIndexWithDistance:()=>O,prequantize:()=>x,quantize:()=>_,snapColorsToPalette:()=>T});var n={signature:`GIF`,version:`89a`,trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function r(e=256){let t=0,n=new Uint8Array(e);return{get buffer(){return n.buffer},reset(){t=0},bytesView(){return n.subarray(0,t)},bytes(){return n.slice(0,t)},writeByte(e){r(t+1),n[t]=e,t++},writeBytes(e,i=0,a=e.length){r(t+a);for(let r=0;r<a;r++)n[t++]=e[r+i]},writeBytesView(e,i=0,a=e.byteLength){r(t+a),n.set(e.subarray(i,i+a),t),t+=a}};function r(e){var r=n.length;if(r>=e)return;e=Math.max(e,r*(r<1024*1024?2:1.125)>>>0),r!=0&&(e=Math.max(e,256));let i=n;n=new Uint8Array(e),t>0&&n.set(i.subarray(0,t),0)}}var i=12,a=5003,o=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function s(e,t,n,s,c=r(512),l=new Uint8Array(256),u=new Int32Array(a),d=new Int32Array(a)){let f=u.length,p=Math.max(2,s);l.fill(0),d.fill(0),u.fill(-1);let m=0,h=0,g=p+1,_=g,v=!1,y=_,b=(1<<y)-1,x=1<<g-1,S=x+1,C=x+2,w=0,T=n[0],E=0;for(let e=f;e<65536;e*=2)++E;E=8-E,c.writeByte(p),O(x);let D=n.length;for(let e=1;e<D;e++)next_block:{let t=n[e],r=(t<<i)+T,a=t<<E^T;if(u[a]===r){T=d[a];break next_block}let o=a===0?1:f-a;for(;u[a]>=0;)if(a-=o,a<0&&(a+=f),u[a]===r){T=d[a];break next_block}O(T),T=t,C<1<<i?(d[a]=C++,u[a]=r):(u.fill(-1),C=x+2,v=!0,O(x))}return O(T),O(S),c.writeByte(0),c.bytesView();function O(e){for(m&=o[h],h>0?m|=e<<h:m=e,h+=y;h>=8;)l[w++]=m&255,w>=254&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0),m>>=8,h-=8;if((C>b||v)&&(v?(y=_,b=(1<<y)-1,v=!1):(++y,b=y===i?1<<y:(1<<y)-1)),e==S){for(;h>0;)l[w++]=m&255,w>=254&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0),m>>=8,h-=8;w>0&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0)}}}var c=s;function l(e,t,n){return e<<8&63488|t<<2&992|n>>3}function u(e,t,n,r){return e>>4|t&240|(n&240)<<4|(r&240)<<8}function d(e,t,n){return e>>4<<8|t&240|n>>4}function f(e,t,n){return e<t?t:e>n?n:e}function p(e){return e*e}function m(e,t,n){var r=0,i=1e100;let a=e[t],o=a.cnt,s=a.ac,c=a.rc,l=a.gc,u=a.bc;for(var d=a.fw;d!=0;d=e[d].fw){let t=e[d],a=t.cnt,m=o*a/(o+a);if(!(m>=i)){var f=0;n&&(f+=m*p(t.ac-s),f>=i)||(f+=m*p(t.rc-c),!(f>=i)&&(f+=m*p(t.gc-l),!(f>=i)&&(f+=m*p(t.bc-u),!(f>=i)&&(i=f,r=d))))}}a.err=i,a.nn=r}function h(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function g(e,t){let n=Array(t===`rgb444`?4096:65536),r=e.length;if(t===`rgba4444`)for(let t=0;t<r;++t){let r=e[t],i=r>>24&255,a=r>>16&255,o=r>>8&255,s=r&255,c=u(s,o,a,i),l=c in n?n[c]:n[c]=h();l.rc+=s,l.gc+=o,l.bc+=a,l.ac+=i,l.cnt++}else if(t===`rgb444`)for(let t=0;t<r;++t){let r=e[t],i=r>>16&255,a=r>>8&255,o=r&255,s=d(o,a,i),c=s in n?n[s]:n[s]=h();c.rc+=o,c.gc+=a,c.bc+=i,c.cnt++}else for(let t=0;t<r;++t){let r=e[t],i=r>>16&255,a=r>>8&255,o=r&255,s=l(o,a,i),c=s in n?n[s]:n[s]=h();c.rc+=o,c.gc+=a,c.bc+=i,c.cnt++}return n}function _(e,t,n={}){let{format:r=`rgb565`,clearAlpha:i=!0,clearAlphaColor:a=0,clearAlphaThreshold:o=0,oneBitAlpha:s=!1}=n;if(!e||!e.buffer||!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw Error(`quantize() expected RGBA Uint8Array data`);let c=new Uint32Array(e.buffer),l=n.useSqrt!==!1,u=r===`rgba4444`,d=g(c,r),h=d.length,_=h-1,y=new Uint32Array(h+1);for(var b=0,x=0;x<h;++x){let e=d[x];if(e!=null){var S=1/e.cnt;u&&(e.ac*=S),e.rc*=S,e.gc*=S,e.bc*=S,d[b++]=e}}p(t)/b<.022&&(l=!1);for(var x=0;x<b-1;++x)d[x].fw=x+1,d[x+1].bk=x,l&&(d[x].cnt=Math.sqrt(d[x].cnt));l&&(d[x].cnt=Math.sqrt(d[x].cnt));var C,w,T;for(x=0;x<b;++x){m(d,x,!1);var E=d[x].err;for(w=++y[0];w>1&&(T=w>>1,!(d[C=y[T]].err<=E));w=T)y[w]=C;y[w]=x}var D=b-t;for(x=0;x<D;){for(var O;;){var k=y[1];if(O=d[k],O.tm>=O.mtm&&d[O.nn].mtm<=O.tm)break;O.mtm==_?k=y[1]=y[y[0]--]:(m(d,k,!1),O.tm=x);var E=d[k].err;for(w=1;(T=w+w)<=y[0]&&(T<y[0]&&d[y[T]].err>d[y[T+1]].err&&T++,!(E<=d[C=y[T]].err));w=T)y[w]=C;y[w]=k}var ee=d[O.nn],te=O.cnt,A=ee.cnt,S=1/(te+A);u&&(O.ac=S*(te*O.ac+A*ee.ac)),O.rc=S*(te*O.rc+A*ee.rc),O.gc=S*(te*O.gc+A*ee.gc),O.bc=S*(te*O.bc+A*ee.bc),O.cnt+=ee.cnt,O.mtm=++x,d[ee.bk].fw=ee.fw,d[ee.fw].bk=ee.bk,ee.mtm=_}let ne=[];var re=0;for(x=0;;++re){let e=f(Math.round(d[x].rc),0,255),t=f(Math.round(d[x].gc),0,255),n=f(Math.round(d[x].bc),0,255),r=255;u&&(r=f(Math.round(d[x].ac),0,255),s&&(r=r<=(typeof s==`number`?s:127)?0:255),i&&r<=o&&(e=t=n=a,r=0));let c=u?[e,t,n,r]:[e,t,n];if(v(ne,c)||ne.push(c),(x=d[x].fw)==0)break}return ne}function v(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2],a=r.length>=4&&t.length>=4?r[3]===t[3]:!0;if(i&&a)return!0}return!1}function y(e,t){var n=0,r;for(r=0;r<e.length;r++){let i=e[r]-t[r];n+=i*i}return n}function b(e,t){return t>1?Math.round(e/t)*t:e}function x(e,{roundRGB:t=5,roundAlpha:n=10,oneBitAlpha:r=null}={}){let i=new Uint32Array(e.buffer);for(let e=0;e<i.length;e++){let a=i[e],o=a>>24&255,s=a>>16&255,c=a>>8&255,l=a&255;o=b(o,n),r&&(o=o<=(typeof r==`number`?r:127)?0:255),l=b(l,t),c=b(c,t),s=b(s,t),i[e]=o<<24|s<<16|c<<8|l<<0}}function S(e,t,n=`rgb565`){if(!e||!e.buffer||!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw Error(`quantize() expected RGBA Uint8Array data`);if(t.length>256)throw Error(`applyPalette() only works with 256 colors or less`);let r=new Uint32Array(e.buffer),i=r.length,a=n===`rgb444`?4096:65536,o=new Uint8Array(i),s=Array(a);if(n===`rgba4444`)for(let e=0;e<i;e++){let n=r[e],i=n>>24&255,a=n>>16&255,c=n>>8&255,l=n&255,d=u(l,c,a,i);o[e]=d in s?s[d]:s[d]=C(l,c,a,i,t)}else{let e=n===`rgb444`?d:l;for(let n=0;n<i;n++){let i=r[n],a=i>>16&255,c=i>>8&255,l=i&255,u=e(l,c,a);o[n]=u in s?s[u]:s[u]=w(l,c,a,t)}}return o}function C(e,t,n,r,i){let a=0,o=1e100;for(let s=0;s<i.length;s++){let c=i[s],l=c[3],u=E(l-r);if(u>o)continue;let d=c[0];if(u+=E(d-e),u>o)continue;let f=c[1];if(u+=E(f-t),u>o)continue;let p=c[2];u+=E(p-n),!(u>o)&&(o=u,a=s)}return a}function w(e,t,n,r){let i=0,a=1e100;for(let o=0;o<r.length;o++){let s=r[o],c=s[0],l=E(c-e);if(l>a)continue;let u=s[1];if(l+=E(u-t),l>a)continue;let d=s[2];l+=E(d-n),!(l>a)&&(a=l,i=o)}return i}function T(e,t,n=5){if(!e.length||!t.length)return;let r=e.map(e=>e.slice(0,3)),i=n*n,a=e[0].length;for(let n=0;n<t.length;n++){let o=t[n];o=o.length<a?[o[0],o[1],o[2],255]:o.length>a?o.slice(0,3):o.slice();let s=O(r,o.slice(0,3),y),c=s[0],l=s[1];l>0&&l<=i&&(e[c]=o)}}function E(e){return e*e}function D(e,t,n=y){let r=1/0,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=n(t,o);s<r&&(r=s,i=a)}return i}function O(e,t,n=y){let r=1/0,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=n(t,o);s<r&&(r=s,i=a)}return[i,r]}function k(e,t,n=y){return e[D(e,t,n)]}function ee(e={}){let{initialCapacity:t=4096,auto:i=!0}=e,a=r(t),o=5003,s=new Uint8Array(256),c=new Int32Array(o),l=new Int32Array(o),u=!1;return{reset(){a.reset(),u=!1},finish(){a.writeByte(n.trailer)},bytes(){return a.bytes()},bytesView(){return a.bytesView()},get buffer(){return a.buffer},get stream(){return a},writeHeader:d,writeFrame(e,t,n,r={}){let{transparent:o=!1,transparentIndex:f=0,delay:p=0,palette:m=null,repeat:h=0,colorDepth:g=8,dispose:_=-1}=r,v=!1;if(i?u||=(v=!0,d(),!0):v=!!r.first,t=Math.max(0,Math.floor(t)),n=Math.max(0,Math.floor(n)),v){if(!m)throw Error(`First frame must include a { palette } option`);A(a,t,n,m,g),re(a,m),h>=0&&ne(a,h)}let y=Math.round(p/10);te(a,_,y,o,f);let b=!!m&&!v;ie(a,t,n,b?m:null),b&&re(a,m),ae(a,e,t,n,g,s,c,l)}};function d(){se(a,`GIF89a`)}}function te(e,t,n,r,i){e.writeByte(33),e.writeByte(249),e.writeByte(4),i<0&&(i=0,r=!1);var a,o;r?(a=1,o=2):(a=0,o=0),t>=0&&(o=t&7),o<<=2,e.writeByte(o|0|a),oe(e,n),e.writeByte(i||0),e.writeByte(0)}function A(e,t,n,r,i=8){let a=ce(r.length)-1,o=i-1<<4|128|a;oe(e,t),oe(e,n),e.writeBytes([o,0,0])}function ne(e,t){e.writeByte(33),e.writeByte(255),e.writeByte(11),se(e,`NETSCAPE2.0`),e.writeByte(3),e.writeByte(1),oe(e,t),e.writeByte(0)}function re(e,t){let n=1<<ce(t.length);for(let r=0;r<n;r++){let n=[0,0,0];r<t.length&&(n=t[r]),e.writeByte(n[0]),e.writeByte(n[1]),e.writeByte(n[2])}}function ie(e,t,n,r){if(e.writeByte(44),oe(e,0),oe(e,0),oe(e,t),oe(e,n),r){let t=ce(r.length)-1;e.writeByte(128|t)}else e.writeByte(0)}function ae(e,t,n,r,i=8,a,o,s){c(n,r,t,i,e,a,o,s)}function oe(e,t){e.writeByte(t&255),e.writeByte(t>>8&255)}function se(e,t){for(var n=0;n<t.length;n++)e.writeByte(t.charCodeAt(n))}function ce(e){return Math.max(Math.ceil(Math.log2(e)),1)}var le=ee}))(),AD="(function(){var e=((e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports))((e=>{var t=Object.defineProperty;(e=>t(e,`__esModule`,{value:!0}))(e),((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(e,{GIFEncoder:()=>A,applyPalette:()=>S,default:()=>B,nearestColor:()=>k,nearestColorIndex:()=>D,nearestColorIndexWithDistance:()=>O,prequantize:()=>x,quantize:()=>_,snapColorsToPalette:()=>T});var n={signature:`GIF`,version:`89a`,trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function r(e=256){let t=0,n=new Uint8Array(e);return{get buffer(){return n.buffer},reset(){t=0},bytesView(){return n.subarray(0,t)},bytes(){return n.slice(0,t)},writeByte(e){r(t+1),n[t]=e,t++},writeBytes(e,i=0,a=e.length){r(t+a);for(let r=0;r<a;r++)n[t++]=e[r+i]},writeBytesView(e,i=0,a=e.byteLength){r(t+a),n.set(e.subarray(i,i+a),t),t+=a}};function r(e){var r=n.length;if(r>=e)return;e=Math.max(e,r*(r<1024*1024?2:1.125)>>>0),r!=0&&(e=Math.max(e,256));let i=n;n=new Uint8Array(e),t>0&&n.set(i.subarray(0,t),0)}}var i=12,a=5003,o=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function s(e,t,n,s,c=r(512),l=new Uint8Array(256),u=new Int32Array(a),d=new Int32Array(a)){let f=u.length,p=Math.max(2,s);l.fill(0),d.fill(0),u.fill(-1);let m=0,h=0,g=p+1,_=g,v=!1,y=_,b=(1<<y)-1,x=1<<g-1,S=x+1,C=x+2,w=0,T=n[0],E=0;for(let e=f;e<65536;e*=2)++E;E=8-E,c.writeByte(p),O(x);let D=n.length;for(let e=1;e<D;e++)next_block:{let t=n[e],r=(t<<i)+T,a=t<<E^T;if(u[a]===r){T=d[a];break next_block}let o=a===0?1:f-a;for(;u[a]>=0;)if(a-=o,a<0&&(a+=f),u[a]===r){T=d[a];break next_block}O(T),T=t,C<1<<i?(d[a]=C++,u[a]=r):(u.fill(-1),C=x+2,v=!0,O(x))}return O(T),O(S),c.writeByte(0),c.bytesView();function O(e){for(m&=o[h],h>0?m|=e<<h:m=e,h+=y;h>=8;)l[w++]=m&255,w>=254&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0),m>>=8,h-=8;if((C>b||v)&&(v?(y=_,b=(1<<y)-1,v=!1):(++y,b=y===i?1<<y:(1<<y)-1)),e==S){for(;h>0;)l[w++]=m&255,w>=254&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0),m>>=8,h-=8;w>0&&(c.writeByte(w),c.writeBytesView(l,0,w),w=0)}}}var c=s;function l(e,t,n){return e<<8&63488|t<<2&992|n>>3}function u(e,t,n,r){return e>>4|t&240|(n&240)<<4|(r&240)<<8}function d(e,t,n){return e>>4<<8|t&240|n>>4}function f(e,t,n){return e<t?t:e>n?n:e}function p(e){return e*e}function m(e,t,n){var r=0,i=1e100;let a=e[t],o=a.cnt,s=a.ac,c=a.rc,l=a.gc,u=a.bc;for(var d=a.fw;d!=0;d=e[d].fw){let t=e[d],a=t.cnt,m=o*a/(o+a);if(!(m>=i)){var f=0;n&&(f+=m*p(t.ac-s),f>=i)||(f+=m*p(t.rc-c),!(f>=i)&&(f+=m*p(t.gc-l),!(f>=i)&&(f+=m*p(t.bc-u),!(f>=i)&&(i=f,r=d))))}}a.err=i,a.nn=r}function h(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function g(e,t){let n=Array(t===`rgb444`?4096:65536),r=e.length;if(t===`rgba4444`)for(let t=0;t<r;++t){let r=e[t],i=r>>24&255,a=r>>16&255,o=r>>8&255,s=r&255,c=u(s,o,a,i),l=c in n?n[c]:n[c]=h();l.rc+=s,l.gc+=o,l.bc+=a,l.ac+=i,l.cnt++}else if(t===`rgb444`)for(let t=0;t<r;++t){let r=e[t],i=r>>16&255,a=r>>8&255,o=r&255,s=d(o,a,i),c=s in n?n[s]:n[s]=h();c.rc+=o,c.gc+=a,c.bc+=i,c.cnt++}else for(let t=0;t<r;++t){let r=e[t],i=r>>16&255,a=r>>8&255,o=r&255,s=l(o,a,i),c=s in n?n[s]:n[s]=h();c.rc+=o,c.gc+=a,c.bc+=i,c.cnt++}return n}function _(e,t,n={}){let{format:r=`rgb565`,clearAlpha:i=!0,clearAlphaColor:a=0,clearAlphaThreshold:o=0,oneBitAlpha:s=!1}=n;if(!e||!e.buffer||!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw Error(`quantize() expected RGBA Uint8Array data`);let c=new Uint32Array(e.buffer),l=n.useSqrt!==!1,u=r===`rgba4444`,d=g(c,r),h=d.length,_=h-1,y=new Uint32Array(h+1);for(var b=0,x=0;x<h;++x){let e=d[x];if(e!=null){var S=1/e.cnt;u&&(e.ac*=S),e.rc*=S,e.gc*=S,e.bc*=S,d[b++]=e}}p(t)/b<.022&&(l=!1);for(var x=0;x<b-1;++x)d[x].fw=x+1,d[x+1].bk=x,l&&(d[x].cnt=Math.sqrt(d[x].cnt));l&&(d[x].cnt=Math.sqrt(d[x].cnt));var C,w,T;for(x=0;x<b;++x){m(d,x,!1);var E=d[x].err;for(w=++y[0];w>1&&(T=w>>1,!(d[C=y[T]].err<=E));w=T)y[w]=C;y[w]=x}var D=b-t;for(x=0;x<D;){for(var O;;){var k=y[1];if(O=d[k],O.tm>=O.mtm&&d[O.nn].mtm<=O.tm)break;O.mtm==_?k=y[1]=y[y[0]--]:(m(d,k,!1),O.tm=x);var E=d[k].err;for(w=1;(T=w+w)<=y[0]&&(T<y[0]&&d[y[T]].err>d[y[T+1]].err&&T++,!(E<=d[C=y[T]].err));w=T)y[w]=C;y[w]=k}var A=d[O.nn],j=O.cnt,M=A.cnt,S=1/(j+M);u&&(O.ac=S*(j*O.ac+M*A.ac)),O.rc=S*(j*O.rc+M*A.rc),O.gc=S*(j*O.gc+M*A.gc),O.bc=S*(j*O.bc+M*A.bc),O.cnt+=A.cnt,O.mtm=++x,d[A.bk].fw=A.fw,d[A.fw].bk=A.bk,A.mtm=_}let N=[];var P=0;for(x=0;;++P){let e=f(Math.round(d[x].rc),0,255),t=f(Math.round(d[x].gc),0,255),n=f(Math.round(d[x].bc),0,255),r=255;u&&(r=f(Math.round(d[x].ac),0,255),s&&(r=r<=(typeof s==`number`?s:127)?0:255),i&&r<=o&&(e=t=n=a,r=0));let c=u?[e,t,n,r]:[e,t,n];if(v(N,c)||N.push(c),(x=d[x].fw)==0)break}return N}function v(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2],a=r.length>=4&&t.length>=4?r[3]===t[3]:!0;if(i&&a)return!0}return!1}function y(e,t){var n=0,r;for(r=0;r<e.length;r++){let i=e[r]-t[r];n+=i*i}return n}function b(e,t){return t>1?Math.round(e/t)*t:e}function x(e,{roundRGB:t=5,roundAlpha:n=10,oneBitAlpha:r=null}={}){let i=new Uint32Array(e.buffer);for(let e=0;e<i.length;e++){let a=i[e],o=a>>24&255,s=a>>16&255,c=a>>8&255,l=a&255;o=b(o,n),r&&(o=o<=(typeof r==`number`?r:127)?0:255),l=b(l,t),c=b(c,t),s=b(s,t),i[e]=o<<24|s<<16|c<<8|l<<0}}function S(e,t,n=`rgb565`){if(!e||!e.buffer||!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw Error(`quantize() expected RGBA Uint8Array data`);if(t.length>256)throw Error(`applyPalette() only works with 256 colors or less`);let r=new Uint32Array(e.buffer),i=r.length,a=n===`rgb444`?4096:65536,o=new Uint8Array(i),s=Array(a);if(n===`rgba4444`)for(let e=0;e<i;e++){let n=r[e],i=n>>24&255,a=n>>16&255,c=n>>8&255,l=n&255,d=u(l,c,a,i);o[e]=d in s?s[d]:s[d]=C(l,c,a,i,t)}else{let e=n===`rgb444`?d:l;for(let n=0;n<i;n++){let i=r[n],a=i>>16&255,c=i>>8&255,l=i&255,u=e(l,c,a);o[n]=u in s?s[u]:s[u]=w(l,c,a,t)}}return o}function C(e,t,n,r,i){let a=0,o=1e100;for(let s=0;s<i.length;s++){let c=i[s],l=c[3],u=E(l-r);if(u>o)continue;let d=c[0];if(u+=E(d-e),u>o)continue;let f=c[1];if(u+=E(f-t),u>o)continue;let p=c[2];u+=E(p-n),!(u>o)&&(o=u,a=s)}return a}function w(e,t,n,r){let i=0,a=1e100;for(let o=0;o<r.length;o++){let s=r[o],c=s[0],l=E(c-e);if(l>a)continue;let u=s[1];if(l+=E(u-t),l>a)continue;let d=s[2];l+=E(d-n),!(l>a)&&(a=l,i=o)}return i}function T(e,t,n=5){if(!e.length||!t.length)return;let r=e.map(e=>e.slice(0,3)),i=n*n,a=e[0].length;for(let n=0;n<t.length;n++){let o=t[n];o=o.length<a?[o[0],o[1],o[2],255]:o.length>a?o.slice(0,3):o.slice();let s=O(r,o.slice(0,3),y),c=s[0],l=s[1];l>0&&l<=i&&(e[c]=o)}}function E(e){return e*e}function D(e,t,n=y){let r=1/0,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=n(t,o);s<r&&(r=s,i=a)}return i}function O(e,t,n=y){let r=1/0,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=n(t,o);s<r&&(r=s,i=a)}return[i,r]}function k(e,t,n=y){return e[D(e,t,n)]}function A(e={}){let{initialCapacity:t=4096,auto:i=!0}=e,a=r(t),o=5003,s=new Uint8Array(256),c=new Int32Array(o),l=new Int32Array(o),u=!1;return{reset(){a.reset(),u=!1},finish(){a.writeByte(n.trailer)},bytes(){return a.bytes()},bytesView(){return a.bytesView()},get buffer(){return a.buffer},get stream(){return a},writeHeader:d,writeFrame(e,t,n,r={}){let{transparent:o=!1,transparentIndex:f=0,delay:p=0,palette:m=null,repeat:h=0,colorDepth:g=8,dispose:_=-1}=r,v=!1;if(i?u||=(v=!0,d(),!0):v=!!r.first,t=Math.max(0,Math.floor(t)),n=Math.max(0,Math.floor(n)),v){if(!m)throw Error(`First frame must include a { palette } option`);M(a,t,n,m,g),P(a,m),h>=0&&N(a,h)}let y=Math.round(p/10);j(a,_,y,o,f);let b=!!m&&!v;F(a,t,n,b?m:null),b&&P(a,m),I(a,e,t,n,g,s,c,l)}};function d(){R(a,`GIF89a`)}}function j(e,t,n,r,i){e.writeByte(33),e.writeByte(249),e.writeByte(4),i<0&&(i=0,r=!1);var a,o;r?(a=1,o=2):(a=0,o=0),t>=0&&(o=t&7),o<<=2,e.writeByte(o|0|a),L(e,n),e.writeByte(i||0),e.writeByte(0)}function M(e,t,n,r,i=8){let a=z(r.length)-1,o=i-1<<4|128|a;L(e,t),L(e,n),e.writeBytes([o,0,0])}function N(e,t){e.writeByte(33),e.writeByte(255),e.writeByte(11),R(e,`NETSCAPE2.0`),e.writeByte(3),e.writeByte(1),L(e,t),e.writeByte(0)}function P(e,t){let n=1<<z(t.length);for(let r=0;r<n;r++){let n=[0,0,0];r<t.length&&(n=t[r]),e.writeByte(n[0]),e.writeByte(n[1]),e.writeByte(n[2])}}function F(e,t,n,r){if(e.writeByte(44),L(e,0),L(e,0),L(e,t),L(e,n),r){let t=z(r.length)-1;e.writeByte(128|t)}else e.writeByte(0)}function I(e,t,n,r,i=8,a,o,s){c(n,r,t,i,e,a,o,s)}function L(e,t){e.writeByte(t&255),e.writeByte(t>>8&255)}function R(e,t){for(var n=0;n<t.length;n++)e.writeByte(t.charCodeAt(n))}function z(e){return Math.max(Math.ceil(Math.log2(e)),1)}var B=A}))();let t=null,n=!0;self.onmessage=e=>{r(e.data).catch(t=>{e.data?.id!=null&&self.postMessage({id:e.data.id,type:`error`,message:t instanceof Error?t.message:String(t)})})};async function r(r){let a=(e,t=[])=>self.postMessage({id:r.id,...e},t);switch(r.type){case`encode-png`:{let e=r.bitmap,t=new OffscreenCanvas(e.width,e.height),n=t.getContext(`2d`);if(!n)throw Error(`OffscreenCanvas 2d unavailable`);n.drawImage(e,0,0),e.close();let o=await t.convertToBlob({type:`image/png`});o.size>18e5&&(o=await t.convertToBlob({type:`image/jpeg`,quality:.85})),a({type:`png`,dataUrl:await i(o)});return}case`gif-init`:t=(0,e.GIFEncoder)(),n=!0,a({type:`ok`});return;case`gif-frame`:{if(!t)return;let i=new Uint8ClampedArray(r.buffer),a=(0,e.quantize)(i,256,{format:`rgb565`}),o=(0,e.applyPalette)(i,a,`rgb565`);t.writeFrame(o,r.width,r.height,{palette:a,delay:r.delay,first:n,repeat:0}),n=!1;return}case`gif-finish`:{if(!t)throw Error(`No active GIF session`);t.finish();let e=t.bytes();t=null,a({type:`gif`,buffer:e.buffer},[e.buffer]);return}case`gif-abort`:t=null;return}}function i(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}})();",jD=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,AD],{type:`text/javascript;charset=utf-8`});function MD(e){let t;try{if(t=jD&&(self.URL||self.webkitURL).createObjectURL(jD),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(AD),{name:e?.name})}}var ND,PD=1,FD=new Map;function ID(){if(ND!==void 0)return ND;try{ND=new MD,ND.onmessage=e=>{let t=e.data?.id;if(t==null)return;let n=FD.get(t);n&&(FD.delete(t),e.data.type===`error`?n.reject(Error(e.data.message??`Worker error`)):n.resolve(e.data))},ND.onerror=()=>{for(let e of FD.values())e.reject(Error(`Image worker crashed`));FD.clear()}}catch{ND=null}return ND}function LD(e,t=[]){let n=ID();if(!n)return Promise.reject(Error(`Image worker unavailable`));let r=PD++;return new Promise((i,a)=>{FD.set(r,{resolve:i,reject:a}),n.postMessage({...e,id:r},t)})}function RD(e,t=[]){let n=ID();return n?(n.postMessage(e,t),!0):!1}var zD=6,BD=Math.round(1e3/zD),VD=3e4,HD=640,UD={phase:`idle`,startedAt:null,result:null,error:null,attachOnCreate:!0},WD=new Set;function GD(e){UD={...UD,...e};for(let e of WD)e(UD)}function KD(){return UD}function qD(e){return WD.add(e),()=>WD.delete(e)}var JD=null,YD=null,XD=null,ZD=null,QD=null,$D=null,eO=!1,tO=0,nO=!0;async function rO(){if(UD.phase===`recording`||UD.phase===`processing`)return;aO();try{JD=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:zD},audio:!1,preferCurrentTab:!0,selfBrowserSurface:`include`,surfaceSwitching:`exclude`,monitorTypeSurfaces:`exclude`,systemAudio:`exclude`})}catch{GD({phase:`error`,error:`Screen capture was denied or cancelled.`});return}let e=JD.getVideoTracks()[0];if(!e){GD({phase:`error`,error:`No video track available.`}),cO();return}e.addEventListener(`ended`,()=>void iO()),YD=document.createElement(`video`),YD.muted=!0,YD.playsInline=!0,YD.srcObject=JD,await YD.play().catch(()=>{});let t=Date.now()+3e3;for(;!YD.videoWidth&&Date.now()<t;)await new Promise(e=>setTimeout(e,50));if(!YD.videoWidth){GD({phase:`error`,error:`Could not read the capture stream.`}),cO();return}let n=Math.min(1,HD/YD.videoWidth),r=Math.round(YD.videoWidth*n),i=Math.round(YD.videoHeight*n);if(XD=document.createElement(`canvas`),XD.width=r,XD.height=i,ZD=XD.getContext(`2d`,{willReadFrequently:!0}),!ZD){GD({phase:`error`,error:`Canvas is unavailable.`}),cO();return}eO=await LD({type:`gif-init`}).then(()=>!0,()=>!1),$D=eO?null:(0,kD.GIFEncoder)(),tO=0,nO=!0,GD({phase:`recording`,startedAt:Date.now(),error:null,result:null}),QD=setInterval(()=>{if(!ZD||!YD||!XD)return;let e=UD.startedAt??Date.now();if(Date.now()-e>=VD){iO();return}try{ZD.drawImage(YD,0,0,XD.width,XD.height);let{data:e}=ZD.getImageData(0,0,XD.width,XD.height);if(eO)RD({type:`gif-frame`,buffer:e.buffer,width:XD.width,height:XD.height,delay:BD},[e.buffer]);else if($D){let t=(0,kD.quantize)(e,256,{format:`rgb565`}),n=(0,kD.applyPalette)(e,t,`rgb565`);$D.writeFrame(n,XD.width,XD.height,{palette:t,delay:BD,first:nO,repeat:0}),nO=!1}tO++}catch{}},BD)}async function iO(){if(UD.phase!==`recording`)return;let e=UD.startedAt??Date.now();GD({phase:`processing`}),QD&&=(clearInterval(QD),null);let t=XD?.width??0,n=XD?.height??0,r=tO,i=$D,a=eO;if($D=null,eO=!1,cO(),!i&&!a||r===0){GD({phase:`error`,error:`Nothing was captured.`});return}try{let o;if(a){let e=await LD({type:`gif-finish`});o=new Uint8Array(e.buffer)}else i.finish(),o=i.bytes();let s=new Blob([o.buffer],{type:`image/gif`});GD({phase:`ready`,result:{blob:s,url:URL.createObjectURL(s),width:t,height:n,frameCount:r,durationMs:Date.now()-e}})}catch(e){GD({phase:`error`,error:e instanceof Error?e.message:`GIF encoding failed.`})}}function aO(){UD.result?.url&&URL.revokeObjectURL(UD.result.url),cO(),QD&&=(clearInterval(QD),null),eO&&RD({type:`gif-abort`}),eO=!1,$D=null,tO=0,GD({phase:`idle`,startedAt:null,result:null,error:null,attachOnCreate:!0})}function oO(e){GD({attachOnCreate:e})}function sO(e){UD.result&&GD({result:{...UD.result,assetUrl:e}})}function cO(){JD?.getTracks().forEach(e=>e.stop()),JD=null,YD&&=(YD.srcObject=null,null),XD=null,ZD=null}Br();var lO=`https://api.linear.app/graphql`,uO=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`LinearError`}},dO=class extends uO{constructor(){super(`Not connected to Linear. Add an API key or connect OAuth in Settings.`),this.name=`LinearNotConnectedError`}};async function fO(e,t){let{linearApiKey:n,linearAccessToken:r}=await Tr(),i=r?`Bearer ${r}`:n;if(!i)throw new dO;let a=await fetch(lO,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:i},body:JSON.stringify({query:e,variables:t})}),o=await a.json().catch(()=>null);if(!a.ok)throw new uO(o?.errors?.[0]?.message??`Linear request failed (${a.status})`,a.status);if(o?.errors?.length)throw new uO(o.errors[0].message);if(!o?.data)throw new uO(`Empty response from Linear`);return o.data}async function pO(){return(await fO(`query { viewer { id name email } }`)).viewer}async function mO(){return(await fO(`query { teams(first: 50) { nodes { id key name } } }`)).teams.nodes}async function hO(){return(await fO(`query {
121
130
  users(filter: { app: { eq: true } }) {
122
131
  nodes { id name displayName url active }
123
132
  }
124
- }`)).users.nodes.filter(e=>e.active!==!1)}async function mO(){return(await uO(`query {
133
+ }`)).users.nodes.filter(e=>e.active!==!1)}async function gO(){return(await fO(`query {
125
134
  issues(
126
135
  first: 50
127
136
  orderBy: updatedAt
@@ -135,7 +144,7 @@ of the other sections.`,_D="- FIRST, self-orient in the repo checkout (skip any
135
144
  attachments(first: 10) { nodes { id title url sourceType } }
136
145
  }
137
146
  }
138
- }`)).issues.nodes.map(e=>({...e,attachments:e.attachments.nodes}))}async function hO(e){let{comments:t,attachments:n,...r}=(await uO(`query($id: String!) {
147
+ }`)).issues.nodes.map(e=>({...e,attachments:e.attachments.nodes}))}async function _O(e){let{comments:t,attachments:n,...r}=(await fO(`query($id: String!) {
139
148
  issue(id: $id) {
140
149
  id identifier title url updatedAt priority description branchName
141
150
  team { id }
@@ -149,7 +158,7 @@ of the other sections.`,_D="- FIRST, self-orient in the repo checkout (skip any
149
158
  nodes { id title url sourceType }
150
159
  }
151
160
  }
152
- }`,{id:e})).issue;return{...r,comments:t.nodes,attachments:n.nodes}}function gO(e){let t=[...e].sort((e,t)=>Date.parse(e.createdAt)-Date.parse(t.createdAt));return t.filter((e,n)=>!e.ephemeral||n===t.length-1)}async function _O(e){try{return(await uO(`query($id: String!) {
161
+ }`,{id:e})).issue;return{...r,comments:t.nodes,attachments:n.nodes}}function vO(e){let t=[...e].sort((e,t)=>Date.parse(e.createdAt)-Date.parse(t.createdAt));return t.filter((e,n)=>!e.ephemeral||n===t.length-1)}async function yO(e){try{return(await fO(`query($id: String!) {
153
162
  issue(id: $id) {
154
163
  agentSessions(first: 10) {
155
164
  nodes {
@@ -171,7 +180,7 @@ of the other sections.`,_D="- FIRST, self-orient in the repo checkout (skip any
171
180
  }
172
181
  }
173
182
  }
174
- }`,{id:e})).issue.agentSessions.nodes.map(e=>({...e,activities:gO(e.activities.nodes)}))}catch{return[]}}async function vO(){try{return(await uO(`query {
183
+ }`,{id:e})).issue.agentSessions.nodes.map(e=>({...e,activities:vO(e.activities.nodes)}))}catch{return[]}}async function bO(){try{return(await fO(`query {
175
184
  agentSessions(first: 50) {
176
185
  nodes {
177
186
  id status summary updatedAt createdAt
@@ -191,7 +200,7 @@ of the other sections.`,_D="- FIRST, self-orient in the repo checkout (skip any
191
200
  }
192
201
  }
193
202
  }
194
- }`)).agentSessions.nodes.map(e=>({...e,activities:gO(e.activities.nodes)})).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))}catch{try{return(await uO(`query {
203
+ }`)).agentSessions.nodes.map(e=>({...e,activities:vO(e.activities.nodes)})).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))}catch{try{return(await fO(`query {
195
204
  agentSessions(first: 50) {
196
205
  nodes {
197
206
  id status summary updatedAt createdAt
@@ -200,89 +209,90 @@ of the other sections.`,_D="- FIRST, self-orient in the repo checkout (skip any
200
209
  issue { id identifier title url state { name color type } }
201
210
  }
202
211
  }
203
- }`)).agentSessions.nodes.map(e=>({...e,activities:[]})).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))}catch{return[]}}}async function yO(e){try{return(await uO(`query($term: String!) {
212
+ }`)).agentSessions.nodes.map(e=>({...e,activities:[]})).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))}catch{return[]}}}async function xO(e){try{return(await fO(`query($term: String!) {
204
213
  searchIssues(term: $term, first: 5) {
205
214
  nodes { id identifier title url state { name color type } }
206
215
  }
207
- }`,{term:e})).searchIssues.nodes}catch{return[]}}async function bO(e){return(await uO(`query($teamId: String!) {
216
+ }`,{term:e})).searchIssues.nodes}catch{return[]}}async function SO(e){return(await fO(`query($teamId: String!) {
208
217
  team(id: $teamId) { states { nodes { id name type position } } }
209
- }`,{teamId:e})).team.states.nodes}async function xO(e,t){if(!(await uO(`mutation($id: String!, $stateId: String!) {
218
+ }`,{teamId:e})).team.states.nodes}async function CO(e,t){if(!(await fO(`mutation($id: String!, $stateId: String!) {
210
219
  issueUpdate(id: $id, input: { stateId: $stateId }) { success }
211
- }`,{id:e,stateId:t})).issueUpdate.success)throw Error(`Linear rejected the state update`)}async function SO(){try{return(await uO(`query { projects(first: 100) { nodes { id name } } }`)).projects.nodes}catch{return[]}}async function CO(){try{return(await uO(`query { issueLabels(first: 100) { nodes { id name color } } }`)).issueLabels.nodes}catch{return[]}}async function wO(e){let t=await uO(`mutation($input: IssueCreateInput!) {
220
+ }`,{id:e,stateId:t})).issueUpdate.success)throw Error(`Linear rejected the state update`)}async function wO(){try{return(await fO(`query { projects(first: 100) { nodes { id name } } }`)).projects.nodes}catch{return[]}}async function TO(){try{return(await fO(`query { issueLabels(first: 100) { nodes { id name color } } }`)).issueLabels.nodes}catch{return[]}}async function EO(e){let t=await fO(`mutation($input: IssueCreateInput!) {
212
221
  issueCreate(input: $input) {
213
222
  success
214
223
  issue { id identifier url }
215
224
  }
216
- }`,{input:e});if(!t.issueCreate.success||!t.issueCreate.issue)throw Error(`Linear rejected the issue create`);return t.issueCreate.issue}async function TO(e,t,n){if(!(await uO(`mutation($input: CommentCreateInput!) {
225
+ }`,{input:e});if(!t.issueCreate.success||!t.issueCreate.issue)throw Error(`Linear rejected the issue create`);return t.issueCreate.issue}async function DO(e,t,n){if(!(await fO(`mutation($input: CommentCreateInput!) {
217
226
  commentCreate(input: $input) { success }
218
- }`,{input:{issueId:e,body:t,...n?{parentId:n}:{}}})).commentCreate.success)throw Error(`Linear rejected the comment`)}async function EO(e,t,n){let r=`@${n.displayName||n.name||`Cursor`}`;await TO(e,`${n.url?`[${r}](${n.url})`:r} ${t}`)}function DO(e){let t=e.filter(e=>!e.parent),n=new Set;for(let t of e)t.user?.app&&n.add(t.parent?.id??t.id);return t.filter(e=>n.has(e.id)).sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt))}Br();async function OO(e,t){let n=await uO(`mutation($contentType: String!, $filename: String!, $size: Int!) {
227
+ }`,{input:{issueId:e,body:t,...n?{parentId:n}:{}}})).commentCreate.success)throw Error(`Linear rejected the comment`)}async function OO(e,t,n){let r=`@${n.displayName||n.name||`Cursor`}`;await DO(e,`${n.url?`[${r}](${n.url})`:r} ${t}`)}function kO(e){let t=e.filter(e=>!e.parent),n=new Set;for(let t of e)t.user?.app&&n.add(t.parent?.id??t.id);return t.filter(e=>n.has(e.id)).sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt))}Br();async function AO(e,t){let n=await fO(`mutation($contentType: String!, $filename: String!, $size: Int!) {
219
228
  fileUpload(contentType: $contentType, filename: $filename, size: $size) {
220
229
  success
221
230
  uploadFile { uploadUrl assetUrl headers { key value } }
222
231
  }
223
- }`,{contentType:e.type,filename:t,size:e.size}),r=n.fileUpload.uploadFile;if(!n.fileUpload.success||!r)throw Error(`Linear did not provide an upload URL.`);let{linearApiKey:i,linearAccessToken:a}=await Tr(),o=a?`Bearer ${a}`:i??``,s=Object.fromEntries((r.headers??[]).map(e=>[e.key,e.value])),c=[{"Content-Type":e.type,...s,...o?{Authorization:o}:{}},{"Content-Type":e.type,...s},{"Content-Type":e.type}],l=null;for(let t of c)try{let n=await fetch(r.uploadUrl,{method:`PUT`,mode:`cors`,headers:t,body:e});if(n.ok)return r.assetUrl;l=Error(`Upload rejected (${n.status}).`)}catch(e){l=e}try{let{bridgeUrl:t}=await Tr(),n=(t?.trim()||`http://localhost:4577`).replace(/\/$/,``);if((await fetch(`${n}/put`,{method:`POST`,headers:{"Content-Type":e.type,"x-upload-url":r.uploadUrl,"x-upload-headers":JSON.stringify({...s,...o?{Authorization:o}:{}})},body:e})).ok)return r.assetUrl}catch{}throw Error(`Upload to Linear storage failed${l instanceof Error?` — ${l.message}`:``}. Run \`npx linear-grab-bridge\` in the repo (uploads relay through it), set the GitHub fallback in Settings, or use "Copy GIF" + paste.`)}Br();async function kO(e,t){try{return await OO(e,t)}catch(n){let r=await Tr();if(r.githubToken&&r.githubAssetsRepo)return AO(e,t,r.githubToken,r.githubAssetsRepo);throw n instanceof Error?Error(`${n.message} Tip: configure the GitHub assets fallback in Settings for automatic uploads in this browser.`):n}}async function AO(e,t,n,r){let i=`linear-grab/${Date.now()}-${t.replace(/[^\w.-]/g,`_`)}`,a=await fetch(`https://api.github.com/repos/${r}/contents/${i}`,{method:`PUT`,headers:{Authorization:`Bearer ${n}`,Accept:`application/vnd.github+json`,"Content-Type":`application/json`},body:JSON.stringify({message:`chore(linear-grab): asset ${t}`,content:await jO(e)})}),o=await a.json().catch(()=>null);if(!a.ok||!o?.content?.download_url)throw Error(`GitHub asset upload failed — ${o?.message??`HTTP ${a.status}`}`);return o.content.download_url}function jO(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result.split(`,`)[1]??``),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}Br();async function MO(){return((await Tr()).bridgeUrl?.trim()||`http://localhost:4577`).replace(/\/$/,``)}async function NO(e,t){let n=await MO(),r=await fetch(`${n}${e}`,{...t,headers:{"Content-Type":`application/json`,...t?.headers??{}}});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Bridge request failed (${r.status})`)}return await r.json()}function PO(){return NO(`/health`)}async function FO(){return(await NO(`/tasks`)).tasks}function IO(e){return NO(`/tasks/${e}`)}function LO(e,t,n){return NO(`/tasks`,{method:`POST`,body:JSON.stringify({title:e,prompt:t,...n})})}function RO(e,t){return NO(`/tasks/${e}/message`,{method:`POST`,body:JSON.stringify({text:t})})}function zO(e,t){return NO(`/tasks/${e}/model`,{method:`POST`,body:JSON.stringify({model:t||null})})}function BO(e){return NO(`/tasks/${e}/stop`,{method:`POST`}).then(()=>void 0)}function VO(e){return NO(`/tasks/${e}/worktree/remove`,{method:`POST`})}function HO(e){return NO(`/tasks/${e}/diff`)}async function UO(){let e=await Tr(),t=e.linearAccessToken?`Bearer ${e.linearAccessToken}`:e.linearApiKey;t&&await NO(`/config`,{method:`POST`,body:JSON.stringify({linearAuth:t})}).catch(()=>void 0)}async function WO(e){if(!e.length)return{statuses:{},previews:{}};let t=await NO(`/pr/status`,{method:`POST`,body:JSON.stringify({urls:e})});return{statuses:t.statuses??{},previews:t.previews??{}}}function GO(e,t){return NO(`/pr/stage`,{method:`POST`,body:JSON.stringify({url:e,base:t})})}function KO(e,t){return NO(`/branch/status`,{method:`POST`,body:JSON.stringify({url:e,base:t})})}function qO(e){return NO(`/deploy/logs`,{method:`POST`,body:JSON.stringify({deployUrl:e})})}function JO(e,t){return NO(`/branch/reset`,{method:`POST`,body:JSON.stringify({url:e,base:t})})}function YO(e){return NO(`/pr/merge`,{method:`POST`,body:JSON.stringify({url:e})})}async function XO(){return((await Tr()).bridgeUrl?.trim()||`http://localhost:4577`).replace(/\/$/,``)}function ZO(e){return`claude --dangerously-skip-permissions --resume ${e.sessionId??`<session-id>`}`}function QO(e,t){return[`🛠️ ${(e=>t===`slack`?`*${e}*`:e)(`${e.identifier} — ${e.title}`)}`,e.summary?.trim()?e.summary.trim().slice(0,300):null,e.impact?.trim()?`Impact: ${e.impact.trim().slice(0,200)}`:null,e.executor===`cursor`?`🤖 Delegated to the Cursor cloud agent — PR with demo video incoming.`:e.executor===`local`?`💻 Delegated to local Claude Code.`:null,e.repo?`Repo: ${e.repo}`:null,e.demoUrl?`Demo: ${e.demoUrl}`:null,`👉 Follow & review: ${e.url}`].filter(Boolean).join(`
224
- `)}async function $O(e,t){let n=await(await fetch(`https://slack.com/api/chat.postMessage`,{method:`POST`,body:new URLSearchParams({token:e.slackToken,channel:e.slackChannelId,text:QO(t,`slack`),unfurl_links:`false`})})).json();if(!n.ok)throw Error(n.error??`slack error`)}async function ek(e,t){let n=`https://api.telegram.org/bot${e.telegramToken}`,r=QO(t,`telegram`),i=t.demoUrl&&/raw\.githubusercontent\.com|\.gif($|\?)/i.test(t.demoUrl),a=await(await fetch(`${n}/${i?`sendAnimation`:`sendMessage`}`,{method:`POST`,body:new URLSearchParams(i?{chat_id:e.telegramChatId,animation:t.demoUrl,caption:r.slice(0,1e3)}:{chat_id:e.telegramChatId,text:r})})).json();if(!a.ok)throw Error(a.description??`telegram error`)}async function tk(e,t){if(e.notifyOnCreate===!1)return[];let n=[];if(e.slackToken&&e.slackChannelId)try{await $O(e,t)}catch{n.push(`Slack`)}if(e.telegramToken&&e.telegramChatId)try{await ek(e,t)}catch{n.push(`Telegram`)}return n}async function nk(e){let t=async t=>await(await fetch(`https://slack.com/api/conversations.list`,{method:`POST`,body:new URLSearchParams({token:e,types:t,exclude_archived:`true`,limit:`200`})})).json(),n=await t(`public_channel,private_channel`);if(!n.ok&&n.error===`missing_scope`&&(n=await t(`public_channel`)),!n.ok)throw Error(n.error??`slack error`);return(n.channels??[]).map(e=>({id:e.id,name:e.name})).sort((e,t)=>e.name.localeCompare(t.name))}var rk=12e3,ik=4e3;async function ak(e){let t=e.logUrl?.trim();if(!t)return null;let n=Math.min(500,Math.max(10,e.logLines??100)),r=new AbortController,i=setTimeout(()=>r.abort(),ik);try{let e=await fetch(t,{cache:`no-store`,signal:r.signal});if(!e.ok)throw Error(`Log fetch failed (${e.status})`);let i=(await e.text()).split(`
232
+ }`,{contentType:e.type,filename:t,size:e.size}),r=n.fileUpload.uploadFile;if(!n.fileUpload.success||!r)throw Error(`Linear did not provide an upload URL.`);let{linearApiKey:i,linearAccessToken:a}=await Tr(),o=a?`Bearer ${a}`:i??``,s=Object.fromEntries((r.headers??[]).map(e=>[e.key,e.value])),c=[{"Content-Type":e.type,...s,...o?{Authorization:o}:{}},{"Content-Type":e.type,...s},{"Content-Type":e.type}],l=null;for(let t of c)try{let n=await fetch(r.uploadUrl,{method:`PUT`,mode:`cors`,headers:t,body:e});if(n.ok)return r.assetUrl;l=Error(`Upload rejected (${n.status}).`)}catch(e){l=e}try{let{bridgeUrl:t}=await Tr(),n=(t?.trim()||`http://localhost:4577`).replace(/\/$/,``);if((await fetch(`${n}/put`,{method:`POST`,headers:{"Content-Type":e.type,"x-upload-url":r.uploadUrl,"x-upload-headers":JSON.stringify({...s,...o?{Authorization:o}:{}})},body:e})).ok)return r.assetUrl}catch{}throw Error(`Upload to Linear storage failed${l instanceof Error?` — ${l.message}`:``}. Run \`npx linear-grab-bridge\` in the repo (uploads relay through it), set the GitHub fallback in Settings, or use "Copy GIF" + paste.`)}Br();async function jO(e,t){try{return await AO(e,t)}catch(n){let r=await Tr();if(r.githubToken&&r.githubAssetsRepo)return MO(e,t,r.githubToken,r.githubAssetsRepo);throw n instanceof Error?Error(`${n.message} Tip: configure the GitHub assets fallback in Settings for automatic uploads in this browser.`):n}}async function MO(e,t,n,r){let i=`linear-grab/${Date.now()}-${t.replace(/[^\w.-]/g,`_`)}`,a=await fetch(`https://api.github.com/repos/${r}/contents/${i}`,{method:`PUT`,headers:{Authorization:`Bearer ${n}`,Accept:`application/vnd.github+json`,"Content-Type":`application/json`},body:JSON.stringify({message:`chore(linear-grab): asset ${t}`,content:await NO(e)})}),o=await a.json().catch(()=>null);if(!a.ok||!o?.content?.download_url)throw Error(`GitHub asset upload failed — ${o?.message??`HTTP ${a.status}`}`);return o.content.download_url}function NO(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result.split(`,`)[1]??``),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}Br();async function PO(){return((await Tr()).bridgeUrl?.trim()||`http://localhost:4577`).replace(/\/$/,``)}async function FO(e,t){let n=await PO(),r=await fetch(`${n}${e}`,{...t,headers:{"Content-Type":`application/json`,...t?.headers??{}}});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Bridge request failed (${r.status})`)}return await r.json()}function IO(){return FO(`/health`)}async function LO(){return(await FO(`/tasks`)).tasks}function RO(e){return FO(`/tasks/${e}`)}function zO(e,t,n){return FO(`/tasks`,{method:`POST`,body:JSON.stringify({title:e,prompt:t,...n})})}async function BO(){return(await FO(`/sessions/running`)).sessions}function VO(e,t){return FO(`/sessions/queue`,{method:`POST`,body:JSON.stringify({text:e,pid:t})})}function HO(e,t){return FO(`/tasks/${e}/message`,{method:`POST`,body:JSON.stringify({text:t})})}function UO(e,t){return FO(`/tasks/${e}/model`,{method:`POST`,body:JSON.stringify({model:t||null})})}function WO(e){return FO(`/tasks/${e}/stop`,{method:`POST`}).then(()=>void 0)}function GO(e){return FO(`/tasks/${e}/worktree/remove`,{method:`POST`})}function KO(e){return FO(`/tasks/${e}/diff`)}async function qO(){let e=await Tr(),t=e.linearAccessToken?`Bearer ${e.linearAccessToken}`:e.linearApiKey;t&&await FO(`/config`,{method:`POST`,body:JSON.stringify({linearAuth:t})}).catch(()=>void 0)}async function JO(e){if(!e.length)return{statuses:{},previews:{}};let t=await FO(`/pr/status`,{method:`POST`,body:JSON.stringify({urls:e})});return{statuses:t.statuses??{},previews:t.previews??{}}}function YO(e,t){return FO(`/pr/stage`,{method:`POST`,body:JSON.stringify({url:e,base:t})})}function XO(e,t){return FO(`/branch/status`,{method:`POST`,body:JSON.stringify({url:e,base:t})})}function ZO(e){return FO(`/deploy/logs`,{method:`POST`,body:JSON.stringify({deployUrl:e})})}function QO(e,t){return FO(`/branch/reset`,{method:`POST`,body:JSON.stringify({url:e,base:t})})}function $O(e){return FO(`/pr/merge`,{method:`POST`,body:JSON.stringify({url:e})})}async function ek(){return((await Tr()).bridgeUrl?.trim()||`http://localhost:4577`).replace(/\/$/,``)}function tk(e){return`claude --dangerously-skip-permissions --resume ${e.sessionId??`<session-id>`}`}function nk(e,t){return[`🛠️ ${(e=>t===`slack`?`*${e}*`:e)(`${e.identifier} — ${e.title}`)}`,e.summary?.trim()?e.summary.trim().slice(0,300):null,e.impact?.trim()?`Impact: ${e.impact.trim().slice(0,200)}`:null,e.executor===`cursor`?`🤖 Delegated to the Cursor cloud agent — PR with demo video incoming.`:e.executor===`local`?`💻 Delegated to local Claude Code.`:null,e.repo?`Repo: ${e.repo}`:null,e.demoUrl?`Demo: ${e.demoUrl}`:null,`👉 Follow & review: ${e.url}`].filter(Boolean).join(`
233
+ `)}async function rk(e,t){let n=await(await fetch(`https://slack.com/api/chat.postMessage`,{method:`POST`,body:new URLSearchParams({token:e.slackToken,channel:e.slackChannelId,text:nk(t,`slack`),unfurl_links:`false`})})).json();if(!n.ok)throw Error(n.error??`slack error`)}async function ik(e,t){let n=`https://api.telegram.org/bot${e.telegramToken}`,r=nk(t,`telegram`),i=t.demoUrl&&/raw\.githubusercontent\.com|\.gif($|\?)/i.test(t.demoUrl),a=await(await fetch(`${n}/${i?`sendAnimation`:`sendMessage`}`,{method:`POST`,body:new URLSearchParams(i?{chat_id:e.telegramChatId,animation:t.demoUrl,caption:r.slice(0,1e3)}:{chat_id:e.telegramChatId,text:r})})).json();if(!a.ok)throw Error(a.description??`telegram error`)}async function ak(e,t){if(e.notifyOnCreate===!1)return[];let n=[];if(e.slackToken&&e.slackChannelId)try{await rk(e,t)}catch{n.push(`Slack`)}if(e.telegramToken&&e.telegramChatId)try{await ik(e,t)}catch{n.push(`Telegram`)}return n}async function ok(e){let t=async t=>await(await fetch(`https://slack.com/api/conversations.list`,{method:`POST`,body:new URLSearchParams({token:e,types:t,exclude_archived:`true`,limit:`200`})})).json(),n=await t(`public_channel,private_channel`);if(!n.ok&&n.error===`missing_scope`&&(n=await t(`public_channel`)),!n.ok)throw Error(n.error??`slack error`);return(n.channels??[]).map(e=>({id:e.id,name:e.name})).sort((e,t)=>e.name.localeCompare(t.name))}var sk=12e3,ck=4e3;async function lk(e){let t=e.logUrl?.trim();if(!t)return null;let n=Math.min(500,Math.max(10,e.logLines??100)),r=new AbortController,i=setTimeout(()=>r.abort(),ck);try{let e=await fetch(t,{cache:`no-store`,signal:r.signal});if(!e.ok)throw Error(`Log fetch failed (${e.status})`);let i=(await e.text()).split(`
225
234
  `).slice(-n).join(`
226
- `).trim();return i.length>rk&&(i=`…\n${i.slice(i.length-rk)}`),i||null}finally{clearTimeout(i)}}var ok=50,sk=[],ck=!1;function lk(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e==`object`&&e)try{return JSON.stringify(e).slice(0,400)}catch{return String(e)}return String(e)}function uk(e,t){let n=t.map(lk).join(` `).slice(0,600);n.trim()&&(sk.push({at:Date.now(),level:e,text:n}),sk.length>ok&&sk.shift())}function dk(){if(ck||typeof window>`u`)return;ck=!0;let e=console.error.bind(console);console.error=(...t)=>{uk(`error`,t),e(...t)};let t=console.warn.bind(console);console.warn=(...e)=>{uk(`warn`,e),t(...e)},window.addEventListener(`error`,e=>{uk(`error`,[`${e.message}${e.filename?` (${e.filename}:${e.lineno})`:``}`])}),window.addEventListener(`unhandledrejection`,e=>{let t=e.reason;uk(`unhandled`,[t?.stack??String(e.reason??`unhandled rejection`)])})}function fk(e=30){return sk.slice(-e)}function pk(e=30){let t=fk(e);if(!t.length)return null;let n=t.map(e=>`[${new Date(e.at).toTimeString().slice(0,8)}] ${e.level.toUpperCase()}: ${e.text}`).join(`
227
- `);return n.length>8e3&&(n=`…\n${n.slice(n.length-8e3)}`),n}function mk(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}var hk=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function gk(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}var _k=null;function vk(e={}){return _k||(e.includeStyleProperties?(_k=e.includeStyleProperties,_k):(_k=gk(window.getComputedStyle(document.documentElement)),_k))}function yk(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function bk(e){let t=yk(e,`border-left-width`),n=yk(e,`border-right-width`);return e.clientWidth+t+n}function xk(e){let t=yk(e,`border-top-width`),n=yk(e,`border-bottom-width`);return e.clientHeight+t+n}function Sk(e,t={}){return{width:t.width||bk(e),height:t.height||xk(e)}}function Ck(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var wk=16384;function Tk(e){(e.width>wk||e.height>wk)&&(e.width>wk&&e.height>wk?e.width>e.height?(e.height*=wk/e.width,e.width=wk):(e.width*=wk/e.height,e.height=wk):e.width>wk?(e.height*=wk/e.width,e.width=wk):(e.width*=wk/e.height,e.height=wk))}function Ek(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function Dk(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Ok(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),Dk(i)}var kk=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||kk(n,t)};function Ak(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function jk(e,t){return vk(t).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function Mk(e,t,n,r){let i=`.${e}:${t}`,a=n.cssText?Ak(n):jk(n,r);return document.createTextNode(`${i}{${a}}`)}function Nk(e,t,n,r){let i=window.getComputedStyle(e,n),a=i.getPropertyValue(`content`);if(a===``||a===`none`)return;let o=hk();try{t.className=`${t.className} ${o}`}catch{return}let s=document.createElement(`style`);s.appendChild(Mk(o,n,i,r)),t.appendChild(s)}function Pk(e,t,n){Nk(e,t,`:before`,n),Nk(e,t,`:after`,n)}var Fk=`application/font-woff`,Ik=`image/jpeg`,Lk={woff:Fk,woff2:Fk,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:Ik,jpeg:Ik,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function Rk(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function zk(e){return Lk[Rk(e).toLowerCase()]||``}function Bk(e){return e.split(/,/)[1]}function Vk(e){return e.search(/^(data:)/)!==-1}function Hk(e,t){return`data:${t};base64,${e}`}async function Uk(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}var Wk={};function Gk(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function Kk(e,t,n){let r=Gk(e,t,n.includeQueryParams);if(Wk[r]!=null)return Wk[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=Hk(await Uk(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,Bk(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return Wk[r]=i,i}async function qk(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):Ek(t)}async function Jk(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),Ek(t.toDataURL())}let n=e.poster;return Ek(await Kk(n,zk(n),t))}async function Yk(e,t){try{if(e?.contentDocument?.body)return await aA(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Xk(e,t){return kk(e,HTMLCanvasElement)?qk(e):kk(e,HTMLVideoElement)?Jk(e,t):kk(e,HTMLIFrameElement)?Yk(e,t):e.cloneNode(Qk(e))}var Zk=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`,Qk=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SVG`;async function $k(e,t,n){if(Qk(t))return t;let r=[];return r=Zk(e)&&e.assignedNodes?gk(e.assignedNodes()):kk(e,HTMLIFrameElement)&&e.contentDocument?.body?gk(e.contentDocument.body.childNodes):gk((e.shadowRoot??e).childNodes),r.length===0||kk(e,HTMLVideoElement)||await r.reduce((e,r)=>e.then(()=>aA(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function eA(e,t,n){let r=t.style;if(!r)return;let i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):vk(n).forEach(n=>{let a=i.getPropertyValue(n);n===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),kk(e,HTMLIFrameElement)&&n===`display`&&a===`inline`&&(a=`block`),n===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),r.setProperty(n,a,i.getPropertyPriority(n))})}function tA(e,t){kk(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),kk(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function nA(e,t){if(kk(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function rA(e,t,n){return kk(t,Element)&&(eA(e,t,n),Pk(e,t,n),tA(e,t),nA(e,t)),t}async function iA(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await aA(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function aA(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>Xk(e,t)).then(n=>$k(e,n,t)).then(n=>rA(e,n,t)).then(e=>iA(e,t))}var oA=/url\((['"]?)([^'"]+?)\1\)/g,sA=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,cA=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lA(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function uA(e){let t=[];return e.replace(oA,(e,n,r)=>(t.push(r),e)),t.filter(e=>!Vk(e))}async function dA(e,t,n,r,i){try{let a=n?mk(t,n):t,o=zk(t),s;return s=i?Hk(await i(a),o):await Kk(a,o,r),e.replace(lA(t),`$1${s}$3`)}catch{}return e}function fA(e,{preferredFontFormat:t}){return t?e.replace(cA,e=>{for(;;){let[n,,r]=sA.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function pA(e){return e.search(oA)!==-1}async function mA(e,t,n){if(!pA(e))return e;let r=fA(e,n);return uA(r).reduce((e,r)=>e.then(e=>dA(e,r,t,n)),Promise.resolve(r))}async function hA(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await mA(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gA(e,t){await hA(`background`,e,t)||await hA(`background-image`,e,t),await hA(`mask`,e,t)||await hA(`-webkit-mask`,e,t)||await hA(`mask-image`,e,t)||await hA(`-webkit-mask-image`,e,t)}async function _A(e,t){let n=kk(e,HTMLImageElement);if(!(n&&!Vk(e.src))&&!(kk(e,SVGImageElement)&&!Vk(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await Kk(r,zk(r),t);await new Promise((r,a)=>{e.onload=r,e.onerror=t.onImageErrorHandler?(...e)=>{try{r(t.onImageErrorHandler(...e))}catch(e){a(e)}}:a;let o=e;o.decode&&=r,o.loading===`lazy`&&(o.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function vA(e,t){let n=gk(e.childNodes).map(e=>yA(e,t));await Promise.all(n).then(()=>e)}async function yA(e,t){kk(e,Element)&&(await gA(e,t),await _A(e,t),await vA(e,t))}function bA(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}var xA={};async function SA(e){let t=xA[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},xA[e]=t,t)}async function CA(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),Uk(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function wA(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function TA(e,t){let n=[],r=[];return e.forEach(n=>{if(`cssRules`in n)try{gk(n.cssRules||[]).forEach((e,i)=>{if(e.type===CSSRule.IMPORT_RULE){let a=i+1,o=e.href,s=SA(o).then(e=>CA(e,t)).then(e=>wA(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});r.push(s)}})}catch(i){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&r.push(SA(n.href).then(e=>CA(e,t)).then(e=>wA(e).forEach(e=>{a.insertRule(e,a.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,i)}}),Promise.all(r).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{gk(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function EA(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>pA(e.style.getPropertyValue(`src`)))}async function DA(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return EA(await TA(gk(e.ownerDocument.styleSheets),t))}function OA(e){return e.trim().replace(/["']/g,``)}function kA(e){let t=new Set;function n(e){(e.style.fontFamily||getComputedStyle(e).fontFamily).split(`,`).forEach(e=>{t.add(OA(e))}),Array.from(e.children).forEach(e=>{e instanceof HTMLElement&&n(e)})}return n(e),t}async function AA(e,t){let n=await DA(e,t),r=kA(e);return(await Promise.all(n.filter(e=>r.has(OA(e.style.fontFamily))).map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return mA(e.cssText,n,t)}))).join(`
228
- `)}async function jA(e,t){let n=t.fontEmbedCSS==null?t.skipFonts?null:await AA(e,t):t.fontEmbedCSS;if(n){let t=document.createElement(`style`),r=document.createTextNode(n);t.appendChild(r),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}}async function MA(e,t={}){let{width:n,height:r}=Sk(e,t),i=await aA(e,t,!0);return await jA(i,t),await yA(i,t),bA(i,t),await Ok(i,n,r)}async function NA(e,t={}){let{width:n,height:r}=Sk(e,t),i=await Ek(await MA(e,t)),a=document.createElement(`canvas`),o=a.getContext(`2d`),s=t.pixelRatio||Ck(),c=t.canvasWidth||n,l=t.canvasHeight||r;return a.width=c*s,a.height=l*s,t.skipAutoScale||Tk(a),a.style.width=`${c}`,a.style.height=`${l}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(i,0,0,a.width,a.height),a}async function PA(e,t={}){return AA(e,t)}var FA=6,IA=class{last=performance.now();async tick(){performance.now()-this.last<=FA||(await new Promise(e=>{`requestIdleCallback`in window?requestIdleCallback(()=>e(),{timeout:100}):setTimeout(e,0)}),this.last=performance.now())}},LA=null,RA=new Map;function zA(e){let t=RA.get(e);if(t)return t;if(!LA){let e=document.createElement(`iframe`);if(e.setAttribute(`data-linear-grab`,`true`),e.style.cssText=`position:absolute;width:0;height:0;border:0;visibility:hidden`,document.body.appendChild(e),LA=e.contentDocument,!LA)return{}}let n=LA.createElement(e);LA.body.appendChild(n);let r=LA.defaultView.getComputedStyle(n),i={};for(let e=0;e<r.length;e++){let t=r[e];i[t]=r.getPropertyValue(t)}return n.remove(),RA.set(e,i),i}function BA(){try{for(let e of[`div`,`span`,`p`,`a`,`button`,`img`,`ul`,`li`,`svg`])zA(e)}catch{}}function VA(e){if(e.id===`linear-grab-root`)return!0;let t=e.tagName?.toLowerCase()??``;return t===`overlay-canvas`||t.startsWith(`react-grab`)||t===`script`||t===`iframe`}function HA(e,t){try{let n=document.createElement(`canvas`);n.width=e.naturalWidth||e.width||1,n.height=e.naturalHeight||e.height||1,n.getContext(`2d`).drawImage(e,0,0),t.src=n.toDataURL(`image/png`)}catch{t.removeAttribute(`src`),t.setAttribute(`style`,`${t.getAttribute(`style`)??``}background:#8b8e9822;`)}}async function UA(e,t){if(VA(e))return null;if(e instanceof SVGSVGElement)return e.cloneNode(!0);let n=e.cloneNode(!1),r=getComputedStyle(e),i=zA(e.tagName.toLowerCase()),a=``;for(let e=0;e<r.length;e++){let t=r[e],n=r.getPropertyValue(t);n&&n!==i[t]&&(a+=`${t}:${n};`)}if(n.setAttribute(`style`,a),n.removeAttribute(`class`),e instanceof HTMLImageElement&&(HA(e,n),n.removeAttribute(`srcset`),n.removeAttribute(`sizes`)),(e instanceof HTMLVideoElement||e instanceof HTMLAudioElement)&&(n.removeAttribute(`src`),n.removeAttribute(`poster`)),e.tagName===`SOURCE`)return null;if(e instanceof HTMLCanvasElement)try{let t=document.createElement(`img`);return t.setAttribute(`style`,a),t.src=e.toDataURL(),t}catch{}e instanceof HTMLInputElement&&n.setAttribute(`value`,e.value),e instanceof HTMLTextAreaElement&&(n.textContent=e.value),await t.tick();for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE)n.appendChild(r.cloneNode());else if(r.nodeType===Node.ELEMENT_NODE){let e=await UA(r,t);e&&n.appendChild(e)}return n}async function WA(e,t){let n=e.getBoundingClientRect(),r=Math.max(1,Math.ceil(n.width)),i=Math.max(1,Math.ceil(n.height)),a=await UA(e,new IA);if(!a)throw Error(`Capture root was filtered`);a.style.margin=`0`;let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${i}"><style>${t}</style><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">${new XMLSerializer().serializeToString(a)}</div></foreignObject></svg>`,s=URL.createObjectURL(new Blob([o],{type:`image/svg+xml;charset=utf-8`})),c=new Image;c.decoding=`async`,c.src=s;try{await c.decode().catch(()=>{if(!c.complete||!c.naturalWidth)throw Error(`SVG rasterize failed — a subresource in the region could not load`)})}finally{URL.revokeObjectURL(s)}let l=8192,u=Math.min(window.devicePixelRatio||1,1.5,l/r,l/i),d=document.createElement(`canvas`);d.width=Math.max(1,Math.round(r*u)),d.height=Math.max(1,Math.round(i*u));let f=d.getContext(`2d`);if(!f)throw Error(`Canvas 2d unavailable`);return f.drawImage(c,0,0,d.width,d.height),d}var GA=null;function KA(e){return GA??=PA(e).catch(()=>``),GA}function qA(){`requestIdleCallback`in window?requestIdleCallback(()=>{BA(),KA(document.body)},{timeout:3e3}):setTimeout(()=>{BA(),KA(document.body)},1500)}var JA=4e3,YA=1e3;async function XA(e){try{if(await new Promise(e=>{requestAnimationFrame(()=>`requestIdleCallback`in window?requestIdleCallback(()=>e(void 0),{timeout:500}):setTimeout(e,80))}),!e.isConnected)return null;let t=ej(e),n=t.querySelectorAll(`*`).length;n>JA&&(t=e);let r;try{r=await WA(t,await KA(t))}catch{t!==e&&n>YA&&(t=e),r=await NA(t,{pixelRatio:Math.min(window.devicePixelRatio||1,1.5),fontEmbedCSS:await KA(t),filter:e=>{if(!(e instanceof Element))return!0;if(e.id===`linear-grab-root`)return!1;let t=e.tagName?.toLowerCase()??``;return!(t===`overlay-canvas`||t.startsWith(`react-grab`))}})}return t!==e&&tj(r,t,e),await $A(r)}catch{return null}}async function ZA(e){return Promise.race([QA(e),new Promise(e=>setTimeout(()=>{console.warn(`[linear-grab] region capture timed out after 15s`),e(null)},15e3))])}async function QA(e){try{let t=e.x+e.w/2,n=e.y+e.h/2,r=document.elementFromPoint(t,n)??document.body,i=t=>{let n=t.getBoundingClientRect();return n.left<=e.x&&n.top<=e.y&&n.right>=e.x+e.w&&n.bottom>=e.y+e.h};for(;r!==document.body&&(!i(r)||r.querySelectorAll(`*`).length<1);)r=r.parentElement??document.body;let a=await WA(r,await KA(r)),o=r.getBoundingClientRect(),s=a.width/o.width,c=a.height/o.height,l=document.createElement(`canvas`);l.width=Math.max(1,Math.round(e.w*s)),l.height=Math.max(1,Math.round(e.h*c));let u=l.getContext(`2d`);return u?(u.drawImage(a,(e.x-o.left+r.scrollLeft)*s,(e.y-o.top+r.scrollTop)*c,e.w*s,e.h*c,0,0,l.width,l.height),await $A(l)):null}catch(e){return console.warn(`[linear-grab] region capture failed:`,e),null}}async function $A(e){try{if(typeof createImageBitmap==`function`&&typeof OffscreenCanvas<`u`){let t=await createImageBitmap(e);return(await FD({type:`encode-png`,bitmap:t},[t])).dataUrl}}catch{}return nj(e)}function ej(e){let t=window.innerWidth,n=window.innerHeight,r=t*n*1.7,i=e,a=e;for(;a&&a!==document.body&&a!==document.documentElement;){let o=a.getBoundingClientRect();if(o.width*o.height>r||a!==e&&(a.scrollTop>0||a.scrollLeft>0)||(i=a,o.width>=t*.55&&o.height>=n*.35))break;a=a.parentElement}return i}function tj(e,t,n){let r=e.getContext(`2d`);if(!r)return;let i=t.getBoundingClientRect(),a=n.getBoundingClientRect();if(!i.width||!i.height)return;let o=e.width/i.width,s=e.height/i.height,c=(a.left-i.left+t.scrollLeft)*o,l=(a.top-i.top+t.scrollTop)*s,u=a.width*o,d=a.height*s,f=Math.min(6*o,u/2,d/2);r.strokeStyle=`rgba(94, 106, 210, 0.35)`,r.lineWidth=8*o,r.beginPath(),r.roundRect(c,l,u,d,f),r.stroke(),r.strokeStyle=`#5e6ad2`,r.lineWidth=3*o,r.beginPath(),r.roundRect(c,l,u,d,f),r.stroke()}function nj(e){let t=e.toDataURL(`image/png`);return t.length<=25e5?t:e.toDataURL(`image/jpeg`,.85)}function rj(e){let[t,n]=e.split(`,`),r=t.match(/data:([^;]+)/)?.[1]??`image/png`,i=atob(n),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);return new Blob([a],{type:r})}var[ij,aj]=T(null),[oj,sj]=T(null);function cj(e,t){aj(e),sj(t??null)}function lj(){aj(null),sj(null)}var[uj,dj]=T(`capture`);function fj(e){dj(e)}var pj=N(`<span class="absolute inset-0 grid place-items-center">`),mj=N(`<button><span>`),hj=N(`<span role=status aria-label=Loading class="text-text-dim relative inline-block shrink-0">`),gj=N(`<span class="absolute top-0 left-1/2 rounded-full bg-current"style="animation:geist-spinner-fade 1.2s linear infinite;will-change:opacity">`),_j=N(`<input>`),vj=N(`<textarea>`),yj=N(`<select>`),bj=N(`<svg viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class=shrink-0><path d="M4.5 12.5a3 3 0 0 1-.4-5.97 4 4 0 0 1 7.8-.9A3.2 3.2 0 0 1 11.5 12.5h-7Z">`),xj=N(`<svg viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class=shrink-0><rect x=1.5 y=2.5 width=13 height=9 rx=1.5></rect><path d="M5.5 14h5M8 11.5V14">`),Sj=N(`<a target=_blank rel="noopener noreferrer"><span class="min-w-0 truncate"></span><svg width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class=shrink-0><path d="M4.5 11.5 11.5 4.5M5.5 4.5h6v6">`),Cj=N(`<span class="text-text-faint text-[10.5px] leading-snug">`),wj=N(`<label class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">`),Tj=N(`<section class="flex flex-col gap-2.5"><h2 class="text-text-dim text-[11px] font-semibold tracking-wide uppercase">`),Ej=N(`<span>`),Dj=N(`<span aria-hidden class="inline-block size-2 shrink-0 rounded-full">`),Oj=N(`<div class="flex flex-col items-center gap-1.5 px-4 py-10 text-center"><p class="text-text-dim text-[12px] font-medium"></p><div class="text-text-faint text-[11.5px] leading-relaxed">`),kj=N(`<p class="bg-danger-soft text-danger rounded-md px-2.5 py-1.5 text-[11.5px] leading-snug break-words">`),Aj={primary:`bg-accent hover:bg-accent-hover text-white border-transparent disabled:bg-surface-3 disabled:text-text-faint`,ghost:`bg-surface-2 hover:bg-surface-3 text-text border-border disabled:text-text-faint disabled:hover:bg-surface-2`,danger:`bg-danger-soft hover:bg-danger/30 text-danger border-transparent`};function q(e){let[t,n]=He(e,[`variant`,`loading`,`children`,`class`,`disabled`,`title`]);return(()=>{var e=mj(),r=e.firstChild;return ft(e,Ve(n,{get"data-tip"(){return t.title||void 0},get"aria-label"(){return n[`aria-label`]??t.title},get disabled(){return t.disabled||t.loading},get class(){return`relative inline-flex h-7 cursor-pointer items-center justify-center gap-1.5 rounded-md border px-3 text-[12px] font-medium transition-colors disabled:cursor-not-allowed ${Aj[t.variant??`ghost`]} ${t.class??``}`}}),!1,!0),P(r,()=>t.children),P(e,j(M,{get when(){return t.loading},get children(){var e=pj();return P(e,j(jj,{})),e}}),null),D(()=>st(r,`inline-flex items-center gap-1.5 ${t.loading?`invisible`:``}`)),e})()}function jj(e){let t=()=>e.size??14,n=()=>Math.max(1,Math.round(t()*.09)),r=()=>Math.round(t()*.26);return(()=>{var e=hj();return P(e,j(We,{get each(){return Array.from({length:12},(e,t)=>t)},children:e=>(()=>{var i=gj();return dt(i,`transform`,`rotate(${e*30}deg)`),dt(i,`animation-delay`,`${(e-12)*.1}s`),D(e=>{var a=`${n()}px`,o=`${r()}px`,s=`-${n()/2}px`,c=`center ${t()/2}px`;return a!==e.e&&dt(i,`width`,e.e=a),o!==e.t&&dt(i,`height`,e.t=o),s!==e.a&&dt(i,`margin-left`,e.a=s),c!==e.o&&dt(i,`transform-origin`,e.o=c),e},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()})),D(n=>{var r=`${t()}px`,i=`${t()}px`;return r!==n.e&&dt(e,`width`,n.e=r),i!==n.t&&dt(e,`height`,n.t=i),n},{e:void 0,t:void 0}),e})()}function Mj(e){let[t,n]=He(e,[`class`]);return(()=>{var e=_j();return ft(e,Ve(n,{get class(){return`bg-surface-2 border-border focus:border-accent placeholder:text-text-faint h-7 w-full rounded-md border px-2 text-[12px] outline-none transition-colors ${t.class??``}`}}),!1,!1),e})()}function Nj(e){let[t,n]=He(e,[`class`]);return(()=>{var e=vj();return ft(e,Ve(n,{get class(){return`bg-surface-2 border-border focus:border-accent placeholder:text-text-faint w-full resize-y rounded-md border px-2 py-1.5 text-[12px] leading-relaxed outline-none transition-colors ${t.class??``}`}}),!1,!1),e})()}function Pj(e){let[t,n]=He(e,[`class`,`children`]);return(()=>{var e=yj();return ft(e,Ve(n,{get class(){return`bg-surface-2 border-border focus:border-accent h-7 w-full cursor-pointer rounded-md border px-1.5 text-[12px] outline-none ${t.class??``}`}}),!1,!0),P(e,()=>t.children),e})()}function Fj(e){let t=e.size??11;return(()=>{var e=bj();return it(e,`width`,t),it(e,`height`,t),e})()}function Ij(e){let t=e.size??11;return(()=>{var e=xj();return it(e,`width`,t),it(e,`height`,t),e})()}function Lj(e){return(()=>{var t=Sj(),n=t.firstChild;return P(n,()=>e.children),D(n=>{var r=e.href,i=e.title||void 0,a=`text-accent inline-flex min-w-0 items-center gap-1 text-[11px] underline-offset-2 hover:underline ${e.class??``}`;return r!==n.e&&it(t,`href`,n.e=r),i!==n.t&&it(t,`data-tip`,n.t=i),a!==n.a&&st(t,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()}function Rj(e){return(()=>{var t=wj(),n=t.firstChild;return P(n,()=>e.label),P(t,()=>e.children,null),P(t,j(M,{get when(){return e.hint},get children(){var t=Cj();return P(t,()=>e.hint),t}}),null),t})()}function zj(e){return(()=>{var t=Tj(),n=t.firstChild;return P(n,()=>e.title),P(t,()=>e.children,null),t})()}function Bj(e){return(()=>{var t=Ej();return P(t,()=>e.children),D(n=>{var r=`bg-surface-3 text-text-dim inline-flex h-[18px] items-center gap-1 rounded-full px-2 text-[10.5px] font-medium whitespace-nowrap ${e.class??``}`,i=e.color?{color:e.color}:void 0,a=e.title||void 0;return r!==n.e&&st(t,n.e=r),n.t=ut(t,i,n.t),a!==n.a&&it(t,`data-tip`,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()}function Vj(e){return(()=>{var t=Dj();return D(n=>dt(t,`background`,e.color)),t})()}function Hj(e){return(()=>{var t=Oj(),n=t.firstChild,r=n.nextSibling;return P(n,()=>e.title),P(r,()=>e.children),t})()}function Uj(e){return(()=>{var t=kj();return P(t,()=>e.message),t})()}var Wj={0:`No priority`,1:`Urgent`,2:`High`,3:`Medium`,4:`Low`};function Gj(e){let t=typeof e==`number`?e:Date.parse(e),n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}Br(),Lx(),vD();var Kj=N(`<span class="truncate font-mono">`),qj=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M5.5 3.5 6.6 2h2.8l1.1 1.5H13A1.5 1.5 0 0 1 14.5 5v7A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12V5A1.5 1.5 0 0 1 3 3.5h2.5Z"></path><circle cx=8 cy=8.2 r=2.4>`),Jj=N(`<div class="flex flex-wrap gap-1.5"><span class="text-text-faint self-end text-[10.5px]">attached on create`),Yj=N(`<div class="flex items-center justify-between gap-1.5"><span class="text-text-faint text-[11px]">Model:</span><div class="flex rounded-md border border-border overflow-hidden">`),Xj=N(`<span class="inline-block min-w-[12ch] text-center">`),Zj=N(`<div class="flex justify-end">`),Qj=N(`<div class="flex flex-col gap-1.5">`),$j=N(`<p class="text-text-faint text-[11px] leading-snug">Primary provider failed — drafted with <span class=text-text-dim></span> (<!>).`),eM=N(`<div class="border-warn/40 bg-surface rounded-md border px-2.5 py-2"><p class="text-warn mb-1 text-[10.5px] font-semibold tracking-wide uppercase">Possibly related — check before creating`),tM=N(`<div class="flex flex-col gap-1">`),nM=N(`<option value>Select a team…`),rM=N(`<option value=cursor> — cloud agent`),iM=N(`<option value=local>Local Claude Code (bridge)`),aM=N(`<option value=none>No one — just create the issue`),oM=N(`<option value>Claude Code default`),sM=N(`<option value=fable>Fable 5`),cM=N(`<option value=opus>Opus`),lM=N(`<option value=sonnet>Sonnet`),uM=N(`<option value=haiku>Haiku`),dM=N(`<label class="flex cursor-pointer items-center gap-2 select-none"><input type=checkbox class="accent-accent rounded"><span class="text-text text-[12px]">Isolated worktree <span class=text-text-dim>— own branch, run agents in parallel safely`),fM=N(`<label class="flex items-center gap-2 cursor-pointer select-none"><input type=checkbox class="rounded accent-accent"><span class="text-[12px] text-text">Attach console errors <span class="text-text-dim tabular-nums">(<!> captured)`),pM=N(`<label class="flex items-center gap-2 cursor-pointer select-none"><input type=checkbox class="rounded accent-accent"><span class="text-[12px] text-text">Attach dev server logs <span class="text-text-dim tabular-nums">(last <!> lines)`),mM=N(`<p class="text-warn text-[11px] leading-snug">`),hM=N(`<span class="text-success text-[11px]">✓`),gM=N(`<div class="flex h-full flex-col gap-4 overflow-y-auto pt-3 pb-4 pl-3 pr-4"><div class="bg-surface border-border flex items-center gap-2 rounded-lg border px-2.5 py-2"><div class="flex min-w-0 flex-1 flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Attached context</span><div class="flex min-w-0 flex-wrap items-center gap-1.5"></div></div></div><div class="bg-bg border-border sticky bottom-0 z-10 -mb-4 flex flex-col gap-2 border-t pt-2.5 pb-3"><div class="flex items-center gap-2">`),_M=N(`<div class="border-border relative overflow-hidden rounded-md border"><img alt="Pasted attachment"class="block h-16 w-16 object-cover"><button class="bg-bg/80 text-text-dim hover:text-danger absolute top-0.5 right-0.5 grid size-4 cursor-pointer place-items-center rounded text-[10px] leading-none"title=Remove aria-label="Remove pasted image">×`),vM=N(`<button>`),yM=N(`<div class="flex min-w-0 items-center gap-1.5 py-0.5"><span class="font-mono text-text-dim shrink-0 text-[10.5px]"></span><a target=_blank rel=noreferrer class="text-accent min-w-0 truncate text-[11px] hover:underline">`),bM=N(`<div class="flex items-center gap-1"><span class="text-text-faint text-[11px] tabular-nums w-4 shrink-0 text-right">.</span><button class="text-text-faint hover:text-danger shrink-0 w-5 h-5 flex items-center justify-center rounded transition-colors cursor-pointer text-[12px] leading-none"aria-label="Remove step">×`),xM=N(`<option>`),SM=N(`<option>Loading teams…`),CM=N(`<div class="bg-surface border-border rounded-lg border p-2.5 flex items-center justify-between gap-2"><a target=_blank rel="noopener noreferrer"class="text-accent font-mono text-[12px] hover:underline">`),wM=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=8 height=8 rx=1.5></rect><path d="M10.5 5.5v-2a1.5 1.5 0 0 0-1.5-1.5H3.5A1.5 1.5 0 0 0 2 3.5V9a1.5 1.5 0 0 0 1.5 1.5h2">`);function TM(e){sr();let t=_r(()=>({queryKey:[`grab`],queryFn:Dr})),n=_r(()=>({queryKey:[`settings`],queryFn:Tr})),r=k(()=>n.data??{}),i=k(()=>t.data?.[0]??null),a=k(()=>!!(r().linearApiKey||r().linearAccessToken)),o=k(()=>Mx(r())),[s,c]=br(`draft:title`,``),[l,u]=br(`draft:description`,``),[d,f]=br(`draft:steps`,[]),[p,m]=br(`draft:expected`,``),[h,g]=br(`draft:actual`,``),[_,v]=br(`draft:impact`,``),[y,b]=br(`draft:analysis`,``),[x,S]=br(`draft:next-steps`,``),[C,w]=br(`draft:priority`,0),[E,ee]=T(r().defaultTeamId??``),[te,A]=T(r().defaultRepo??``),[ne,re]=br(`draft:target`,`none`),[ie,oe]=br(`draft:local-model`,``),[se,ce]=br(`draft:cloud-model`,``),[le,ue]=br(`draft:worktree`,!1),[de,fe]=T(!0),[pe,me]=T(fk().length);O(()=>{let e=setInterval(()=>me(fk().length),3e3);ae(()=>clearInterval(e))});let[he,ge]=T(``);O(()=>{let e=s().trim(),t=setTimeout(()=>ge(e.length>=8?e:``),600);ae(()=>clearTimeout(t))});let _e=_r(()=>({queryKey:[`dup-search`,he()],queryFn:()=>yO(he()),enabled:!!he()&&a(),staleTime:3e4})),[ve,ye]=br(`draft:note`,``),[be,xe]=T([]),Se=e=>{for(let t of Array.from(e.clipboardData?.items??[])){if(!t.type.startsWith(`image/`))continue;let e=t.getAsFile();if(!e||e.size>8e6)continue;let n=new FileReader;n.onload=()=>xe(e=>[...e,{id:Date.now()+Math.random(),dataUrl:n.result}].slice(-6)),n.readAsDataURL(e)}},[Ce,we]=T(`fast`),[Te,Ee]=T(!0),De=!1;O(()=>{let e=n.data;De||!e||(De=!0,ee(e.defaultTeamId??``),A(e.defaultRepo??``),re(e.cursorAgentId?`cursor`:`none`))});let Oe=_r(()=>({queryKey:[`teams`],queryFn:fO,enabled:a()})),ke=k(()=>(Oe.data??[]).find(e=>e.id===E())?.name),[Ae,je]=T(!1),Me=async()=>{let e=hD({description:l(),reproSteps:d(),expected:p(),actual:h(),impact:_(),analysisNotes:y(),suggestedNextSteps:x(),grabs:t.data??[]}),n=`Fix this issue in the current repo. Test the change hands-on before calling it done.\n\n# ${s().trim()||`Issue`}\n\n${e}`;try{await navigator.clipboard.writeText(n),je(!0),setTimeout(()=>je(!1),1800)}catch{}},[Ne,Pe]=T(!1),[Fe,Ie]=T(null),[Le,Re]=T(null),ze=null,Be=()=>{ze?.(),ze=null};ae(Be);let Ve=e=>{e.title!==void 0&&c(e.title),e.description!==void 0&&u(e.description),e.reproSteps!==void 0&&f(e.reproSteps),e.expected!==void 0&&m(e.expected),e.actual!==void 0&&g(e.actual),e.impact!==void 0&&v(e.impact),e.analysisNotes!==void 0&&b(e.analysisNotes),e.suggestedNextSteps!==void 0&&S(e.suggestedNextSteps),e.priority!==void 0&&w(e.priority)},He=async()=>{if(!o())return;Pe(!0),Ie(null),Re(null),Be();let e=r().logUrl&&Te()?await ak({logUrl:r().logUrl,logLines:40}).catch(()=>void 0):void 0,n=de()?pk(15):null,a=[e?`--- dev server ---\n${e}`:null,n?`--- browser console ---\n${n}`:null].filter(Boolean).join(`
235
+ `).trim();return i.length>sk&&(i=`…\n${i.slice(i.length-sk)}`),i||null}finally{clearTimeout(i)}}var uk=50,dk=[],fk=!1;function pk(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e==`object`&&e)try{return JSON.stringify(e).slice(0,400)}catch{return String(e)}return String(e)}function mk(e,t){let n=t.map(pk).join(` `).slice(0,600);n.trim()&&(dk.push({at:Date.now(),level:e,text:n}),dk.length>uk&&dk.shift())}function hk(){if(fk||typeof window>`u`)return;fk=!0;let e=console.error.bind(console);console.error=(...t)=>{mk(`error`,t),e(...t)};let t=console.warn.bind(console);console.warn=(...e)=>{mk(`warn`,e),t(...e)},window.addEventListener(`error`,e=>{mk(`error`,[`${e.message}${e.filename?` (${e.filename}:${e.lineno})`:``}`])}),window.addEventListener(`unhandledrejection`,e=>{let t=e.reason;mk(`unhandled`,[t?.stack??String(e.reason??`unhandled rejection`)])})}function gk(e=30){return dk.slice(-e)}function _k(e=30){let t=gk(e);if(!t.length)return null;let n=t.map(e=>`[${new Date(e.at).toTimeString().slice(0,8)}] ${e.level.toUpperCase()}: ${e.text}`).join(`
236
+ `);return n.length>8e3&&(n=`…\n${n.slice(n.length-8e3)}`),n}function vk(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}var yk=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function bk(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}var xk=null;function Sk(e={}){return xk||(e.includeStyleProperties?(xk=e.includeStyleProperties,xk):(xk=bk(window.getComputedStyle(document.documentElement)),xk))}function Ck(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function wk(e){let t=Ck(e,`border-left-width`),n=Ck(e,`border-right-width`);return e.clientWidth+t+n}function Tk(e){let t=Ck(e,`border-top-width`),n=Ck(e,`border-bottom-width`);return e.clientHeight+t+n}function Ek(e,t={}){return{width:t.width||wk(e),height:t.height||Tk(e)}}function Dk(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var Ok=16384;function kk(e){(e.width>Ok||e.height>Ok)&&(e.width>Ok&&e.height>Ok?e.width>e.height?(e.height*=Ok/e.width,e.width=Ok):(e.width*=Ok/e.height,e.height=Ok):e.width>Ok?(e.height*=Ok/e.width,e.width=Ok):(e.width*=Ok/e.height,e.height=Ok))}function Ak(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function jk(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Mk(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),jk(i)}var Nk=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Nk(n,t)};function Pk(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function Fk(e,t){return Sk(t).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function Ik(e,t,n,r){let i=`.${e}:${t}`,a=n.cssText?Pk(n):Fk(n,r);return document.createTextNode(`${i}{${a}}`)}function Lk(e,t,n,r){let i=window.getComputedStyle(e,n),a=i.getPropertyValue(`content`);if(a===``||a===`none`)return;let o=yk();try{t.className=`${t.className} ${o}`}catch{return}let s=document.createElement(`style`);s.appendChild(Ik(o,n,i,r)),t.appendChild(s)}function Rk(e,t,n){Lk(e,t,`:before`,n),Lk(e,t,`:after`,n)}var zk=`application/font-woff`,Bk=`image/jpeg`,Vk={woff:zk,woff2:zk,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:Bk,jpeg:Bk,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function Hk(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function Uk(e){return Vk[Hk(e).toLowerCase()]||``}function Wk(e){return e.split(/,/)[1]}function Gk(e){return e.search(/^(data:)/)!==-1}function Kk(e,t){return`data:${t};base64,${e}`}async function qk(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}var Jk={};function Yk(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function Xk(e,t,n){let r=Yk(e,t,n.includeQueryParams);if(Jk[r]!=null)return Jk[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=Kk(await qk(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,Wk(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return Jk[r]=i,i}async function Zk(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):Ak(t)}async function Qk(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),Ak(t.toDataURL())}let n=e.poster;return Ak(await Xk(n,Uk(n),t))}async function $k(e,t){try{if(e?.contentDocument?.body)return await lA(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function eA(e,t){return Nk(e,HTMLCanvasElement)?Zk(e):Nk(e,HTMLVideoElement)?Qk(e,t):Nk(e,HTMLIFrameElement)?$k(e,t):e.cloneNode(nA(e))}var tA=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`,nA=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SVG`;async function rA(e,t,n){if(nA(t))return t;let r=[];return r=tA(e)&&e.assignedNodes?bk(e.assignedNodes()):Nk(e,HTMLIFrameElement)&&e.contentDocument?.body?bk(e.contentDocument.body.childNodes):bk((e.shadowRoot??e).childNodes),r.length===0||Nk(e,HTMLVideoElement)||await r.reduce((e,r)=>e.then(()=>lA(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function iA(e,t,n){let r=t.style;if(!r)return;let i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Sk(n).forEach(n=>{let a=i.getPropertyValue(n);n===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Nk(e,HTMLIFrameElement)&&n===`display`&&a===`inline`&&(a=`block`),n===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),r.setProperty(n,a,i.getPropertyPriority(n))})}function aA(e,t){Nk(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Nk(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function oA(e,t){if(Nk(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function sA(e,t,n){return Nk(t,Element)&&(iA(e,t,n),Rk(e,t,n),aA(e,t),oA(e,t)),t}async function cA(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await lA(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function lA(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>eA(e,t)).then(n=>rA(e,n,t)).then(n=>sA(e,n,t)).then(e=>cA(e,t))}var uA=/url\((['"]?)([^'"]+?)\1\)/g,dA=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,fA=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function pA(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function mA(e){let t=[];return e.replace(uA,(e,n,r)=>(t.push(r),e)),t.filter(e=>!Gk(e))}async function hA(e,t,n,r,i){try{let a=n?vk(t,n):t,o=Uk(t),s;return s=i?Kk(await i(a),o):await Xk(a,o,r),e.replace(pA(t),`$1${s}$3`)}catch{}return e}function gA(e,{preferredFontFormat:t}){return t?e.replace(fA,e=>{for(;;){let[n,,r]=dA.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function _A(e){return e.search(uA)!==-1}async function vA(e,t,n){if(!_A(e))return e;let r=gA(e,n);return mA(r).reduce((e,r)=>e.then(e=>hA(e,r,t,n)),Promise.resolve(r))}async function yA(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await vA(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function bA(e,t){await yA(`background`,e,t)||await yA(`background-image`,e,t),await yA(`mask`,e,t)||await yA(`-webkit-mask`,e,t)||await yA(`mask-image`,e,t)||await yA(`-webkit-mask-image`,e,t)}async function xA(e,t){let n=Nk(e,HTMLImageElement);if(!(n&&!Gk(e.src))&&!(Nk(e,SVGImageElement)&&!Gk(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await Xk(r,Uk(r),t);await new Promise((r,a)=>{e.onload=r,e.onerror=t.onImageErrorHandler?(...e)=>{try{r(t.onImageErrorHandler(...e))}catch(e){a(e)}}:a;let o=e;o.decode&&=r,o.loading===`lazy`&&(o.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function SA(e,t){let n=bk(e.childNodes).map(e=>CA(e,t));await Promise.all(n).then(()=>e)}async function CA(e,t){Nk(e,Element)&&(await bA(e,t),await xA(e,t),await SA(e,t))}function wA(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}var TA={};async function EA(e){let t=TA[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},TA[e]=t,t)}async function DA(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),qk(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function OA(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function kA(e,t){let n=[],r=[];return e.forEach(n=>{if(`cssRules`in n)try{bk(n.cssRules||[]).forEach((e,i)=>{if(e.type===CSSRule.IMPORT_RULE){let a=i+1,o=e.href,s=EA(o).then(e=>DA(e,t)).then(e=>OA(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});r.push(s)}})}catch(i){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&r.push(EA(n.href).then(e=>DA(e,t)).then(e=>OA(e).forEach(e=>{a.insertRule(e,a.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,i)}}),Promise.all(r).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{bk(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function AA(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>_A(e.style.getPropertyValue(`src`)))}async function jA(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return AA(await kA(bk(e.ownerDocument.styleSheets),t))}function MA(e){return e.trim().replace(/["']/g,``)}function NA(e){let t=new Set;function n(e){(e.style.fontFamily||getComputedStyle(e).fontFamily).split(`,`).forEach(e=>{t.add(MA(e))}),Array.from(e.children).forEach(e=>{e instanceof HTMLElement&&n(e)})}return n(e),t}async function PA(e,t){let n=await jA(e,t),r=NA(e);return(await Promise.all(n.filter(e=>r.has(MA(e.style.fontFamily))).map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return vA(e.cssText,n,t)}))).join(`
237
+ `)}async function FA(e,t){let n=t.fontEmbedCSS==null?t.skipFonts?null:await PA(e,t):t.fontEmbedCSS;if(n){let t=document.createElement(`style`),r=document.createTextNode(n);t.appendChild(r),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}}async function IA(e,t={}){let{width:n,height:r}=Ek(e,t),i=await lA(e,t,!0);return await FA(i,t),await CA(i,t),wA(i,t),await Mk(i,n,r)}async function LA(e,t={}){let{width:n,height:r}=Ek(e,t),i=await Ak(await IA(e,t)),a=document.createElement(`canvas`),o=a.getContext(`2d`),s=t.pixelRatio||Dk(),c=t.canvasWidth||n,l=t.canvasHeight||r;return a.width=c*s,a.height=l*s,t.skipAutoScale||kk(a),a.style.width=`${c}`,a.style.height=`${l}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(i,0,0,a.width,a.height),a}async function RA(e,t={}){return PA(e,t)}var zA=6,BA=class{last=performance.now();async tick(){performance.now()-this.last<=zA||(await new Promise(e=>{`requestIdleCallback`in window?requestIdleCallback(()=>e(),{timeout:100}):setTimeout(e,0)}),this.last=performance.now())}},VA=null,HA=new Map;function UA(e){let t=HA.get(e);if(t)return t;if(!VA){let e=document.createElement(`iframe`);if(e.setAttribute(`data-linear-grab`,`true`),e.style.cssText=`position:absolute;width:0;height:0;border:0;visibility:hidden`,document.body.appendChild(e),VA=e.contentDocument,!VA)return{}}let n=VA.createElement(e);VA.body.appendChild(n);let r=VA.defaultView.getComputedStyle(n),i={};for(let e=0;e<r.length;e++){let t=r[e];i[t]=r.getPropertyValue(t)}return n.remove(),HA.set(e,i),i}function WA(){try{for(let e of[`div`,`span`,`p`,`a`,`button`,`img`,`ul`,`li`,`svg`])UA(e)}catch{}}function GA(e){if(e.id===`linear-grab-root`)return!0;let t=e.tagName?.toLowerCase()??``;return t===`overlay-canvas`||t.startsWith(`react-grab`)||t===`script`||t===`iframe`}function KA(e,t){try{let n=document.createElement(`canvas`);n.width=e.naturalWidth||e.width||1,n.height=e.naturalHeight||e.height||1,n.getContext(`2d`).drawImage(e,0,0),t.src=n.toDataURL(`image/png`)}catch{t.removeAttribute(`src`),t.setAttribute(`style`,`${t.getAttribute(`style`)??``}background:#8b8e9822;`)}}async function qA(e,t){if(GA(e))return null;if(e instanceof SVGSVGElement)return e.cloneNode(!0);let n=e.cloneNode(!1),r=getComputedStyle(e),i=UA(e.tagName.toLowerCase()),a=``;for(let e=0;e<r.length;e++){let t=r[e],n=r.getPropertyValue(t);n&&n!==i[t]&&(a+=`${t}:${n};`)}if(n.setAttribute(`style`,a),n.removeAttribute(`class`),e instanceof HTMLImageElement&&(KA(e,n),n.removeAttribute(`srcset`),n.removeAttribute(`sizes`)),(e instanceof HTMLVideoElement||e instanceof HTMLAudioElement)&&(n.removeAttribute(`src`),n.removeAttribute(`poster`)),e.tagName===`SOURCE`)return null;if(e instanceof HTMLCanvasElement)try{let t=document.createElement(`img`);return t.setAttribute(`style`,a),t.src=e.toDataURL(),t}catch{}e instanceof HTMLInputElement&&n.setAttribute(`value`,e.value),e instanceof HTMLTextAreaElement&&(n.textContent=e.value),await t.tick();for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE)n.appendChild(r.cloneNode());else if(r.nodeType===Node.ELEMENT_NODE){let e=await qA(r,t);e&&n.appendChild(e)}return n}async function JA(e,t){let n=e.getBoundingClientRect(),r=Math.max(1,Math.ceil(n.width)),i=Math.max(1,Math.ceil(n.height)),a=await qA(e,new BA);if(!a)throw Error(`Capture root was filtered`);a.style.margin=`0`;let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${i}"><style>${t}</style><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">${new XMLSerializer().serializeToString(a)}</div></foreignObject></svg>`,s=URL.createObjectURL(new Blob([o],{type:`image/svg+xml;charset=utf-8`})),c=new Image;c.decoding=`async`,c.src=s;try{await c.decode().catch(()=>{if(!c.complete||!c.naturalWidth)throw Error(`SVG rasterize failed — a subresource in the region could not load`)})}finally{URL.revokeObjectURL(s)}let l=8192,u=Math.min(window.devicePixelRatio||1,1.5,l/r,l/i),d=document.createElement(`canvas`);d.width=Math.max(1,Math.round(r*u)),d.height=Math.max(1,Math.round(i*u));let f=d.getContext(`2d`);if(!f)throw Error(`Canvas 2d unavailable`);return f.drawImage(c,0,0,d.width,d.height),d}var YA=null;function XA(e){return YA??=RA(e).catch(()=>``),YA}function ZA(){`requestIdleCallback`in window?requestIdleCallback(()=>{WA(),XA(document.body)},{timeout:3e3}):setTimeout(()=>{WA(),XA(document.body)},1500)}var QA=4e3,$A=1e3;async function ej(e){try{if(await new Promise(e=>{requestAnimationFrame(()=>`requestIdleCallback`in window?requestIdleCallback(()=>e(void 0),{timeout:500}):setTimeout(e,80))}),!e.isConnected)return null;let t=ij(e),n=t.querySelectorAll(`*`).length;n>QA&&(t=e);let r;try{r=await JA(t,await XA(t))}catch{t!==e&&n>$A&&(t=e),r=await LA(t,{pixelRatio:Math.min(window.devicePixelRatio||1,1.5),fontEmbedCSS:await XA(t),filter:e=>{if(!(e instanceof Element))return!0;if(e.id===`linear-grab-root`)return!1;let t=e.tagName?.toLowerCase()??``;return!(t===`overlay-canvas`||t.startsWith(`react-grab`))}})}return t!==e&&aj(r,t,e),await rj(r)}catch{return null}}async function tj(e){return Promise.race([nj(e),new Promise(e=>setTimeout(()=>{console.warn(`[linear-grab] region capture timed out after 15s`),e(null)},15e3))])}async function nj(e){try{let t=e.x+e.w/2,n=e.y+e.h/2,r=document.elementFromPoint(t,n)??document.body,i=t=>{let n=t.getBoundingClientRect();return n.left<=e.x&&n.top<=e.y&&n.right>=e.x+e.w&&n.bottom>=e.y+e.h};for(;r!==document.body&&(!i(r)||r.querySelectorAll(`*`).length<1);)r=r.parentElement??document.body;let a=await JA(r,await XA(r)),o=r.getBoundingClientRect(),s=a.width/o.width,c=a.height/o.height,l=document.createElement(`canvas`);l.width=Math.max(1,Math.round(e.w*s)),l.height=Math.max(1,Math.round(e.h*c));let u=l.getContext(`2d`);return u?(u.drawImage(a,(e.x-o.left+r.scrollLeft)*s,(e.y-o.top+r.scrollTop)*c,e.w*s,e.h*c,0,0,l.width,l.height),await rj(l)):null}catch(e){return console.warn(`[linear-grab] region capture failed:`,e),null}}async function rj(e){try{if(typeof createImageBitmap==`function`&&typeof OffscreenCanvas<`u`){let t=await createImageBitmap(e);return(await LD({type:`encode-png`,bitmap:t},[t])).dataUrl}}catch{}return oj(e)}function ij(e){let t=window.innerWidth,n=window.innerHeight,r=t*n*1.7,i=e,a=e;for(;a&&a!==document.body&&a!==document.documentElement;){let o=a.getBoundingClientRect();if(o.width*o.height>r||a!==e&&(a.scrollTop>0||a.scrollLeft>0)||(i=a,o.width>=t*.55&&o.height>=n*.35))break;a=a.parentElement}return i}function aj(e,t,n){let r=e.getContext(`2d`);if(!r)return;let i=t.getBoundingClientRect(),a=n.getBoundingClientRect();if(!i.width||!i.height)return;let o=e.width/i.width,s=e.height/i.height,c=(a.left-i.left+t.scrollLeft)*o,l=(a.top-i.top+t.scrollTop)*s,u=a.width*o,d=a.height*s,f=Math.min(6*o,u/2,d/2);r.strokeStyle=`rgba(94, 106, 210, 0.35)`,r.lineWidth=8*o,r.beginPath(),r.roundRect(c,l,u,d,f),r.stroke(),r.strokeStyle=`#5e6ad2`,r.lineWidth=3*o,r.beginPath(),r.roundRect(c,l,u,d,f),r.stroke()}function oj(e){let t=e.toDataURL(`image/png`);return t.length<=25e5?t:e.toDataURL(`image/jpeg`,.85)}function sj(e){let[t,n]=e.split(`,`),r=t.match(/data:([^;]+)/)?.[1]??`image/png`,i=atob(n),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);return new Blob([a],{type:r})}var[cj,lj]=T(null),[uj,dj]=T(null);function fj(e,t){lj(e),dj(t??null)}function pj(){lj(null),dj(null)}var[mj,hj]=T(`capture`);function gj(e){hj(e)}var _j=N(`<span class="absolute inset-0 grid place-items-center">`),vj=N(`<button><span>`),yj=N(`<span role=status aria-label=Loading class="text-text-dim relative inline-block shrink-0">`),bj=N(`<span class="absolute top-0 left-1/2 rounded-full bg-current"style="animation:geist-spinner-fade 1.2s linear infinite;will-change:opacity">`),xj=N(`<input>`),Sj=N(`<textarea>`),Cj=N(`<select>`),wj=N(`<svg viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class=shrink-0><path d="M4.5 12.5a3 3 0 0 1-.4-5.97 4 4 0 0 1 7.8-.9A3.2 3.2 0 0 1 11.5 12.5h-7Z">`),Tj=N(`<svg viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class=shrink-0><rect x=1.5 y=2.5 width=13 height=9 rx=1.5></rect><path d="M5.5 14h5M8 11.5V14">`),Ej=N(`<a target=_blank rel="noopener noreferrer"><span class="min-w-0 truncate"></span><svg width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class=shrink-0><path d="M4.5 11.5 11.5 4.5M5.5 4.5h6v6">`),Dj=N(`<span class="text-text-faint text-[10.5px] leading-snug">`),Oj=N(`<label class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">`),kj=N(`<section class="flex flex-col gap-2.5"><h2 class="text-text-dim text-[11px] font-semibold tracking-wide uppercase">`),Aj=N(`<span>`),jj=N(`<span aria-hidden class="inline-block size-2 shrink-0 rounded-full">`),Mj=N(`<div class="flex flex-col items-center gap-1.5 px-4 py-10 text-center"><p class="text-text-dim text-[12px] font-medium"></p><div class="text-text-faint text-[11.5px] leading-relaxed">`),Nj=N(`<p class="bg-danger-soft text-danger rounded-md px-2.5 py-1.5 text-[11.5px] leading-snug break-words">`),Pj={primary:`bg-accent hover:bg-accent-hover text-white border-transparent disabled:bg-surface-3 disabled:text-text-faint`,ghost:`bg-surface-2 hover:bg-surface-3 text-text border-border disabled:text-text-faint disabled:hover:bg-surface-2`,danger:`bg-danger-soft hover:bg-danger/30 text-danger border-transparent`};function q(e){let[t,n]=He(e,[`variant`,`loading`,`children`,`class`,`disabled`,`title`]);return(()=>{var e=vj(),r=e.firstChild;return ft(e,Ve(n,{get"data-tip"(){return t.title||void 0},get"aria-label"(){return n[`aria-label`]??t.title},get disabled(){return t.disabled||t.loading},get class(){return`relative inline-flex h-7 cursor-pointer items-center justify-center gap-1.5 rounded-md border px-3 text-[12px] font-medium transition-colors disabled:cursor-not-allowed ${Pj[t.variant??`ghost`]} ${t.class??``}`}}),!1,!0),P(r,()=>t.children),P(e,j(M,{get when(){return t.loading},get children(){var e=_j();return P(e,j(Fj,{})),e}}),null),D(()=>st(r,`inline-flex items-center gap-1.5 ${t.loading?`invisible`:``}`)),e})()}function Fj(e){let t=()=>e.size??14,n=()=>Math.max(1,Math.round(t()*.09)),r=()=>Math.round(t()*.26);return(()=>{var e=yj();return P(e,j(We,{get each(){return Array.from({length:12},(e,t)=>t)},children:e=>(()=>{var i=bj();return dt(i,`transform`,`rotate(${e*30}deg)`),dt(i,`animation-delay`,`${(e-12)*.1}s`),D(e=>{var a=`${n()}px`,o=`${r()}px`,s=`-${n()/2}px`,c=`center ${t()/2}px`;return a!==e.e&&dt(i,`width`,e.e=a),o!==e.t&&dt(i,`height`,e.t=o),s!==e.a&&dt(i,`margin-left`,e.a=s),c!==e.o&&dt(i,`transform-origin`,e.o=c),e},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()})),D(n=>{var r=`${t()}px`,i=`${t()}px`;return r!==n.e&&dt(e,`width`,n.e=r),i!==n.t&&dt(e,`height`,n.t=i),n},{e:void 0,t:void 0}),e})()}function Ij(e){let[t,n]=He(e,[`class`]);return(()=>{var e=xj();return ft(e,Ve(n,{get class(){return`bg-surface-2 border-border focus:border-accent placeholder:text-text-faint h-7 w-full rounded-md border px-2 text-[12px] outline-none transition-colors ${t.class??``}`}}),!1,!1),e})()}function Lj(e){let[t,n]=He(e,[`class`]);return(()=>{var e=Sj();return ft(e,Ve(n,{get class(){return`bg-surface-2 border-border focus:border-accent placeholder:text-text-faint w-full resize-y rounded-md border px-2 py-1.5 text-[12px] leading-relaxed outline-none transition-colors ${t.class??``}`}}),!1,!1),e})()}function Rj(e){let[t,n]=He(e,[`class`,`children`]);return(()=>{var e=Cj();return ft(e,Ve(n,{get class(){return`bg-surface-2 border-border focus:border-accent h-7 w-full cursor-pointer rounded-md border px-1.5 text-[12px] outline-none ${t.class??``}`}}),!1,!0),P(e,()=>t.children),e})()}function zj(e){let t=e.size??11;return(()=>{var e=wj();return it(e,`width`,t),it(e,`height`,t),e})()}function Bj(e){let t=e.size??11;return(()=>{var e=Tj();return it(e,`width`,t),it(e,`height`,t),e})()}function Vj(e){return(()=>{var t=Ej(),n=t.firstChild;return P(n,()=>e.children),D(n=>{var r=e.href,i=e.title||void 0,a=`text-accent inline-flex min-w-0 items-center gap-1 text-[11px] underline-offset-2 hover:underline ${e.class??``}`;return r!==n.e&&it(t,`href`,n.e=r),i!==n.t&&it(t,`data-tip`,n.t=i),a!==n.a&&st(t,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()}function Hj(e){return(()=>{var t=Oj(),n=t.firstChild;return P(n,()=>e.label),P(t,()=>e.children,null),P(t,j(M,{get when(){return e.hint},get children(){var t=Dj();return P(t,()=>e.hint),t}}),null),t})()}function Uj(e){return(()=>{var t=kj(),n=t.firstChild;return P(n,()=>e.title),P(t,()=>e.children,null),t})()}function Wj(e){return(()=>{var t=Aj();return P(t,()=>e.children),D(n=>{var r=`bg-surface-3 text-text-dim inline-flex h-[18px] items-center gap-1 rounded-full px-2 text-[10.5px] font-medium whitespace-nowrap ${e.class??``}`,i=e.color?{color:e.color}:void 0,a=e.title||void 0;return r!==n.e&&st(t,n.e=r),n.t=ut(t,i,n.t),a!==n.a&&it(t,`data-tip`,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()}function Gj(e){return(()=>{var t=jj();return D(n=>dt(t,`background`,e.color)),t})()}function Kj(e){return(()=>{var t=Mj(),n=t.firstChild,r=n.nextSibling;return P(n,()=>e.title),P(r,()=>e.children),t})()}function qj(e){return(()=>{var t=Nj();return P(t,()=>e.message),t})()}var Jj={0:`No priority`,1:`Urgent`,2:`High`,3:`Medium`,4:`Low`};function Yj(e){let t=typeof e==`number`?e:Date.parse(e),n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}Br(),Lx(),bD();var Xj=N(`<span class="truncate font-mono">`),Zj=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M5.5 3.5 6.6 2h2.8l1.1 1.5H13A1.5 1.5 0 0 1 14.5 5v7A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12V5A1.5 1.5 0 0 1 3 3.5h2.5Z"></path><circle cx=8 cy=8.2 r=2.4>`),Qj=N(`<div class="flex flex-wrap gap-1.5"><span class="text-text-faint self-end text-[10.5px]">attached on create`),$j=N(`<div class="flex items-center justify-between gap-1.5"><span class="text-text-faint text-[11px]">Model:</span><div class="flex rounded-md border border-border overflow-hidden">`),eM=N(`<span class="inline-block min-w-[12ch] text-center">`),tM=N(`<div class="flex justify-end">`),nM=N(`<div class="flex flex-col gap-1.5">`),rM=N(`<p class="text-text-faint text-[11px] leading-snug">Primary provider failed — drafted with <span class=text-text-dim></span> (<!>).`),iM=N(`<div class="border-warn/40 bg-surface rounded-md border px-2.5 py-2"><p class="text-warn mb-1 text-[10.5px] font-semibold tracking-wide uppercase">Possibly related — check before creating`),aM=N(`<div class="flex flex-col gap-1">`),oM=N(`<option value>Select a team…`),sM=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Evidence</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5"></div><span class="text-text-faint text-[10.5px] leading-snug">`),cM=N(`<option value=cursor> — cloud agent`),lM=N(`<option value=local>Local Claude Code (bridge)`),uM=N(`<option value=none>No one — just create the issue`),dM=N(`<span class="text-text-dim font-medium">`),fM=N(`<span class="text-text-faint text-[10.5px] leading-snug">`),pM=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Local session</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5">`),mM=N(`<option value>Claude Code default`),hM=N(`<option value=claude-fable-5-1>Fable 5.1`),gM=N(`<option value=fable>Fable 5`),_M=N(`<option value=opus>Opus`),vM=N(`<option value=sonnet>Sonnet`),yM=N(`<option value=haiku>Haiku`),bM=N(`<label class="flex cursor-pointer items-center gap-2 select-none"><input type=checkbox class="accent-accent rounded"><span class="text-text text-[12px]">Isolated worktree <span class=text-text-dim>— own branch, run agents in parallel safely`),xM=N(`<label class="flex items-center gap-2 cursor-pointer select-none"><input type=checkbox class="rounded accent-accent"><span class="text-[12px] text-text">Attach console errors <span class="text-text-dim tabular-nums">(<!> captured)`),SM=N(`<label class="flex items-center gap-2 cursor-pointer select-none"><input type=checkbox class="rounded accent-accent"><span class="text-[12px] text-text">Attach dev server logs <span class="text-text-dim tabular-nums">(last <!> lines)`),CM=N(`<p class="text-warn text-[11px] leading-snug">`),wM=N(`<span class="text-success text-[11px]">✓`),TM=N(`<div class="flex h-full flex-col gap-4 overflow-y-auto pt-3 pb-4 pl-3 pr-4"><div class="bg-surface border-border flex items-center gap-2 rounded-lg border px-2.5 py-2"><div class="flex min-w-0 flex-1 flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Attached context</span><div class="flex min-w-0 flex-wrap items-center gap-1.5"></div></div></div><div class="bg-bg border-border sticky bottom-0 z-10 -mb-4 flex flex-col gap-2 border-t pt-2.5 pb-3"><div class="flex items-center gap-2">`),EM=N(`<div class="border-border relative overflow-hidden rounded-md border"><img alt="Pasted attachment"class="block h-16 w-16 object-cover"><button class="bg-bg/80 text-text-dim hover:text-danger absolute top-0.5 right-0.5 grid size-4 cursor-pointer place-items-center rounded text-[10px] leading-none"title=Remove aria-label="Remove pasted image">×`),DM=N(`<button>`),OM=N(`<div class="flex min-w-0 items-center gap-1.5 py-0.5"><span class="font-mono text-text-dim shrink-0 text-[10.5px]"></span><a target=_blank rel=noreferrer class="text-accent min-w-0 truncate text-[11px] hover:underline">`),kM=N(`<div class="flex items-center gap-1"><span class="text-text-faint text-[11px] tabular-nums w-4 shrink-0 text-right">.</span><button class="text-text-faint hover:text-danger shrink-0 w-5 h-5 flex items-center justify-center rounded transition-colors cursor-pointer text-[12px] leading-none"aria-label="Remove step">×`),AM=N(`<option>`),jM=N(`<option>Loading teams…`),MM=N(`<button type=button>`),NM=N(`<div class="bg-surface border-border rounded-lg border p-2.5 flex items-center justify-between gap-2"><a target=_blank rel="noopener noreferrer"class="text-accent font-mono text-[12px] hover:underline">`),PM=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=8 height=8 rx=1.5></rect><path d="M10.5 5.5v-2a1.5 1.5 0 0 0-1.5-1.5H3.5A1.5 1.5 0 0 0 2 3.5V9a1.5 1.5 0 0 0 1.5 1.5h2">`);function FM(e){sr();let t=_r(()=>({queryKey:[`grab`],queryFn:Dr})),n=_r(()=>({queryKey:[`settings`],queryFn:Tr})),r=k(()=>n.data??{}),i=k(()=>t.data?.[0]??null),a=k(()=>!!(r().linearApiKey||r().linearAccessToken)),o=k(()=>Mx(r())),[s,c]=br(`draft:title`,``),[l,u]=br(`draft:description`,``),[d,f]=br(`draft:steps`,[]),[p,m]=br(`draft:expected`,``),[h,g]=br(`draft:actual`,``),[_,v]=br(`draft:impact`,``),[y,b]=br(`draft:analysis`,``),[x,S]=br(`draft:next-steps`,``),[C,w]=br(`draft:priority`,0),[E,ee]=T(r().defaultTeamId??``),[te,A]=T(r().defaultRepo??``),[ne,re]=br(`draft:target`,`none`),[ie,oe]=br(`draft:evidence`,``),se=k(()=>ie()||r().defaultEvidence||`video`),[ce,le]=br(`draft:local-mode`,`new`),ue=_r(()=>({queryKey:[`bridge-running-sessions`],queryFn:BO,enabled:ne()===`local`&&ce()===`queue`,refetchInterval:1e4,retry:0})),[de,fe]=br(`draft:local-model`,``),[pe,me]=br(`draft:cloud-model`,``),[he,ge]=br(`draft:worktree`,!1),[_e,ve]=T(!0),[ye,be]=T(gk().length);O(()=>{let e=setInterval(()=>be(gk().length),3e3);ae(()=>clearInterval(e))});let[xe,Se]=T(``);O(()=>{let e=s().trim(),t=setTimeout(()=>Se(e.length>=8?e:``),600);ae(()=>clearTimeout(t))});let Ce=_r(()=>({queryKey:[`dup-search`,xe()],queryFn:()=>xO(xe()),enabled:!!xe()&&a(),staleTime:3e4})),[we,Te]=br(`draft:note`,``),[Ee,De]=T([]),Oe=e=>{for(let t of Array.from(e.clipboardData?.items??[])){if(!t.type.startsWith(`image/`))continue;let e=t.getAsFile();if(!e||e.size>8e6)continue;let n=new FileReader;n.onload=()=>De(e=>[...e,{id:Date.now()+Math.random(),dataUrl:n.result}].slice(-6)),n.readAsDataURL(e)}},[ke,Ae]=T(`fast`),[je,Me]=T(!0),Ne=!1;O(()=>{let e=n.data;Ne||!e||(Ne=!0,ee(e.defaultTeamId??``),A(e.defaultRepo??``),re(e.cursorAgentId?`cursor`:`none`))});let Pe=_r(()=>({queryKey:[`teams`],queryFn:mO,enabled:a()})),Fe=k(()=>(Pe.data??[]).find(e=>e.id===E())?.name),[Ie,Le]=T(!1),Re=async()=>{let e=gD({description:l(),reproSteps:d(),expected:p(),actual:h(),impact:_(),analysisNotes:y(),suggestedNextSteps:x(),grabs:t.data??[]}),n=`Fix this issue in the current repo. Test the change hands-on before calling it done.\n\n# ${s().trim()||`Issue`}\n\n${e}`;try{await navigator.clipboard.writeText(n),Le(!0),setTimeout(()=>Le(!1),1800)}catch{}},[ze,Be]=T(!1),[Ve,He]=T(null),[Ue,Ke]=T(null),qe=null,Je=()=>{qe?.(),qe=null};ae(Je);let Ye=e=>{e.title!==void 0&&c(e.title),e.description!==void 0&&u(e.description),e.reproSteps!==void 0&&f(e.reproSteps),e.expected!==void 0&&m(e.expected),e.actual!==void 0&&g(e.actual),e.impact!==void 0&&v(e.impact),e.analysisNotes!==void 0&&b(e.analysisNotes),e.suggestedNextSteps!==void 0&&S(e.suggestedNextSteps),e.priority!==void 0&&w(e.priority)},Xe=async()=>{if(!o())return;Be(!0),He(null),Ke(null),Je();let e=r().logUrl&&je()?await lk({logUrl:r().logUrl,logLines:40}).catch(()=>void 0):void 0,n=_e()?_k(15):null,a=[e?`--- dev server ---\n${e}`:null,n?`--- browser console ---\n${n}`:null].filter(Boolean).join(`
229
238
 
230
- `)||void 0;ze=wD({note:be().length?`${ve()}\n\n(${be().length} pasted screenshot(s) will be attached to the issue.)`:ve(),grabbed:i()??null,grabbedList:t.data??void 0,teamName:ke(),tier:Ce(),template:dD(r()),logs:a},{onPartial:Ve,onDone:e=>{Ve(e.draft),e.fellBack&&Re({provider:e.provider,modelId:e.modelId}),Pe(!1),ze=null},onError:(e,t)=>{Ie(t===`no-provider`?`No AI provider configured — add an OpenAI or Anthropic key in Settings.`:e),Pe(!1),ze=null}})},[Ue,Ke]=T(WD());ae(GD(Ke));let qe=async()=>{let e=WD().result;if(!e)throw Error(`No recording available.`);if(e.assetUrl)return e.assetUrl;let t=await kO(e.blob,`recording-${Date.now()}.gif`);return aO(t),t},[Je,Ye]=T(null),[Xe,Ze]=T(null),[Qe,et]=T(null),tt=vr(()=>({mutationFn:async()=>{let e=hD({description:l(),reproSteps:d(),expected:p(),actual:h(),impact:_(),analysisNotes:y(),suggestedNextSteps:x(),grabs:t.data??[],repo:te(),model:se().trim()||r().cursorModel,agentInstructions:dD(r())});Ze(null);let n=[],i=WD();if(i.result&&i.attachOnCreate)try{let t=await qe();e+=`\n\n### Recording\n![Screen recording](${t})`}catch{n.push(`recording`)}let a=(t.data??[]).filter(e=>e.screenshotDataUrl).slice(0,3);for(let[t,r]of a.entries())try{let n=await kO(rj(r.screenshotDataUrl),`element-${Date.now()}-${t}.png`),i=r.componentName?`<${r.componentName}>`:r.tagName??`element`;e+=`\n\n### Element location${a.length>1?` — ${i}`:``}\n![Highlighted element in context](${n})`}catch{n.push(`screenshot${a.length>1?` ${t+1}`:``}`)}let o=be();for(let[t,r]of o.entries())try{let n=await kO(rj(r.dataUrl),`pasted-${Date.now()}-${t}.png`);e+=`${t===0?`
239
+ `)||void 0;qe=ED({note:Ee().length?`${we()}\n\n(${Ee().length} pasted screenshot(s) will be attached to the issue.)`:we(),grabbed:i()??null,grabbedList:t.data??void 0,teamName:Fe(),tier:ke(),template:fD(r(),{evidence:se()}),logs:a},{onPartial:Ye,onDone:e=>{Ye(e.draft),e.fellBack&&Ke({provider:e.provider,modelId:e.modelId}),Be(!1),qe=null},onError:(e,t)=>{He(t===`no-provider`?`No AI provider configured — add an OpenAI or Anthropic key in Settings.`:e),Be(!1),qe=null}})},[Ze,Qe]=T(KD());ae(qD(Qe));let et=async()=>{let e=KD().result;if(!e)throw Error(`No recording available.`);if(e.assetUrl)return e.assetUrl;let t=await jO(e.blob,`recording-${Date.now()}.gif`);return sO(t),t},[tt,nt]=T(null),[N,rt]=T(null),[at,ot]=T(null),ct=vr(()=>({mutationFn:async()=>{let e=gD({description:l(),reproSteps:d(),expected:p(),actual:h(),impact:_(),analysisNotes:y(),suggestedNextSteps:x(),grabs:t.data??[],repo:te(),model:pe().trim()||r().cursorModel,agentInstructions:fD(r(),{evidence:se()})});rt(null);let n=[],i=KD();if(i.result&&i.attachOnCreate)try{let t=await et();e+=`\n\n### Recording\n![Screen recording](${t})`}catch{n.push(`recording`)}let a=(t.data??[]).filter(e=>e.screenshotDataUrl).slice(0,3);for(let[t,r]of a.entries())try{let n=await jO(sj(r.screenshotDataUrl),`element-${Date.now()}-${t}.png`),i=r.componentName?`<${r.componentName}>`:r.tagName??`element`;e+=`\n\n### Element location${a.length>1?` — ${i}`:``}\n![Highlighted element in context](${n})`}catch{n.push(`screenshot${a.length>1?` ${t+1}`:``}`)}let o=Ee();for(let[t,r]of o.entries())try{let n=await jO(sj(r.dataUrl),`pasted-${Date.now()}-${t}.png`);e+=`${t===0?`
231
240
 
232
- ### Attachments`:``}\n![pasted screenshot ${t+1}](${n})`}catch{n.push(`pasted image ${t+1}`)}if(de()){let t=pk(30);t&&(e+=`\n\n### Console errors (client)\n\`\`\`\n${t}\n\`\`\``)}if(r().logUrl&&Te())try{let t=await ak(r());if(t){let n=Math.min(500,Math.max(10,r().logLines??100));e+=`\n\n### Dev server logs (last ${n} lines)\n\`\`\`\n${t}\n\`\`\``}}catch{n.push(`server logs (fetch failed — is the Log URL serving the file?)`)}if(n.length){let e=n.some(e=>!e.startsWith(`server logs`));Ze(`Skipped: ${n.join(`, `)} — issue created without ${n.length>1?`them`:`it`}.${e?" Real fix for uploads: run `npx linear-grab-bridge` in the repo (uploads relay through it) or set the GitHub fallback in Settings.":``}`)}let c=await wO({teamId:E(),title:s(),description:e,priority:C(),delegateId:ne()===`cursor`?r().cursorAgentId:void 0,projectId:r().defaultProjectId||void 0,labelIds:r().defaultLabelIds?.length?r().defaultLabelIds:void 0}),u=!1;if(ne()===`local`)try{let t=[`You are delegated Linear issue ${c.identifier} (${c.url}).`,``,e,``,`## Closeout — do ALL of this autonomously when the fix is verified (permissions are granted):`,`1. Create a branch (e.g. fix/${c.identifier.toLowerCase()}-short-slug), commit, push.`,`2. Open a PR: \`gh pr create\` — reference ${c.identifier} and ${c.url} in the body so Linear links it.`,`3. Update the Linear issue via its GraphQL API (https://api.linear.app/graphql) using the LINEAR_API_KEY env var as the Authorization header:`,` - commentCreate on issue ${c.identifier}: one-line fix summary + root cause + the PR link.`,` - Move it to review: query the team's workflowStates, then issueUpdate with the review/'In Review' stateId.`,`4. Announce the finished fix on every channel whose token appears in the instructions above (Slack chat.postMessage + files upload, Telegram sendMessage/sendVideo) — include: what was broken, the one-line fix, the Linear issue link, the PR link, and the demo recording if you made one. End with "👉 Review the PR".`].join(`
233
- `);await LO(`${c.identifier} — ${s()}`,le()?`${t}\n\nNote: you are running in an ISOLATED git worktree on a dedicated branch (already checked out) — commit and push THAT branch for the PR; do not switch back to main.`:t,{model:ie()||void 0,permissionMode:`bypassPermissions`,worktree:le(),env:r().linearApiKey?{LINEAR_API_KEY:r().linearApiKey}:void 0}),u=!0;try{let e=(await bO(E())).filter(e=>e.type===`started`).sort((e,t)=>e.position-t.position)[0];e&&await xO(c.id,e.id)}catch{}await TO(c.id,`🖥️ Delegated to **local Claude Code** on this machine (Linear Grab bridge). Live status, conversation, and steering in the panel's Local tab. The agent will post its fix summary + PR here and move this issue to review when done.`).catch(()=>{})}catch{Ze("Issue created, but the local bridge is unreachable — run `npx linear-grab-bridge` in the repo and re-delegate from the Local tab.")}let f=await tk(r(),{identifier:c.identifier,title:s(),url:c.url,summary:l(),impact:_(),repo:te()||r().defaultRepo,demoUrl:WD().result?.assetUrl,executor:ne()});return f.length&&Ze(`${f.join(` + `)} announcement failed — check the token/channel in Settings.`),{...c,localTask:u}},onSuccess:e=>{et({identifier:e.identifier,url:e.url}),Ye(null),Re(null),xe([]),ye(``),c(``),u(``),f([]),m(``),g(``),v(``),b(``),S(``),w(0),rO(),e.localTask&&cj(`local`)},onError:e=>{Ye(e.message)}})),nt=k(()=>!!s().trim()&&!!E()&&a()),N=k(()=>{let e=o();return e?kx(r(),e,Ce()):null}),rt=()=>f(e=>[...e,``]),at=e=>f(t=>t.filter((t,n)=>n!==e)),ot=(e,t)=>f(n=>n.map((n,r)=>r===e?t:n));return(()=>{var n=gM(),f=n.firstChild,T=f.firstChild.firstChild.nextSibling,O=f.nextSibling,k=O.firstChild;return P(T,j(M,{get when(){return i()},get fallback(){return j(Bj,{class:`text-text-faint`,children:`No element`})},get children(){return j(Bj,{class:`text-accent max-w-full`,get children(){var e=Kj();return P(e,(()=>{var e=$e(()=>!!i().componentName);return()=>e()?`<${i().componentName}>`:i().source?.filePath?.split(`/`).pop()??`element`})()),e}})}}),null),P(T,j(M,{get when(){return i()?.screenshotDataUrl},get children(){return j(Bj,{class:`text-success`,children:`screenshot ✓`})}}),null),P(T,j(M,{get when(){return Ue().result},get children(){return j(Bj,{get class(){return Ue().attachOnCreate?`text-success`:`text-text-faint`},get children(){return[`gif `,$e(()=>(Ue().result.durationMs/1e3).toFixed(0)),`s`,$e(()=>Ue().attachOnCreate?` ✓`:` (off)`)]}})}}),null),P(T,j(M,{get when(){return(t.data?.length??0)>1},get children(){return j(Bj,{get children(){return[`+`,$e(()=>t.data.length-1),` more`]}})}}),null),P(T,j(M,{get when(){return Ue().phase===`recording`},get children(){return j(Bj,{class:`text-danger`,children:`● recording…`})}}),null),P(f,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,title:`Manage in the Capture tab — elements, screenshots, recording`,"aria-label":`Open Capture tab`,onClick:()=>cj(`capture`),get children(){return qj()}}),null),P(n,j(zj,{title:`AI draft`,get children(){return[j(Rj,{label:`Your note`,get children(){return j(Nj,{rows:3,placeholder:`Describe the problem or change in your own words… (paste screenshots here too)`,get value(){return ve()},onInput:e=>ye(e.currentTarget.value),onPaste:Se})}}),j(M,{get when(){return be().length>0},get children(){var e=Jj(),t=e.firstChild;return P(e,j(We,{get each(){return be()},children:e=>(()=>{var t=_M(),n=t.firstChild,r=n.nextSibling;return r.$$click=()=>xe(t=>t.filter(t=>t.id!==e.id)),D(()=>it(n,`src`,e.dataUrl)),t})()}),t),e}}),(()=>{var e=Yj(),t=e.firstChild.nextSibling;return P(t,()=>[`fast`,`best`].map(e=>(()=>{var t=vM();return t.$$click=()=>we(e),P(t,e===`fast`?`Fast`:`Best`),D(()=>st(t,`h-6 px-2.5 text-[11px] font-medium transition-colors cursor-pointer ${Ce()===e?`bg-accent text-white`:`bg-surface-2 text-text-dim hover:text-text`}`)),t})())),e})(),(()=>{var e=Qj();return P(e,j(M,{get when(){return o()},get fallback(){return j(q,{variant:`ghost`,class:`w-full opacity-60 cursor-default`,disabled:!1,children:`Add an AI key in Settings`})},get children(){return j(q,{variant:`primary`,class:`w-full`,get loading(){return Ne()},onClick:He,get disabled(){return Ne()},children:`Draft with AI`})}}),null),P(e,j(M,{get when(){return N()},get children(){var e=Zj();return P(e,j(Bj,{get children(){var e=Xj();return P(e,N),e}})),e}}),null),e})(),j(M,{get when(){return Le()},get children(){var e=$j(),t=e.firstChild.nextSibling,n=t.nextSibling.nextSibling;return n.nextSibling,P(t,()=>Le().provider),P(e,()=>Le().modelId,n),e}}),j(M,{get when(){return Fe()},get children(){return j(Uj,{get message(){return Fe()}})}})]}}),O),P(n,j(zj,{title:`Issue`,get children(){return[j(Rj,{label:`Title`,get children(){return j(Mj,{class:`h-8 text-[13px] font-medium`,get value(){return s()},onInput:e=>c(e.currentTarget.value),placeholder:`Brief summary of the issue`})}}),j(M,{get when(){return(_e.data??[]).length>0},get children(){var e=eM();return e.firstChild,P(e,j(We,{get each(){return _e.data.slice(0,3)},children:e=>(()=>{var t=yM(),n=t.firstChild,r=n.nextSibling;return P(n,()=>e.identifier),P(r,()=>e.title),P(t,j(Bj,{class:`ml-auto shrink-0`,get children(){return e.state.name}}),null),D(t=>{var n=e.url,i=e.title;return n!==t.e&&it(r,`href`,t.e=n),i!==t.t&&it(r,`title`,t.t=i),t},{e:void 0,t:void 0}),t})()}),null),e}}),j(Rj,{label:`Description`,get children(){return j(Nj,{rows:6,get value(){return l()},onInput:e=>u(e.currentTarget.value),placeholder:`Markdown supported`})}}),j(Rj,{label:`Reproduction steps`,get children(){var e=tM();return P(e,j(Ge,{get each(){return d()},children:(e,t)=>(()=>{var n=bM(),r=n.firstChild,i=r.firstChild,a=r.nextSibling;return P(r,t+1,i),P(n,j(Mj,{class:`flex-1`,get value(){return e()},onInput:e=>ot(t,e.currentTarget.value),placeholder:`Step ${t+1}`}),a),a.$$click=()=>at(t),n})()}),null),P(e,j(q,{variant:`ghost`,class:`self-start h-6 px-2 text-[11px]`,onClick:rt,children:`+ Add step`}),null),e}}),j(Rj,{label:`Expected`,get children(){return j(Nj,{rows:2,get value(){return p()},onInput:e=>m(e.currentTarget.value),placeholder:`What should happen`})}}),j(Rj,{label:`Actual`,get children(){return j(Nj,{rows:2,get value(){return h()},onInput:e=>g(e.currentTarget.value),placeholder:`What actually happens`})}}),j(Rj,{label:`Impact`,get children(){return j(Nj,{rows:2,get value(){return _()},onInput:e=>v(e.currentTarget.value),placeholder:`Who/what is affected and how badly`})}}),j(Rj,{label:`Analysis / Notes`,get children(){return j(Nj,{rows:3,get value(){return y()},onInput:e=>b(e.currentTarget.value),placeholder:`- Likely root cause…`})}}),j(Rj,{label:`Suggested next steps`,get children(){return j(Nj,{rows:3,get value(){return x()},onInput:e=>S(e.currentTarget.value),placeholder:`- Concrete fix suggestion…`})}}),j(Rj,{label:`Priority`,get children(){return j(Pj,{get value(){return C()},onChange:e=>w(Number(e.currentTarget.value)),get children(){return j(We,{get each(){return Object.entries(Wj)},children:([e,t])=>(()=>{var n=xM();return n.value=e,P(n,t),n})()})}})}}),j(M,{get when(){return a()},get fallback(){return j(Uj,{message:`Connect Linear in Settings to create issues.`})},get children(){return j(Rj,{label:`Team`,get children(){return j(M,{get when(){return!Oe.isLoading},get fallback(){return j(Pj,{disabled:!0,get children(){return SM()}})},get children(){return j(Pj,{get value(){return E()},onChange:e=>ee(e.currentTarget.value),get children(){return[nM(),j(We,{get each(){return Oe.data??[]},children:e=>(()=>{var t=xM();return P(t,()=>e.name),D(()=>t.selected=e.id===E()),D(()=>t.value=e.id),t})()})]}})}})}})}}),j(Rj,{label:`Repo`,hint:`Appended as [repo=…] so Cursor works in the right repository.`,get children(){return j(Mj,{get value(){return te()},onInput:e=>A(e.currentTarget.value),placeholder:`owner/repository`})}}),j(Rj,{label:`Delegate to`,get hint(){return $e(()=>ne()===`local`)()?"Requires `npx linear-grab-bridge` running in the repo — track it in the Local tab.":ne()===`cursor`&&!r().cursorAgentId?`Pick the Cursor agent in Settings first.`:void 0},get children(){return j(Pj,{get value(){return ne()},onChange:e=>re(e.currentTarget.value),get children(){return[(()=>{var e=rM(),t=e.firstChild;return P(e,()=>r().cursorAgentName??`Cursor`,t),D(t=>{var n=!r().cursorAgentId,i=ne()===`cursor`;return n!==t.e&&(e.disabled=t.e=n),i!==t.t&&(e.selected=t.t=i),t},{e:void 0,t:void 0}),e})(),(()=>{var e=iM();return D(()=>e.selected=ne()===`local`),e})(),(()=>{var e=aM();return D(()=>e.selected=ne()===`none`),e})()]}})}}),j(M,{get when(){return ne()===`cursor`},get children(){return j(Rj,{label:`Cloud model`,get hint(){return`Sent as [model=…]. Empty = ${r().cursorModel?`your default (${r().cursorModel})`:`Cursor's default`}.`},get children(){return j(Mj,{get placeholder(){return r().cursorModel||`Cursor's default — e.g. claude-opus-4-8, composer`},get value(){return se()},onInput:e=>ce(e.currentTarget.value)})}})}}),j(M,{get when(){return ne()===`local`},get children(){return[j(Rj,{label:`Local model`,hint:`Switchable while running from the Local tab.`,get children(){return j(Pj,{get value(){return ie()},onChange:e=>oe(e.currentTarget.value),get children(){return[(()=>{var e=oM();return D(()=>e.selected=ie()===``),e})(),(()=>{var e=sM();return D(()=>e.selected=ie()===`fable`),e})(),(()=>{var e=cM();return D(()=>e.selected=ie()===`opus`),e})(),(()=>{var e=lM();return D(()=>e.selected=ie()===`sonnet`),e})(),(()=>{var e=uM();return D(()=>e.selected=ie()===`haiku`),e})()]}})}}),(()=>{var e=dM(),t=e.firstChild;return t.addEventListener(`change`,e=>ue(e.currentTarget.checked)),D(()=>t.checked=le()),e})()]}}),j(M,{get when(){return pe()>0},get children(){var e=fM(),t=e.firstChild,n=t.nextSibling.firstChild.nextSibling,r=n.firstChild.nextSibling;return r.nextSibling,t.addEventListener(`change`,e=>fe(e.currentTarget.checked)),P(n,pe,r),D(()=>t.checked=de()),e}}),j(M,{get when(){return r().logUrl},get children(){var e=pM(),t=e.firstChild,n=t.nextSibling.firstChild.nextSibling,i=n.firstChild.nextSibling;return i.nextSibling,t.addEventListener(`change`,e=>Ee(e.currentTarget.checked)),P(n,()=>Math.min(500,Math.max(10,r().logLines??100)),i),D(()=>t.checked=Te()),e}})]}}),O),P(O,j(M,{get when(){return Je()},get children(){return j(Uj,{get message(){return Je()}})}}),k),P(O,j(M,{get when(){return Xe()},get children(){var e=mM();return P(e,Xe),e}}),k),P(O,j(M,{get when(){return Qe()},children:t=>(()=>{var n=CM(),r=n.firstChild;return P(r,()=>t().identifier),P(n,j(q,{variant:`ghost`,class:`h-6 px-2 text-[11px]`,onClick:()=>{et(null),Re(null),e.onCreated()},children:`View activity`}),null),D(()=>it(r,`href`,t().url)),n})()}),k),P(k,j(q,{variant:`ghost`,class:`h-9 shrink-0 px-3`,get title(){return Ae()?`Copied!`:`Copy as a clean prompt — issue context only (no Slack/video/Linear closeout), paste into a local Claude Code session`},"aria-label":`Copy issue as prompt`,onClick:()=>void Me(),get children(){return j(M,{get when(){return Ae()},get fallback(){return wM()},get children(){return hM()}})}}),null),P(k,j(q,{variant:`primary`,class:`h-9 min-w-0 flex-1`,get loading(){return tt.isPending},get disabled(){return!nt()},onClick:()=>tt.mutate(),children:`Create issue`}),null),n})()}rt([`click`]);function EM(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await lP(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=cP(i,t,n);if(e)return e;i=n?null:i.sibling}return null}function DM(e,t){let n=0,r=0,i=0;do i=NP[e.next()],n|=(i&31)<<r,r+=5;while(i&32);let a=n&1;return n>>>=1,a&&(n=-2147483648|-n),t+n}function OM(e,t){return e.pos>=t?!1:e.peek()!==AP}function kM(e){let{length:t}=e,n=new PP(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i=DM(n,i),i<u&&(l=!1),u=i,OM(n,e)?(a=DM(n,a),o=DM(n,o),s=DM(n,s),OM(n,e)?(c=DM(n,c),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||AM(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function AM(e){e.sort(jM)}function jM(e,t){return e[0]-t[0]}var MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM,qM,JM,YM,XM,ZM,QM,$M,eN,tN,nN,rN,iN,aN,oN,sN,cN,lN,uN,dN,fN,pN,mN,hN,gN,_N,vN,yN,bN,xN,SN,CN,wN,TN,EN,DN,ON,kN,AN,jN,MN,NN,PN,FN,IN,LN,RN,zN,BN,VN,HN,UN,WN,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP,oP,sP,cP,lP,uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP,SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP,zP,BP,VP,HP,UP,WP,GP,KP,qP,JP,YP,XP,ZP,QP,$P,eF,tF,nF,rF,iF,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF,wF,TF,EF,DF,OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I,vI,yI,bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI,UI,WI,GI,KI,qI,JI,YI,XI,ZI,QI,$I,eL,tL,nL,rL,iL,aL,oL,sL,cL,lL,uL,dL,fL,pL,mL,hL,gL,_L,vL,yL,bL,xL,SL,CL,wL,TL,EL,DL,OL,kL,AL,jL,ML,NL,PL,FL,IL,LL,RL,zL,BL,VL,HL,UL,WL,GL,KL,qL,JL,YL,XL,ZL,QL,$L,eR,tR,nR,rR,iR,aR,oR,sR,cR,lR,uR,dR,fR,pR,mR=t((()=>{MM=null,NM=()=>{if(MM!==null)return MM;try{MM=window.matchMedia(`(color-gamut: p3)`).matches}catch{MM=!1}return MM},PM=NM(),FM=e=>PM?`color(display-p3 0.84 0.19 0.78 / ${e})`:`rgba(210, 57, 192, ${e})`,IM=null,LM=e=>{IM=e},RM=()=>IM,zM=e=>!IM||e!==null&&IM.contains(e),BM=e=>e,VM=`data-react-grab`,HM=`0.1.48`,UM=`var(--rg-shadow)`,WM=-1e3,GM=.95,KM=1500,qM=[`/components/ui/`,`/packages/ui/`,`/design-system/`,`/design-systems/`,`/primitives/`],JM=5e3,YM=8e3,XM=1e4,ZM=2147483647,QM=2147483645,$M=.7,eN=1e3/60,tN=.01,nN=FM(.4),rN=FM(.05),iN=FM(.5),aN=FM(.08),oN=FM(.15),sN=.2,cN=[`id`,`class`,`aria-label`,`data-testid`,`role`,`name`,`title`],lN=new Set([`id`,`data-testid`,`aria-label`,`href`,`src`,`alt`,`type`,`name`,`placeholder`,`role`,`for`,`action`,`method`,`title`,`disabled`,`checked`,`readonly`,`required`,`selected`,`open`]),uN=new Set([`a`,`code`,`pre`]),dN=new Set([`script`,`style`,`template`,`noscript`]),fN=[`Meta`,`Control`,`Shift`,`Alt`],pN=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]),mN=`data-react-grab-frozen`,hN=.5,gN=`data-react-grab-input`,_N=.5,vN=`copy`,yN=`comment`,bN=`edit`,xN=`superellipse(1.25)`,SN=.01,CN=1e3,wN={left:-9999,top:-9999},TN={left:`left center`,right:`right center`,top:`center top`,bottom:`center bottom`},EN=1e3,DN=`#00000000`,ON=`transparent`,kN=2e3,AN=`cubic-bezier(0.34, 1.56, 0.64, 1)`,jN=12e3,MN=9e3,NN=1e4,PN=8e3,FN=5e3,IN=1e3,LN=1.2,RN=-9999,new Set(`display.position.top.right.bottom.left.z-index.overflow.overflow-x.overflow-y.width.height.min-width.min-height.max-width.max-height.margin-top.margin-right.margin-bottom.margin-left.padding-top.padding-right.padding-bottom.padding-left.flex-direction.flex-wrap.justify-content.align-items.align-self.align-content.flex-grow.flex-shrink.flex-basis.order.gap.row-gap.column-gap.grid-template-columns.grid-template-rows.grid-template-areas.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-align.text-decoration-line.text-decoration-style.text-transform.text-overflow.text-shadow.white-space.word-break.overflow-wrap.vertical-align.color.background-color.background-image.background-position.background-size.background-repeat.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.box-shadow.opacity.transform.filter.backdrop-filter.object-fit.object-position`.split(`.`)),zN=e=>(e.tagName||``).toLowerCase(),VN=()=>{if(BN!==void 0)return BN;let e=document.querySelector(`script[nonce], style[nonce]`),t=e?.nonce||e?.getAttribute(`nonce`)||null;return t&&(BN=t),t},HN=[[`data-rr-block`,``],[`data-rr-ignore`,``],[`data-rr-mask`,``],[`data-sentry-block`,``],[`data-sentry-ignore`,``],[`data-sentry-mask`,``],[`data-dd-privacy`,`hidden`],[`data-fs-exclude`,``],[`data-lr-exclude`,``],[`data-hj-suppress`,``],[`data-recording-disable`,``],[`data-clarity-mask`,`true`],[`data-heap-redact-text`,``]],UN=e=>{for(let[t,n]of HN)e.setAttribute(t,n);e.setAttribute(`data-testid`,`react-grab-overlay`),e.classList.add(`ph-no-capture`)},WN=`bippy-0.5.43`,GN=Object.defineProperty,KN=Object.prototype.hasOwnProperty,qN=()=>{},JN=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build`)})}catch{}},YN=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e),XN=!1,QN=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>XN?!0:(e&&typeof e.inject==`function`&&(ZN=e.inject.toString()),!!ZN?.includes(`(injected)`)),$N=new Set,eP=new Set,tP=e=>{let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:WN,checkDCE:JN,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),eP.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,$N.forEach(e=>e())),i},on:qN,onCommitFiberRoot:qN,onCommitFiberUnmount:qN,onPostCommitFiberRoot:qN,renderers:t,supportsFiber:!0,supportsFlight:!0};try{GN(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{eP.add(e),t.renderers.set(n,e)}),nP(e))}}});let t=window.hasOwnProperty,n=!1;GN(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{nP(e)}return r},nP=e=>{e&&$N.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=JN,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=WN,t._instrumentationIsActive=!1;let e=YN(t);if(e||(t.on=qN),t.renderers.size){t._instrumentationIsActive=!0,$N.forEach(e=>e());return}let n=t.inject,r=QN(t);r&&!e&&(XN=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return eP.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,$N.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||QN())&&e?.()}catch{}},rP=()=>KN.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),iP=e=>rP()?(nP(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):tP(e),aP=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`)),oP=()=>{try{aP()&&iP()}catch{}},sP=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},cP=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=cP(r,t,n);if(e)return e;r=n?null:r.sibling}return null},lP=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await lP(r,t,n);if(e)return e;r=n?null:r.sibling}return null},uP=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?uP(t.type||t.render):null},dP=e=>{let t=e;if(typeof t==`string`)return t;if(typeof t!=`function`&&!(typeof t==`object`&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=uP(t);return r&&(r.displayName||r.name)||null},fP=()=>{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return!!e?._instrumentationIsActive||YN(e)||QN(e)},pP=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let t=n.findFiberByHostInstance?.(e);if(t)return t}catch{}if(typeof e==`object`&&e){if(`_reactRootContainer`in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let t in e)if(t.startsWith(`__reactContainer$`)||t.startsWith(`__reactInternalInstance$`)||t.startsWith(`__reactFiber`))return e[t]||null}return null},mP=new Set,hP=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,gP=[`rsc://`,`file:///`,`webpack-internal://`,`webpack://`,`node:`,`turbopack://`,`metro://`,`/app-pages-browser/`,`/(app-pages-browser)/`],_P=[`<anonymous>`,`eval`,``],vP=/\.(jsx|tsx|ts|js)$/,yP=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,bP=/^\?[\w~.-]+(?:=[^&#]*)?(?:&[\w~.-]+(?:=[^&#]*)?)*$/,xP=/\(at [^)]+\)$/,SP=/(^|@)\S+:\d+/,CP=/^\s*at .*(\S+:\d+|\(native\))/m,wP=/^(eval@)?(\[native code\])?$/,TP=(e,t)=>{if(t?.includeInElement!==!1){let n=e.split(`
234
- `),r=[];for(let e of n)if(/^\s*at\s+/.test(e)){let t=OP(e,void 0)[0];t&&r.push(t)}else if(/^\s*in\s+/.test(e)){let t=e.replace(/^\s*in\s+/,``).replace(/\s*\(at .*\)$/,``);r.push({functionName:t,source:e})}else if(e.match(SP)){let t=kP(e,void 0)[0];t&&r.push(t)}return DP(r,t)}return e.match(CP)?OP(e,t):kP(e,t)},EP=e=>{if(!e.includes(`:`))return[e,void 0,void 0];let t=e.startsWith(`(`)&&/:\d+\)$/.test(e)?e.slice(1,-1):e,n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t);return n?[n[1],n[2]||void 0,n[3]||void 0]:[t,void 0,void 0]},DP=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e,OP=(e,t)=>DP(e.split(`
235
- `).filter(e=>!!e.match(CP)),t).map(e=>{let t=e;t.includes(`(eval `)&&(t=t.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));let n=t.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],``):n;let i=EP(r?r[1]:n);return{functionName:r&&n||void 0,fileName:[`eval`,`<anonymous>`].includes(i[0])?void 0:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}),kP=(e,t)=>DP(e.split(`
236
- `).filter(e=>!e.match(wP)),t).map(e=>{let t=e;if(t.includes(` > eval`)&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),!t.includes(`@`)&&!t.includes(`:`))return{functionName:t};{let e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=EP(t.replace(e,``));return{functionName:r,fileName:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}}),AP=44,jP=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,MP=new Uint8Array(64),NP=new Uint8Array(128);for(let e=0;e<jP.length;e++){let t=jP.charCodeAt(e);MP[e]=t,NP[t]=e}PP=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}},FP=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,IP=/^data:application\/json[^,]+base64,/,LP=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,RP=new Map,zP=new Map,BP=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let i=e[n];if(!i||i.length===0)return null;let a=null;for(let e of i)if(e[0]<=r)a=e;else break;if(!a||a.length<4)return null;let[,o,s,c]=a;if(o===void 0||s===void 0||c===void 0)return null;let l=t[o];return l?{columnNumber:c,fileName:l,lineNumber:s+1}:null},VP=(e,t,n)=>{if(e.sections){let r=null;for(let i of e.sections)if(t>i.offset.line||t===i.offset.line&&n>=i.offset.column)r=i;else break;if(!r)return null;let i=t-r.offset.line,a=t===r.offset.line?n-r.offset.column:n;return BP(r.map.mappings,r.map.sources,i,a)}return BP(e.mappings,e.sources,t-1,n)},HP=(e,t)=>{let n=t.split(`
237
- `),r;for(let e=n.length-1;e>=0&&!r;e--){let t=n[e].match(LP);t&&(r=t[1]||t[2])}if(!r)return null;let i=FP.test(r);if(!(IP.test(r)||i||r.startsWith(`/`))){let t=e.split(`/`);t[t.length-1]=r,r=t.join(`/`)}return r},UP=e=>({file:e.file,mappings:kM(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),WP=e=>{let t=e.sections.map(({map:e,offset:t})=>({map:{...e,mappings:kM(e.mappings)},offset:t})),n=new Set;for(let e of t)for(let t of e.map.sources)n.add(t);return{file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},GP=e=>{if(!e)return!1;let t=e.trim();if(!t)return!1;let n=t.match(FP);if(!n)return!0;let r=n[0].toLowerCase();return r===`http:`||r===`https:`},KP=async(e,t=fetch)=>{if(!GP(e))return null;let n=await t(e);if(!n.ok)return null;let r=await n.text();if(!r)return null;let i=HP(e,r);if(!i||!GP(i))return null;let a=await t(i);if(!a.ok)return null;try{let e=await a.json();return`sections`in e?WP(e):UP(e)}catch{return null}},qP=async(e,t=!0,n)=>{if(t&&RP.has(e))return RP.get(e)??null;let r=t?zP.get(e):void 0;if(r)return(await r).sourceMap;let i=KP(e,n).then(e=>({sourceMap:e,isTransientFailure:!1}),()=>({sourceMap:null,isTransientFailure:!0}));t&&zP.set(e,i);let{sourceMap:a,isTransientFailure:o}=await i;return t&&(zP.delete(e),o||RP.set(e,a)),a},JP=async(e,t=!0,n)=>await Promise.all(e.map(async e=>{if(!e.fileName)return e;let r=await qP(e.fileName,t,n);if(!r||typeof e.lineNumber!=`number`||typeof e.columnNumber!=`number`)return e;let i=VP(r,e.lineNumber,e.columnNumber);return i?{...e,source:i.fileName&&e.source?e.source.replace(e.fileName,i.fileName):e.source,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,isSymbolicated:!0}:e})),YP=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack==`string`,XP=()=>{let e=iP();for(let t of[...Array.from(eP),...Array.from(e.renderers.values())]){let e=t.currentDispatcherRef;if(e&&typeof e==`object`)return`H`in e?e.H:e.current}return null},ZP=e=>{for(let t of eP){let n=t.currentDispatcherRef;n&&typeof n==`object`&&(`H`in n?n.H=e:n.current=e)}},QP=e=>`\n in ${e}`,$P=(e,t)=>{let n=QP(e);return t&&(n+=` (at ${t})`),n},eF=!1,tF=(e,t)=>{if(!e||eF)return``;let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,eF=!0;let r=XP();ZP(null);let i=console.error,a=console.warn;console.error=()=>{},console.warn=()=>{};try{let n={DetermineComponentFrameRoot(){let n;try{if(t){let t=function(){throw Error()};if(Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){n=e}let t=e();t&&typeof t.catch==`function`&&t.catch(()=>{})}}catch(e){if(e instanceof Error&&n instanceof Error&&typeof e.stack==`string`)return[e.stack,n.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`,Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,`name`)?.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});let[r,i]=n.DetermineComponentFrameRoot();if(r&&i){let t=r.split(`
241
+ ### Attachments`:``}\n![pasted screenshot ${t+1}](${n})`}catch{n.push(`pasted image ${t+1}`)}if(_e()){let t=_k(30);t&&(e+=`\n\n### Console errors (client)\n\`\`\`\n${t}\n\`\`\``)}if(r().logUrl&&je())try{let t=await lk(r());if(t){let n=Math.min(500,Math.max(10,r().logLines??100));e+=`\n\n### Dev server logs (last ${n} lines)\n\`\`\`\n${t}\n\`\`\``}}catch{n.push(`server logs (fetch failed — is the Log URL serving the file?)`)}if(n.length){let e=n.some(e=>!e.startsWith(`server logs`));rt(`Skipped: ${n.join(`, `)} — issue created without ${n.length>1?`them`:`it`}.${e?" Real fix for uploads: run `npx linear-grab-bridge` in the repo (uploads relay through it) or set the GitHub fallback in Settings.":``}`)}let c=await EO({teamId:E(),title:s(),description:e,priority:C(),delegateId:ne()===`cursor`?r().cursorAgentId:void 0,projectId:r().defaultProjectId||void 0,labelIds:r().defaultLabelIds?.length?r().defaultLabelIds:void 0}),u=!1;if(ne()===`local`)try{let t=ce()===`queue`,n=t?`using the Linear API key from this issue's Agent instructions (if present; otherwise ask the user for one) as the Authorization header`:`using the LINEAR_API_KEY env var as the Authorization header`,i=[`You are delegated Linear issue ${c.identifier} (${c.url}).`,``,e,``,`## Closeout — do ALL of this autonomously when the fix is verified (permissions are granted):`,`1. Create a branch (e.g. fix/${c.identifier.toLowerCase()}-short-slug), commit, push.`,`2. Open a PR: \`gh pr create\` — reference ${c.identifier} and ${c.url} in the body so Linear links it.`,`3. Update the Linear issue via its GraphQL API (https://api.linear.app/graphql) ${n}:`,` - commentCreate on issue ${c.identifier}: one-line fix summary + root cause + the PR link.`,` - Move it to review: query the team's workflowStates, then issueUpdate with the review/'In Review' stateId.`,`4. Announce the finished fix on every channel whose token appears in the instructions above (Slack chat.postMessage + files upload, Telegram sendMessage/sendVideo) — include: what was broken, the one-line fix, the Linear issue link, the PR link, and the evidence you produced. End with "👉 Review the PR".`].join(`
242
+ `);if(t){let e=await VO([`[linear-grab] New Linear issue delegated to you: ${c.identifier} — ${s()} (${c.url}).`,``,`Do NOT drop what you are working on: add this issue to your task board NOW (queue it at the end, /add-todo-list-style) and pick it up when your current work completes. The full issue and closeout protocol follow.`,``,i].join(`
243
+ `));u=!0,await DO(c.id,`🖥️ Queued to the running local Claude Code session${e.name?` **${e.name}**`:``} — it adds the issue to its task board and picks it up after its current work. The agent will post its fix summary + PR here and move this issue to review when done.`).catch(()=>{})}else{await zO(`${c.identifier} — ${s()}`,he()?`${i}\n\nNote: you are running in an ISOLATED git worktree on a dedicated branch (already checked out) — commit and push THAT branch for the PR; do not switch back to main.`:i,{model:de()||void 0,permissionMode:`bypassPermissions`,worktree:he(),env:r().linearApiKey?{LINEAR_API_KEY:r().linearApiKey}:void 0}),u=!0;try{let e=(await SO(E())).filter(e=>e.type===`started`).sort((e,t)=>e.position-t.position)[0];e&&await CO(c.id,e.id)}catch{}await DO(c.id,`🖥️ Delegated to **local Claude Code** on this machine (Linear Grab bridge). Live status, conversation, and steering in the panel's Local tab. The agent will post its fix summary + PR here and move this issue to review when done.`).catch(()=>{})}}catch(e){rt(ce()===`queue`?`Issue created, but queueing to the running session failed — ${e instanceof Error?e.message:`is the bridge running and a Claude Code session open in the repo?`}`:"Issue created, but the local bridge is unreachable — run `npx linear-grab-bridge` in the repo and re-delegate from the Local tab.")}let f=await ak(r(),{identifier:c.identifier,title:s(),url:c.url,summary:l(),impact:_(),repo:te()||r().defaultRepo,demoUrl:KD().result?.assetUrl,executor:ne()});return f.length&&rt(`${f.join(` + `)} announcement failed — check the token/channel in Settings.`),{...c,localTask:u}},onSuccess:e=>{ot({identifier:e.identifier,url:e.url}),nt(null),Ke(null),De([]),Te(``),c(``),u(``),f([]),m(``),g(``),v(``),b(``),S(``),w(0),aO(),e.localTask&&fj(`local`)},onError:e=>{nt(e.message)}})),lt=k(()=>!!s().trim()&&!!E()&&a()),ut=k(()=>{let e=o();return e?kx(r(),e,ke()):null}),dt=()=>f(e=>[...e,``]),ft=e=>f(t=>t.filter((t,n)=>n!==e)),pt=(e,t)=>f(n=>n.map((n,r)=>r===e?t:n));return(()=>{var n=TM(),f=n.firstChild,T=f.firstChild.firstChild.nextSibling,O=f.nextSibling,k=O.firstChild;return P(T,j(M,{get when(){return i()},get fallback(){return j(Wj,{class:`text-text-faint`,children:`No element`})},get children(){return j(Wj,{class:`text-accent max-w-full`,get children(){var e=Xj();return P(e,(()=>{var e=$e(()=>!!i().componentName);return()=>e()?`<${i().componentName}>`:i().source?.filePath?.split(`/`).pop()??`element`})()),e}})}}),null),P(T,j(M,{get when(){return i()?.screenshotDataUrl},get children(){return j(Wj,{class:`text-success`,children:`screenshot ✓`})}}),null),P(T,j(M,{get when(){return Ze().result},get children(){return j(Wj,{get class(){return Ze().attachOnCreate?`text-success`:`text-text-faint`},get children(){return[`gif `,$e(()=>(Ze().result.durationMs/1e3).toFixed(0)),`s`,$e(()=>Ze().attachOnCreate?` ✓`:` (off)`)]}})}}),null),P(T,j(M,{get when(){return(t.data?.length??0)>1},get children(){return j(Wj,{get children(){return[`+`,$e(()=>t.data.length-1),` more`]}})}}),null),P(T,j(M,{get when(){return Ze().phase===`recording`},get children(){return j(Wj,{class:`text-danger`,children:`● recording…`})}}),null),P(f,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,title:`Manage in the Capture tab — elements, screenshots, recording`,"aria-label":`Open Capture tab`,onClick:()=>fj(`capture`),get children(){return Zj()}}),null),P(n,j(Uj,{title:`AI draft`,get children(){return[j(Hj,{label:`Your note`,get children(){return j(Lj,{rows:3,placeholder:`Describe the problem or change in your own words… (paste screenshots here too)`,get value(){return we()},onInput:e=>Te(e.currentTarget.value),onPaste:Oe})}}),j(M,{get when(){return Ee().length>0},get children(){var e=Qj(),t=e.firstChild;return P(e,j(We,{get each(){return Ee()},children:e=>(()=>{var t=EM(),n=t.firstChild,r=n.nextSibling;return r.$$click=()=>De(t=>t.filter(t=>t.id!==e.id)),D(()=>it(n,`src`,e.dataUrl)),t})()}),t),e}}),(()=>{var e=$j(),t=e.firstChild.nextSibling;return P(t,()=>[`fast`,`best`].map(e=>(()=>{var t=DM();return t.$$click=()=>Ae(e),P(t,e===`fast`?`Fast`:`Best`),D(()=>st(t,`h-6 px-2.5 text-[11px] font-medium transition-colors cursor-pointer ${ke()===e?`bg-accent text-white`:`bg-surface-2 text-text-dim hover:text-text`}`)),t})())),e})(),(()=>{var e=nM();return P(e,j(M,{get when(){return o()},get fallback(){return j(q,{variant:`ghost`,class:`w-full opacity-60 cursor-default`,disabled:!1,children:`Add an AI key in Settings`})},get children(){return j(q,{variant:`primary`,class:`w-full`,get loading(){return ze()},onClick:Xe,get disabled(){return ze()},children:`Draft with AI`})}}),null),P(e,j(M,{get when(){return ut()},get children(){var e=tM();return P(e,j(Wj,{get children(){var e=eM();return P(e,ut),e}})),e}}),null),e})(),j(M,{get when(){return Ue()},get children(){var e=rM(),t=e.firstChild.nextSibling,n=t.nextSibling.nextSibling;return n.nextSibling,P(t,()=>Ue().provider),P(e,()=>Ue().modelId,n),e}}),j(M,{get when(){return Ve()},get children(){return j(qj,{get message(){return Ve()}})}})]}}),O),P(n,j(Uj,{title:`Issue`,get children(){return[j(Hj,{label:`Title`,get children(){return j(Ij,{class:`h-8 text-[13px] font-medium`,get value(){return s()},onInput:e=>c(e.currentTarget.value),placeholder:`Brief summary of the issue`})}}),j(M,{get when(){return(Ce.data??[]).length>0},get children(){var e=iM();return e.firstChild,P(e,j(We,{get each(){return Ce.data.slice(0,3)},children:e=>(()=>{var t=OM(),n=t.firstChild,r=n.nextSibling;return P(n,()=>e.identifier),P(r,()=>e.title),P(t,j(Wj,{class:`ml-auto shrink-0`,get children(){return e.state.name}}),null),D(t=>{var n=e.url,i=e.title;return n!==t.e&&it(r,`href`,t.e=n),i!==t.t&&it(r,`title`,t.t=i),t},{e:void 0,t:void 0}),t})()}),null),e}}),j(Hj,{label:`Description`,get children(){return j(Lj,{rows:6,get value(){return l()},onInput:e=>u(e.currentTarget.value),placeholder:`Markdown supported`})}}),j(Hj,{label:`Reproduction steps`,get children(){var e=aM();return P(e,j(Ge,{get each(){return d()},children:(e,t)=>(()=>{var n=kM(),r=n.firstChild,i=r.firstChild,a=r.nextSibling;return P(r,t+1,i),P(n,j(Ij,{class:`flex-1`,get value(){return e()},onInput:e=>pt(t,e.currentTarget.value),placeholder:`Step ${t+1}`}),a),a.$$click=()=>ft(t),n})()}),null),P(e,j(q,{variant:`ghost`,class:`self-start h-6 px-2 text-[11px]`,onClick:dt,children:`+ Add step`}),null),e}}),j(Hj,{label:`Expected`,get children(){return j(Lj,{rows:2,get value(){return p()},onInput:e=>m(e.currentTarget.value),placeholder:`What should happen`})}}),j(Hj,{label:`Actual`,get children(){return j(Lj,{rows:2,get value(){return h()},onInput:e=>g(e.currentTarget.value),placeholder:`What actually happens`})}}),j(Hj,{label:`Impact`,get children(){return j(Lj,{rows:2,get value(){return _()},onInput:e=>v(e.currentTarget.value),placeholder:`Who/what is affected and how badly`})}}),j(Hj,{label:`Analysis / Notes`,get children(){return j(Lj,{rows:3,get value(){return y()},onInput:e=>b(e.currentTarget.value),placeholder:`- Likely root cause…`})}}),j(Hj,{label:`Suggested next steps`,get children(){return j(Lj,{rows:3,get value(){return x()},onInput:e=>S(e.currentTarget.value),placeholder:`- Concrete fix suggestion…`})}}),j(Hj,{label:`Priority`,get children(){return j(Rj,{get value(){return C()},onChange:e=>w(Number(e.currentTarget.value)),get children(){return j(We,{get each(){return Object.entries(Jj)},children:([e,t])=>(()=>{var n=AM();return n.value=e,P(n,t),n})()})}})}}),j(M,{get when(){return a()},get fallback(){return j(qj,{message:`Connect Linear in Settings to create issues.`})},get children(){return j(Hj,{label:`Team`,get children(){return j(M,{get when(){return!Pe.isLoading},get fallback(){return j(Rj,{disabled:!0,get children(){return jM()}})},get children(){return j(Rj,{get value(){return E()},onChange:e=>ee(e.currentTarget.value),get children(){return[oM(),j(We,{get each(){return Pe.data??[]},children:e=>(()=>{var t=AM();return P(t,()=>e.name),D(()=>t.selected=e.id===E()),D(()=>t.value=e.id),t})()})]}})}})}})}}),j(Hj,{label:`Repo`,hint:`Appended as [repo=…] so Cursor works in the right repository.`,get children(){return j(Ij,{get value(){return te()},onInput:e=>A(e.currentTarget.value),placeholder:`owner/repository`})}}),(()=>{var e=sM(),t=e.firstChild.nextSibling,n=t.nextSibling;return P(t,j(We,{each:[{id:`video`,label:`Video demo`},{id:`spec`,label:`Spec-crawler 1:1`},{id:`none`,label:`None`}],children:e=>(()=>{var t=MM();return t.$$click=()=>oe(e.id),P(t,()=>e.label),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${se()===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),P(n,(()=>{var e=$e(()=>se()===`video`);return()=>e()?`Agent records a demo video/GIF and tests with the configured test account.`:se()===`spec`?`No video — the agent proves the fix with 1:1 computed-style evidence via the spec-crawler MCP (reference vs build, frame files cited).`:`Hands-on testing only — no recorded evidence, no test-account credentials embedded.`})()),e})(),j(Hj,{label:`Delegate to`,get hint(){return $e(()=>ne()===`local`)()?"Requires `npx linear-grab-bridge` running in the repo — track it in the Local tab.":ne()===`cursor`&&!r().cursorAgentId?`Pick the Cursor agent in Settings first.`:void 0},get children(){return j(Rj,{get value(){return ne()},onChange:e=>re(e.currentTarget.value),get children(){return[(()=>{var e=cM(),t=e.firstChild;return P(e,()=>r().cursorAgentName??`Cursor`,t),D(t=>{var n=!r().cursorAgentId,i=ne()===`cursor`;return n!==t.e&&(e.disabled=t.e=n),i!==t.t&&(e.selected=t.t=i),t},{e:void 0,t:void 0}),e})(),(()=>{var e=lM();return D(()=>e.selected=ne()===`local`),e})(),(()=>{var e=uM();return D(()=>e.selected=ne()===`none`),e})()]}})}}),j(M,{get when(){return ne()===`cursor`},get children(){return j(Hj,{label:`Cloud model`,get hint(){return`Sent as [model=…]. Empty = ${r().cursorModel?`your default (${r().cursorModel})`:`Cursor's default`}.`},get children(){return j(Ij,{get placeholder(){return r().cursorModel||`Cursor's default — e.g. claude-opus-4-8, composer`},get value(){return pe()},onInput:e=>me(e.currentTarget.value)})}})}}),j(M,{get when(){return ne()===`local`},get children(){return[(()=>{var e=pM(),t=e.firstChild.nextSibling;return P(t,j(We,{each:[{id:`new`,label:`New agent session`},{id:`queue`,label:`Queue to running session`}],children:e=>(()=>{var t=MM();return t.$$click=()=>le(e.id),P(t,()=>e.label),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${ce()===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),P(e,j(M,{get when(){return ce()===`queue`},get children(){var e=fM();return P(e,j(M,{get when(){return ue.data?.length},get fallback(){return ue.isError?"Bridge unreachable — run `npx linear-grab-bridge` in the repo.":`No interactive Claude Code session detected in the repo — open one in a terminal there.`},get children(){return[`Delivers into`,` `,(()=>{var e=dM();return P(e,()=>ue.data[0].name??`pid ${ue.data[0].pid}`),e})(),` `,`— the agent queues it on its task board (/add-todo-list-style) and picks it up after its current work, keeping that session's full context.`]}})),e}}),null),e})(),j(M,{get when(){return ce()===`new`},get children(){return[j(Hj,{label:`Local model`,hint:`Switchable while running from the Local tab.`,get children(){return j(Rj,{get value(){return de()},onChange:e=>fe(e.currentTarget.value),get children(){return[(()=>{var e=mM();return D(()=>e.selected=de()===``),e})(),(()=>{var e=hM();return D(()=>e.selected=de()===`claude-fable-5-1`),e})(),(()=>{var e=gM();return D(()=>e.selected=de()===`fable`),e})(),(()=>{var e=_M();return D(()=>e.selected=de()===`opus`),e})(),(()=>{var e=vM();return D(()=>e.selected=de()===`sonnet`),e})(),(()=>{var e=yM();return D(()=>e.selected=de()===`haiku`),e})()]}})}}),(()=>{var e=bM(),t=e.firstChild;return t.addEventListener(`change`,e=>ge(e.currentTarget.checked)),D(()=>t.checked=he()),e})()]}})]}}),j(M,{get when(){return ye()>0},get children(){var e=xM(),t=e.firstChild,n=t.nextSibling.firstChild.nextSibling,r=n.firstChild.nextSibling;return r.nextSibling,t.addEventListener(`change`,e=>ve(e.currentTarget.checked)),P(n,ye,r),D(()=>t.checked=_e()),e}}),j(M,{get when(){return r().logUrl},get children(){var e=SM(),t=e.firstChild,n=t.nextSibling.firstChild.nextSibling,i=n.firstChild.nextSibling;return i.nextSibling,t.addEventListener(`change`,e=>Me(e.currentTarget.checked)),P(n,()=>Math.min(500,Math.max(10,r().logLines??100)),i),D(()=>t.checked=je()),e}})]}}),O),P(O,j(M,{get when(){return tt()},get children(){return j(qj,{get message(){return tt()}})}}),k),P(O,j(M,{get when(){return N()},get children(){var e=CM();return P(e,N),e}}),k),P(O,j(M,{get when(){return at()},children:t=>(()=>{var n=NM(),r=n.firstChild;return P(r,()=>t().identifier),P(n,j(q,{variant:`ghost`,class:`h-6 px-2 text-[11px]`,onClick:()=>{ot(null),Ke(null),e.onCreated()},children:`View activity`}),null),D(()=>it(r,`href`,t().url)),n})()}),k),P(k,j(q,{variant:`ghost`,class:`h-9 shrink-0 px-3`,get title(){return Ie()?`Copied!`:`Copy as a clean prompt — issue context only (no Slack/video/Linear closeout), paste into a local Claude Code session`},"aria-label":`Copy issue as prompt`,onClick:()=>void Re(),get children(){return j(M,{get when(){return Ie()},get fallback(){return PM()},get children(){return wM()}})}}),null),P(k,j(q,{variant:`primary`,class:`h-9 min-w-0 flex-1`,get loading(){return ct.isPending},get disabled(){return!lt()},onClick:()=>ct.mutate(),children:`Create issue`}),null),n})()}rt([`click`]);function IM(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await yP(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=vP(i,t,n);if(e)return e;i=n?null:i.sibling}return null}function LM(e,t){let n=0,r=0,i=0;do i=UP[e.next()],n|=(i&31)<<r,r+=5;while(i&32);let a=n&1;return n>>>=1,a&&(n=-2147483648|-n),t+n}function RM(e,t){return e.pos>=t?!1:e.peek()!==BP}function zM(e){let{length:t}=e,n=new WP(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i=LM(n,i),i<u&&(l=!1),u=i,RM(n,e)?(a=LM(n,a),o=LM(n,o),s=LM(n,s),RM(n,e)?(c=LM(n,c),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||BM(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function BM(e){e.sort(VM)}function VM(e,t){return e[0]-t[0]}var HM,UM,WM,GM,KM,qM,JM,YM,XM,ZM,QM,$M,eN,tN,nN,rN,iN,aN,oN,sN,cN,lN,uN,dN,fN,pN,mN,hN,gN,_N,vN,yN,bN,xN,SN,CN,wN,TN,EN,DN,ON,kN,AN,jN,MN,NN,PN,FN,IN,LN,RN,zN,BN,VN,HN,UN,WN,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP,oP,sP,cP,lP,uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP,SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP,zP,BP,VP,HP,UP,WP,GP,KP,qP,JP,YP,XP,ZP,QP,$P,eF,tF,nF,rF,iF,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF,wF,TF,EF,DF,OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I,vI,yI,bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI,UI,WI,GI,KI,qI,JI,YI,XI,ZI,QI,$I,eL,tL,nL,rL,iL,aL,oL,sL,cL,lL,uL,dL,fL,pL,mL,hL,gL,_L,vL,yL,bL,xL,SL,CL,wL,TL,EL,DL,OL,kL,AL,jL,ML,NL,PL,FL,IL,LL,RL,zL,BL,VL,HL,UL,WL,GL,KL,qL,JL,YL,XL,ZL,QL,$L,eR,tR,nR,rR,iR,aR,oR,sR,cR,lR,uR,dR,fR,pR,mR,hR,gR,_R,vR,yR,bR,xR,SR,CR,wR=t((()=>{HM=null,UM=()=>{if(HM!==null)return HM;try{HM=window.matchMedia(`(color-gamut: p3)`).matches}catch{HM=!1}return HM},WM=UM(),GM=e=>WM?`color(display-p3 0.84 0.19 0.78 / ${e})`:`rgba(210, 57, 192, ${e})`,KM=null,qM=e=>{KM=e},JM=()=>KM,YM=e=>!KM||e!==null&&KM.contains(e),XM=e=>e,ZM=`data-react-grab`,QM=`0.1.48`,$M=`var(--rg-shadow)`,eN=-1e3,tN=.95,nN=1500,rN=[`/components/ui/`,`/packages/ui/`,`/design-system/`,`/design-systems/`,`/primitives/`],iN=5e3,aN=8e3,oN=1e4,sN=2147483647,cN=2147483645,lN=.7,uN=1e3/60,dN=.01,fN=GM(.4),pN=GM(.05),mN=GM(.5),hN=GM(.08),gN=GM(.15),_N=.2,vN=[`id`,`class`,`aria-label`,`data-testid`,`role`,`name`,`title`],yN=new Set([`id`,`data-testid`,`aria-label`,`href`,`src`,`alt`,`type`,`name`,`placeholder`,`role`,`for`,`action`,`method`,`title`,`disabled`,`checked`,`readonly`,`required`,`selected`,`open`]),bN=new Set([`a`,`code`,`pre`]),xN=new Set([`script`,`style`,`template`,`noscript`]),SN=[`Meta`,`Control`,`Shift`,`Alt`],CN=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]),wN=`data-react-grab-frozen`,TN=.5,EN=`data-react-grab-input`,DN=.5,ON=`copy`,kN=`comment`,AN=`edit`,jN=`superellipse(1.25)`,MN=.01,NN=1e3,PN={left:-9999,top:-9999},FN={left:`left center`,right:`right center`,top:`center top`,bottom:`center bottom`},IN=1e3,LN=`#00000000`,RN=`transparent`,zN=2e3,BN=`cubic-bezier(0.34, 1.56, 0.64, 1)`,VN=12e3,HN=9e3,UN=1e4,WN=8e3,GN=5e3,KN=1e3,qN=1.2,JN=-9999,new Set(`display.position.top.right.bottom.left.z-index.overflow.overflow-x.overflow-y.width.height.min-width.min-height.max-width.max-height.margin-top.margin-right.margin-bottom.margin-left.padding-top.padding-right.padding-bottom.padding-left.flex-direction.flex-wrap.justify-content.align-items.align-self.align-content.flex-grow.flex-shrink.flex-basis.order.gap.row-gap.column-gap.grid-template-columns.grid-template-rows.grid-template-areas.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-align.text-decoration-line.text-decoration-style.text-transform.text-overflow.text-shadow.white-space.word-break.overflow-wrap.vertical-align.color.background-color.background-image.background-position.background-size.background-repeat.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.box-shadow.opacity.transform.filter.backdrop-filter.object-fit.object-position`.split(`.`)),YN=e=>(e.tagName||``).toLowerCase(),ZN=()=>{if(XN!==void 0)return XN;let e=document.querySelector(`script[nonce], style[nonce]`),t=e?.nonce||e?.getAttribute(`nonce`)||null;return t&&(XN=t),t},QN=[[`data-rr-block`,``],[`data-rr-ignore`,``],[`data-rr-mask`,``],[`data-sentry-block`,``],[`data-sentry-ignore`,``],[`data-sentry-mask`,``],[`data-dd-privacy`,`hidden`],[`data-fs-exclude`,``],[`data-lr-exclude`,``],[`data-hj-suppress`,``],[`data-recording-disable`,``],[`data-clarity-mask`,`true`],[`data-heap-redact-text`,``]],$N=e=>{for(let[t,n]of QN)e.setAttribute(t,n);e.setAttribute(`data-testid`,`react-grab-overlay`),e.classList.add(`ph-no-capture`)},eP=`bippy-0.5.43`,tP=Object.defineProperty,nP=Object.prototype.hasOwnProperty,rP=()=>{},iP=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build`)})}catch{}},aP=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e),oP=!1,cP=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>oP?!0:(e&&typeof e.inject==`function`&&(sP=e.inject.toString()),!!sP?.includes(`(injected)`)),lP=new Set,uP=new Set,dP=e=>{let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:eP,checkDCE:iP,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),uP.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,lP.forEach(e=>e())),i},on:rP,onCommitFiberRoot:rP,onCommitFiberUnmount:rP,onPostCommitFiberRoot:rP,renderers:t,supportsFiber:!0,supportsFlight:!0};try{tP(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{uP.add(e),t.renderers.set(n,e)}),fP(e))}}});let t=window.hasOwnProperty,n=!1;tP(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{fP(e)}return r},fP=e=>{e&&lP.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=iP,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=eP,t._instrumentationIsActive=!1;let e=aP(t);if(e||(t.on=rP),t.renderers.size){t._instrumentationIsActive=!0,lP.forEach(e=>e());return}let n=t.inject,r=cP(t);r&&!e&&(oP=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return uP.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,lP.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||cP())&&e?.()}catch{}},pP=()=>nP.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),mP=e=>pP()?(fP(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):dP(e),hP=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`)),gP=()=>{try{hP()&&mP()}catch{}},_P=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},vP=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=vP(r,t,n);if(e)return e;r=n?null:r.sibling}return null},yP=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await yP(r,t,n);if(e)return e;r=n?null:r.sibling}return null},bP=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?bP(t.type||t.render):null},xP=e=>{let t=e;if(typeof t==`string`)return t;if(typeof t!=`function`&&!(typeof t==`object`&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=bP(t);return r&&(r.displayName||r.name)||null},SP=()=>{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return!!e?._instrumentationIsActive||aP(e)||cP(e)},CP=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let t=n.findFiberByHostInstance?.(e);if(t)return t}catch{}if(typeof e==`object`&&e){if(`_reactRootContainer`in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let t in e)if(t.startsWith(`__reactContainer$`)||t.startsWith(`__reactInternalInstance$`)||t.startsWith(`__reactFiber`))return e[t]||null}return null},wP=new Set,TP=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,EP=[`rsc://`,`file:///`,`webpack-internal://`,`webpack://`,`node:`,`turbopack://`,`metro://`,`/app-pages-browser/`,`/(app-pages-browser)/`],DP=[`<anonymous>`,`eval`,``],OP=/\.(jsx|tsx|ts|js)$/,kP=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,AP=/^\?[\w~.-]+(?:=[^&#]*)?(?:&[\w~.-]+(?:=[^&#]*)?)*$/,jP=/\(at [^)]+\)$/,MP=/(^|@)\S+:\d+/,NP=/^\s*at .*(\S+:\d+|\(native\))/m,PP=/^(eval@)?(\[native code\])?$/,FP=(e,t)=>{if(t?.includeInElement!==!1){let n=e.split(`
244
+ `),r=[];for(let e of n)if(/^\s*at\s+/.test(e)){let t=RP(e,void 0)[0];t&&r.push(t)}else if(/^\s*in\s+/.test(e)){let t=e.replace(/^\s*in\s+/,``).replace(/\s*\(at .*\)$/,``);r.push({functionName:t,source:e})}else if(e.match(MP)){let t=zP(e,void 0)[0];t&&r.push(t)}return LP(r,t)}return e.match(NP)?RP(e,t):zP(e,t)},IP=e=>{if(!e.includes(`:`))return[e,void 0,void 0];let t=e.startsWith(`(`)&&/:\d+\)$/.test(e)?e.slice(1,-1):e,n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t);return n?[n[1],n[2]||void 0,n[3]||void 0]:[t,void 0,void 0]},LP=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e,RP=(e,t)=>LP(e.split(`
245
+ `).filter(e=>!!e.match(NP)),t).map(e=>{let t=e;t.includes(`(eval `)&&(t=t.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));let n=t.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],``):n;let i=IP(r?r[1]:n);return{functionName:r&&n||void 0,fileName:[`eval`,`<anonymous>`].includes(i[0])?void 0:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}),zP=(e,t)=>LP(e.split(`
246
+ `).filter(e=>!e.match(PP)),t).map(e=>{let t=e;if(t.includes(` > eval`)&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),!t.includes(`@`)&&!t.includes(`:`))return{functionName:t};{let e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=IP(t.replace(e,``));return{functionName:r,fileName:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}}),BP=44,VP=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,HP=new Uint8Array(64),UP=new Uint8Array(128);for(let e=0;e<VP.length;e++){let t=VP.charCodeAt(e);HP[e]=t,UP[t]=e}WP=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}},GP=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,KP=/^data:application\/json[^,]+base64,/,qP=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,JP=new Map,YP=new Map,XP=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let i=e[n];if(!i||i.length===0)return null;let a=null;for(let e of i)if(e[0]<=r)a=e;else break;if(!a||a.length<4)return null;let[,o,s,c]=a;if(o===void 0||s===void 0||c===void 0)return null;let l=t[o];return l?{columnNumber:c,fileName:l,lineNumber:s+1}:null},ZP=(e,t,n)=>{if(e.sections){let r=null;for(let i of e.sections)if(t>i.offset.line||t===i.offset.line&&n>=i.offset.column)r=i;else break;if(!r)return null;let i=t-r.offset.line,a=t===r.offset.line?n-r.offset.column:n;return XP(r.map.mappings,r.map.sources,i,a)}return XP(e.mappings,e.sources,t-1,n)},QP=(e,t)=>{let n=t.split(`
247
+ `),r;for(let e=n.length-1;e>=0&&!r;e--){let t=n[e].match(qP);t&&(r=t[1]||t[2])}if(!r)return null;let i=GP.test(r);if(!(KP.test(r)||i||r.startsWith(`/`))){let t=e.split(`/`);t[t.length-1]=r,r=t.join(`/`)}return r},$P=e=>({file:e.file,mappings:zM(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),eF=e=>{let t=e.sections.map(({map:e,offset:t})=>({map:{...e,mappings:zM(e.mappings)},offset:t})),n=new Set;for(let e of t)for(let t of e.map.sources)n.add(t);return{file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},tF=e=>{if(!e)return!1;let t=e.trim();if(!t)return!1;let n=t.match(GP);if(!n)return!0;let r=n[0].toLowerCase();return r===`http:`||r===`https:`},nF=async(e,t=fetch)=>{if(!tF(e))return null;let n=await t(e);if(!n.ok)return null;let r=await n.text();if(!r)return null;let i=QP(e,r);if(!i||!tF(i))return null;let a=await t(i);if(!a.ok)return null;try{let e=await a.json();return`sections`in e?eF(e):$P(e)}catch{return null}},rF=async(e,t=!0,n)=>{if(t&&JP.has(e))return JP.get(e)??null;let r=t?YP.get(e):void 0;if(r)return(await r).sourceMap;let i=nF(e,n).then(e=>({sourceMap:e,isTransientFailure:!1}),()=>({sourceMap:null,isTransientFailure:!0}));t&&YP.set(e,i);let{sourceMap:a,isTransientFailure:o}=await i;return t&&(YP.delete(e),o||JP.set(e,a)),a},iF=async(e,t=!0,n)=>await Promise.all(e.map(async e=>{if(!e.fileName)return e;let r=await rF(e.fileName,t,n);if(!r||typeof e.lineNumber!=`number`||typeof e.columnNumber!=`number`)return e;let i=ZP(r,e.lineNumber,e.columnNumber);return i?{...e,source:i.fileName&&e.source?e.source.replace(e.fileName,i.fileName):e.source,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,isSymbolicated:!0}:e})),aF=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack==`string`,oF=()=>{let e=mP();for(let t of[...Array.from(uP),...Array.from(e.renderers.values())]){let e=t.currentDispatcherRef;if(e&&typeof e==`object`)return`H`in e?e.H:e.current}return null},sF=e=>{for(let t of uP){let n=t.currentDispatcherRef;n&&typeof n==`object`&&(`H`in n?n.H=e:n.current=e)}},cF=e=>`\n in ${e}`,lF=(e,t)=>{let n=cF(e);return t&&(n+=` (at ${t})`),n},uF=!1,dF=(e,t)=>{if(!e||uF)return``;let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,uF=!0;let r=oF();sF(null);let i=console.error,a=console.warn;console.error=()=>{},console.warn=()=>{};try{let n={DetermineComponentFrameRoot(){let n;try{if(t){let t=function(){throw Error()};if(Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){n=e}let t=e();t&&typeof t.catch==`function`&&t.catch(()=>{})}}catch(e){if(e instanceof Error&&n instanceof Error&&typeof e.stack==`string`)return[e.stack,n.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`,Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,`name`)?.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});let[r,i]=n.DetermineComponentFrameRoot();if(r&&i){let t=r.split(`
238
248
  `),n=i.split(`
239
- `),a=0,o=0;for(;a<t.length&&!t[a].includes(`DetermineComponentFrameRoot`);)a++;for(;o<n.length&&!n[o].includes(`DetermineComponentFrameRoot`);)o++;if(a===t.length||o===n.length)for(a=t.length-1,o=n.length-1;a>=1&&o>=0&&t[a]!==n[o];)o--;for(;a>=1&&o>=0;a--,o--)if(t[a]!==n[o]){if(a!==1||o!==1)do if(a--,o--,o<0||t[a]!==n[o]){let n=`\n${t[a].replace(` at new `,` at `)}`,r=dP(e);return r&&n.includes(`<anonymous>`)&&(n=n.replace(`<anonymous>`,r)),n}while(a>=1&&o>=0);break}}}finally{eF=!1,Error.prepareStackTrace=n,ZP(r),console.error=i,console.warn=a}let o=e?dP(e):``;return o?QP(o):``},nF=(e,t)=>{let n=e.tag,r=``;switch(n){case 28:r=QP(`Activity`);break;case 1:r=tF(e.type,!0);break;case 11:r=tF(e.type.render,!1);break;case 0:case 15:r=tF(e.type,!1);break;case 5:case 26:case 27:r=QP(e.type);break;case 16:r=QP(`Lazy`);break;case 13:r=e.child!==t&&t!==null?QP(`Suspense Fallback`):QP(`Suspense`);break;case 19:r=QP(`SuspenseList`);break;case 30:r=QP(`ViewTransition`);break;default:return``}return r},rF=e=>{try{let t=``,n=e,r=null;do{t+=nF(n,r);let e=n._debugInfo;if(e&&Array.isArray(e))for(let n=e.length-1;n>=0;n--){let r=e[n];typeof r.name==`string`&&(t+=$P(r.name,r.env))}r=n,n=n.return}while(n);return t}catch(e){return e instanceof Error?`\nError generating stack: ${e.message}\n${e.stack}`:``}},iF=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return``;Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
249
+ `),a=0,o=0;for(;a<t.length&&!t[a].includes(`DetermineComponentFrameRoot`);)a++;for(;o<n.length&&!n[o].includes(`DetermineComponentFrameRoot`);)o++;if(a===t.length||o===n.length)for(a=t.length-1,o=n.length-1;a>=1&&o>=0&&t[a]!==n[o];)o--;for(;a>=1&&o>=0;a--,o--)if(t[a]!==n[o]){if(a!==1||o!==1)do if(a--,o--,o<0||t[a]!==n[o]){let n=`\n${t[a].replace(` at new `,` at `)}`,r=xP(e);return r&&n.includes(`<anonymous>`)&&(n=n.replace(`<anonymous>`,r)),n}while(a>=1&&o>=0);break}}}finally{uF=!1,Error.prepareStackTrace=n,sF(r),console.error=i,console.warn=a}let o=e?xP(e):``;return o?cF(o):``},fF=(e,t)=>{let n=e.tag,r=``;switch(n){case 28:r=cF(`Activity`);break;case 1:r=dF(e.type,!0);break;case 11:r=dF(e.type.render,!1);break;case 0:case 15:r=dF(e.type,!1);break;case 5:case 26:case 27:r=cF(e.type);break;case 16:r=cF(`Lazy`);break;case 13:r=e.child!==t&&t!==null?cF(`Suspense Fallback`):cF(`Suspense`);break;case 19:r=cF(`SuspenseList`);break;case 30:r=cF(`ViewTransition`);break;default:return``}return r},pF=e=>{try{let t=``,n=e,r=null;do{t+=fF(n,r);let e=n._debugInfo;if(e&&Array.isArray(e))for(let n=e.length-1;n>=0;n--){let r=e[n];typeof r.name==`string`&&(t+=lF(r.name,r.env))}r=n,n=n.return}while(n);return t}catch(e){return e instanceof Error?`\nError generating stack: ${e.message}\n${e.stack}`:``}},mF=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return``;Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
240
250
  `)&&(n=n.slice(29));let r=n.indexOf(`
241
251
  `);if(r!==-1&&(n=n.slice(r+1)),r=Math.max(n.indexOf(`react_stack_bottom_frame`),n.indexOf(`react-stack-bottom-frame`)),r!==-1&&(r=n.lastIndexOf(`
242
- `,r)),r!==-1)n=n.slice(0,r);else return``;return n},aF=e=>!!(e.functionName&&e.fileName&&(e.fileName.startsWith(`rsc://`)||e.fileName.startsWith(`about://React/`))),oF=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,sF=e=>{let t=new Map;for(let n of e)for(let e of n.stackFrames){if(!aF(e))continue;let n=e.functionName,r=t.get(n)??[];r.some(t=>oF(t,e))||(r.push(e),t.set(n,r))}return t},cF=(e,t,n)=>{if(!e.functionName)return{...e,isServer:!0};let r=t.get(e.functionName);if(!r||r.length===0)return{...e,isServer:!0};let i=n.get(e.functionName)??0,a=r[i%r.length];return n.set(e.functionName,i+1),{...e,isServer:!0,fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,source:e.source?.replace(`(at Server)`,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},lF=e=>{let t=[];return EM(e,e=>{if(!YP(e))return;let n=typeof e.type==`string`?e.type:dP(e.type)||`<anonymous>`;t.push({componentName:n,stackFrames:TP(iF(e._debugStack?.stack))})},!0),t},uF=async(e,t=!0,n)=>{let r=lF(e),i=TP(rF(e)),a=sF(r),o=new Map;return JP(i.map(e=>(e.source?.includes(`(at Server)`)??!1)||e.source!=null&&xP.test(e.source)?cF(e,a,o):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName}),t,n)},dF=e=>{let t=e._debugSource;return t?typeof t==`object`&&!!t&&`fileName`in t&&typeof t.fileName==`string`&&`lineNumber`in t&&typeof t.lineNumber==`number`:!1},fF=async(e,t=!0,n)=>{if(dF(e))return e._debugSource||null;let r=await uF(e,t,n);for(let e of r)if(e.fileName)return{fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,functionName:e.functionName};return null},pF=e=>e.split(`/`).filter(Boolean).length,mF=e=>e.split(`/`).filter(Boolean)[0]??null,hF=e=>{let t=e.indexOf(`/`,1);if(t===-1||pF(e.slice(0,t))!==1)return e;let n=e.slice(t);if(!vP.test(n)||pF(n)<2)return e;let r=mF(n);return!r||r.startsWith(`@`)||r.length>4?e:n},gF=e=>{if(!e||_P.some(t=>t===e))return``;let t=e,n=t.startsWith(`http://`)||t.startsWith(`https://`);if(n)try{t=new URL(t).pathname}catch{}if(n&&(t=hF(t)),t.startsWith(`about://React/`)){let e=t.slice(14),n=e.indexOf(`/`),r=e.indexOf(`:`);t=n!==-1&&(r===-1||n<r)?e.slice(n+1):e}let r=!0;for(;r;){r=!1;for(let e of gP)if(t.startsWith(e)){t=t.slice(e.length),e===`file:///`&&(t=`/${t.replace(/^\/+/,``)}`),r=!0;break}}if(hP.test(t)){let e=t.match(hP);e&&(t=t.slice(e[0].length))}if(t.startsWith(`//`)){let e=t.indexOf(`/`,2);t=e===-1?``:t.slice(e)}let i=t.indexOf(`?`);if(i!==-1){let e=t.slice(i);bP.test(e)&&(t=t.slice(0,i))}return t},_F=e=>{let t=gF(e);return!(!t||!vP.test(t)||yP.test(t))},vF=Symbol.for(`react.context`),yF=[],bF=null,xF=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render."),SF=()=>{let e=bF;return e!==null&&(bF=e.next),e},CF=e=>e._currentValue,wF=(e,t,n,r=null)=>{yF.push({displayName:r,primitive:e,stackError:Error(),value:t,dispatcherHookName:n})},TF=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.then==`function`){let e=t;switch(e.status){case`fulfilled`:return wF(`Promise`,e.value,`Use`),e.value;case`rejected`:throw e.reason}throw wF(`Unresolved`,e,`Use`),xF}if(t.$$typeof===vF&&`_currentValue`in t){let e=t,n=CF(e);return wF(`Context (use)`,n,`Use`,e.displayName||`Context`),n}}throw Error(`An unsupported type was passed to use(): `+String(e))},EF=e=>{let t=CF(e);return wF(`Context`,t,`Context`,e.displayName||null),t},DF=e=>{let t=SF(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return wF(`State`,n,`State`),[n,()=>{}]},OF=(e,t,n)=>{let r=SF(),i=r===null?n===void 0?t:n(t):r.memoizedState;return wF(`Reducer`,i,`Reducer`),[i,()=>{}]},kF=e=>{let t=SF(),n=t===null?{current:e}:t.memoizedState;return wF(`Ref`,n.current,`Ref`),n},AF=()=>{let e=SF();return wF(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},jF=e=>{SF(),wF(`LayoutEffect`,e,`LayoutEffect`)},MF=e=>{SF(),wF(`InsertionEffect`,e,`InsertionEffect`)},NF=e=>{SF(),wF(`Effect`,e,`Effect`)},PF=e=>{SF();let t;typeof e==`object`&&e&&`current`in e&&(t=e.current),wF(`ImperativeHandle`,t,`ImperativeHandle`)},FF=(e,t)=>{wF(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},IF=e=>{let t=SF();return wF(`Callback`,t===null?e:t.memoizedState[0],`Callback`),e},LF=e=>{let t=SF(),n=t===null?e():t.memoizedState[0];return wF(`Memo`,n,`Memo`),n},RF=(e,t)=>{let n=SF();SF();let r=n===null?t():n.memoizedState;return wF(`SyncExternalStore`,r,`SyncExternalStore`),r},zF=()=>{let e=SF();SF();let t=e!==null&&e.memoizedState;return wF(`Transition`,t,`Transition`),[t,()=>{}]},BF=e=>{let t=SF(),n=t===null?e:t.memoizedState;return wF(`DeferredValue`,n,`DeferredValue`),n},VF=()=>{let e=SF(),t=e===null?``:e.memoizedState;return wF(`Id`,t,`Id`),t},HF=e=>[],UF=e=>{let t=SF(),n=t===null?e:t.memoizedState;return wF(`Optimistic`,n,`Optimistic`),[n,()=>{}]},WF=(e,t)=>{let n,r=null;if(e!==null){let t=e.memoizedState;if(typeof t==`object`&&t&&`then`in t&&typeof t.then==`function`){let e=t;switch(e.status){case`fulfilled`:n=e.value;break;case`rejected`:r=e.reason;break;default:r=xF,n=e}}else n=t}else n=t;return{value:n,error:r}},GF=e=>(t,n)=>{let r=SF();SF(),SF();let i=Error(),{value:a,error:o}=WF(r,n);if(yF.push({displayName:null,primitive:e,stackError:i,value:a,dispatcherHookName:e}),o!==null)throw o;return[a,()=>{},!1]},KF=GF(`ActionState`),qF={readContext:CF,use:TF,useCallback:IF,useContext:EF,useEffect:NF,useImperativeHandle:PF,useLayoutEffect:jF,useInsertionEffect:MF,useMemo:LF,useReducer:OF,useRef:kF,useState:DF,useDebugValue:FF,useDeferredValue:BF,useTransition:zF,useSyncExternalStore:RF,useId:VF,useHostTransitionStatus:()=>{let e=CF({_currentValue:null});return wF(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:GF(`FormState`),useActionState:KF,useOptimistic:UF,useMemoCache:HF,useCacheRefresh:AF,useEffectEvent:e=>(SF(),wF(`EffectEvent`,e,`EffectEvent`),e)},typeof Proxy>`u`||new Proxy(qF,{get(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=Error(`Missing method in Dispatcher: `+t);throw n.name=`ReactDebugToolsUnsupportedHookError`,n}}),oP(),JF=/^(?:\.\/)?\/?\([a-z][a-z0-9-]*\)\//,YF=e=>{let t=gF(e);return t=t.replace(JF,``),t.startsWith(`./`)&&(t=t.slice(2)),t},ZF=e=>(e&&(XF=void 0),XF??=typeof document<`u`&&!!(document.getElementById(`__NEXT_DATA__`)||document.querySelector(`nextjs-portal`)),XF),$F=()=>{if(QF!==void 0)return QF;let e=document.querySelector(`script[src*="/_next/"]`)?.src,t=e?new URL(e).pathname:``,n=t.indexOf(`/_next/`);return QF=n>0?t.slice(0,n):``,QF},eI=typeof window<`u`,tI=e=>0,nI=e=>{},rI=eI?(Object.getOwnPropertyDescriptor(Window.prototype,`requestAnimationFrame`)?.value??window.requestAnimationFrame).bind(window):tI,iI=eI?(Object.getOwnPropertyDescriptor(Window.prototype,`cancelAnimationFrame`)?.value??window.cancelAnimationFrame).bind(window):nI,aI=()=>eI?new Promise(e=>rI(()=>e())):Promise.resolve(),oI=(e,t=window.getComputedStyle(e))=>t.display!==`none`&&t.visibility!==`hidden`&&t.opacity!==`0`,sI=e=>{let t=zN(e);return t===`html`||t===`body`},cI=[`data-react-grab`,`data-react-grab-demo`],lI=e=>cI.some(t=>e.hasAttribute(t)),uI=e=>{if(lI(e))return!0;let t=e.getRootNode();return t instanceof ShadowRoot&&lI(t.host)},dI=e=>e.hasAttribute(`data-react-grab-ignore`)||e.closest(`[data-react-grab-ignore]`)!==null,fI=e=>{let t=parseInt(e.zIndex,10);return e.pointerEvents===`none`&&e.position===`fixed`&&!isNaN(t)&&t>=2147483600},pI=e=>{let t=e.backgroundColor;return t===`transparent`||t===`rgba(0, 0, 0, 0)`},mI=e=>{let t=e.position;if(t!==`fixed`&&t!==`absolute`)return!1;if(pI(e)||parseFloat(e.opacity)<.1)return!0;let n=parseInt(e.zIndex,10);return!isNaN(n)&&n>1e3},hI=new WeakMap,gI=()=>{hI=new WeakMap},_I=e=>{if(sI(e)||uI(e)||dI(e))return!1;let t=performance.now(),n=hI.get(e);if(n&&t-n.timestamp<50)return n.isVisible;let r=window.getComputedStyle(e);return oI(e,r)?e.clientWidth/window.innerWidth>=.9&&e.clientHeight/window.innerHeight>=.9&&(fI(r)||mI(r))?!1:(hI.set(e,{isVisible:!0,timestamp:t}),!0):(hI.set(e,{isVisible:!1,timestamp:t}),!1)},vI=(e,t)=>{let n=document.createElement(`style`);n.setAttribute(e,``);let r=VN();return r&&(n.nonce=r),UN(n),n.textContent=t,document.head.appendChild(n),n},yI=null,bI=null,xI=()=>yI!==null,SI=()=>{yI||(yI=vI(`data-react-grab-frozen-pseudo`,`html { pointer-events: none !important; }`),bI=vI(`data-react-grab-hittest-override`,`html, body { pointer-events: auto !important; }`),bI.disabled=!0)},CI=()=>{yI?.remove(),yI=null,bI?.remove(),bI=null},wI=()=>{yI&&(yI.disabled||=!0,bI?.disabled&&(bI.disabled=!1))},TI=()=>{yI&&(yI.disabled&&=!1,bI&&!bI.disabled&&(bI.disabled=!0))},EI=null,DI=null,OI=null,kI=(e,t,n)=>e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom,AI=()=>{OI!==null&&clearTimeout(OI),OI=setTimeout(()=>{OI=null,TI()},100)},jI=()=>{OI!==null&&(clearTimeout(OI),OI=null)},MI=(e,t,n,r)=>{let i=Math.abs(e-n),a=Math.abs(t-r);return i<=2&&a<=2},NI=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return[];jI(),wI();let n=document.elementsFromPoint(e,t);return AI(),RM()?n.filter(zM):n},PI=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return null;let n=performance.now();if(DI&&kI(e,t,DI.rect))return DI.element;if(EI){let r=MI(e,t,EI.clientX,EI.clientY),i=n-EI.timestamp<16;if(r||i)return EI.element}jI(),wI();let r=null,i=document.elementFromPoint(e,t);if(i&&_I(i)&&zM(i))r=i;else{let n=document.elementsFromPoint(e,t);for(let e of n)if(e!==i&&_I(e)&&zM(e)){r=e;break}}return AI(),DI=r instanceof HTMLIFrameElement?{element:r,rect:r.getBoundingClientRect()}:null,EI={clientX:e,clientY:t,element:r,timestamp:n},r},FI=()=>{jI(),TI(),EI=null,DI=null},II=async(e,t)=>{let n=ZF(),r=new URLSearchParams({file:e}),i=n?`line1`:`line`,a=n?`column1`:`column`;t&&r.set(i,String(t)),r.set(a,`1`);let o=n?`${$F()}/__nextjs_launch-editor`:`/__open-in-editor`;return(await fetch(`${o}?${r}`)).ok},LI=async(e,t,n)=>{let r=YF(e);if(await II(r,t).catch(()=>!1))return;let i=t?`&line=${t}`:``,a=`https://react-grab.com/open-file?url=${encodeURIComponent(r)}${i}`,o=n?n(a,r,t):a;window.open(o,`_blank`,`noopener,noreferrer`)},RI=!1,zI=new Map,BI=-1,VI=new WeakSet,HI=new Map,UI=new Map,WI=e=>VI.has(e)?!0:!RI||!(`gsapVersions`in window)||!(Error().stack??``).includes(`_tick`)?!1:(VI.add(e),!0),typeof window<`u`&&(window.requestAnimationFrame=e=>{if(!WI(e))return rI(e);if(RI){let t=BI--;return zI.set(t,e),t}let t=rI(n=>{if(RI){let n=BI--;zI.set(n,e),HI.set(t,n);return}e(n)});return t},window.cancelAnimationFrame=e=>{if(zI.has(e)){zI.delete(e);return}let t=UI.get(e);if(t!==void 0){iI(t.nativeId),UI.delete(e);return}let n=HI.get(e);if(n!==void 0){zI.delete(n),HI.delete(e);return}iI(e)}),GI=()=>{if(!RI){RI=!0,zI.clear(),HI.clear();for(let[e,{nativeId:t,callback:n}]of UI)iI(t),zI.set(e,n);UI.clear()}},KI=()=>{if(RI){RI=!1;for(let[e,t]of zI.entries()){let n=rI(n=>{UI.delete(e),t(n)});UI.set(e,{nativeId:n,callback:t})}zI.clear(),HI.clear()}},qI=`
243
- [${mN}],
244
- [${mN}] * {
252
+ `,r)),r!==-1)n=n.slice(0,r);else return``;return n},hF=e=>!!(e.functionName&&e.fileName&&(e.fileName.startsWith(`rsc://`)||e.fileName.startsWith(`about://React/`))),gF=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,_F=e=>{let t=new Map;for(let n of e)for(let e of n.stackFrames){if(!hF(e))continue;let n=e.functionName,r=t.get(n)??[];r.some(t=>gF(t,e))||(r.push(e),t.set(n,r))}return t},vF=(e,t,n)=>{if(!e.functionName)return{...e,isServer:!0};let r=t.get(e.functionName);if(!r||r.length===0)return{...e,isServer:!0};let i=n.get(e.functionName)??0,a=r[i%r.length];return n.set(e.functionName,i+1),{...e,isServer:!0,fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,source:e.source?.replace(`(at Server)`,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},yF=e=>{let t=[];return IM(e,e=>{if(!aF(e))return;let n=typeof e.type==`string`?e.type:xP(e.type)||`<anonymous>`;t.push({componentName:n,stackFrames:FP(mF(e._debugStack?.stack))})},!0),t},bF=async(e,t=!0,n)=>{let r=yF(e),i=FP(pF(e)),a=_F(r),o=new Map;return iF(i.map(e=>(e.source?.includes(`(at Server)`)??!1)||e.source!=null&&jP.test(e.source)?vF(e,a,o):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName}),t,n)},xF=e=>{let t=e._debugSource;return t?typeof t==`object`&&!!t&&`fileName`in t&&typeof t.fileName==`string`&&`lineNumber`in t&&typeof t.lineNumber==`number`:!1},SF=async(e,t=!0,n)=>{if(xF(e))return e._debugSource||null;let r=await bF(e,t,n);for(let e of r)if(e.fileName)return{fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,functionName:e.functionName};return null},CF=e=>e.split(`/`).filter(Boolean).length,wF=e=>e.split(`/`).filter(Boolean)[0]??null,TF=e=>{let t=e.indexOf(`/`,1);if(t===-1||CF(e.slice(0,t))!==1)return e;let n=e.slice(t);if(!OP.test(n)||CF(n)<2)return e;let r=wF(n);return!r||r.startsWith(`@`)||r.length>4?e:n},EF=e=>{if(!e||DP.some(t=>t===e))return``;let t=e,n=t.startsWith(`http://`)||t.startsWith(`https://`);if(n)try{t=new URL(t).pathname}catch{}if(n&&(t=TF(t)),t.startsWith(`about://React/`)){let e=t.slice(14),n=e.indexOf(`/`),r=e.indexOf(`:`);t=n!==-1&&(r===-1||n<r)?e.slice(n+1):e}let r=!0;for(;r;){r=!1;for(let e of EP)if(t.startsWith(e)){t=t.slice(e.length),e===`file:///`&&(t=`/${t.replace(/^\/+/,``)}`),r=!0;break}}if(TP.test(t)){let e=t.match(TP);e&&(t=t.slice(e[0].length))}if(t.startsWith(`//`)){let e=t.indexOf(`/`,2);t=e===-1?``:t.slice(e)}let i=t.indexOf(`?`);if(i!==-1){let e=t.slice(i);AP.test(e)&&(t=t.slice(0,i))}return t},DF=e=>{let t=EF(e);return!(!t||!OP.test(t)||kP.test(t))},OF=Symbol.for(`react.context`),kF=[],AF=null,jF=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render."),MF=()=>{let e=AF;return e!==null&&(AF=e.next),e},NF=e=>e._currentValue,PF=(e,t,n,r=null)=>{kF.push({displayName:r,primitive:e,stackError:Error(),value:t,dispatcherHookName:n})},FF=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.then==`function`){let e=t;switch(e.status){case`fulfilled`:return PF(`Promise`,e.value,`Use`),e.value;case`rejected`:throw e.reason}throw PF(`Unresolved`,e,`Use`),jF}if(t.$$typeof===OF&&`_currentValue`in t){let e=t,n=NF(e);return PF(`Context (use)`,n,`Use`,e.displayName||`Context`),n}}throw Error(`An unsupported type was passed to use(): `+String(e))},IF=e=>{let t=NF(e);return PF(`Context`,t,`Context`,e.displayName||null),t},LF=e=>{let t=MF(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return PF(`State`,n,`State`),[n,()=>{}]},RF=(e,t,n)=>{let r=MF(),i=r===null?n===void 0?t:n(t):r.memoizedState;return PF(`Reducer`,i,`Reducer`),[i,()=>{}]},zF=e=>{let t=MF(),n=t===null?{current:e}:t.memoizedState;return PF(`Ref`,n.current,`Ref`),n},BF=()=>{let e=MF();return PF(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},VF=e=>{MF(),PF(`LayoutEffect`,e,`LayoutEffect`)},HF=e=>{MF(),PF(`InsertionEffect`,e,`InsertionEffect`)},UF=e=>{MF(),PF(`Effect`,e,`Effect`)},WF=e=>{MF();let t;typeof e==`object`&&e&&`current`in e&&(t=e.current),PF(`ImperativeHandle`,t,`ImperativeHandle`)},GF=(e,t)=>{PF(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},KF=e=>{let t=MF();return PF(`Callback`,t===null?e:t.memoizedState[0],`Callback`),e},qF=e=>{let t=MF(),n=t===null?e():t.memoizedState[0];return PF(`Memo`,n,`Memo`),n},JF=(e,t)=>{let n=MF();MF();let r=n===null?t():n.memoizedState;return PF(`SyncExternalStore`,r,`SyncExternalStore`),r},YF=()=>{let e=MF();MF();let t=e!==null&&e.memoizedState;return PF(`Transition`,t,`Transition`),[t,()=>{}]},XF=e=>{let t=MF(),n=t===null?e:t.memoizedState;return PF(`DeferredValue`,n,`DeferredValue`),n},ZF=()=>{let e=MF(),t=e===null?``:e.memoizedState;return PF(`Id`,t,`Id`),t},QF=e=>[],$F=e=>{let t=MF(),n=t===null?e:t.memoizedState;return PF(`Optimistic`,n,`Optimistic`),[n,()=>{}]},eI=(e,t)=>{let n,r=null;if(e!==null){let t=e.memoizedState;if(typeof t==`object`&&t&&`then`in t&&typeof t.then==`function`){let e=t;switch(e.status){case`fulfilled`:n=e.value;break;case`rejected`:r=e.reason;break;default:r=jF,n=e}}else n=t}else n=t;return{value:n,error:r}},tI=e=>(t,n)=>{let r=MF();MF(),MF();let i=Error(),{value:a,error:o}=eI(r,n);if(kF.push({displayName:null,primitive:e,stackError:i,value:a,dispatcherHookName:e}),o!==null)throw o;return[a,()=>{},!1]},nI=tI(`ActionState`),rI={readContext:NF,use:FF,useCallback:KF,useContext:IF,useEffect:UF,useImperativeHandle:WF,useLayoutEffect:VF,useInsertionEffect:HF,useMemo:qF,useReducer:RF,useRef:zF,useState:LF,useDebugValue:GF,useDeferredValue:XF,useTransition:YF,useSyncExternalStore:JF,useId:ZF,useHostTransitionStatus:()=>{let e=NF({_currentValue:null});return PF(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:tI(`FormState`),useActionState:nI,useOptimistic:$F,useMemoCache:QF,useCacheRefresh:BF,useEffectEvent:e=>(MF(),PF(`EffectEvent`,e,`EffectEvent`),e)},typeof Proxy>`u`||new Proxy(rI,{get(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=Error(`Missing method in Dispatcher: `+t);throw n.name=`ReactDebugToolsUnsupportedHookError`,n}}),gP(),iI=/^(?:\.\/)?\/?\([a-z][a-z0-9-]*\)\//,aI=e=>{let t=EF(e);return t=t.replace(iI,``),t.startsWith(`./`)&&(t=t.slice(2)),t},sI=e=>(e&&(oI=void 0),oI??=typeof document<`u`&&!!(document.getElementById(`__NEXT_DATA__`)||document.querySelector(`nextjs-portal`)),oI),lI=()=>{if(cI!==void 0)return cI;let e=document.querySelector(`script[src*="/_next/"]`)?.src,t=e?new URL(e).pathname:``,n=t.indexOf(`/_next/`);return cI=n>0?t.slice(0,n):``,cI},uI=typeof window<`u`,dI=e=>0,fI=e=>{},pI=uI?(Object.getOwnPropertyDescriptor(Window.prototype,`requestAnimationFrame`)?.value??window.requestAnimationFrame).bind(window):dI,mI=uI?(Object.getOwnPropertyDescriptor(Window.prototype,`cancelAnimationFrame`)?.value??window.cancelAnimationFrame).bind(window):fI,hI=()=>uI?new Promise(e=>pI(()=>e())):Promise.resolve(),gI=(e,t=window.getComputedStyle(e))=>t.display!==`none`&&t.visibility!==`hidden`&&t.opacity!==`0`,_I=e=>{let t=YN(e);return t===`html`||t===`body`},vI=[`data-react-grab`,`data-react-grab-demo`],yI=e=>vI.some(t=>e.hasAttribute(t)),bI=e=>{if(yI(e))return!0;let t=e.getRootNode();return t instanceof ShadowRoot&&yI(t.host)},xI=e=>e.hasAttribute(`data-react-grab-ignore`)||e.closest(`[data-react-grab-ignore]`)!==null,SI=e=>{let t=parseInt(e.zIndex,10);return e.pointerEvents===`none`&&e.position===`fixed`&&!isNaN(t)&&t>=2147483600},CI=e=>{let t=e.backgroundColor;return t===`transparent`||t===`rgba(0, 0, 0, 0)`},wI=e=>{let t=e.position;if(t!==`fixed`&&t!==`absolute`)return!1;if(CI(e)||parseFloat(e.opacity)<.1)return!0;let n=parseInt(e.zIndex,10);return!isNaN(n)&&n>1e3},TI=new WeakMap,EI=()=>{TI=new WeakMap},DI=e=>{if(_I(e)||bI(e)||xI(e))return!1;let t=performance.now(),n=TI.get(e);if(n&&t-n.timestamp<50)return n.isVisible;let r=window.getComputedStyle(e);return gI(e,r)?e.clientWidth/window.innerWidth>=.9&&e.clientHeight/window.innerHeight>=.9&&(SI(r)||wI(r))?!1:(TI.set(e,{isVisible:!0,timestamp:t}),!0):(TI.set(e,{isVisible:!1,timestamp:t}),!1)},OI=(e,t)=>{let n=document.createElement(`style`);n.setAttribute(e,``);let r=ZN();return r&&(n.nonce=r),$N(n),n.textContent=t,document.head.appendChild(n),n},kI=null,AI=null,jI=()=>kI!==null,MI=()=>{kI||(kI=OI(`data-react-grab-frozen-pseudo`,`html { pointer-events: none !important; }`),AI=OI(`data-react-grab-hittest-override`,`html, body { pointer-events: auto !important; }`),AI.disabled=!0)},NI=()=>{kI?.remove(),kI=null,AI?.remove(),AI=null},PI=()=>{kI&&(kI.disabled||=!0,AI?.disabled&&(AI.disabled=!1))},FI=()=>{kI&&(kI.disabled&&=!1,AI&&!AI.disabled&&(AI.disabled=!0))},II=null,LI=null,RI=null,zI=(e,t,n)=>e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom,BI=()=>{RI!==null&&clearTimeout(RI),RI=setTimeout(()=>{RI=null,FI()},100)},VI=()=>{RI!==null&&(clearTimeout(RI),RI=null)},HI=(e,t,n,r)=>{let i=Math.abs(e-n),a=Math.abs(t-r);return i<=2&&a<=2},UI=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return[];VI(),PI();let n=document.elementsFromPoint(e,t);return BI(),JM()?n.filter(YM):n},WI=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return null;let n=performance.now();if(LI&&zI(e,t,LI.rect))return LI.element;if(II){let r=HI(e,t,II.clientX,II.clientY),i=n-II.timestamp<16;if(r||i)return II.element}VI(),PI();let r=null,i=document.elementFromPoint(e,t);if(i&&DI(i)&&YM(i))r=i;else{let n=document.elementsFromPoint(e,t);for(let e of n)if(e!==i&&DI(e)&&YM(e)){r=e;break}}return BI(),LI=r instanceof HTMLIFrameElement?{element:r,rect:r.getBoundingClientRect()}:null,II={clientX:e,clientY:t,element:r,timestamp:n},r},GI=()=>{VI(),FI(),II=null,LI=null},KI=async(e,t)=>{let n=sI(),r=new URLSearchParams({file:e}),i=n?`line1`:`line`,a=n?`column1`:`column`;t&&r.set(i,String(t)),r.set(a,`1`);let o=n?`${lI()}/__nextjs_launch-editor`:`/__open-in-editor`;return(await fetch(`${o}?${r}`)).ok},qI=async(e,t,n)=>{let r=aI(e);if(await KI(r,t).catch(()=>!1))return;let i=t?`&line=${t}`:``,a=`https://react-grab.com/open-file?url=${encodeURIComponent(r)}${i}`,o=n?n(a,r,t):a;window.open(o,`_blank`,`noopener,noreferrer`)},JI=!1,YI=new Map,XI=-1,ZI=new WeakSet,QI=new Map,$I=new Map,eL=e=>ZI.has(e)?!0:!JI||!(`gsapVersions`in window)||!(Error().stack??``).includes(`_tick`)?!1:(ZI.add(e),!0),typeof window<`u`&&(window.requestAnimationFrame=e=>{if(!eL(e))return pI(e);if(JI){let t=XI--;return YI.set(t,e),t}let t=pI(n=>{if(JI){let n=XI--;YI.set(n,e),QI.set(t,n);return}e(n)});return t},window.cancelAnimationFrame=e=>{if(YI.has(e)){YI.delete(e);return}let t=$I.get(e);if(t!==void 0){mI(t.nativeId),$I.delete(e);return}let n=QI.get(e);if(n!==void 0){YI.delete(n),QI.delete(e);return}mI(e)}),tL=()=>{if(!JI){JI=!0,YI.clear(),QI.clear();for(let[e,{nativeId:t,callback:n}]of $I)mI(t),YI.set(e,n);$I.clear()}},nL=()=>{if(JI){JI=!1;for(let[e,t]of YI.entries()){let n=pI(n=>{$I.delete(e),t(n)});$I.set(e,{nativeId:n,callback:t})}YI.clear(),QI.clear()}},rL=`
253
+ [${wN}],
254
+ [${wN}] * {
245
255
  animation-play-state: paused !important;
246
256
  transition: none !important;
247
257
  }
248
- `,JI=null,YI=[],XI=[],ZI=[],QI=null,$I=[],eL=[],tL=!1,nL=new Map,rL=[],iL=()=>{JI||=vI(`data-react-grab-frozen-styles`,qI)},aL=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),oL=e=>{let t=new Set;for(let n of e){n instanceof SVGSVGElement?t.add(n):n instanceof SVGElement&&n.ownerSVGElement&&t.add(n.ownerSVGElement);for(let e of n.querySelectorAll(`svg`))e instanceof SVGSVGElement&&t.add(e)}return[...t]},sL=(e,t)=>{let n=Reflect.get(e,t);typeof n==`function`&&n.call(e)},cL=e=>{for(let t of e){let e=nL.get(t)??0;e===0&&sL(t,`pauseAnimations`),nL.set(t,e+1)}},lL=e=>{for(let t of e){let e=nL.get(t);if(e){if(e===1){nL.delete(t),sL(t,`unpauseAnimations`);continue}nL.set(t,e-1)}}},uL=e=>{let t=[];for(let n of e)for(let e of n.getAnimations({subtree:!0}))e.playState===`running`&&t.push(e);return t},dL=e=>{for(let t of e)try{t.finish()}catch{}},fL=e=>{if(!(e.effect instanceof KeyframeEffect))return!1;let t=e.effect.target;return t instanceof Element&&t.getRootNode()instanceof ShadowRoot},pL=e=>{if(e.length!==0&&!aL(e,ZI)){mL(),ZI=[...e],iL(),YI=e,XI=oL(YI),cL(XI);for(let e of YI)e.setAttribute(mN,``);rL=uL(YI);for(let e of rL)e.pause()}},mL=()=>{if(!(YI.length===0&&XI.length===0&&rL.length===0)){for(let e of YI)e.removeAttribute(mN);lL(XI),dL(rL),YI=[],XI=[],rL=[],ZI=[]}},hL=e=>e.length===0?(mL(),()=>{}):(pL(e),mL),gL=()=>{if(QI)return[];let e=[];for(let t of document.getAnimations())fL(t)||t.playState===`running`&&e.push(t);return e},_L=e=>{if(!QI){if(QI=vI(`data-react-grab-global-freeze`,``),e.length>200)QI.textContent=`
258
+ `,iL=null,aL=[],oL=[],sL=[],cL=null,lL=[],uL=[],dL=!1,fL=new Map,pL=[],mL=()=>{iL||=OI(`data-react-grab-frozen-styles`,rL)},hL=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),gL=e=>{let t=new Set;for(let n of e){n instanceof SVGSVGElement?t.add(n):n instanceof SVGElement&&n.ownerSVGElement&&t.add(n.ownerSVGElement);for(let e of n.querySelectorAll(`svg`))e instanceof SVGSVGElement&&t.add(e)}return[...t]},_L=(e,t)=>{let n=Reflect.get(e,t);typeof n==`function`&&n.call(e)},vL=e=>{for(let t of e){let e=fL.get(t)??0;e===0&&_L(t,`pauseAnimations`),fL.set(t,e+1)}},yL=e=>{for(let t of e){let e=fL.get(t);if(e){if(e===1){fL.delete(t),_L(t,`unpauseAnimations`);continue}fL.set(t,e-1)}}},bL=e=>{let t=[];for(let n of e)for(let e of n.getAnimations({subtree:!0}))e.playState===`running`&&t.push(e);return t},xL=e=>{for(let t of e)try{t.finish()}catch{}},SL=e=>{if(!(e.effect instanceof KeyframeEffect))return!1;let t=e.effect.target;return t instanceof Element&&t.getRootNode()instanceof ShadowRoot},CL=e=>{if(e.length!==0&&!hL(e,sL)){wL(),sL=[...e],mL(),aL=e,oL=gL(aL),vL(oL);for(let e of aL)e.setAttribute(wN,``);pL=bL(aL);for(let e of pL)e.pause()}},wL=()=>{if(!(aL.length===0&&oL.length===0&&pL.length===0)){for(let e of aL)e.removeAttribute(wN);yL(oL),xL(pL),aL=[],oL=[],pL=[],sL=[]}},TL=e=>e.length===0?(wL(),()=>{}):(CL(e),wL),EL=()=>{if(cL)return[];let e=[];for(let t of document.getAnimations())SL(t)||t.playState===`running`&&e.push(t);return e},DL=e=>{if(!cL){if(cL=OI(`data-react-grab-global-freeze`,``),e.length>200)cL.textContent=`
249
259
  *, *::before, *::after {
250
260
  animation-play-state: paused !important;
251
261
  transition: none !important;
252
262
  }
253
- `,tL=!0,eL=[];else{for(let t of e)t.pause();eL=e,tL=!1}$I=oL(Array.from(document.querySelectorAll(`svg`))),cL($I),GI()}},vL=()=>{if(QI){if(tL){QI.textContent=`
263
+ `,dL=!0,uL=[];else{for(let t of e)t.pause();uL=e,dL=!1}lL=gL(Array.from(document.querySelectorAll(`svg`))),vL(lL),tL()}},OL=()=>{if(cL){if(dL){cL.textContent=`
254
264
  *, *::before, *::after {
255
265
  transition: none !important;
256
266
  }
257
- `;let e=[];for(let t of document.getAnimations())fL(t)||e.push(t);dL(e),tL=!1}else{for(let e of eL)try{e.finish()}catch{try{e.play()}catch{}}eL=[]}QI.remove(),QI=null,lL($I),$I=[],KI()}},yL=[`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`],bL=[`focus`,`blur`,`focusin`,`focusout`],xL=[`background-color`,`color`,`border-color`,`box-shadow`,`transform`,`opacity`,`outline`,`filter`,`scale`,`visibility`],SL=[`background-color`,`color`,`border-color`,`box-shadow`,`outline`,`outline-offset`,`outline-width`,`outline-color`,`outline-style`,`filter`,`opacity`,`ring-color`,`ring-width`],CL=new Map,wL=new Map,TL=e=>{e.stopImmediatePropagation()},EL=e=>{e.preventDefault(),e.stopImmediatePropagation()},DL=(e,t)=>{let n=new Map;for(let r of t){let t=e.style.getPropertyValue(r);t&&n.set(r,t)}return n},OL=(e,t,n)=>{if(n?.has(e))return null;let r=getComputedStyle(e),i=e.style.cssText,a=DL(e,t);for(let e of t){let t=r.getPropertyValue(e);t&&(i+=`${e}: ${t} !important; `)}return{element:e,frozenStyles:i,originalPropertyValues:a}},kL=(e,t)=>{let n=[],r=document.elementFromPoint(e,t);for(;r&&r!==document.documentElement;)r instanceof HTMLElement&&n.push(r),r=r.parentElement;return n},AL=()=>{let e=[],t=document.activeElement;for(;t&&t!==document.body;)t instanceof HTMLElement&&e.push(t),t=t.shadowRoot?.activeElement??null;return e},jL=(e,t)=>{for(let{element:n,frozenStyles:r,originalPropertyValues:i}of e)t.set(n,i),n.style.cssText=r},ML=(e,t)=>{for(let[n,r]of e)for(let e of t){let t=r.get(e);t?n.style.setProperty(e,t):n.style.removeProperty(e)}e.clear()},NL=(e,t)=>{if(xI())return null;let n=[],r=e!==void 0&&t!==void 0&&e>=0&&t>=0&&e<window.innerWidth&&t<window.innerHeight?kL(e,t):Array.from(document.querySelectorAll(`:hover`)).filter(e=>e instanceof HTMLElement);for(let e of r){let t=OL(e,xL);t&&n.push(t)}let i=[];for(let e of AL()){let t=OL(e,SL,wL);t&&i.push(t)}return{hoverStates:n,focusStates:i}},PL=e=>{if(e){for(let e of yL)document.addEventListener(e,TL,!0);for(let e of bL)document.addEventListener(e,EL,!0);jL(e.hoverStates,CL),jL(e.focusStates,wL),SI()}},FL=()=>{FI();for(let e of yL)document.removeEventListener(e,TL,!0);for(let e of bL)document.removeEventListener(e,EL,!0);ML(CL,xL),ML(wL,SL),CI()},IL=(e,t)=>{let n=NL(e,t),r=gL();PL(n),_L(r)},LL=()=>{FL(),vL()},RL=!1,zL=(e,t,n)=>{let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i},BL=new WeakMap,VL=new WeakMap,HL=new WeakMap,UL=new Set,WL=[],GL=[],KL=new WeakMap,qL=new WeakMap,JL=new WeakSet,YL=mP,XL=e=>{let t=e;for(;t.return;)t=t.return;return t.stateNode??null},ZL=()=>{if(YL.size>0)return YL;let e=new Set,t=n=>{let r=pP(n);if(r){let t=XL(r);t&&e.add(t);return}for(let r of Array.from(n.children))if(t(r),e.size>0)return};return t(document.body),e},QL=(e,t)=>{if(!e)return t;if(!t)return e;if(!e.next||!t.next)return t;let n=e.next,r=t.next,i=e===n,a=t===r;return i&&a?(e.next=t,t.next=e):i?(e.next=r,t.next=e):a?(t.next=n,e.next=t):(e.next=r,t.next=n),t},$L=e=>{if(!e||KL.has(e))return;let t={originalPendingDescriptor:Object.getOwnPropertyDescriptor(e,`pending`),pendingValueAtPause:e.pending,bufferedPending:null};typeof e.getSnapshot==`function`&&(t.originalGetSnapshot=e.getSnapshot,t.snapshotValueAtPause=e.getSnapshot(),e.getSnapshot=()=>RL?t.snapshotValueAtPause:t.originalGetSnapshot());let n=t.pendingValueAtPause;Object.defineProperty(e,"pending",{configurable:!0,enumerable:!0,get:()=>RL?null:n,set:e=>{if(RL){e!==null&&(t.bufferedPending=QL(t.bufferedPending??null,e));return}n=e}}),KL.set(e,t)},eR=e=>{if(!e)return[];let t=[],n=e.next;if(!n)return[];let r=n;do r&&=(t.push(r.action),r.next);while(r&&r!==n);return t},tR=e=>{let t=KL.get(e);if(!t)return;t.originalGetSnapshot&&(e.getSnapshot=t.originalGetSnapshot),t.originalPendingDescriptor?Object.defineProperty(e,"pending",t.originalPendingDescriptor):delete e.pending,e.pending=null;let n=e.dispatch;if(typeof n==`function`){let e=eR(t.pendingValueAtPause??null),r=eR(t.bufferedPending??null);for(let t of[...e,...r])GL.push(()=>n(t))}KL.delete(e)},nR=e=>{if(qL.has(e))return;let t={originalDescriptor:Object.getOwnPropertyDescriptor(e,`memoizedValue`),frozenValue:e.memoizedValue};Object.defineProperty(e,"memoizedValue",{configurable:!0,enumerable:!0,get(){return RL?t.frozenValue:t.originalDescriptor?.get?t.originalDescriptor.get.call(this):this._memoizedValue},set(e){if(RL){t.pendingValue=e,t.didReceivePendingValue=!0;return}t.originalDescriptor?.set?t.originalDescriptor.set.call(this,e):this._memoizedValue=e}}),t.originalDescriptor?.get||(e._memoizedValue=t.frozenValue),qL.set(e,t)},rR=e=>{let t=qL.get(e);t&&(t.originalDescriptor?Object.defineProperty(e,"memoizedValue",t.originalDescriptor):delete e.memoizedValue,t.didReceivePendingValue&&(e.memoizedValue=t.pendingValue),qL.delete(e))},iR=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&$L(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)nR(n),n=n.next},aR=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&tR(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)rR(n),n=n.next},oR=e=>{let t=e;for(;t;){if(sP(t)&&iR(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},sR=e=>{let t=e;for(;t;){if(sP(t)&&aR(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},cR=e=>{if(BL.has(e))return;let t=e,n={useState:t.useState,useReducer:t.useReducer,useTransition:t.useTransition,useSyncExternalStore:t.useSyncExternalStore};BL.set(e,n),t.useState=(...t)=>{let r=n.useState.apply(e,t);if(!RL||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,zL(VL,a,()=>(...e)=>{RL?GL.push(()=>a(...e)):a(...e)})]},t.useReducer=(...t)=>{let r=n.useReducer.apply(e,t);if(!RL||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,zL(VL,a,()=>(...e)=>{RL?GL.push(()=>a(...e)):a(...e)})]},t.useTransition=(...t)=>{let r=n.useTransition.apply(e,t);if(!RL||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,zL(HL,a,()=>e=>{RL?WL.push(()=>a(e)):a(e)})]},t.useSyncExternalStore=((e,t,r)=>RL?n.useSyncExternalStore(t=>e(()=>{RL?UL.add(t):t()}),t,r):n.useSyncExternalStore(e,t,r))},lR=e=>{let t=e.currentDispatcherRef;if(!t||typeof t!=`object`)return;let n=`H`in t?`H`:`current`,r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>(r&&typeof r==`object`&&cR(r),r),set:e=>{r=e}})},uR=e=>{queueMicrotask(()=>{try{for(let t of iP().renderers.values())if(typeof t.scheduleUpdate==`function`){for(let n of e)if(n.current)try{t.scheduleUpdate(n.current)}catch{}}}catch{}})},dR=e=>{for(let t of e)try{t()}catch{}},fR=()=>{for(let e of iP().renderers.values())JL.has(e)||(lR(e),JL.add(e))},pR=()=>{if(RL)return()=>{};fR(),RL=!0;let e=ZL();for(let t of e)oR(t.current);return()=>{if(RL)try{let e=ZL();for(let t of e)sR(t.current);let t=Array.from(UL),n=WL.slice(),r=GL.slice();RL=!1,dR(t),dR(n),dR(r),uR(e)}finally{UL.clear(),WL.length=0,GL.length=0}}}}));function hR(e){let t=String(e),n=t.length-1;return Nz.context.id+(n?String.fromCharCode(96+n):``)+t}function gR(e){Nz.context=e}function _R(e,t){let n=Wz,r=Hz,i=e.length===0,a=t===void 0?r:t,o=i?Bz:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>wR(()=>GR(o)));Hz=o,Wz=null;try{return zR(s,!0)}finally{Wz=n,Hz=r}}function J(e,t){t=t?Object.assign({},Rz,t):Rz;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[NR.bind(n),e=>(typeof e==`function`&&(e=Uz&&Uz.running&&Uz.sources.has(n)?e(n.tValue):e(n.value)),PR(n,e))]}function vR(e,t,n){FR(LR(e,t,!0,1))}function yR(e,t,n){FR(LR(e,t,!1,1))}function bR(e,t,n){zz=HR;let r=LR(e,t,!1,1),i=Xz&&jR(Xz);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),Kz?Kz.push(r):FR(r)}function Y(e,t,n){n=n?Object.assign({},Rz,n):Rz;let r=LR(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,FR(r),NR.bind(r)}function xR(e){return e&&typeof e==`object`&&`then`in e}function SR(e,t,n){let r,i,a;typeof t==`function`?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=Vz,c=null,l=!1,u=!1,d=`initialValue`in a,f=typeof r==`function`&&Y(r),p=new Set,[m,h]=(a.storage||J)(a.initialValue),[g,_]=J(void 0),[v,y]=J(void 0,{equals:!1}),[b,x]=J(d?`ready`:`unresolved`);Nz.context&&(c=Nz.getNextContextId(),a.ssrLoadFrom===`initial`?s=a.initialValue:Nz.load&&Nz.has(c)&&(s=Nz.load(c)));function S(e,t,n,r){return o===e&&(o=null,r!==void 0&&(d=!0),(e===s||t===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(r,{value:t})),s=Vz,Uz&&e&&l?(Uz.promises.delete(e),l=!1,zR(()=>{Uz.running=!0,C(t,n)},!1)):C(t,n)),t}function C(e,t){zR(()=>{t===void 0&&h(()=>e),x(t===void 0?d?`ready`:`unresolved`:`errored`),_(t);for(let e of p.keys())e.decrement();p.clear()},!1)}function w(){let e=Xz&&jR(Xz),t=m(),n=g();if(n!==void 0&&!o)throw n;return Wz&&!Wz.user&&e&&vR(()=>{v(),o&&(e.resolved&&Uz&&l?Uz.promises.add(o):p.has(e)||(e.increment(),p.add(e)))}),t}function T(e=!0){if(e!==!1&&u)return;u=!1;let t=f?f():r;if(l=Uz&&Uz.running,t==null||t===!1){S(o,wR(m));return}Uz&&o&&Uz.promises.delete(o);let n,a=s===Vz?wR(()=>{try{return i(t,{value:m(),refetching:e})}catch(e){n=e}}):s;if(n!==void 0){S(o,void 0,qR(n),t);return}else if(!xR(a))return S(o,a,void 0,t),a;return o=a,`v`in a?(a.s===1?S(o,a.v,void 0,t):S(o,void 0,qR(a.v),t),a):(u=!0,queueMicrotask(()=>u=!1),zR(()=>{x(d?`refreshing`:`pending`),y()},!1),a.then(e=>S(a,e,void 0,t),e=>S(a,void 0,qR(e),t)))}Object.defineProperties(w,{state:{get:()=>b()},error:{get:()=>g()},loading:{get(){let e=b();return e===`pending`||e===`refreshing`}},latest:{get(){if(!d)return w();let e=g();if(e&&!o)throw e;return m()}}});let E=Hz;return f?vR(()=>(E=Hz,T(!1))):T(!1),[w,{refetch:e=>kR(E,()=>T(e)),mutate:h}]}function CR(e){return zR(e,!1)}function wR(e){if(Wz===null)return e();let t=Wz;Wz=null;try{return e()}finally{Wz=t}}function TR(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=wR(()=>t(o,i,n));return i=o,s}}function ER(e){bR(()=>wR(e))}function DR(e){return Hz===null||(Hz.cleanups===null?Hz.cleanups=[e]:Hz.cleanups.push(e)),e}function OR(){return Wz}function kR(e,t){let n=Hz,r=Wz;Hz=e,Wz=null;try{return zR(t,!0)}catch(e){JR(e)}finally{Hz=n,Wz=r}}function AR(e,t){let n=Symbol(`context`);return{id:n,Provider:XR(n),defaultValue:e}}function jR(e){let t;return Hz&&Hz.context&&(t=Hz.context[e.id])!==void 0?t:e.defaultValue}function MR(e){let t=Y(e),n=Y(()=>YR(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}function NR(){let e=Uz&&Uz.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===1)FR(this);else{let e=Gz;Gz=null,zR(()=>UR(this),!1),Gz=e}if(Wz){let e=this.observers?this.observers.length:0;Wz.sources?(Wz.sources.push(this),Wz.sourceSlots.push(e)):(Wz.sources=[this],Wz.sourceSlots=[e]),this.observers?(this.observers.push(Wz),this.observerSlots.push(Wz.sources.length-1)):(this.observers=[Wz],this.observerSlots=[Wz.sources.length-1])}return e&&Uz.sources.has(this)?this.tValue:this.value}function PR(e,t,n){let r=Uz&&Uz.running&&Uz.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(Uz){let r=Uz.running;(r||!n&&Uz.sources.has(e))&&(Uz.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&zR(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=Uz&&Uz.running;r&&Uz.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?Gz.push(n):Kz.push(n),n.observers&&WR(n)),r?n.tState=1:n.state=1)}if(Gz.length>1e6)throw Gz=[],Error()},!1)}return t}function FR(e){if(!e.fn)return;GR(e);let t=qz;IR(e,Uz&&Uz.running&&Uz.sources.has(e)?e.tValue:e.value,t),Uz&&!Uz.running&&Uz.sources.has(e)&&queueMicrotask(()=>{zR(()=>{Uz&&(Uz.running=!0),Wz=Hz=e,IR(e,e.tValue,t),Wz=Hz=null},!1)})}function IR(e,t,n){let r,i=Hz,a=Wz;Wz=Hz=e;try{r=e.fn(t)}catch(t){return e.pure&&(Uz&&Uz.running?(e.tState=1,e.tOwned&&e.tOwned.forEach(GR),e.tOwned=void 0):(e.state=1,e.owned&&e.owned.forEach(GR),e.owned=null)),e.updatedAt=n+1,JR(t)}finally{Wz=a,Hz=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?PR(e,r,!0):Uz&&Uz.running&&e.pure?(Uz.sources.has(e)||(e.value=r),Uz.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function LR(e,t,n,r=1,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Hz,context:Hz?Hz.context:null,pure:n};return Uz&&Uz.running&&(a.state=0,a.tState=r),Hz===null||Hz!==Bz&&(Uz&&Uz.running&&Hz.pure?Hz.tOwned?Hz.tOwned.push(a):Hz.tOwned=[a]:Hz.owned?Hz.owned.push(a):Hz.owned=[a]),a}function RR(e){let t=Uz&&Uz.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===2)return UR(e);if(e.suspense&&wR(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<qz);){if(t&&Uz.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(Uz.disposed.has(t))return}if((t?e.tState:e.state)===1)FR(e);else if((t?e.tState:e.state)===2){let t=Gz;Gz=null,zR(()=>UR(e,n[0]),!1),Gz=t}}}function zR(e,t){if(Gz)return e();let n=!1;t||(Gz=[]),Kz?n=!0:Kz=[],qz++;try{let t=e();return BR(n),t}catch(e){n||(Kz=null),Gz=null,JR(e)}}function BR(e){if(Gz&&=(VR(Gz),null),e)return;let t;if(Uz){if(!Uz.promises.size&&!Uz.queue.size){let e=Uz.sources,n=Uz.disposed;Kz.push.apply(Kz,Uz.effects),t=Uz.resolve;for(let e of Kz)`tState`in e&&(e.state=e.tState),delete e.tState;Uz=null,zR(()=>{for(let e of n)GR(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)GR(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}Yz(!1)},!1)}else if(Uz.running){Uz.running=!1,Uz.effects.push.apply(Uz.effects,Kz),Kz=null,Yz(!0);return}}let n=Kz;Kz=null,n.length&&zR(()=>zz(n),!1),t&&t()}function VR(e){for(let t=0;t<e.length;t++)RR(e[t])}function HR(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:RR(r)}if(Nz.context){if(Nz.count){Nz.effects||=[],Nz.effects.push(...e.slice(0,n));return}gR()}for(Nz.effects&&(Nz.done||!Nz.count)&&(e=[...Nz.effects,...e],n+=Nz.effects.length,delete Nz.effects),t=0;t<n;t++)RR(e[t])}function UR(e,t){let n=Uz&&Uz.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===1?i!==t&&(!i.updatedAt||i.updatedAt<qz)&&RR(i):e===2&&UR(i,t)}}}function WR(e){let t=Uz&&Uz.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=2:r.state=2,r.pure?Gz.push(r):Kz.push(r),r.observers&&WR(r))}}function GR(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)GR(e.tOwned[t]);delete e.tOwned}if(Uz&&Uz.running&&e.pure)KR(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)GR(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}Uz&&Uz.running?e.tState=0:e.state=0}function KR(e,t){if(t||(e.tState=0,Uz.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)KR(e.owned[t])}function qR(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function JR(e,t=Hz){throw qR(e)}function YR(e){if(typeof e==`function`&&!e.length)return YR(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=YR(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function XR(e,t){return function(t){let n;return yR(()=>n=wR(()=>(Hz.context={...Hz.context,[e]:t.value},MR(()=>t.children))),void 0),n}}function ZR(e){for(let t=0;t<e.length;t++)e[t]()}function QR(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return DR(()=>ZR(a)),()=>{let c=e()||[],l=c.length,u,d;return c[Lz],wR(()=>{let e,t,p,m,h,g,_,v,y;if(l===0)o!==0&&(ZR(a),a=[],r=[],i=[],o=0,s&&=[]),n.fallback&&(r=[Zz],i[0]=_R(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(l),d=0;d<l;d++)r[d]=c[d],i[d]=_R(f);o=l}else{for(p=Array(l),m=Array(l),s&&(h=Array(l)),g=0,_=Math.min(o,l);g<_&&r[g]===c[g];g++);for(_=o-1,v=l-1;_>=g&&v>=g&&r[_]===c[v];_--,v--)p[v]=i[_],m[v]=a[_],s&&(h[v]=s[_]);for(e=new Map,t=Array(v+1),d=v;d>=g;d--)y=c[d],u=e.get(y),t[d]=u===void 0?-1:u,e.set(y,d);for(u=g;u<=_;u++)y=r[u],d=e.get(y),d!==void 0&&d!==-1?(p[d]=i[u],m[d]=a[u],s&&(h[d]=s[u]),d=t[d],e.set(y,d)):a[u]();for(d=g;d<l;d++)d in p?(i[d]=p[d],a[d]=m[d],s&&(s[d]=h[d],s[d](d))):i[d]=_R(f);i=i.slice(0,o=l),r=c.slice(0)}return i});function f(e){if(a[d]=e,s){let[e,n]=J(d);return s[d]=n,t(c[d],e)}return t(c[d])}}}function $R(e,t,n={}){let r=[],i=[],a=[],o=[],s=0,c;return DR(()=>ZR(a)),()=>{let l=e()||[],u=l.length;return l[Lz],wR(()=>{if(u===0)return s!==0&&(ZR(a),a=[],r=[],i=[],s=0,o=[]),n.fallback&&(r=[Zz],i[0]=_R(e=>(a[0]=e,n.fallback())),s=1),i;for(r[0]===Zz&&(a[0](),a=[],r=[],i=[],s=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?o[c](()=>l[c]):c>=r.length&&(i[c]=_R(d));for(;c<r.length;c++)a[c]();return s=o.length=a.length=u,r=l.slice(0),i=i.slice(0,s)});function d(e){a[c]=e;let[n,r]=J(l[c]);return o[c]=r,t(n,c)}}}function X(e,t){return wR(()=>e(t||{}))}function ez(){return!0}function tz(e){return(e=typeof e==`function`?e():e)?e:{}}function nz(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function rz(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&Fz in r,e[n]=typeof r==`function`?(t=!0,Y(r)):r}if(Iz&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=tz(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in tz(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(tz(e[n])));return[...new Set(t)]}},Qz);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:nz.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},a=Object.keys(r);for(let e=a.length-1;e>=0;e--){let t=a[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function iz(e,...t){let n=t.length;if(Iz&&Fz in e){let r=n>1?t.flat():t[0],i=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},Qz));return i.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Qz)),i}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function az(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return Y(QR(()=>e.each,e.children,t||void 0))}function oz(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return Y($R(()=>e.each,e.children,t||void 0))}function sz(e){let t=e.keyed,n=Y(()=>e.when,void 0,void 0),r=t?n:Y(n,void 0,{equals:(e,t)=>!e==!t});return Y(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?wR(()=>a(t?i:()=>{if(!wR(r))throw $z(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function cz(e){let t=MR(()=>e.children),n=Y(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=Y(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:Y(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return Y(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?wR(()=>o(a.keyed?i():()=>{if(wR(n)()?.[0]!==r)throw $z(`Match`);return i()})):o},void 0,void 0)}function lz(e){return e}function uz(e,t){let n=rB[e];return typeof n==`object`?n[t]?n.$:void 0:n}function dz(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}function fz(e,t,n,r={}){let i;return _R(r=>{i=r,t===document?e():$(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function Z(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>wR(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function pz(e,t=window.document){let n=t[sB]||(t[sB]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Oz))}}function Q(e,t,n){wz(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function mz(e,t,n,r){wz(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function hz(e,t,n){wz(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function gz(e,t){wz(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function _z(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function vz(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(Ez(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(Ez(e,i,!0),n[i]=o)}return n}function yz(e,t,n){if(!t)return n?Q(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function bz(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function xz(e,t={},n,r){let i={};return r||yR(()=>i.children=kz(e,t.children,i.children)),yR(()=>typeof t.ref==`function`&&Sz(t.ref,e)),yR(()=>Cz(e,t,n,!0,i,!0)),i}function Sz(e,t,n){return wR(()=>e(t,n))}function $(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return kz(e,t,r,n);yR(r=>kz(e,t(),r,n),r)}function Cz(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=Dz(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||kz(e,t.children);continue}let s=t[o];i[o]=Dz(e,o,s,i[o],n,a,t)}}function wz(e){return!!Nz.context&&!Nz.done&&(!e||e.isConnected)}function Tz(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Ez(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function Dz(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return yz(e,n,r);if(t===`classList`)return vz(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=iB.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(_z(e,i,n,a),a&&pz([i]))}else if(t.slice(0,5)===`attr:`)Q(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)hz(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=tB.has(t))||!i&&((u=uz(t,e.tagName))||(c=eB.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(wz(e))return n;t===`class`||t===`className`?gz(e,n):s&&!c&&!l?e[Tz(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&aB[t.split(`:`)[0]];r?mz(e,r,t,n):Q(e,nB[t]||t,n)}return n}function Oz(e){if(Nz.registry&&Nz.events&&Nz.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Nz.registry&&!Nz.done&&(Nz.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function kz(e,t,n,r,i){let a=wz(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Mz(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Mz(e,n,r)}else if(o===`function`)return yR(()=>{let i=t();for(;typeof i==`function`;)i=i();n=kz(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(Az(o,t,n,i))return yR(()=>n=kz(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Mz(e,n,r),s)return n}else c?n.length===0?jz(e,o,r):dz(e,n,o):(n&&Mz(e),jz(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Mz(e,n,r,t);Mz(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function Az(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=Az(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=Az(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function jz(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Mz(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var Nz,Pz,Fz,Iz,Lz,Rz,zz,Bz,Vz,Hz,Uz,Wz,Gz,Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB,oB,sB,cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB,yB,bB,xB,SB,CB,wB,TB,EB,DB,OB,kB,AB,jB,MB,NB,PB,FB,IB,LB,RB,zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,QB,$B,eV,tV,nV,rV,iV,aV,oV,sV,cV,lV,uV,dV,fV,pV,mV,hV,gV,_V,vV,yV,bV,xV,SV,CV,wV,TV,EV,DV,OV,kV,AV,jV,MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,GV,KV,qV=t((()=>{mR(),Nz={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return hR(this.context.count)},getNextContextId(){return hR(this.context.count++)}},Pz=(e,t)=>e===t,Fz=Symbol(`solid-proxy`),Iz=typeof Proxy==`function`,Lz=Symbol(`solid-track`),Rz={equals:Pz},zz=VR,Bz={owned:null,cleanups:null,context:null,owner:null},Vz={},Hz=null,Uz=null,Wz=null,Gz=null,Kz=null,qz=0,[Jz,Yz]=J(!1),Zz=Symbol(`fallback`),Qz={get(e,t,n){return t===Fz?n:e.get(t)},has(e,t){return t===Fz||e.has(t)},set:ez,deleteProperty:ez,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ez,deleteProperty:ez}},ownKeys(e){return e.keys()}},$z=e=>`Stale read from <${e}>.`,eB=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),tB=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),nB=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),rB=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}}),iB=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),aB={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},oB=e=>Y(()=>e()),sB=`_$DX_DELEGATE`,cB=e=>!!(e?.isConnected??e?.ownerDocument?.contains(e)),lB=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`,`combobox`],uB=e=>{if(e.composed){let t=e.composedPath()[0];if(t instanceof HTMLElement)return t}else if(e.target instanceof HTMLElement)return e.target},dB=e=>{if(document.designMode===`on`)return!0;let t=uB(e);if(!t)return!1;if(t.isContentEditable)return!0;let n=zN(t);return lB.some(e=>e===n||e===t.role)},fB=e=>{let t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=t.selectionStart??0;return(t.selectionEnd??0)-e>0}return!1},pB=()=>{let e=window.getSelection();return e?e.toString().length>0:!1},mB=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/,hB=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`),gB=(e,t,n,r=1)=>{let i=hB(e),a=hB(t),o=hB(n);return r>=1?`#${i}${a}${o}`:`#${i}${a}${o}${hB(r*255)}`},_B=e=>{if(!e.startsWith(`#`))return null;let t=e.slice(1);if(t.length!==6&&t.length!==8)return null;let n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16),a=t.length===8?parseInt(t.slice(6,8),16)/255:1;return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)?null:{red:n,green:r,blue:i,alpha:a}},vB=e=>{let t=e.match(mB);if(!t)return null;let n=1;if(t[4]!==void 0){let e=t[4];n=e.endsWith(`%`)?Number(e.slice(0,-1))/100:Number(e)}return gB(Number(t[1]),Number(t[2]),Number(t[3]),n)},yB=e=>{let t=e.match(mB);return!t||t[4]===void 0?!1:(t[4].endsWith(`%`)?Number(t[4].slice(0,-1))/100:Number(t[4]))===0},bB=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,xB=e=>{let t=e.match(bB);if(!t)return null;let n=t[1];return n.length===3?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`:n.length===4?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`:`#${n}`},SB=`rgba(0, 0, 0, 0)`,CB=/^oklch\(\s*([+-]?\d*\.?\d+%?)\s+([+-]?\d*\.?\d+%?)\s+([+-]?\d*\.?\d+)(deg|grad|rad|turn)?(?:\s*\/\s*([+-]?\d*\.?\d+%?))?\s*\)$/i,wB=180/Math.PI,TB=(e,t)=>e.endsWith(`%`)?Number(e.slice(0,-1))/100*t:Number(e),EB=(e,t)=>{let n=Number(e);return t===`grad`?n*.9:t===`rad`?n*wB:t===`turn`?n*360:n},DB=e=>{let t=Math.max(0,Math.min(1,e));return(t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055)*255},OB=e=>{let t=e.match(CB);if(!t)return null;let n=TB(t[1],1),r=TB(t[2],.4),i=EB(t[3],t[4])*Math.PI/180,a=t[5]===void 0?1:TB(t[5],1);if(![n,r,i,a].every(Number.isFinite))return null;let o=r*Math.cos(i),s=r*Math.sin(i),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,g=-.0041960863*d-.7034186147*f+1.707614701*p;return gB(DB(m),DB(h),DB(g),Math.max(0,Math.min(1,a)))},kB=null,AB=()=>kB||(typeof document>`u`?null:(kB=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0}),kB)),jB=(e,t)=>{e.clearRect(0,0,1,1),e.fillStyle=t,e.fillRect(0,0,1,1);let n=e.getImageData(0,0,1,1).data;return n[3]===0?DN:gB(n[0],n[1],n[2],n[3]/255)},MB=e=>{let t=e.trim();if(!t)return null;if(t.toLowerCase()===`transparent`)return DN;let n=xB(t);if(n)return n;let r=OB(t);if(r)return r;let i=AB();if(!i)return null;i.fillStyle=SB,i.fillStyle=t;let a=i.fillStyle;return typeof a==`string`?a.toLowerCase()===SB?t.toLowerCase().replace(/\s+/g,``)===`rgba(0,0,0,0)`?DN:null:a.startsWith(`#`)&&a.length===7?a:a.startsWith(`rgb`)?vB(a):jB(i,t):null},NB=(e,t,n)=>Math.max(t,Math.min(e,n)),PB=null,FB=()=>{if(typeof navigator>`u`||!(`userAgentData`in navigator))return null;let e=navigator.userAgentData;if(typeof e!=`object`||!e||!(`platform`in e))return null;let t=e.platform;return typeof t==`string`?t:null},IB=()=>{if(PB===null){if(typeof navigator>`u`)return PB=!1,PB;let e=navigator.platform??FB()??navigator.userAgent;PB=/Mac|iPhone|iPad|iPod/i.test(e)}return PB},LB=(e,t)=>{try{return e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute(t))}catch{return!1}},RB=`padding-top.padding-right.padding-bottom.padding-left.margin-top.margin-right.margin-bottom.margin-left.gap.row-gap.column-gap.font-size.line-height.letter-spacing.border-radius.border-top-left-radius.border-top-right-radius.border-bottom-right-radius.border-bottom-left-radius.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.opacity.width.height.min-width.min-height.max-width.max-height.top.right.bottom.left.z-index`.split(`.`),zB=-128,BB=-512,VB=-9999,HB=9999,UB=new Set([`letter-spacing`,`gap`,`row-gap`,`column-gap`]),WB=new Set([`z-index`]),GB=[{key:`padding`,label:`padding`,longhands:[`padding-top`,`padding-right`,`padding-bottom`,`padding-left`]},{key:`padding-top,padding-bottom`,label:`padding-y`,longhands:[`padding-top`,`padding-bottom`]},{key:`padding-left,padding-right`,label:`padding-x`,longhands:[`padding-left`,`padding-right`]},{key:`padding-top`,label:`padding top`,longhands:[`padding-top`]},{key:`padding-right`,label:`padding right`,longhands:[`padding-right`]},{key:`padding-bottom`,label:`padding bottom`,longhands:[`padding-bottom`]},{key:`padding-left`,label:`padding left`,longhands:[`padding-left`]}],KB=[{key:`margin`,label:`margin`,longhands:[`margin-top`,`margin-right`,`margin-bottom`,`margin-left`]},{key:`margin-top,margin-bottom`,label:`margin-y`,longhands:[`margin-top`,`margin-bottom`]},{key:`margin-left,margin-right`,label:`margin-x`,longhands:[`margin-left`,`margin-right`]},{key:`margin-top`,label:`margin top`,longhands:[`margin-top`]},{key:`margin-right`,label:`margin right`,longhands:[`margin-right`]},{key:`margin-bottom`,label:`margin bottom`,longhands:[`margin-bottom`]},{key:`margin-left`,label:`margin left`,longhands:[`margin-left`]}],qB=[{key:`gap`,label:`gap`,longhands:[`row-gap`,`column-gap`]},{key:`row-gap`,label:`row gap`,longhands:[`row-gap`]},{key:`column-gap`,label:`column gap`,longhands:[`column-gap`]}],JB=[{key:`border-radius`,label:`border radius`,longhands:[`border-top-left-radius`,`border-top-right-radius`,`border-bottom-right-radius`,`border-bottom-left-radius`]},{key:`border-top-left-radius,border-top-right-radius`,label:`top corners`,longhands:[`border-top-left-radius`,`border-top-right-radius`]},{key:`border-bottom-left-radius,border-bottom-right-radius`,label:`bottom corners`,longhands:[`border-bottom-left-radius`,`border-bottom-right-radius`]},{key:`border-top-left-radius,border-bottom-left-radius`,label:`left corners`,longhands:[`border-top-left-radius`,`border-bottom-left-radius`]},{key:`border-top-right-radius,border-bottom-right-radius`,label:`right corners`,longhands:[`border-top-right-radius`,`border-bottom-right-radius`]},{key:`border-top-left-radius`,label:`top left radius`,longhands:[`border-top-left-radius`]},{key:`border-top-right-radius`,label:`top right radius`,longhands:[`border-top-right-radius`]},{key:`border-bottom-right-radius`,label:`bottom right radius`,longhands:[`border-bottom-right-radius`]},{key:`border-bottom-left-radius`,label:`bottom left radius`,longhands:[`border-bottom-left-radius`]}],YB=[{key:`top,right,bottom,left`,label:`inset`,longhands:[`top`,`right`,`bottom`,`left`]},{key:`top,bottom`,label:`inset-y`,longhands:[`top`,`bottom`]},{key:`left,right`,label:`inset-x`,longhands:[`left`,`right`]},{key:`top`,label:`top`,longhands:[`top`]},{key:`right`,label:`right`,longhands:[`right`]},{key:`bottom`,label:`bottom`,longhands:[`bottom`]},{key:`left`,label:`left`,longhands:[`left`]}],XB=new Set(YB.map(e=>e.key)),ZB=[GB,KB,qB,JB,[{key:`border-width`,label:`border width`,longhands:[`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`]},{key:`border-top-width`,label:`border top width`,longhands:[`border-top-width`]},{key:`border-right-width`,label:`border right width`,longhands:[`border-right-width`]},{key:`border-bottom-width`,label:`border bottom width`,longhands:[`border-bottom-width`]},{key:`border-left-width`,label:`border left width`,longhands:[`border-left-width`]}],[{key:`width,height`,label:`size`,longhands:[`width`,`height`]},{key:`width`,label:`width`,longhands:[`width`]},{key:`height`,label:`height`,longhands:[`height`]}],YB],QB=[{key:`font-size`,label:`font size`},{key:`line-height`,label:`line height`},{key:`letter-spacing`,label:`letter spacing`},{key:`min-width`,label:`min width`},{key:`min-height`,label:`min height`},{key:`max-width`,label:`max width`},{key:`max-height`,label:`max height`},{key:`z-index`,label:`z-index`},{key:`opacity`,label:`opacity`}],$B=[{key:`color`,label:`text color`,alwaysShow:!0},{key:`background-color`,label:`background`,alwaysShow:!0},{key:`border-color`,label:`border color`},{key:`fill`,label:`fill`},{key:`stroke`,label:`stroke`}],eV=[{value:`ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,label:`sans`},{value:`ui-serif, Georgia, Cambria, "Times New Roman", Times, serif`,label:`serif`},{value:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`,label:`mono`},{value:`system-ui, sans-serif`,label:`system`},{value:`serif`,label:`serif`},{value:`monospace`,label:`mono`}],tV=e=>{let t=e.trim();return eV.some(e=>e.value===t)?eV:[{value:t,label:`current`},...eV]},nV={key:`font-family`,label:`font family`},rV=[{key:`display`,label:`display`,options:[{value:`block`,label:`block`},{value:`flex`,label:`flex`},{value:`inline-block`,label:`inline-block`},{value:`inline`,label:`inline`},{value:`grid`,label:`grid`},{value:`none`,label:`none`}]},{key:`text-align`,label:`text align`,options:[{value:`left`,label:`left`},{value:`center`,label:`center`},{value:`right`,label:`right`},{value:`justify`,label:`justify`}]},{key:`font-style`,label:`font style`,options:[{value:`normal`,label:`normal`},{value:`italic`,label:`italic`}]},{key:`text-transform`,label:`text transform`,options:[{value:`none`,label:`none`},{value:`uppercase`,label:`uppercase`},{value:`lowercase`,label:`lowercase`},{value:`capitalize`,label:`capitalize`}]},{key:`white-space`,label:`white space`,options:[{value:`normal`,label:`normal`},{value:`nowrap`,label:`nowrap`},{value:`pre`,label:`pre`},{value:`pre-wrap`,label:`pre-wrap`},{value:`pre-line`,label:`pre-line`},{value:`break-spaces`,label:`break-spaces`}]},{key:`word-break`,label:`word break`,options:[{value:`normal`,label:`normal`},{value:`break-all`,label:`break-all`},{value:`keep-all`,label:`keep-all`}]},{key:`overflow-wrap`,label:`wrap`,options:[{value:`normal`,label:`normal`},{value:`break-word`,label:`break-word`},{value:`anywhere`,label:`anywhere`}]},{key:`font-variant-numeric`,label:`number style`,options:[{value:`normal`,label:`normal`},{value:`tabular-nums`,label:`tabular`},{value:`proportional-nums`,label:`proportional`},{value:`lining-nums`,label:`lining`},{value:`oldstyle-nums`,label:`oldstyle`},{value:`slashed-zero`,label:`slashed zero`}]},{key:`text-decoration-line`,label:`decoration`,options:[{value:`none`,label:`none`},{value:`underline`,label:`underline`},{value:`line-through`,label:`strike`}]},{key:`border-style`,label:`border style`,options:[{value:`none`,label:`none`},{value:`solid`,label:`solid`},{value:`dashed`,label:`dashed`},{value:`dotted`,label:`dotted`}]},{key:`visibility`,label:`visibility`,options:[{value:`visible`,label:`visible`},{value:`hidden`,label:`hidden`}]},{key:`align-items`,label:`align items`,options:[{value:`stretch`,label:`stretch`},{value:`flex-start`,label:`start`},{value:`center`,label:`center`},{value:`flex-end`,label:`end`},{value:`baseline`,label:`baseline`}]},{key:`justify-content`,label:`justify content`,options:[{value:`flex-start`,label:`start`},{value:`center`,label:`center`},{value:`flex-end`,label:`end`},{value:`space-between`,label:`between`},{value:`space-around`,label:`around`},{value:`space-evenly`,label:`evenly`}]},{key:`font-weight`,label:`font weight`,options:[{value:`100`,label:`thin`},{value:`200`,label:`extra-light`},{value:`300`,label:`light`},{value:`400`,label:`normal`},{value:`500`,label:`medium`},{value:`600`,label:`semibold`},{value:`700`,label:`bold`},{value:`800`,label:`extra-bold`},{value:`900`,label:`black`}]}],iV=[...RB,`color`,`background-color`,`border-color`,`fill`,`stroke`,`font-family`,`display`,`text-align`,`font-style`,`text-transform`,`white-space`,`word-break`,`overflow-wrap`,`font-variant-numeric`,`text-decoration-line`,`border-style`,`visibility`,`align-items`,`justify-content`,`font-weight`],aV=e=>Number.isInteger(e)?e:Math.round(e*100)/100,oV=e=>Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,``),sV=e=>Number.isFinite(e)?oV(aV(e)):String(e),cV=e=>Math.round(e),lV=(e,t)=>{if(e.kind===`color`||e.kind===`enum`)return typeof t==`string`?t:e.value;let n=typeof t==`number`?t:e.value;return e.key===`opacity`&&e.unit===`%`?oV(aV(n/100)):`${oV(aV(n))}${e.unit}`},uV={slate:{50:`#f8fafc`,100:`#f1f5f9`,200:`#e2e8f0`,300:`#cbd5e1`,400:`#94a3b8`,500:`#64748b`,600:`#475569`,700:`#334155`,800:`#1e293b`,900:`#0f172a`,950:`#020617`},gray:{50:`#f9fafb`,100:`#f3f4f6`,200:`#e5e7eb`,300:`#d1d5db`,400:`#9ca3af`,500:`#6b7280`,600:`#4b5563`,700:`#374151`,800:`#1f2937`,900:`#111827`,950:`#030712`},zinc:{50:`#fafafa`,100:`#f4f4f5`,200:`#e4e4e7`,300:`#d4d4d8`,400:`#a1a1aa`,500:`#71717a`,600:`#52525b`,700:`#3f3f46`,800:`#27272a`,900:`#18181b`,950:`#09090b`},neutral:{50:`#fafafa`,100:`#f5f5f5`,200:`#e5e5e5`,300:`#d4d4d4`,400:`#a3a3a3`,500:`#737373`,600:`#525252`,700:`#404040`,800:`#262626`,900:`#171717`,950:`#0a0a0a`},stone:{50:`#fafaf9`,100:`#f5f5f4`,200:`#e7e5e4`,300:`#d6d3d1`,400:`#a8a29e`,500:`#78716c`,600:`#57534e`,700:`#44403c`,800:`#292524`,900:`#1c1917`,950:`#0c0a09`},red:{50:`#fef2f2`,100:`#fee2e2`,200:`#fecaca`,300:`#fca5a5`,400:`#f87171`,500:`#ef4444`,600:`#dc2626`,700:`#b91c1c`,800:`#991b1b`,900:`#7f1d1d`,950:`#450a0a`},orange:{50:`#fff7ed`,100:`#ffedd5`,200:`#fed7aa`,300:`#fdba74`,400:`#fb923c`,500:`#f97316`,600:`#ea580c`,700:`#c2410c`,800:`#9a3412`,900:`#7c2d12`,950:`#431407`},amber:{50:`#fffbeb`,100:`#fef3c7`,200:`#fde68a`,300:`#fcd34d`,400:`#fbbf24`,500:`#f59e0b`,600:`#d97706`,700:`#b45309`,800:`#92400e`,900:`#78350f`,950:`#451a03`},yellow:{50:`#fefce8`,100:`#fef9c3`,200:`#fef08a`,300:`#fde047`,400:`#facc15`,500:`#eab308`,600:`#ca8a04`,700:`#a16207`,800:`#854d0e`,900:`#713f12`,950:`#422006`},lime:{50:`#f7fee7`,100:`#ecfccb`,200:`#d9f99d`,300:`#bef264`,400:`#a3e635`,500:`#84cc16`,600:`#65a30d`,700:`#4d7c0f`,800:`#3f6212`,900:`#365314`,950:`#1a2e05`},green:{50:`#f0fdf4`,100:`#dcfce7`,200:`#bbf7d0`,300:`#86efac`,400:`#4ade80`,500:`#22c55e`,600:`#16a34a`,700:`#15803d`,800:`#166534`,900:`#14532d`,950:`#052e16`},emerald:{50:`#ecfdf5`,100:`#d1fae5`,200:`#a7f3d0`,300:`#6ee7b7`,400:`#34d399`,500:`#10b981`,600:`#059669`,700:`#047857`,800:`#065f46`,900:`#064e3b`,950:`#022c22`},teal:{50:`#f0fdfa`,100:`#ccfbf1`,200:`#99f6e4`,300:`#5eead4`,400:`#2dd4bf`,500:`#14b8a6`,600:`#0d9488`,700:`#0f766e`,800:`#115e59`,900:`#134e4a`,950:`#042f2e`},cyan:{50:`#ecfeff`,100:`#cffafe`,200:`#a5f3fc`,300:`#67e8f9`,400:`#22d3ee`,500:`#06b6d4`,600:`#0891b2`,700:`#0e7490`,800:`#155e75`,900:`#164e63`,950:`#083344`},sky:{50:`#f0f9ff`,100:`#e0f2fe`,200:`#bae6fd`,300:`#7dd3fc`,400:`#38bdf8`,500:`#0ea5e9`,600:`#0284c7`,700:`#0369a1`,800:`#075985`,900:`#0c4a6e`,950:`#082f49`},blue:{50:`#eff6ff`,100:`#dbeafe`,200:`#bfdbfe`,300:`#93c5fd`,400:`#60a5fa`,500:`#3b82f6`,600:`#2563eb`,700:`#1d4ed8`,800:`#1e40af`,900:`#1e3a8a`,950:`#172554`},indigo:{50:`#eef2ff`,100:`#e0e7ff`,200:`#c7d2fe`,300:`#a5b4fc`,400:`#818cf8`,500:`#6366f1`,600:`#4f46e5`,700:`#4338ca`,800:`#3730a3`,900:`#312e81`,950:`#1e1b4b`},violet:{50:`#f5f3ff`,100:`#ede9fe`,200:`#ddd6fe`,300:`#c4b5fd`,400:`#a78bfa`,500:`#8b5cf6`,600:`#7c3aed`,700:`#6d28d9`,800:`#5b21b6`,900:`#4c1d95`,950:`#2e1065`},purple:{50:`#faf5ff`,100:`#f3e8ff`,200:`#e9d5ff`,300:`#d8b4fe`,400:`#c084fc`,500:`#a855f7`,600:`#9333ea`,700:`#7e22ce`,800:`#6b21a8`,900:`#581c87`,950:`#3b0764`},fuchsia:{50:`#fdf4ff`,100:`#fae8ff`,200:`#f5d0fe`,300:`#f0abfc`,400:`#e879f9`,500:`#d946ef`,600:`#c026d3`,700:`#a21caf`,800:`#86198f`,900:`#701a75`,950:`#4a044e`},pink:{50:`#fdf2f8`,100:`#fce7f3`,200:`#fbcfe8`,300:`#f9a8d4`,400:`#f472b6`,500:`#ec4899`,600:`#db2777`,700:`#be185d`,800:`#9d174d`,900:`#831843`,950:`#500724`},rose:{50:`#fff1f2`,100:`#ffe4e6`,200:`#fecdd3`,300:`#fda4af`,400:`#fb7185`,500:`#f43f5e`,600:`#e11d48`,700:`#be123c`,800:`#9f1239`,900:`#881337`,950:`#4c0519`}},dV={p:`padding`,px:`padding-left,padding-right`,py:`padding-top,padding-bottom`,pt:`padding-top`,pr:`padding-right`,pb:`padding-bottom`,pl:`padding-left`,ps:`padding-left`,pe:`padding-right`,m:`margin`,mx:`margin-left,margin-right`,my:`margin-top,margin-bottom`,mt:`margin-top`,mr:`margin-right`,mb:`margin-bottom`,ml:`margin-left`,ms:`margin-left`,me:`margin-right`,gap:`gap`,"gap-x":`column-gap`,"gap-y":`row-gap`,text:`font-size`,leading:`line-height`,tracking:`letter-spacing`,rounded:`border-radius`,"rounded-t":`border-top-left-radius,border-top-right-radius`,"rounded-b":`border-bottom-left-radius,border-bottom-right-radius`,"rounded-l":`border-top-left-radius,border-bottom-left-radius`,"rounded-r":`border-top-right-radius,border-bottom-right-radius`,"rounded-tl":`border-top-left-radius`,"rounded-tr":`border-top-right-radius`,"rounded-bl":`border-bottom-left-radius`,"rounded-br":`border-bottom-right-radius`,border:`border-width`,"border-t":`border-top-width`,"border-r":`border-right-width`,"border-b":`border-bottom-width`,"border-l":`border-left-width`,w:`width`,h:`height`,size:`width,height`,"max-w":`max-width`,"max-h":`max-height`,"min-w":`min-width`,"min-h":`min-height`,opacity:`opacity`,inset:`top,right,bottom,left`,"inset-x":`left,right`,"inset-y":`top,bottom`,top:`top`,right:`right`,bottom:`bottom`,left:`left`,z:`z-index`,items:`align-items`,justify:`justify-content`,font:`font-weight`,whitespace:`white-space`},fV={"font-size":[`font-size`,`font size`,`text-size`,`text size`],color:[`color`,`text-color`,`text color`,`text-colour`,`text colour`,`foreground`,`fg`],"background-color":[`background`,`background-color`,`background color`,`bg`,`bg-color`,`bg color`],"border-color":[`border-color`,`border color`],fill:[`fill`,`fill-color`,`fill color`],stroke:[`stroke`,`stroke-color`,`stroke color`],"font-family":[`font`,`font-sans`,`font-serif`,`font-mono`,`family`,`sans`,`serif`,`mono`],"font-style":[`italic`,`not-italic`],"text-align":[`text-left`,`text-center`,`text-right`,`text-justify`],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-decoration-line":[`underline`,`line-through`,`no-underline`],"white-space":[`whitespace`,`whitespace-normal`,`whitespace-nowrap`,`whitespace-pre`],"word-break":[`break-normal`,`break-all`,`break-keep`],"overflow-wrap":[`break-words`,`break-anywhere`],"font-variant-numeric":[`tabular-nums`,`proportional-nums`,`lining-nums`,`oldstyle-nums`],"border-style":[`border-solid`,`border-dashed`,`border-dotted`,`border-none`]},pV=(()=>{let e={};for(let[t,n]of Object.entries(dV))n!==void 0&&(e[n]??=new Set).add(t);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=Array.from(r));for(let[e,n]of Object.entries(fV)){let r=new Set([...t[e]??[],...n]);t[e]=Array.from(r)}return t})(),mV={text:`color`,bg:`background-color`,border:`border-color`,"border-x":`border-color`,"border-y":`border-color`,"border-t":`border-color`,"border-r":`border-color`,"border-b":`border-color`,"border-l":`border-color`,"border-s":`border-color`,"border-e":`border-color`,fill:`fill`,stroke:`stroke`},hV=e=>dV[e]!==void 0||mV[e]!==void 0,gV=e=>{let t=0,n=-1;for(let r=0;r<e.length;r++){let i=e[r];i===`[`?t++:i===`]`?t--:i===`:`&&t===0&&(n=r)}let r=n>=0?e.slice(n+1):e;return r.startsWith(`!`)?r.slice(1):r},_V=e=>{let t=gV(e);if(!t)return null;let n=t.indexOf(`[`);if(n>0)return t.slice(0,n).replace(/-$/,``)||null;let r=t.split(`-`).filter(Boolean);if(r.length===0)return null;for(let e=r.length;e>=1;e--){let t=r.slice(0,e).join(`-`);if(hV(t))return t}return r[0]},vV=/-(red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone|black|white|transparent|current|inherit)\b/,yV=(e,t)=>e!==`text`&&e!==`bg`&&e!==`border`&&!e.startsWith(`border-`)?!1:vV.test(t),bV=new Set(`color.red.orange.amber.yellow.lime.green.emerald.teal.cyan.sky.blue.indigo.violet.purple.fuchsia.pink.rose.slate.gray.grey.zinc.neutral.stone.black.white.transparent.current.currentcolor.inherit.primary.secondary.accent.muted.foreground.background.destructive.success.warning.error.info.card.popover.input.ring`.split(`.`)),xV=new Set([`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`,`8xl`,`9xl`]),SV=/^(#|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color:|color\(|var\(--.*color)/,CV=/^(-?\d|length:|size:)/,wV=e=>e.trim().toLowerCase().replace(/\s+/g,`-`).replace(/([a-z])(\d)/g,`$1-$2`),TV=e=>SV.test(e)&&!CV.test(e),EV=(e,t)=>{if(e===t)return``;let n=`${t}-`;return e.startsWith(n)?e.slice(n.length):null},DV=e=>{let t=gV(wV(e)),n=_V(t);if(!n)return null;let r=mV[n];if(!r)return null;let i=t.indexOf(`[`);if(i>=0)return TV(t.slice(i+1).replace(/\]$/,``))?r:null;let a=EV(t,n);if(a===null)return null;if(n===`bg`&&a===``||(n===`fill`||n===`stroke`)&&a===``)return r;let o=a.split(`-`)[0];return n===`text`&&xV.has(o)?null:bV.has(o)?r:null},OV={black:`#000000`,white:`#ffffff`,transparent:DN},kV=e=>{let t=gV(wV(e)),n=_V(t);if(!n||mV[n]===void 0||t.includes(`[`))return null;let r=EV(t,n);if(!r)return null;let i=OV[r];if(i)return i;let a=r.lastIndexOf(`-`);if(a<0)return null;let o=r.slice(0,a),s=o===`grey`?`gray`:o,c=Number.parseInt(r.slice(a+1),10);return uV[s]?.[c]??null},AV=/^-?\d/,jV=(e,t)=>{if(t===``||t.startsWith(`[`)||AV.test(t))return!0;let n=t.split(`-`)[0];return e===`text`?xV.has(n):e===`font`||e===`border`||e.startsWith(`border-`)?!1:(e===`rounded`||e.startsWith(`rounded-`),!0)},MV={"font-sans":{property:`font-family`,value:`ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`},"font-serif":{property:`font-family`,value:`ui-serif, Georgia, Cambria, "Times New Roman", Times, serif`},"font-mono":{property:`font-family`,value:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`},"font-thin":{property:`font-weight`,value:`100`},"font-extralight":{property:`font-weight`,value:`200`},"font-light":{property:`font-weight`,value:`300`},"font-normal":{property:`font-weight`,value:`400`},"font-medium":{property:`font-weight`,value:`500`},"font-semibold":{property:`font-weight`,value:`600`},"font-bold":{property:`font-weight`,value:`700`},"font-extrabold":{property:`font-weight`,value:`800`},"font-black":{property:`font-weight`,value:`900`},"text-left":{property:`text-align`,value:`left`},"text-center":{property:`text-align`,value:`center`},"text-right":{property:`text-align`,value:`right`},"text-justify":{property:`text-align`,value:`justify`},italic:{property:`font-style`,value:`italic`},"not-italic":{property:`font-style`,value:`normal`},uppercase:{property:`text-transform`,value:`uppercase`},lowercase:{property:`text-transform`,value:`lowercase`},capitalize:{property:`text-transform`,value:`capitalize`},"normal-case":{property:`text-transform`,value:`none`},underline:{property:`text-decoration-line`,value:`underline`},"line-through":{property:`text-decoration-line`,value:`line-through`},"no-underline":{property:`text-decoration-line`,value:`none`},"whitespace-normal":{property:`white-space`,value:`normal`},"whitespace-nowrap":{property:`white-space`,value:`nowrap`},"whitespace-pre":{property:`white-space`,value:`pre`},"whitespace-pre-line":{property:`white-space`,value:`pre-line`},"whitespace-pre-wrap":{property:`white-space`,value:`pre-wrap`},"whitespace-break-spaces":{property:`white-space`,value:`break-spaces`},"break-normal":{property:`word-break`,value:`normal`},"break-all":{property:`word-break`,value:`break-all`},"break-keep":{property:`word-break`,value:`keep-all`},"break-words":{property:`overflow-wrap`,value:`break-word`},"break-anywhere":{property:`overflow-wrap`,value:`anywhere`},"tabular-nums":{property:`font-variant-numeric`,value:`tabular-nums`},"proportional-nums":{property:`font-variant-numeric`,value:`proportional-nums`},"lining-nums":{property:`font-variant-numeric`,value:`lining-nums`},"oldstyle-nums":{property:`font-variant-numeric`,value:`oldstyle-nums`},"slashed-zero":{property:`font-variant-numeric`,value:`slashed-zero`},"border-solid":{property:`border-style`,value:`solid`},"border-dashed":{property:`border-style`,value:`dashed`},"border-dotted":{property:`border-style`,value:`dotted`},"border-none":{property:`border-style`,value:`none`}},NV=e=>{let t=wV(e);if(!t)return[];let n=RV(t);if(n)return[n.property];let r=DV(t);return r?[r]:[]},PV=e=>{let t=wV(e);if(!t)return[];let n=_V(t);if(!n)return[];let r=EV(gV(t),n);if(r===null||!jV(n,r))return[];let i=LV(n);return i?[i]:[]},FV=e=>{let t=e.getAttribute(`class`);if(!t)return new Set;let n=t.split(/\s+/).filter(Boolean),r=new Set;for(let e of n){let t=_V(e);if(!t||yV(t,e))continue;let n=RV(e);if(n){r.add(n.property);continue}let i=LV(t);i&&r.add(i)}return r},IV=e=>pV[e]??[],LV=e=>{let t=dV[e];return t===void 0?null:t},RV=e=>{let t=MV[gV(e)];return t===void 0?null:t},zV=`react-grab-toolbar-state`,BV=()=>{try{let e=localStorage.getItem(zV);if(!e)return null;let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t,r=typeof n.collapsed==`boolean`&&n.collapsed;return{edge:n.edge===`top`||n.edge===`bottom`||n.edge===`left`||n.edge===`right`?n.edge:`bottom`,ratio:typeof n.ratio==`number`?n.ratio:_N,collapsed:r,enabled:!r,defaultAction:typeof n.defaultAction==`string`?n.defaultAction:vN}}catch(e){console.warn(`[react-grab] Failed to load toolbar state from localStorage:`,e)}return null},VV=e=>{try{localStorage.setItem(zV,JSON.stringify(e))}catch(e){console.warn(`[react-grab] Failed to save toolbar state to localStorage:`,e)}},HV=e=>{let[t,n]=J(!1);return ER(()=>{let t=BM(t=>n(e(t))),r=()=>n(!1);window.addEventListener(`keydown`,t,{capture:!0}),window.addEventListener(`keyup`,t,{capture:!0}),window.addEventListener(`blur`,r),DR(()=>{window.removeEventListener(`keydown`,t,{capture:!0}),window.removeEventListener(`keyup`,t,{capture:!0}),window.removeEventListener(`blur`,r)})}),t},UV=e=>e.key===`Enter`,WV=e=>e.metaKey||e.ctrlKey,GV=(e,t,n={})=>{if(!t.key)return null;if(UV(t))return e.find(e=>e.shortcut===`Enter`)??null;if(t.repeat)return null;let r=t.key.toLowerCase();return WV(t)?n.includeModifierShortcuts===!0?e.find(e=>e.shortcut!==void 0&&e.shortcut!==`Enter`&&e.shortcutModifier!==!1&&r===e.shortcut.toLowerCase())??null:null:e.find(e=>e.shortcut!==void 0&&e.shortcutModifier===!1&&r===e.shortcut.toLowerCase())??null},KV=()=>{let e=!1;return{arm:()=>{e=!0},clear:()=>{e=!1},consume:()=>e?(e=!1,!0):!1}}})),JV,YV,XV,ZV,QV,$V,eH,tH,nH,rH,iH,aH,oH,sH,cH,lH,uH,dH,fH,pH,mH,hH,gH,_H,vH,yH,bH,xH,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU,NU,PU,FU,IU,LU,RU,zU,BU,VU,HU,UU,WU,GU,KU,qU,JU,YU,XU,ZU,QU,$U,eW,tW,nW,rW,iW,aW=t((()=>{mR(),JV=class extends Error{constructor(e){super(e),this.name=`ReactGrabError`}},YV=class extends JV{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},XV=class extends JV{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},ZV=class extends JV{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},QV=class extends JV{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}},$V=e=>e===void 0||!Number.isFinite(e)?3:Math.max(0,Math.floor(e)),eH=e=>{try{return decodeURIComponent(e)}catch{return e}},tH=/(?:^|[/\\])node_modules[/\\]/,nH=/[/\\]\.vite[/\\]deps[^/\\]*[/\\]/,rH=/\.[mc]?[jt]sx?$/i,iH=/^chunk-[A-Za-z0-9_-]+$/,aH=/[/\\]/,oH=/^(.+?)@v?\d/,sH=e=>e.split(aH).filter(Boolean),cH=e=>{let[t,n]=sH(e);return!t||t.startsWith(`.`)?null:t.startsWith(`@`)?n?`${t}/${n}`:null:t},lH=e=>{let t=sH(e)[0];if(!t)return null;let n=t.replace(rH,``);if(iH.test(n))return null;if(!n.startsWith(`@`))return n;let r=n.indexOf(`_`);return r===-1?null:`${n.slice(0,r)}/${n.slice(r+1)}`},uH=(e,t,n)=>{let r=e.split(t);return r.length>1?n(r[r.length-1]):null},dH=e=>e?.match(oH)?.[1]??null,fH=e=>{let t;try{t=new URL(e)}catch{return null}if(!t.hostname)return null;let n=sH(t.pathname).map(eH);for(let[e,t]of n.entries()){if(t.startsWith(`@`)){let r=dH(n[e+1]);if(r)return`${t}/${r}`;continue}let r=dH(t);if(r)return r}return null},pH=e=>uH(e,nH,lH)??uH(e,tH,cH),mH=e=>{if(!e)return null;let t=gF(e);return t&&(pH(eH(t))||fH(e))||null},hH=/^@[A-Za-z0-9][A-Za-z0-9._-]*$/,gH=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,_H=new Set([`app`,`web`,`website`,`frontend`,`client`,`src`]),vH=new Set([`app`,`src`,`components`,`pages`,`features`,`modules`,`hooks`,`lib`,`utils`,`ui`,`shared`,`common`,`core`,`styles`,`assets`]),yH=e=>{let t=e;for(;t.startsWith(`../`)||t.startsWith(`./`);)t=t.slice(t.startsWith(`../`)?3:2);return t},bH=e=>{let t=yH(eH(gF(e)));if(t.startsWith(`/`))return null;let[n,r,...i]=sH(t);return!n||!r||i.length===0||!hH.test(n)||vH.has(n.slice(1))||!gH.test(r)||rH.test(r)||_H.has(r)?null:`${n}/${r}`},xH=e=>e?mH(e)??bH(e):null,SH=e=>{if(!e)return{origin:`unknown`,packageName:null};let t=xH(e);return t?{origin:`package`,packageName:t}:_F(e)?{origin:`app`,packageName:null}:{origin:`unknown`,packageName:null}},CH=new Set([`role`,`name`,`aria-label`,`rel`,`href`]),wH=e=>{if(!/^[a-z-]{3,}$/i.test(e))return!1;let t=e.split(/-|[A-Z]/);for(let e of t)if(e.length<=2||/[^aeiou]{4,}/i.test(e))return!1;return!0},TH=(e,t)=>{let n=CH.has(e)||e.startsWith(`data-`)&&wH(e),r=wH(t)&&t.length<100||t.startsWith(`#`)&&wH(t.slice(1));return n&&r},EH=e=>{let t=e[0].name;for(let n=1;n<e.length;n++)t=`${e[n].name} > ${t}`;return t},DH=e=>{let t=0;for(let n of e)t+=n.penalty;return t},OH=(e,t)=>DH(e)-DH(t),kH=(e,t)=>{let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let i=0;for(;r&&(r instanceof Element&&(t===void 0||r.tagName.toLowerCase()===t)&&i++,r!==e);)r=r.nextSibling;return i},AH=(e,t)=>e===`html`?`html`:`${e}:nth-child(${t})`,jH=(e,t)=>e===`html`?`html`:`${e}:nth-of-type(${t})`,MH=(e,t)=>{let n=[],r=e.getAttribute(`id`),i=e.tagName.toLowerCase();r&&wH(r)&&n.push({name:`#${CSS.escape(r)}`,penalty:0});for(let t of e.classList)wH(t)&&n.push({name:`.${CSS.escape(t)}`,penalty:1});for(let r of e.attributes)t(r.name,r.value)&&n.push({name:`[${CSS.escape(r.name)}="${CSS.escape(r.value)}"]`,penalty:2});n.push({name:i,penalty:5});let a=kH(e,i);a!==void 0&&n.push({name:jH(i,a),penalty:10});let o=kH(e);return o!==void 0&&n.push({name:AH(i,o),penalty:50}),n},NH=(e,t=XM,n=[])=>{if(t<=0)return[];if(e.length===0)return[n];let r=[];for(let i of e[0]){let a=t-r.length;if(a<=0)break;r.push(...NH(e.slice(1),a,[...n,i]))}return r},PH=(e,t)=>{let n=t.getRootNode?.();return n instanceof ShadowRoot?n:e instanceof Document?e:e.ownerDocument},FH=(e,t)=>t.querySelectorAll(EH(e)).length===1,IH=(e,t)=>{let n=e,r=[];for(;n&&n!==t;){let e=n.tagName.toLowerCase(),t=kH(n,e);if(t===void 0)return;r.push({name:jH(e,t),penalty:10}),n=n.parentElement}return FH(r,t)?r:void 0},LH=(e,t,n,r)=>{if(e.nodeType!==Node.ELEMENT_NODE)throw new YV;if(e.tagName.toLowerCase()===`html`)return`html`;let i=PH(t,e),a=Date.now(),o=[],s=e,c=0,l;for(;s&&s!==i&&!l;)if(o.push(MH(s,r)),s=s.parentElement,c++,c>=3){let t=NH(o);t.sort(OH);for(let r of t){if(Date.now()-a>n){let t=IH(e,i);if(!t)throw new XV(n);return EH(t)}if(FH(r,i)){l=r;break}}}if(!l&&c<3){let e=NH(o);e.sort(OH);for(let t of e){if(Date.now()-a>n)break;if(FH(t,i)){l=t;break}}}if(!l)throw new ZV;return EH(l)},RH=e=>e.ownerDocument.body??e.ownerDocument.documentElement,zH=new Set([`data-testid`,`data-test-id`,`data-test`,`data-cy`,`data-qa`,`aria-label`,`href`,`src`,`role`,`name`,`title`,`alt`]),BH=e=>e.length>0&&e.length<=120,VH=(e,t)=>{try{let n=e.ownerDocument.querySelectorAll(t);return n.length===1&&n[0]===e}catch{return!1}},HH=e=>{if(e instanceof HTMLElement&&e.id){let t=`#${CSS.escape(e.id)}`;if(VH(e,t))return t}for(let t of zH){let n=e.getAttribute(t);if(!n||!BH(n))continue;let r=`[${t}=${JSON.stringify(n)}]`;if(VH(e,r))return r;let i=`${e.tagName.toLowerCase()}${r}`;if(VH(e,i))return i}return null},UH=e=>{let t=[],n=RH(e),r=e;for(;r;){if(r instanceof HTMLElement&&r.id){t.unshift(`#${CSS.escape(r.id)}`);break}let e=r.parentElement;if(!e){t.unshift(r.tagName.toLowerCase());break}let i=Array.from(e.children).indexOf(r)+1;if(t.unshift(`${r.tagName.toLowerCase()}:nth-child(${i})`),e===n){t.unshift(n.tagName.toLowerCase());break}r=e}return t.join(` > `)},WH=e=>{let t=HH(e);if(t)return t;try{let t=LH(e,RH(e),200,(e,t)=>TH(e,t)||zH.has(e)&&BH(t));if(t)return t}catch{}return UH(e)},GH=e=>{if(!e)return!1;let t=`/${YF(e)}/`.toLowerCase();return qM.some(e=>t.includes(e))},KH=e=>e.map(e=>`\n in ${e}`).join(``),qH=[`about://React/`,`rsc://React/`],JH=e=>qH.some(t=>e.startsWith(t)),YH=e=>{for(let t of qH){if(!e.startsWith(t))continue;let n=e.indexOf(`/`,t.length);if(n===-1)continue;let r=n+1,i=e.lastIndexOf(`?`);return eH(i>r?e.slice(r,i):e.slice(r))}return e},XH=e=>{if(typeof e!=`object`||!e||!(`status`in e)||e.status!==`fulfilled`||!(`value`in e)||typeof e.value!=`object`||e.value===null||!(`originalStackFrame`in e.value))return null;let t=e.value.originalStackFrame;return typeof t!=`object`||!t||!(`file`in t)||typeof t.file!=`string`||!t.file||`ignored`in t&&t.ignored?null:{file:t.file,line1:`line1`in t&&typeof t.line1==`number`?t.line1:null,column1:`column1`in t&&typeof t.column1==`number`?t.column1:null}},ZH=async(e,t)=>{let n=[],r=[];for(let t=0;t<e.length;t++){let i=e[t];!i.isServer||!i.fileName||(n.push(t),r.push({file:YH(i.fileName),methodName:i.functionName??`<unknown>`,line1:i.lineNumber??null,column1:i.columnNumber??null,arguments:[]}))}if(r.length===0)return e;let i=new AbortController,a=setTimeout(()=>i.abort(),JM),o=()=>i.abort();t?.aborted&&i.abort(),t?.addEventListener(`abort`,o);try{let t=await fetch(`${$F()}/__nextjs_original-stack-frames`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({frames:r,isServer:!0,isEdgeServer:!1,isAppDirectory:!0}),priority:`high`,signal:i.signal});if(!t.ok)return e;let a=await t.json();if(!Array.isArray(a))return e;let o=[...e];for(let t=0;t<n.length;t++){let r=XH(a[t]);if(!r)continue;let i=n[t];o[i]={...e[i],fileName:r.file,lineNumber:r.line1??void 0,columnNumber:r.column1??void 0,isSymbolicated:!0}}return o}catch{return e}finally{clearTimeout(a),t?.removeEventListener(`abort`,o)}},QH=e=>{let t=new Map;return EM(e,e=>{if(!YP(e))return!1;let n=iF(e._debugStack.stack);if(!n)return!1;for(let e of TP(n))!e.functionName||!e.fileName||JH(e.fileName)&&(t.has(e.functionName)||t.set(e.functionName,{...e,isServer:!0}));return!1},!0),t},$H=(e,t)=>{if(!t.some(e=>e.isServer&&!e.fileName&&e.functionName))return t;let n=QH(e);return n.size===0?t:t.map(e=>{if(!e.isServer||e.fileName||!e.functionName)return e;let t=n.get(e.functionName);return t?{...e,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber}:e})},eU=0,tU=[],nU=()=>eU<3?(eU+=1,Promise.resolve()):new Promise(e=>{tU.push(e)}),rU=()=>{let e=tU.shift();if(e){e();return}--eU},iU=async(e,t,n=YM)=>{await nU();let r=new AbortController,i,a=new Promise(e=>{i=setTimeout(()=>{r.abort(),e(t)},n)}),o=e(r.signal);o.catch(()=>{});try{return await Promise.race([o,a])}finally{clearTimeout(i),rU()}},aU=(e,t)=>e.length>t?`${e.slice(0,t)}...`:e,oU=e=>e.startsWith(`data-react-grab-`),sU=e=>e.replace(/\s+/g,` `).trim(),cU=e=>{let t=[];for(let n of e.childNodes){if(n.nodeType!==Node.TEXT_NODE)continue;let e=sU(n.textContent??``);e&&t.push(e)}return t.join(` `)},lU=e=>e.getAttribute(`aria-hidden`)===`true`||e.hasAttribute(`hidden`)?!0:dN.has(e.tagName.toLowerCase()),uU=(e,t,n)=>{if(e.nodeType===Node.TEXT_NODE){let r=sU(e.textContent??``);return r?(t.push(r),n-r.length):n}if(!(e instanceof Element)||lU(e))return n;for(let r of e.childNodes)if(n=uU(r,t,n),n<=0)break;return n},dU=(e,t)=>{if(lU(e))return``;let n=cU(e);if(!uN.has(t)||n&&e.children.length===0)return n;let r=[];return uU(e,r,100),r.join(` `)},fU=e=>aU(e,15),pU=e=>{let t=[];for(let n of cN){let r=e.getAttribute(n);r&&t.push(`${n}="${r}"`)}return t.length>0?` ${t.join(` `)}`:``},mU=e=>e===`class`||e===`className`||e===`style`,hU=e=>{let t=[],n=[],r=``;for(let{name:i,value:a}of e.attributes)if(!oU(i)){if(mU(i)){i!==`style`&&a&&(r=` class="${fU(a)}"`);continue}lN.has(i)?t.push(a?` ${i}="${a}"`:` ${i}`):a&&n.push(` ${i}="${fU(a)}"`)}return t.join(``)+n.join(``)+r},gU=e=>e.length===0?``:e.length<=2?e.map(e=>`<${zN(e)} ...>`).join(`
258
- `):`(${e.length} elements)`,_U=e=>{let t=zN(e);if(!(e instanceof HTMLElement))return`<${t}${pU(e)} />`;let n=hU(e),r=aU(dU(e,t),100);return r?`<${t}${n}>${r}</${t}>`:`<${t}${n} />`},vU=e=>{let t=zN(e),n=hU(e),r=dU(e,t),i=[],a=[],o=!1;for(let t of e.childNodes)t.nodeType!==Node.COMMENT_NODE&&(t.nodeType===Node.TEXT_NODE?t.textContent&&t.textContent.trim().length>0&&(o=!0):t instanceof Element&&(o?a.push(t):i.push(t)));let s=r.length>0&&uN.has(t),c=``,l=gU(i);l&&!s&&(c+=`\n ${l}`),r&&(c+=`\n ${aU(r,100)}`);let u=gU(a);return u&&!s&&(c+=`\n ${u}`),c.length>0?`<${t}${n}>${c}\n</${t}>`:`<${t}${n} />`},yU=new Set([`_`,`$`,`motion.`,`styled.`,`chakra.`,`ark.`,`Primitive.`,`Slot.`]),bU=new Set(`AppRouter.AppRouterAnnouncer.AppDevOverlay.AppDevOverlayErrorBoundary.ClientPageRoot.ClientSegmentRoot.DevRootHTTPAccessFallbackBoundary.ErrorBoundary.ErrorBoundaryHandler.GracefulDegradeBoundary.HTTPAccessErrorFallback.HTTPAccessFallbackBoundary.HTTPAccessFallbackErrorBoundary.HandleRedirect.Head.HistoryUpdater.HotReload.InnerLayoutRouter.InnerScrollAndFocusHandler.InnerScrollAndFocusHandlerOld.InnerScrollAndMaybeFocusHandler.InnerScrollHandlerNew.LoadableComponent.LoadingBoundary.LoadingBoundaryProvider.NotAllowedRootHTTPFallbackError.OfflineProvider.OuterLayoutRouter.RedirectBoundary.RedirectErrorBoundary.RenderFromTemplateContext.RenderValidationBoundaryAtThisLevel.ReplaySsrOnlyErrors.RootErrorBoundary.RootLevelDevOverlayElement.Router.ScrollAndFocusHandler.ScrollAndMaybeFocusHandler.SegmentBoundaryTrigger.SegmentBoundaryTriggerNode.SegmentStateProvider.SegmentTrieNode.SegmentViewNode.SegmentViewStateNode.ServerRoot.body.html`.split(`.`)),xU=new Set([`Suspense`,`Fragment`,`StrictMode`,`Profiler`,`SuspenseList`]),SU=new Set([`MotionDOMComponent`]),CU=e=>{if(bU.has(e)||xU.has(e)||SU.has(e))return!0;for(let t of yU)if(e.startsWith(t))return!0;return!1},wU=e=>!(!e||CU(e)||e===`SlotClone`||e===`Slot`),TU=e=>!(e.length<=1||CU(e)||e[0]!==e[0].toUpperCase()||e.endsWith(`Provider`)||e.endsWith(`Context`)),EU=e=>e&&TU(e)?e:null,DU=e=>{if(!fP())return e;let t=e;for(;t;){if(pP(t))return t;t=t.parentElement}return e},OU=e=>{if(!fP())return null;let t=pP(DU(e)),n=0;for(;t;){if(t.key)return t.key;if(sP(t)&&(n+=1,n===2))break;t=t.return}return null},kU=new WeakMap,AU=new WeakMap,jU=e=>t=>fetch(t,{signal:e,priority:`high`}),MU=e=>iU(async t=>{try{let n=pP(e);if(!n)return null;let r=await uF(n,!0,jU(t));return ZF()?await ZH($H(n,r),t):r}catch{return null}},null),NU=e=>{if(!fP())return Promise.resolve([]);let t=DU(e),n=kU.get(t);if(n)return n;let r=MU(t).then(e=>(e===null&&kU.delete(t),e));return kU.set(t,r),r},PU=async e=>{if(!fP())return null;let t=await NU(e);if(!t)return null;for(let e of t){let t=EU(e.functionName);if(t)return t}return null},FU=e=>e.find(e=>!!EU(e.functionName))??e[0]??null,IU=e=>!e||!sP(e)?null:EU(dP(e.type)),LU=e=>iU(async t=>{let n=pP(DU(e));if(!n)return null;try{let e=await fF(n,!0,jU(t));return e?.fileName?{filePath:YF(e.fileName),lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null,componentName:EU(e.functionName)??IU(n._debugOwner),origin:SH(e.fileName).origin}:null}catch{return null}},null),RU=e=>{let t=DU(e),n=AU.get(t);if(n)return n;let r=LU(t).then(e=>(e||AU.delete(t),e));return AU.set(t,r),r},zU=[`app`,`package`],BU=(e,t)=>{for(let n of zU){if(e?.origin===n)return e;let r=FU(t.filter(e=>SH(e.fileName).origin===n));if(r?.fileName)return{filePath:YF(r.fileName),lineNumber:r.lineNumber??null,columnNumber:r.columnNumber??null,componentName:EU(r.functionName),origin:n}}return null},VU=async e=>{let t=await RU(e);return t?.origin===`app`?t:BU(t,await NU(e)??[])},HU=e=>UU(DU(e),1)[0]??null,UU=(e,t,n=()=>!0)=>{if(!fP())return[];let r=pP(e);if(!r)return[];let i=[];return EM(r,e=>{if(i.length>=t)return!0;if(sP(e)){let t=dP(e.type);t&&wU(t)&&n(t)&&i.push(t)}return!1},!0),i},WU=[`/src/app/`,`/src/pages/`,`/app/`,`/pages/`],GU=(e,t)=>{let n=YF(e);if(!t||!n.startsWith(`/`))return n;for(let e of WU){let t=n.indexOf(e);if(t!==-1)return`/./${n.slice(t+1)}`}return n},KU=(e,t)=>{let n=GU(e.filePath,t),r=t&&e.lineNumber?`${n}:${e.lineNumber}${e.columnNumber?`:${e.columnNumber}`:``}`:n;return e.componentName?`\n in ${e.componentName} (at ${r})`:`\n in ${r}`},qU={isAppSource:!1,consumesBudget:!1},JU=(e,t,n,r)=>{let i=t.packageName,a=t.origin===`app`?e.fileName:null;if(e.isServer&&!a&&(n||!e.functionName)){let e=i?`${i} at Server`:`at Server`;return{text:`\n in ${n??`<anonymous>`} (${e})`,...qU}}return!a&&n?{text:i?`\n in ${n} (${i})`:`\n in ${n}`,...qU}:i?{text:`\n in ${i}`,...qU}:a?{text:KU({componentName:n,filePath:a,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null},r),isAppSource:!0,consumesBudget:!GH(a)}:null},YU=(e,t={},n=null)=>{let r=$V(t.maxLines),i=Math.max(r,20),a=ZF(),o=[],s=new Set,c=null,l=!1,u=!1,d=!1,f=0,p=e=>{e&&s.add(e)};n&&(u=n.origin===`app`,GH(n.filePath)||(f+=1),p(n.componentName),o.push(KU(n,a)));for(let t of e){if(f>=r||o.length>=i)break;let e=SH(t.fileName),s=EU(t.functionName),m=e.packageName?`${e.packageName}:${s??``}:${t.isServer?`server`:`client`}`:null;if(m&&m===c)continue;if(!l&&s&&s===n?.componentName){l=!0;continue}let h=JU(t,e,s,a);h!==null&&h.text!==o[o.length-1]&&(h.isAppSource&&(u=!0),h.consumesBudget&&(f+=1,d=!0),p(s),o.push(h.text),c=m)}return{text:o.join(``),shouldAppendSelectorHint:!u,hasBudgetedStackFrame:d,renderedComponentNames:s}},XU=async e=>{let t=await RU(e);return t?.origin===`app`?t:null},ZU=(e,t,n)=>{let r=UU(DU(e),n,e=>TU(e)&&!t.renderedComponentNames.has(e));return r.length===0?t:{...t,text:`${t.text}${KH(r)}`}},QU=async(e,t={})=>{let n=await XU(e),r=await NU(e),i=$V(t.maxLines),a=YU(r??[],t,n);if(a.text)return a.hasBudgetedStackFrame?a:ZU(e,a,i);let o=UU(DU(e),i);return{text:KH(o),shouldAppendSelectorHint:!0,hasBudgetedStackFrame:!1,renderedComponentNames:new Set(o)}},$U=async(e,t={})=>(await QU(e,t)).text,eW=(e,t)=>{let n=OU(e),r=n===null?``:`\n key: "${n}"`,i=t.shouldAppendSelectorHint?`\n selector: ${WH(e)}`:``;return`${t.text}${r}${i}`},tW=async(e,t={})=>{let n=await QU(e,t);return`${_U(e)}${eW(e,n).replace(/\n\s+/g,` `)}`},nW=async(e,t={})=>{let n=DU(e);return`${vU(n)}${eW(n,await QU(n,t))}`},rW=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`),iW=(e,t)=>{let n=t?.componentName??`div`,r={version:HM,content:e,entries:t?.entries??[{tagName:t?.tagName,componentName:n,content:e,commentText:t?.commentText}],timestamp:Date.now()},i=t=>{t.preventDefault(),t.clipboardData?.setData(`text/plain`,e),t.clipboardData?.setData(`text/html`,`<meta charset='utf-8'><pre><code>${rW(e)}</code></pre>`),t.clipboardData?.setData(`application/x-react-grab`,JSON.stringify(r))};document.addEventListener(`copy`,i);let a=document.createElement(`textarea`);a.value=e,a.style.position=`fixed`,a.style.left=`-9999px`,a.ariaHidden=`true`,document.body.appendChild(a),a.select();try{return typeof document.execCommand==`function`&&document.execCommand(`copy`)}finally{document.removeEventListener(`copy`,i),a.remove()}}})),oW=r({ReactGrabRenderer:()=>DJ}),sW,cW,lW,uW,dW,fW,pW,mW,hW,gW,_W,vW,yW,bW,xW,SW,CW,wW,TW,EW,DW,OW,kW,AW,jW,MW,NW,PW,FW,IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW,qW,JW,YW,XW,ZW,QW,$W,eG,tG,nG,rG,iG,aG,oG,sG,cG,lG,uG,dG,fG,pG,mG,hG,gG,_G,vG,yG,bG,xG,SG,CG,wG,TG,EG,DG,OG,kG,AG,jG,MG,NG,PG,FG,IG,LG,RG,zG,BG,VG,HG,UG,WG,GG,KG,qG,JG,YG,XG,ZG,QG,$G,eK,tK,nK,rK,iK,aK,oK,sK,cK,lK,uK,dK,fK,pK,mK,hK,gK,_K,vK,yK,bK,xK,SK,CK,wK,TK,EK,DK,OK,kK,AK,jK,MK,NK,PK,FK,IK,LK,RK,zK,BK,VK,HK,UK,WK,GK,KK,qK,JK,YK,XK,ZK,QK,$K,eq,tq,nq,rq,iq,aq,oq,sq,cq,lq,uq,dq,fq,pq,mq,hq,gq,_q,vq,yq,bq,xq,Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ=t((()=>{qV(),mR(),sW=(e,t,n)=>e+(t-e)*n,cW=(e,t)=>{let n=Math.max(t,1);return 1-(1-e)**(n/eN)},lW=Z(`<canvas data-react-grab-overlay-canvas style=position:fixed;top:0;left:0;pointer-events:none>`),uW={borderColor:iN,fillColor:aN,lerpFactor:GM},dW={drag:{borderColor:nN,fillColor:rN,lerpFactor:$M},selection:uW,grabbed:uW},fW=e=>{let t,n=null,r=0,i=0,a=1,o=null,s=null,c={drag:{canvas:null,context:null},selection:{canvas:null,context:null},grabbed:{canvas:null,context:null}},l=[],u=null,d=[],f=NM()?`display-p3`:`srgb`,p=(e,t,n)=>{let r=new OffscreenCanvas(e*n,t*n),i=r.getContext(`2d`,{colorSpace:f});return i&&i.scale(n,n),{canvas:r,context:i}},m=()=>{if(t){a=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,i=window.innerHeight,t.width=r*a,t.height=i*a,t.style.width=`${r}px`,t.style.height=`${i}px`,n=t.getContext(`2d`,{colorSpace:f}),n&&n.scale(a,a);for(let e of Object.keys(c))c[e]=p(r,i,a)}},h=e=>{if(!e)return 0;let t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):0},g=(e,t,n)=>({id:e,current:{x:t.x,y:t.y,width:t.width,height:t.height},target:{x:t.x,y:t.y,width:t.width,height:t.height},borderRadius:h(t.borderRadius),opacity:n?.opacity??1,targetOpacity:n?.targetOpacity??n?.opacity??1,createdAt:n?.createdAt,fadeStartTimestamp:null,isInitialized:!0}),_=(e,t,n)=>{let r=e.target;r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height,e.borderRadius=h(t.borderRadius),n!==void 0&&(e.targetOpacity=n)},v=e=>e.boundsMultiple??[e.bounds],y=(e,t,n,r,i,a,o,s,c=1)=>{if(r<=0||i<=0)return;let l=Math.min(r/2,i/2),u=Math.min(a,l),d=c!==1;d&&(e.globalAlpha=c),e.beginPath(),u>0?e.roundRect(t,n,r,i,u):e.rect(t,n,r,i),e.fillStyle=o,e.fill(),e.strokeStyle=s,e.lineWidth=1,e.stroke(),d&&(e.globalAlpha=1)},b=()=>{let t=c.drag;if(!t.context)return;let n=t.context;if(n.clearRect(0,0,r,i),!e.dragVisible||!u)return;let a=dW.drag;y(n,u.current.x,u.current.y,u.current.width,u.current.height,u.borderRadius,a.fillColor,a.borderColor)},x=()=>{let t=c.selection;if(!t.context)return;let n=t.context;if(n.clearRect(0,0,r,i),!e.selectionVisible)return;let a=dW.selection;for(let e of l)y(n,e.current.x,e.current.y,e.current.width,e.current.height,e.borderRadius,a.fillColor,a.borderColor,e.opacity)},S=(e,t)=>{let n=c[e];if(!n.context)return;let a=n.context;a.clearRect(0,0,r,i);let o=dW[e];for(let e of t)y(a,e.current.x,e.current.y,e.current.width,e.current.height,e.borderRadius,o.fillColor,o.borderColor,e.opacity)},C=()=>{if(!(!n||!t)&&!(r<=0||i<=0)){n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.width,t.height),n.setTransform(a,0,0,a,0,0),b(),x(),S(`grabbed`,d);for(let e of[`drag`,`selection`,`grabbed`]){let t=c[e];t.canvas&&n.drawImage(t.canvas,0,0,r,i)}}},w=(e,t,n)=>{let r=sW(e.current.x,e.target.x,t),i=sW(e.current.y,e.target.y,t),a=sW(e.current.width,e.target.width,t),o=sW(e.current.height,e.target.height,t),s=Math.abs(r-e.target.x)<.5&&Math.abs(i-e.target.y)<.5&&Math.abs(a-e.target.width)<.5&&Math.abs(o-e.target.height)<.5;e.current.x=s?e.target.x:r,e.current.y=s?e.target.y:i,e.current.width=s?e.target.width:a,e.current.height=s?e.target.height:o;let c=!0;if(n?.interpolateOpacity){let n=sW(e.opacity,e.targetOpacity,t);c=Math.abs(n-e.targetOpacity)<tN,e.opacity=c?e.targetOpacity:n}return!s||!c},T=()=>{let e=performance.now(),t=s===null?eN:e-s;s=e;let n=cW(dW.drag.lerpFactor,t),r=cW(dW.selection.lerpFactor,t),i=cW(dW.grabbed.lerpFactor,t),a=!1;u?.isInitialized&&w(u,n)&&(a=!0);for(let e of l)e.isInitialized&&w(e,r)&&(a=!0);let c=Date.now();d=d.filter(t=>{let n=t.id.startsWith(`label-`);if(t.isInitialized&&w(t,i)&&(a=!0),n&&t.targetOpacity===0){t.fadeStartTimestamp===null&&(t.fadeStartTimestamp=e);let n=e-t.fadeStartTimestamp,r=Math.min(1,n/125),i=1-(1-r)*(1-r);return t.opacity=Math.max(0,1-i),r>=1?!1:(a=!0,!0)}else n&&(t.fadeStartTimestamp=null);if(t.createdAt){let e=c-t.createdAt;if(e>=1625)return!1;if(e>1500){let n=Math.min(1,(e-KM)/125);t.opacity=1-(1-(1-n)*(1-n)),a=!0}return!0}return n?!0:t.opacity>0}),C(),a?o=rI(T):(o=null,s=null)},E=()=>{o===null&&(o=rI(T))},D=()=>{m(),E()};return bR(TR(()=>[e.selectionVisible,e.selectionBounds,e.selectionBoundsMultiple,e.selectionShouldSnap],([e,t,n,r])=>{if(!e||!t&&(!n||n.length===0)){l=[],E();return}let i;i=n&&n.length>0?n:t?[t]:[];let a=new Map;for(let e of l)a.set(e.id,e);l=i.map((e,t)=>{let n=`selection-${t}`,i=a.get(n);return i?(_(i,e),r&&(i.current.x=i.target.x,i.current.y=i.target.y,i.current.width=i.target.width,i.current.height=i.target.height),i):g(n,e)}),E()})),bR(TR(()=>[e.dragVisible,e.dragBounds],([e,t])=>{if(!e||!t){u=null,E();return}u?_(u,t):u=g(`drag`,t),E()})),bR(TR(()=>[e.grabbedBoxes,e.labelInstances],([e,t])=>{let n=e??[],r=t??[],i=new Map;for(let e of n)i.set(e.id,e);let a=new Map;for(let e of d)a.set(e.id,e);for(let e of n)if(!a.has(e.id)){let t=g(e.id,e.bounds,{createdAt:e.createdAt});d.push(t),a.set(e.id,t)}for(let e of d){let t=i.get(e.id);t&&_(e,t.bounds)}let o=new Set;for(let e of r){let t=v(e),n=e.status===`fading`?0:1;for(let r=0;r<t.length;r++){let i=t[r],s=`label-${e.id}-${r}`;o.add(s);let c=a.get(s);if(c)_(c,i,n);else{let e=g(s,i,{opacity:1,targetOpacity:n});d.push(e),a.set(s,e)}}}d=d.filter(e=>e.id.startsWith(`label-`)?o.has(e.id):i.has(e.id)),E()})),ER(()=>{m(),E(),window.addEventListener(`resize`,D);let e=null,t=()=>{Math.max(window.devicePixelRatio||1,2)!==a&&(D(),n())},n=()=>{e&&e.removeEventListener(`change`,t),e=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),e.addEventListener(`change`,t)};n(),DR(()=>{window.removeEventListener(`resize`,D),e&&e.removeEventListener(`change`,t),o!==null&&iI(o)})}),(()=>{var e=lW(),n=t;return typeof n==`function`?Sz(n,e):t=e,yR(t=>bz(e,`z-index`,String(QM))),e})()},pW=Z(`<div style=position:fixed;pointer-events:none;will-change:opacity;contain:strict;transform:translateZ(0)>`),mW=e=>{let t=RM(),n=t?getComputedStyle(t).borderRadius:`0px`,r=()=>t?.getBoundingClientRect()??null,[i,a]=J(r());if(t){let n=()=>a(r());ER(()=>{let e=new ResizeObserver(n);e.observe(t),window.addEventListener(`scroll`,n,{capture:!0,passive:!0}),window.addEventListener(`resize`,n),DR(()=>{e.disconnect(),window.removeEventListener(`scroll`,n,{capture:!0}),window.removeEventListener(`resize`,n)})}),bR(()=>{e.visible&&n()})}let o=()=>{let e=i();return e?`${e.top}px`:`0`},s=()=>{let e=i();return e?`${e.left}px`:`0`},c=()=>{let e=i();return e?`${e.width}px`:`100%`},l=()=>{let e=i();return e?`${e.height}px`:`100%`};return(()=>{var t=pW();return bz(t,`border-radius`,n),bz(t,`z-index`,QM),bz(t,`transition`,`opacity 125ms ease-out`),bz(t,`box-shadow`,`inset 0 0 50px ${oN}`),yR(n=>{var r=o(),i=s(),a=c(),u=l(),d=+!!e.visible;return r!==n.e&&bz(t,`top`,n.e=r),i!==n.t&&bz(t,`left`,n.t=i),a!==n.a&&bz(t,`width`,n.a=a),u!==n.o&&bz(t,`height`,n.o=u),d!==n.i&&bz(t,`opacity`,n.i=d),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),t})()},hW=(e,t)=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,t)}px`},gW=(e,t)=>{e&&e.focus(t)},_W=e=>{if(e<=0)return 8;let t=e*sN;return Math.round(Math.max(4,Math.min(8,t)))},vW=()=>{let e=RM();if(e){let t=e.getBoundingClientRect();return{width:t.width,height:t.height,offsetLeft:t.left,offsetTop:t.top}}let t=window.visualViewport;return t?{width:t.width,height:t.height,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop}:{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0}},yW=e=>{if(typeof e==`string`||typeof e==`number`)return String(e);if(!e||typeof e!=`object`)return``;if(Array.isArray(e)){let t=``;for(let n of e){if(!n)continue;let e=yW(n);e&&(t=t?`${t} ${e}`:e)}return t}let t=``;for(let n in e)e[n]&&(t=t?`${t} ${n}`:n);return t},bW=(...e)=>{let t=``;for(let n of e){if(!n)continue;let e=yW(n);e&&(t=t?`${t} ${e}`:e)}return t},xW=e=>e.elementsCount&&e.elementsCount>1?{tagName:`${e.elementsCount} elements`,componentName:void 0}:{tagName:e.tagName||e.componentName||`element`,componentName:e.tagName?e.componentName:void 0},SW=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M19.2929 12.7071C19.6834 13.0976 20.3166 13.0976 20.7071 12.7071C21.0976 12.3166 21.0976 11.6834 20.7071 11.2929L12.7071 3.29289C12.5196 3.10536 12.2652 3 12 3C11.7348 3 11.4804 3.10536 11.2929 3.29289L3.29289 11.2929C2.90237 11.6834 2.90237 12.3166 3.29289 12.7071C3.68342 13.0976 4.31658 13.0976 4.70711 12.7071L11 6.41421L11 20C11 20.5523 11.4477 21 12 21C12.5523 21 13 20.5523 13 20L13 6.41422L19.2929 12.7071Z">`),CW=e=>{let t=()=>e.size??10;return(()=>{var n=SW();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},wW=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path class=icon-loader-bar d="M12 2v4"style=animation-delay:0ms></path><path class=icon-loader-bar d="M15 6.8l2-3.5"style=animation-delay:-42ms></path><path class=icon-loader-bar d="M17.2 9l3.5-2"style=animation-delay:-83ms></path><path class=icon-loader-bar d="M18 12h4"style=animation-delay:-125ms></path><path class=icon-loader-bar d="M17.2 15l3.5 2"style=animation-delay:-167ms></path><path class=icon-loader-bar d="M15 17.2l2 3.5"style=animation-delay:-208ms></path><path class=icon-loader-bar d="M12 18v4"style=animation-delay:-250ms></path><path class=icon-loader-bar d="M9 17.2l-2 3.5"style=animation-delay:-292ms></path><path class=icon-loader-bar d="M6.8 15l-3.5 2"style=animation-delay:-333ms></path><path class=icon-loader-bar d="M2 12h4"style=animation-delay:-375ms></path><path class=icon-loader-bar d="M6.8 9l-3.5-2"style=animation-delay:-417ms></path><path class=icon-loader-bar d="M9 6.8l-2-3.5"style=animation-delay:-458ms>`),TW=e=>{let t=()=>e.size??16;return(()=>{var n=wW();return n.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling,yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},EW=Z(`<svg data-react-grab-arrow class="absolute block z-10"><path>`),DW=e=>{let t=()=>e.color??`var(--rg-panel-bg)`,n=()=>e.position===`bottom`,r=()=>_W(e.labelWidth??0),i=()=>r()*2,a=()=>r(),o=()=>{let e=i(),t=a(),r=1*Math.SQRT1_2,o=e/2,s=n()?t:0,c=n()?r:t-r,l=+!!n();return`M0 ${s} L${o-r} ${c} A1 1 0 0 ${l} ${o+r} ${c} L${e} ${s} Z`};return(()=>{var r=EW(),s=r.firstChild;return yR(c=>{var l=i(),u=a(),d=`0 0 ${i()} ${a()}`,f=`calc(${e.leftPercent}% + ${e.leftOffsetPx}px)`,p=n()?`0`:void 0,m=n()?void 0:`0`,h=n()?`translateX(-50%) translateY(calc(-100% + 1px))`:`translateX(-50%) translateY(calc(100% - 1px))`,g=o(),_=t();return l!==c.e&&Q(r,`width`,c.e=l),u!==c.t&&Q(r,`height`,c.t=u),d!==c.a&&Q(r,`viewBox`,c.a=d),f!==c.o&&bz(r,`left`,c.o=f),p!==c.i&&bz(r,`top`,c.i=p),m!==c.n&&bz(r,`bottom`,c.n=m),h!==c.s&&bz(r,`transform`,c.s=h),g!==c.h&&Q(s,`d`,c.h=g),_!==c.r&&Q(s,`fill`,c.r=_),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),r})()},OW=Z(`<span class=text-[var(--rg-text-primary)]>`),kW=Z(`<span class=text-[var(--rg-text-secondary)]>.`),AW=Z(`<span class="text-[13px] leading-4 h-fit font-medium overflow-hidden text-ellipsis whitespace-nowrap min-w-0">`),jW=Z(`<button type=button>`),MW=Z(`<div>`),NW=e=>{let t=()=>{e.onHoverChange?.(!0)},n=()=>{e.onHoverChange?.(!1)},r=()=>e.componentName?`${e.componentName}.${e.tagName}`:e.tagName,i=()=>(()=>{var t=AW();return $(t,X(sz,{get when(){return e.componentName},get children(){return[(()=>{var t=OW();return $(t,()=>e.componentName),t})(),(()=>{var t=kW();return t.firstChild,$(t,()=>e.tagName,null),t})()]}}),null),$(t,X(sz,{get when(){return!e.componentName},get children(){var t=OW();return $(t,()=>e.tagName),t}}),null),t})();return X(sz,{get when(){return e.isClickable},get fallback(){return(()=>{var r=MW();return _z(r,`click`,e.onClick,!0),r.addEventListener(`mouseleave`,n),r.addEventListener(`mouseenter`,t),$(r,i),yR(()=>gz(r,bW(`contain-layout flex items-center gap-1 max-w-[280px] overflow-hidden`,e.shrink&&`shrink-0`))),r})()},get children(){var a=jW();return _z(a,`click`,e.onClick,!0),a.addEventListener(`mouseleave`,n),a.addEventListener(`mouseenter`,t),$(a,i),yR(t=>{var n=`Open source for ${r()}`,i=bW(`contain-layout flex items-center gap-1 max-w-[280px] overflow-hidden cursor-pointer bg-transparent border-none p-0 m-0 text-left`,e.shrink&&`shrink-0`);return n!==t.e&&Q(a,`aria-label`,t.e=n),i!==t.t&&gz(a,t.t=i),t},{e:void 0,t:void 0}),a}})},pz([`click`]),PW=Z(`<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-1.5 w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[var(--rg-border-subtle)] antialiased rounded-t-none rounded-b-[6px]">`),FW=e=>(()=>{var t=PW();return $(t,()=>e.children),t})(),IW=(e,t={})=>(n={})=>{let r=t.variants;if(!r)return e;let i=[e];for(let e in r){let a=n[e]??t.defaultVariants?.[e];if(a===void 0)continue;let o=r[e][String(a)];o&&i.push(o)}return bW(...i)},LW=Z(`<div>`),RW=IW(`contain-layout antialiased [font-synthesis:none] bg-[var(--rg-panel-bg)]`,{variants:{shape:{panel:`rounded-[14px] [corner-shape:superellipse(1.25)]`,pill:`rounded-full`}},defaultVariants:{shape:`panel`}}),zW=e=>{let[t,n]=iz(e,[`shape`,`class`]);return(()=>{var e=LW();return xz(e,rz({get class(){return bW(RW({shape:t.shape}),t.class)}},n),!1,!1),e})()},BW=null,VW={claim:e=>{BW=e},release:e=>{BW===e&&(BW=null)},isActive:e=>BW===e},HW=e=>{let t=Symbol(),n=BM(n=>{VW.isActive(t)&&(dB(n)||(n.code===`Enter`?e.onEnter?.(n):n.code===`Escape`&&e.onEscape?.(n)))});return ER(()=>{VW.claim(t),window.addEventListener(`keydown`,n,{capture:!0})}),DR(()=>{VW.release(t),window.removeEventListener(`keydown`,n,{capture:!0})}),{claimFocus:()=>VW.claim(t)}},UW=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M10.7071 21.2071C10.3166 21.5976 9.68342 21.5976 9.29289 21.2071L3.29289 15.2071C2.90237 14.8166 2.90237 14.1834 3.29289 13.7929L9.29289 7.79289C9.68342 7.40237 10.3166 7.40237 10.7071 7.79289C11.0976 8.18342 11.0976 8.81658 10.7071 9.20711L6.41421 13.5H16C16.5523 13.5 17 13.0523 17 12.5V3.5C17 2.94772 17.4477 2.5 18 2.5C18.5523 2.5 19 2.94772 19 3.5V12.5C19 14.1569 17.6569 15.5 16 15.5H6.41421L10.7071 19.7929C11.0976 20.1834 11.0976 20.8166 10.7071 21.2071Z">`),WW=e=>{let t=()=>e.size??10;return(()=>{var n=UW();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},GW=Z(`<button>`),KW=IW(`contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all press-scale`,{variants:{variant:{chip:`px-[3px] py-px h-[17px] rounded-sm bg-[var(--rg-surface-hover)] [border-width:0.5px] border-solid border-[var(--rg-border-button)] hover:bg-[var(--rg-surface-active)] text-[var(--rg-text-primary)]`,destructive:`px-[3px] py-px h-[17px] rounded-sm bg-[var(--rg-error-bg)] hover:bg-[var(--rg-error-bg-hover)] text-[var(--rg-error-text)]`,ghost:`rounded-sm bg-transparent hover:bg-[var(--rg-surface-hover)] border-none outline-none p-0`}},defaultVariants:{variant:`chip`}}),qW=e=>{let[t,n]=iz(e,[`variant`,`class`,`type`]);return(()=>{var e=GW();return xz(e,rz({get type(){return t.type??`button`},get class(){return bW(KW({variant:t.variant}),t.class)}},n),!1,!1),e})()},JW=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">No`),YW=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Copy`),XW=Z(`<span class="text-[var(--rg-error-text)] text-[13px] leading-3.5 font-sans font-medium">Yes`),ZW=Z(`<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit">`),QW=Z(`<div data-react-grab-discard-prompt class="contain-layout shrink-0 flex flex-col justify-center items-end w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">`),$W=e=>{let t=()=>e.showCancel??!0,{claimFocus:n}=HW({onEnter:t=>{t.preventDefault(),t.stopPropagation();let n=t.composedPath()[0],r=n instanceof HTMLElement?n:null;if(r?.closest(`[data-react-grab-discard-copy]`)){e.onCopy?.();return}if(r?.closest(`[data-react-grab-discard-no]`)){e.onCancel?.();return}if(r?.closest(`[data-react-grab-discard-yes]`)){e.onConfirm?.();return}e.onConfirm?.()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.cancelOnEscape?e.onCancel?.():e.onConfirm?.()}});return(()=>{var r=QW(),i=r.firstChild.firstChild;return _z(r,`click`,n,!0),_z(r,`pointerdown`,n,!0),$(i,()=>e.label??`Discard?`),$(r,X(FW,{get children(){var n=ZW();return $(n,X(sz,{get when(){return t()},get children(){return X(qW,{"data-react-grab-discard-no":!0,get onClick(){return e.onCancel},get children(){return JW()}})}}),null),$(n,X(sz,{get when(){return e.onCopy},get children(){return X(qW,{"data-react-grab-discard-copy":!0,get onClick(){return e.onCopy},get children(){return YW()}})}}),null),$(n,X(qW,{variant:`destructive`,class:`gap-0.5`,"data-react-grab-discard-yes":!0,get onClick(){return e.onConfirm},get children(){return[XW(),X(WW,{size:10,class:`text-[var(--rg-error-text)] opacity-50`})]}}),null),n}}),null),r})()},pz([`pointerdown`,`click`]),eG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M7 2C4.23858 2 2 4.23858 2 7V15C2 17.7614 4.23858 20 7 20H8C8.55228 20 9 19.5523 9 19C9 18.4477 8.55228 18 8 18H7C5.34315 18 4 16.6569 4 15V7C4 5.34315 5.34315 4 7 4H17C18.6569 4 20 5.34315 20 7V15C20 16.6569 18.6569 18 17 18H14.4142L16.2071 16.2071C16.5976 15.8166 16.5976 15.1834 16.2071 14.7929C15.8166 14.4024 15.1834 14.4024 14.7929 14.7929L11.2929 18.2929C11.197 18.3888 11.1247 18.4993 11.0759 18.6172C11.027 18.7351 11 18.8644 11 19C11 19.2728 11.1093 19.5201 11.2864 19.7005C11.2889 19.7031 11.2914 19.7056 11.2939 19.7081L14.7929 23.2071C15.1834 23.5976 15.8166 23.5976 16.2071 23.2071C16.5976 22.8166 16.5976 22.1834 16.2071 21.7929L14.4142 20H17C19.7614 20 22 17.7614 22 15V7C22 4.23858 19.7614 2 17 2H7Z">`),tG=e=>{let t=()=>e.size??12;return(()=>{var n=eG();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},nG=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Retry`),rG=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Ok`),iG=Z(`<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit">`),aG=Z(`<div data-react-grab-error role=alert aria-live=assertive class="contain-layout shrink-0 flex flex-col justify-center items-end w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-start gap-1 px-2 w-full h-fit"><span class="text-[var(--rg-error-text)] text-[13px] leading-4 font-sans font-medium overflow-hidden line-clamp-5">`),oG=e=>{let{claimFocus:t}=HW({onEnter:t=>{t.preventDefault(),t.stopPropagation(),e.onRetry?.()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.onAcknowledge?.()}}),n=()=>!!(e.onRetry||e.onAcknowledge);return(()=>{var r=aG(),i=r.firstChild,a=i.firstChild;return _z(r,`click`,t,!0),_z(r,`pointerdown`,t,!0),$(a,()=>e.error),$(r,X(sz,{get when(){return n()},get children(){return X(FW,{get children(){var t=iG();return $(t,X(sz,{get when(){return e.onRetry},get children(){return X(qW,{"data-react-grab-retry":!0,class:`gap-1`,"aria-keyshortcuts":`Enter`,get onClick(){return e.onRetry},get children(){return[nG(),X(tG,{size:10,"aria-hidden":`true`,class:`text-[var(--rg-text-secondary)]`})]}})}}),null),$(t,X(sz,{get when(){return e.onAcknowledge},get children(){return X(qW,{"data-react-grab-error-ok":!0,class:`gap-1`,"aria-keyshortcuts":`Escape`,get onClick(){return e.onAcknowledge},get children(){return rG()}})}}),null),t}})}}),null),yR(t=>{var r={"pt-1.5 pb-1":n(),"py-1.5":!n()},o=e.error;return t.e=vz(i,r,t.e),o!==t.t&&Q(a,`title`,t.t=o),t},{e:void 0,t:void 0}),r})()},pz([`pointerdown`,`click`]),sG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M7.5 12C7.5 13.3807 6.38071 14.5 5 14.5C3.61929 14.5 2.5 13.3807 2.5 12C2.5 10.6193 3.61929 9.5 5 9.5C6.38071 9.5 7.5 10.6193 7.5 12ZM14.5 12C14.5 13.3807 13.3807 14.5 12 14.5C10.6193 14.5 9.5 13.3807 9.5 12C9.5 10.6193 10.6193 9.5 12 9.5C13.3807 9.5 14.5 10.6193 14.5 12ZM19 14.5C20.3807 14.5 21.5 13.3807 21.5 12C21.5 10.6193 20.3807 9.5 19 9.5C17.6193 9.5 16.5 10.6193 16.5 12C16.5 13.3807 17.6193 14.5 19 14.5Z">`),cG=e=>{let t=()=>e.size??14;return(()=>{var n=sG();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},lG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM17.7071 10.7071C18.0976 10.3166 18.0976 9.68342 17.7071 9.29289C17.3166 8.90237 16.6834 8.90237 16.2929 9.29289L11 14.5858L8.70711 12.2929C8.31658 11.9024 7.68342 11.9024 7.29289 12.2929C6.90237 12.6834 6.90237 13.3166 7.29289 13.7071L10.2929 16.7071C10.6834 17.0976 11.3166 17.0976 11.7071 16.7071L17.7071 10.7071Z">`),uG=e=>{let t=()=>e.size??14;return(()=>{var n=lG();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},dG=Z(`<button data-react-grab-ignore-events data-react-grab-more-options>`),fG=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Keep`),pG=Z(`<div class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap min-w-0"></span><div class="contain-layout shrink-0 flex items-center gap-2 h-fit">`),mG=Z(`<div class="contain-layout shrink-0 flex items-center gap-0.5 py-1.5 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap min-w-0">`),hG=e=>(()=>{var t=dG();return _z(t,`click`,t=>{t.stopImmediatePropagation(),e.onClick()}),_z(t,`pointerdown`,e=>{e.stopImmediatePropagation()}),$(t,X(cG,{size:14,class:`opacity-50 group-hover:opacity-100 transition-opacity`})),yR(()=>gz(t,bW(KW({variant:`ghost`}),`group size-4 text-[var(--rg-text-secondary)] hover:text-[var(--rg-text-primary)]`))),t})(),gG=e=>{let t,n,[r,i]=J(!1),[a,o]=J(!1),s=()=>r()?`Copied`:e.statusText,c=()=>{t!==void 0&&window.clearTimeout(t),n!==void 0&&window.clearTimeout(n),o(!0),e.onFadingChange?.(!0),e.onShowContextMenu?.()},l=()=>{r()||(i(!0),t=window.setTimeout(()=>{o(!0),e.onFadingChange?.(!0),n=window.setTimeout(()=>{e.onDismiss?.()},125)},1375))},{claimFocus:u}=HW({onEnter:e=>{e.preventDefault(),e.stopPropagation(),l()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.onDismiss?.()}});return DR(()=>{t!==void 0&&window.clearTimeout(t),n!==void 0&&window.clearTimeout(n)}),X(zW,{shape:`pill`,"data-react-grab-completion":!0,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,class:`shrink-0 flex flex-col justify-center items-end w-fit h-fit max-w-[280px] transition-opacity duration-100 ease-out`,get style(){return{opacity:+!a()}},onPointerDown:u,onClick:u,get children(){return[X(sz,{get when(){return oB(()=>!r())()&&e.onDismiss},get children(){var t=pG(),n=t.firstChild,i=n.nextSibling;return $(n,s),$(i,X(sz,{get when(){return e.onShowContextMenu},get children(){return X(hG,{onClick:c})}}),null),$(i,X(sz,{get when(){return e.onDismiss},get children(){return X(qW,{"data-react-grab-dismiss":!0,class:`gap-1`,"aria-keyshortcuts":`Enter`,onClick:l,get disabled(){return r()},get"aria-disabled"(){return r()},get children(){return[fG(),X(sz,{get when(){return!r()},get children(){return X(WW,{size:10,class:`text-[var(--rg-text-secondary)]`})}})]}})}}),null),t}}),X(sz,{get when(){return r()||!e.onDismiss},get children(){var t=mG(),n=t.firstChild;return $(t,X(uG,{size:14,"aria-hidden":`true`,class:`text-[var(--rg-text-primary-85)] shrink-0`}),n),$(n,s),$(t,X(sz,{get when(){return e.onShowContextMenu},get children(){return X(hG,{onClick:c})}}),null),t}})]}})},_G=Z(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 py-1.5 px-2 w-full h-fit"><span class="shimmer-text text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap">`),vG=Z(`<div class="contain-layout shrink-0 flex flex-col items-start w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 w-fit h-fit px-2 py-1.5">`),yG=Z(`<button data-react-grab-submit type=button aria-label="Submit context"class="contain-layout shrink-0 flex items-center justify-center size-4 rounded-full bg-[var(--rg-submit-bg)] cursor-pointer ml-1 interactive-scale a11y-hitbox">`),bG=Z(`<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events data-react-grab-input aria-label="Add context for selected element"aria-keyshortcuts="Enter Escape"class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-medium bg-transparent border-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="Add context"rows=1 style=field-sizing:content;min-height:16px;scrollbar-width:none>`),xG=Z(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit min-w-[150px] max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2 max-w-full">`),SG=Z(`<div data-react-grab-ignore-events data-react-grab-selection-label>`),CG={left:RN,top:RN,arrowLeftPercent:50,arrowLeftOffset:0,edgeOffsetX:0},wG=e=>{let t,n,r,i=!1,[a,o]=J(0),[s,c]=J(0),[l,u]=J(0),[d,f]=J(0),[p,m]=J(!1),[h,g]=J(!1),_=()=>e.status!==`copying`&&e.status!==`copied`&&e.status!==`fading`&&e.status!==`error`,v=()=>e.status===`copied`||e.status===`fading`,y=()=>!!e.shouldToggleExpandOnClick&&!!e.onToggleExpand&&_()&&!e.discardPrompt&&!e.isPromptMode,b=()=>!!(e.isPromptMode||e.discardPrompt||y()||v()&&(e.onDismiss||e.onShowContextMenu)||e.status===`error`&&(e.onAcknowledgeError||e.onRetry)),x,S=e=>{i=e},C=()=>{f(e=>e+1)},w=BM(t=>{dB(t)||t.code===`Enter`&&!e.isPromptMode&&!e.discardPrompt&&_()&&(t.preventDefault(),t.stopImmediatePropagation(),e.onToggleExpand?.())});ER(()=>{let r=RM();if(x=new ResizeObserver(e=>{for(let a of e){let e=a.target.getBoundingClientRect();a.target===t&&!i?(o(e.width),c(e.height)):a.target===n?u(e.width):a.target===r&&C()}}),r&&x.observe(r),t){let e=t.getBoundingClientRect();o(e.width),c(e.height),x.observe(t)}n&&(u(n.getBoundingClientRect().width),x.observe(n)),window.addEventListener(`scroll`,C,!0),window.addEventListener(`resize`,C),window.visualViewport?.addEventListener(`resize`,C),window.visualViewport?.addEventListener(`scroll`,C),e.onToggleExpand&&window.addEventListener(`keydown`,w,{capture:!0})}),DR(()=>{x?.disconnect(),window.removeEventListener(`scroll`,C,!0),window.removeEventListener(`resize`,C),window.visualViewport?.removeEventListener(`resize`,C),window.visualViewport?.removeEventListener(`scroll`,C),window.removeEventListener(`keydown`,w,{capture:!0})});let T=()=>`${e.tagName??``}:${e.componentName??``}`,E=Y(t=>{d();let n=T(),r=n===t.elementIdentity?t:{position:CG,computedArrowPosition:null,hadValidBounds:!1,elementIdentity:n},i=e.selectionBounds,o=a(),c=s(),u=o>0&&c>0,f=i&&i.width>0&&i.height>0;if(!u||!f)return{position:r.hadValidBounds?r.position:CG,computedArrowPosition:r.computedArrowPosition,hadValidBounds:r.hadValidBounds,elementIdentity:n};let p=vW(),m=p.offsetLeft,h=p.offsetTop,g=m+p.width,_=h+p.height;if(!(i.x+i.width>m&&i.x<g&&i.y+i.height>h&&i.y<_))return{position:CG,computedArrowPosition:r.computedArrowPosition,hadValidBounds:r.hadValidBounds,elementIdentity:n};let v=i.x+i.width/2,y=e.mouseX??v,b=i.y+i.height,x=i.y,S=e.hideArrow?0:_W(l()),C=y,w=0,E=b+S+4;if(o>0){let e=C-o/2,t=C+o/2;t>g-8&&(w=g-8-t),e+w<m+8&&(w=m+8-e)}let D=c+S+4,O=E+c<=_-8;O||(E=x-D),E<h+8&&(E=h+8);let k=o/2,ee=k-w,te=Math.min(16,k),A=Math.max(o-16,k),ne=Math.max(te,Math.min(A,ee))-k;return{position:{left:C,top:E,arrowLeftPercent:50,arrowLeftOffset:ne,edgeOffsetX:w},computedArrowPosition:O?`bottom`:`top`,hadValidBounds:!0,elementIdentity:n}},{position:CG,computedArrowPosition:null,hadValidBounds:!1,elementIdentity:``}),D=()=>E().computedArrowPosition??`bottom`,O=()=>E().hadValidBounds;bR(TR(()=>e.selectionLabelShakeCount,()=>g(!0),{defer:!0}));let k=t=>{if(t.isComposing||t.keyCode===229)return;t.stopImmediatePropagation();let n=t.code===`Enter`&&!t.shiftKey,r=t.code===`Escape`;n?(t.preventDefault(),e.onSubmit?.()):r&&(t.preventDefault(),e.onConfirmDismiss?.())},ee=t=>{let n=t.target;n instanceof HTMLTextAreaElement&&(hW(n,95),e.onInputChange?.(n.value))},te=()=>xW({tagName:e.tagName,componentName:e.componentName,elementsCount:e.elementsCount}),A=Y(()=>!(e.error||e.discardPrompt||_()&&e.isPromptMode)),ne=t=>{if(t.stopImmediatePropagation(),e.filePath&&e.onOpen){e.onOpen();return}y()&&e.onToggleExpand?.()},re=t=>{t.stopImmediatePropagation(),_()&&e.isPromptMode&&!e.discardPrompt&&e.onSubmit&&r&&gW(r,{preventScroll:!0})},ie=()=>O()&&(v()||e.status===`error`);return X(sz,{get when(){return oB(()=>e.visible!==!1)()&&(e.selectionBounds||ie())},get children(){var i=SG();i.addEventListener(`mouseleave`,()=>e.onHoverChange?.(!1)),i.addEventListener(`mouseenter`,()=>e.onHoverChange?.(!0)),i.$$click=e=>{e.stopImmediatePropagation()},i.$$pointerdown=re;var a=t;return typeof a==`function`?Sz(a,i):t=i,bz(i,`z-index`,`${ZM}`),bz(i,`transition`,`opacity 125ms ease-out, filter 125ms ease-out`),$(i,X(sz,{get when(){return!e.hideArrow},get children(){return X(DW,{get position(){return D()},get leftPercent(){return E().position.arrowLeftPercent},get leftOffsetPx(){return E().position.arrowLeftOffset},get labelWidth(){return l()}})}}),null),$(i,X(sz,{get when(){return oB(()=>!!v())()&&!e.error},get children(){return X(gG,{get statusText(){return e.statusText??`Copied`},get onDismiss(){return e.onDismiss},onFadingChange:m,get onShowContextMenu(){return e.onShowContextMenu}})}}),null),$(i,X(zW,{ref:e=>n=e,get shape(){return A()?`pill`:`panel`},get class(){return bW(`flex items-center gap-[5px] w-fit h-fit p-0`,h()&&`animate-shake`)},get style(){return{display:v()&&!e.error?`none`:void 0}},onAnimationEnd:()=>g(!1),get children(){return[X(sz,{get when(){return e.status===`copying`},get children(){var t=_G(),n=t.firstChild,r=n.firstChild;return $(n,X(TW,{size:13,class:`text-[var(--rg-text-secondary)] shrink-0`}),r),$(r,()=>e.statusText??`Grabbing…`),t}}),X(sz,{get when(){return oB(()=>!!(_()&&!e.isPromptMode))()&&!e.discardPrompt},get children(){var t=vG(),n=t.firstChild;return $(n,X(NW,{get tagName(){return te().tagName},get componentName(){return te().componentName},get isClickable(){return!!(e.filePath&&e.onOpen)},onClick:ne,onHoverChange:S,shrink:!0})),t}}),X(sz,{get when(){return oB(()=>!!(_()&&e.isPromptMode))()&&!e.discardPrompt},get children(){var t=xG(),n=t.firstChild;return $(n,X(NW,{get tagName(){return te().tagName},get componentName(){return te().componentName},get isClickable(){return!!(e.filePath&&e.onOpen)},onClick:ne,onHoverChange:S})),$(t,X(FW,{get children(){var t=bG(),n=t.firstChild;return n.$$keydown=k,n.$$input=ee,Sz(t=>{r=t,e.onSubmit&&queueMicrotask(()=>{gW(t,{preventScroll:!0}),hW(t,95)})},n),bz(n,`max-height`,`95px`),$(t,X(sz,{get when(){return e.onSubmit},get children(){var t=yG();return t.$$click=()=>e.onSubmit?.(),$(t,X(CW,{size:10,"aria-hidden":`true`,class:`text-[var(--rg-submit-fg)]`})),t}}),null),yR(()=>n.readOnly=!e.onSubmit),yR(()=>n.value=e.inputValue??``),t}}),null),t}}),X(sz,{get when(){return e.discardPrompt},keyed:!0,children:e=>X($W,{get label(){return oB(()=>!!e.isKeyboardSelection)()?`Discard selection?`:e.label},get showCancel(){return!e.isKeyboardSelection},get cancelOnEscape(){return e.cancelOnEscape},get onConfirm(){return e.onConfirm},get onCopy(){return e.onCopy},onCancel:()=>{e.isKeyboardSelection||e.onCancel?.(),gW(r,{preventScroll:!0})}})}),X(sz,{get when(){return e.error},get children(){return X(oG,{get error(){return e.error},get onAcknowledge(){return e.onAcknowledgeError},get onRetry(){return e.onRetry}})}})]}}),null),yR(t=>{var n=bW(`fixed font-sans text-[13px] antialiased select-none ease-out`),r=`${E().position.top}px`,a=`${E().position.left}px`,o=`translateX(calc(-50% + ${E().position.edgeOffsetX}px))`,s=b()?`auto`:`none`,c=e.status===`fading`||p()?0:1,l=`drop-shadow(${UM}) blur(${e.status===`fading`||p()?`3px`:`0`})`;return n!==t.e&&gz(i,t.e=n),r!==t.t&&bz(i,`top`,t.t=r),a!==t.a&&bz(i,`left`,t.a=a),o!==t.o&&bz(i,`transform`,t.o=o),s!==t.i&&bz(i,`pointer-events`,t.i=s),c!==t.n&&bz(i,`opacity`,t.n=c),l!==t.s&&bz(i,`filter`,t.s=l),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i}})},pz([`pointerdown`,`click`,`input`,`keydown`]),TG=Z(`<span style="transition-property:transform;transition-timing-function:cubic-bezier(0.32, 0.72, 0, 1)"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M20.8977 4.02356L21.8277 4.39121C22.3784 2.99813 21.0382 1.60206 19.6238 2.09546L3.47334 7.72936C1.38661 8.45728 1.49021 11.443 3.6224 12.0245L10.1289 13.799L11.2331 19.8724C11.638 22.0991 14.7072 22.4019 15.5393 20.2972L21.8277 4.39121L20.8977 4.02356Z">`),EG=e=>{let t=()=>e.size??14,n=()=>e.rotationDeg??0;return(()=>{var r=TG(),i=r.firstChild;return bz(r,`transition-duration`,`180ms`),yR(a=>{var o=bW(`inline-flex items-center justify-center will-change-transform`,e.class),s=`rotate(${n()}deg)`,c=t(),l=t();return o!==a.e&&gz(r,a.e=o),s!==a.t&&bz(r,`transform`,a.t=s),c!==a.a&&Q(i,`width`,a.a=c),l!==a.o&&Q(i,`height`,a.o=l),a},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()},DG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 12 12"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M1 6C1 3.239 3.239 1 6 1C8.761 1 11 3.239 11 6C11 8.761 8.761 11 6 11C5.103 11 4.261 10.764 3.532 10.35C2.959 10.759 2.257 11 1.5 11C1.376 11 1.253 10.993 1.132 10.981C0.923 10.959 0.75 10.809 0.699 10.605C0.648 10.402 0.729 10.188 0.903 10.07C1.347 9.768 1.688 9.328 1.865 8.812C1.319 8.011 1 7.042 1 6Z">`),OG=e=>{let t=()=>e.size??14;return(()=>{var n=DG();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},kG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 13.867 20.345 14.992 18.77 14.992H16.029C14.739 14.992 13.823 16.248 14.218 17.476L14.48 18.295C14.751 19.139 14.643 20.041 14.211 20.751C13.769 21.479 12.985 22 12 22C6.477 22 2 17.523 2 12ZM12.21 6.783C12.416 7.585 11.933 8.403 11.131 8.609C10.328 8.815 9.511 8.332 9.305 7.529C9.099 6.727 9.582 5.909 10.384 5.703C11.187 5.497 12.004 5.981 12.21 6.783ZM7.59 9.207C8.388 9.43 8.853 10.258 8.63 11.055C8.407 11.853 7.579 12.319 6.782 12.096C5.984 11.873 5.518 11.045 5.741 10.247C5.964 9.449 6.792 8.983 7.59 9.207ZM9.497 14.446C8.918 13.854 7.968 13.844 7.376 14.423C6.784 15.002 6.773 15.952 7.353 16.544C7.932 17.136 8.882 17.147 9.474 16.567C10.066 15.988 10.076 15.039 9.497 14.446ZM16.624 9.575C16.032 10.155 15.082 10.144 14.503 9.552C13.923 8.96 13.934 8.01 14.526 7.431C15.118 6.852 16.068 6.862 16.647 7.454C17.226 8.046 17.216 8.996 16.624 9.575Z">`),AG=e=>{let t=()=>e.size??14;return(()=>{var n=kG();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},jG=Z(`<div>`),MG=0,NG=()=>Date.now()-MG<800,PG=e=>{let[t,n]=J(!1),[r,i]=J(!0),a;bR(TR(()=>e.visible,e=>{a!==void 0&&(clearTimeout(a),a=void 0),e?NG()?(i(!1),n(!0)):(i(!0),a=setTimeout(()=>{n(!0)},400)):(t()&&(MG=Date.now()),n(!1))})),DR(()=>{a!==void 0&&clearTimeout(a),t()&&(MG=Date.now())});let o=()=>e.position===`top`||e.position===`bottom`?{left:`50%`,translate:`-50%`,"z-index":`${ZM}`}:{top:`50%`,translate:`0 -50%`,"z-index":`${ZM}`};return X(sz,{get when(){return t()},get children(){var t=jG();return $(t,()=>e.children),yR(n=>{var i=bW(`absolute whitespace-nowrap px-2 py-0.5 rounded-full text-[10px] font-sans font-medium leading-4 pointer-events-none`,`bg-[var(--rg-panel-bg)] text-[var(--rg-text-primary)] [box-shadow:var(--rg-shadow)]`,e.position===`top`&&`bottom-full mb-2.5`,e.position===`bottom`&&`top-full mt-2.5`,e.position===`left`&&`right-full mr-2.5`,e.position===`right`&&`left-full ml-2.5`,r()&&`animate-tooltip-fade-in`),a=o();return i!==n.e&&gz(t,n.e=i),n.t=yz(t,a,n.t),n},{e:void 0,t:void 0}),t}})},FG=Z(`<div><button data-react-grab-ignore-events type=button>`),IG=e=>(()=>{var t=FG(),n=t.firstChild;_z(n,`mouseleave`,e.onMouseLeave),_z(n,`mouseenter`,e.onMouseEnter),_z(n,`contextmenu`,t=>e.onContextMenu?.(t)),_z(n,`click`,e.onClick,!0);var r=e.ref;return typeof r==`function`?Sz(r,n):e.ref=n,$(n,()=>e.icon),$(t,X(sz,{get when(){return e.tooltip},get children(){return X(PG,{get visible(){return!!e.tooltipVisible},get position(){return e.tooltipPosition??`top`},get children(){return e.tooltip}})}}),null),yR(r=>{var i=e.wrapperClass,a=e.isToggle?``:void 0,o=e.actionId,s=e.label,c=!!e.isActive,l=e.class;return i!==r.e&&gz(t,r.e=i),a!==r.t&&Q(n,`data-react-grab-toolbar-toggle`,r.t=a),o!==r.a&&Q(n,`data-react-grab-toolbar-action`,r.a=o),s!==r.o&&Q(n,`aria-label`,r.o=s),c!==r.i&&Q(n,`aria-pressed`,r.i=c),l!==r.n&&gz(n,r.n=l),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})(),pz([`click`]),LG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M9.29289 16.7071C8.90237 16.3166 8.90237 15.6834 9.29289 15.2929L12.5858 12L9.29289 8.70711C8.90237 8.31658 8.90237 7.68342 9.29289 7.29289C9.68342 6.90237 10.3166 6.90237 10.7071 7.29289L14.7071 11.2929C14.8946 11.4804 15 11.7348 15 12C15 12.2652 14.8946 12.5196 14.7071 12.7071L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071Z">`),RG=e=>{let t=()=>e.size??14;return(()=>{var n=LG();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},zG=Z(`<button data-react-grab-ignore-events data-react-grab-toolbar-collapse type=button class="group contain-layout shrink-0 flex items-center justify-center cursor-pointer interactive-scale a11y-hitbox">`),BG=Z(`<div data-react-grab-toolbar-panel><div><div><div>`),VG=e=>{let t=()=>e.snapEdge??`bottom`,n=()=>t()===`left`||t()===`right`,r=()=>e.isCollapsed?`duration-140`:`duration-220`,i=()=>n()?`transition-[grid-template-rows] ${r()} ease-drawer`:`transition-[grid-template-columns] ${r()} ease-drawer`,a=()=>n()?`min-h-0`:`min-w-0`,o=()=>e.isCollapsed?`${{top:`rounded-t-none rounded-b-[10px]`,bottom:`rounded-b-none rounded-t-[10px]`,left:`rounded-l-none rounded-r-[10px]`,right:`rounded-r-none rounded-l-[10px]`}[t()]} ${n()?`px-0.25 py-2`:`px-2 py-0.25`}`:``,s=()=>{let n=e.isCollapsed;switch(t()){case`top`:return n?`rotate-90`:`-rotate-90`;case`bottom`:return n?`-rotate-90`:`rotate-90`;case`left`:return n?`rotate-0`:`rotate-180`;case`right`:return n?`rotate-180`:`rotate-0`;default:return`-rotate-90`}},c=()=>{if(e.isChevronPressed)return n()?`scale(0.97, 1)`:`scale(1, 0.97)`},l=()=>(()=>{var t=zG();return _z(t,`pointercancel`,e.onCollapsePointerLeave),_z(t,`pointerleave`,e.onCollapsePointerLeave),_z(t,`pointerup`,e.onCollapsePointerUp,!0),_z(t,`pointerdown`,e.onCollapsePointerDown),_z(t,`click`,e.onCollapseClick,!0),$(t,X(RG,{size:18,get class(){return bW(`text-[var(--rg-text-secondary)] group-hover:text-[var(--rg-text-primary)] transition-[transform,color] duration-150 ease-drawer -m-0.5`,s())}})),yR(n=>{var r=e.isCollapsed?`Expand toolbar`:`Collapse toolbar`,i=!e.isCollapsed;return r!==n.e&&Q(t,`aria-label`,n.e=r),i!==n.t&&Q(t,`aria-expanded`,n.t=i),n},{e:void 0,t:void 0}),t})(),u=()=>e.isChevronPressed?`transition-[padding,border-radius,transform] duration-60 ease-[cubic-bezier(0,0,0.2,1)]`:`transition-[padding,border-radius,transform] ${r()} ease-drawer`;return(()=>{var t=BG(),r=t.firstChild,s=r.firstChild,d=s.firstChild;return _z(t,`click`,e.onPanelClick,!0),_z(t,`animationend`,e.onAnimationEnd),$(d,()=>e.actionButtons),$(t,l,null),yR(l=>{var f=bW(`flex items-center justify-center rounded-[13px] antialiased relative overflow-visible [font-synthesis:none]`,u(),n()&&`flex-col`,`bg-[var(--rg-panel-bg)] [box-shadow:var(--rg-shadow)]`,!e.isCollapsed&&(n()?`px-1.5 gap-0 py-2`:`py-1.5 gap-0 px-2`),o(),e.isShaking&&(n()?`animate-shake-vertical`:`animate-shake`)),p=e.transformOrigin,m=c(),h=bW(`grid relative overflow-visible`,i(),e.isCollapsed?n()?`grid-rows-[0fr] pointer-events-none`:`grid-cols-[0fr] pointer-events-none`:n()?`grid-rows-[1fr]`:`grid-cols-[1fr]`),g=bW(`flex`,n()?`flex-col items-center min-h-0`:`items-center min-w-0`,e.isCollapsed?`opacity-0`:`opacity-100`,e.isCollapsed?`transition-opacity duration-100 ease-drawer`:`transition-opacity duration-180 ease-drawer delay-[80ms]`),_=bW(`relative overflow-visible flex`,n()?`flex-col items-center`:`items-center`,a());return f!==l.e&&gz(t,l.e=f),p!==l.t&&bz(t,`transform-origin`,l.t=p),m!==l.a&&bz(t,`transform`,l.a=m),h!==l.o&&gz(r,l.o=h),g!==l.i&&gz(s,l.i=g),_!==l.n&&gz(d,l.n=_),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()},pz([`click`,`pointerup`]),HG=e=>e===`top`||e===`bottom`,UG=e=>{let t=HG(e);return{width:t?30:16,height:t?16:30}},WG=(e,t,n,r)=>{let i=vW(),a=i.width,o=i.height,s=i.offsetLeft+16,c=Math.max(s,i.offsetLeft+a-n-16),l=i.offsetTop+16,u=Math.max(l,i.offsetTop+o-r-16);if(e===`top`||e===`bottom`){let r=Math.max(0,a-n-32);return{x:Math.min(c,Math.max(s,i.offsetLeft+16+r*t)),y:e===`top`?l:u}}let d=Math.max(0,o-r-32),f=Math.min(u,Math.max(l,i.offsetTop+16+d*t));return{x:e===`left`?s:c,y:f}},GG=(e,t,n,r,i)=>{let a=vW(),o=a.width,s=a.height;if(e===`top`||e===`bottom`){let e=o-r-32;return e<=0?_N:Math.max(0,Math.min(1,(t-a.offsetLeft-16)/e))}let c=s-i-32;return c<=0?_N:Math.max(0,Math.min(1,(n-a.offsetTop-16)/c))},KG=(e,t,n,r,i)=>{let a=vW(),o=a.width,s=a.height,{width:c,height:l}=n,u;if(t===`top`||t===`bottom`){let n=(c-r)/2;u={x:NB(e.x-n,a.offsetLeft+16,a.offsetLeft+o-c-16),y:t===`top`?a.offsetTop+16:a.offsetTop+s-l-16}}else{let n=(l-i)/2,r=NB(e.y-n,a.offsetTop+16,a.offsetTop+s-l-16);u={x:t===`left`?a.offsetLeft+16:a.offsetLeft+o-c-16,y:r}}let d=GG(t,u.x,u.y,c,l);return{position:u,ratio:d}},qG=(e,t,n,r)=>{let i=vW(),{width:a,height:o}=n,{width:s,height:c}=r;switch(e){case`top`:case`bottom`:{let n=(a-s)/2;return{x:NB(t.x+n,i.offsetLeft,i.offsetLeft+i.width-s),y:e===`top`?i.offsetTop:i.offsetTop+i.height-c}}case`left`:case`right`:{let n=(o-c)/2,r=NB(t.y+n,i.offsetTop,i.offsetTop+i.height-c);return{x:e===`left`?i.offsetLeft:i.offsetLeft+i.width-s,y:r}}}},JG=(e,t,n,r,i,a)=>{let o=vW(),s=o.width,c=o.height,l=e+i*150,u=t+a*150,d=u-o.offsetTop+r/2,f=o.offsetTop+c-u-r/2,p=l-o.offsetLeft+n/2,m=o.offsetLeft+s-l-n/2,h=Math.min(d,f,p,m),g=e=>NB(e,o.offsetLeft+16,o.offsetLeft+s-n-16),_=e=>NB(e,o.offsetTop+16,o.offsetTop+c-r-16);return h===d?{edge:`top`,x:g(l),y:o.offsetTop+16}:h===p?{edge:`left`,x:o.offsetLeft+16,y:_(u)}:h===m?{edge:`right`,x:o.offsetLeft+s-n-16,y:_(u)}:{edge:`bottom`,x:g(l),y:o.offsetTop+c-r-16}},YG=e=>{let[t,n]=J(!1),[r,i]=J(!1),[a,o]=J(!1),[s,c]=J({x:0,y:0}),l={x:0,y:0},u={x:0,y:0,time:0},d={x:0,y:0},f=!1,p,m=null,h=()=>{m?.abort(),m=null},g=t=>{if(!a()){if(Math.hypot(t.clientX-d.x,t.clientY-d.y)<=5)return;o(!0),e.onDragStart()}let n=performance.now(),r=n-u.time;r>0&&c({x:(t.clientX-u.x)/r,y:(t.clientY-u.y)/r}),u={x:t.clientX,y:t.clientY,time:n};let i=t.clientX-l.x,s=t.clientY-l.y;e.onPositionUpdate({x:i,y:s})},_=()=>{h();let t=a();if(n(!1),!t)return;f=!0;let r=e.getContainerRef(),o=r?.getBoundingClientRect();if(!o)return;let c=s(),l=JG(o.left,o.top,o.width,o.height,c.x,c.y),u=GG(l.edge,l.x,l.y,o.width,o.height);e.onSnapEdgeChange(l.edge,u),i(!0),rI(()=>{let t=r?.getBoundingClientRect(),n=t?{width:t.width,height:t.height}:e.getExpandedDimensions();rI(()=>{let t=WG(l.edge,u,n.width,n.height);e.onSnapComplete({edge:l.edge,ratio:u,position:t,expandedDimensions:n}),p=setTimeout(()=>{i(!1),e.onSnapAnimationEnd?.()},300)})})},v=BM(t=>{if(t.button!==0||e.isCollapsed())return;let r=e.getContainerRef()?.getBoundingClientRect();if(!r)return;d={x:t.clientX,y:t.clientY},l={x:t.clientX-r.left,y:t.clientY-r.top},n(!0),o(!1),c({x:0,y:0}),u={x:t.clientX,y:t.clientY,time:performance.now()},h(),m=new AbortController;let{signal:i}=m;window.addEventListener(`pointermove`,g,{signal:i}),window.addEventListener(`pointerup`,_,{signal:i}),window.addEventListener(`pointercancel`,_,{signal:i})});return DR(()=>{h(),clearTimeout(p)}),{isDragging:t,isSnapping:r,handlePointerDown:v,createDragAwareHandler:e=>t=>{if(t.stopImmediatePropagation(),f){f=!1;return}e()}}},XG=(e,t)=>{let n=t-e;return e+(n-Math.round(n/360)*360)},ZG=Z(`<div data-react-grab-ignore-events data-react-grab-toolbar>`),QG=e=>{let t,n,r=null,i=BV(),[a,o]=J(!1),[s,c]=J(!1),[l,u]=J(!1),[d,f]=J(i?.edge??`bottom`),[p,m]=J(i?.ratio??.5),[h,g]=J({x:0,y:0}),[_,v]=J(!1),[y,b]=J(!1),[x,S]=J(!1),[C,w]=J(!1),[T,E]=J(0),[D,O]=J(null),k=()=>{r?.(),r=null,e.isActive||LL()},ee=YG({getContainerRef:()=>t,isCollapsed:s,getExpandedDimensions:()=>ce,onDragStart:()=>{O(null),r&&k()},onPositionUpdate:e=>g(e),onSnapEdgeChange:(e,t)=>{de(d(),e),f(e),m(t)},onSnapComplete:e=>{ce=e.expandedDimensions,g(e.position),Ae({edge:e.edge,ratio:e.ratio,collapsed:s(),enabled:!s()})}}),te=()=>d()===`left`||d()===`right`,A=()=>te()?`mb-1.5`:`mr-1.5`,ne=t=>e.activeActionId===t,re=()=>!!e.isActive&&(e.activeActionId??`copy`)===`copy`,ie=t=>D()===t&&!e.isActive&&!s()&&!ee.isDragging()&&!ee.isSnapping()&&!e.isContextMenuOpen,ae=()=>{switch(d()){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;default:return`top`}},oe=e=>{e.stopImmediatePropagation()},se=(t,n)=>({onMouseEnter:e=>{ee.isDragging()||(O(t),n?.shouldFreezeInteractions!==!1&&!r&&(r=pR(),IL(e.clientX,e.clientY)),n?.onHoverChange?.(!0))},onMouseLeave:()=>{O(e=>e===t?null:e),n?.shouldFreezeInteractions!==!1&&!e.isActive&&!e.isContextMenuOpen&&k(),n?.onHoverChange?.(!1)}});bR(TR(()=>e.shakeCount,t=>{t&&!e.enabled&&v(!0)})),bR(TR(()=>[e.isActive,e.isContextMenuOpen],([e,t])=>{!e&&!t&&r&&(r(),r=null)})),bR(TR(()=>re(),e=>{if(!e){E(e=>XG(e,0));return}let t=BM(e=>{if(!n)return;let t=n.getBoundingClientRect(),r=t.left+t.width/2,i=t.top+t.height/2,a=e.clientX-r,o=e.clientY-i;if(Math.hypot(a,o)<4)return;let s=Math.atan2(o,a)*180/Math.PI- -45;E(e=>XG(e,s))});window.addEventListener(`pointermove`,t,{passive:!0}),DR(()=>{window.removeEventListener(`pointermove`,t)})}));let ce={width:78,height:28},[le,ue]=J(UG(d())),de=(e,t)=>{HG(e)!==HG(t)&&ue(UG(t))},fe=(e,n)=>{let r=t?.getBoundingClientRect(),i=UG(n);return KG(e,n,ce,r?.width??i.width,r?.height??i.height)},pe=()=>{g(WG(d(),p(),ce.width,ce.height))},me=ee.createDragAwareHandler(()=>e.onToggle?.()),he=ee.createDragAwareHandler(()=>e.onActivateAction?.(yN)),ge=ee.createDragAwareHandler(()=>e.onActivateAction?.(bN)),_e=`group contain-layout flex items-center justify-center cursor-pointer interactive-scale a11y-hitbox`,ve=()=>bW(`relative contain-layout flex items-center justify-center`,A()),ye=e=>e?`text-[var(--rg-text-primary)]`:`text-[var(--rg-text-secondary)] group-hover:text-[var(--rg-text-primary)]`,be=ee.createDragAwareHandler(()=>{let e=t?.getBoundingClientRect(),n=s(),r=p();if(n){let{position:e,ratio:t}=fe(je(),d());r=t,g(e),m(r)}else e&&(ce={width:e.width,height:e.height});b(!0),c(e=>!e),Ae({edge:d(),ratio:r,collapsed:!n,enabled:n}),Ce&&clearTimeout(Ce),Ce=setTimeout(()=>{b(!1),Te()},260)}),xe=()=>qG(d(),h(),ce,le()),Se,Ce,we=null,Te=()=>{let e=t?.getBoundingClientRect();!e||e.width===0||e.height===0||(s()?ue({width:e.width,height:e.height}):(ce={width:e.width,height:e.height},we={width:e.width,height:e.height}))},Ee=(e,t)=>{if(!(e===0||t===0)&&!(ee.isDragging()||ee.isSnapping())&&!y()){if(s()){let n=le();if(n.width===e&&n.height===t)return;ue({width:e,height:t});return}we&&we.width===e&&we.height===t||(we={width:e,height:t},ce={width:e,height:t},g(WG(d(),p(),e,t)))}},De=null,Oe=()=>{ee.isDragging()||ee.isSnapping()||De===null&&(De=rI(()=>{De=null,pe()}))},ke=()=>{ee.isDragging()||(u(!0),pe(),Se&&clearTimeout(Se),Se=setTimeout(()=>{u(!1);let e=GG(d(),h().x,h().y,ce.width,ce.height);m(e),Ae({edge:d(),ratio:e,collapsed:s(),enabled:!s()})},500))},Ae=t=>{VV(t),e.onStateChange?.(t)};ER(()=>{t&&e.onContainerRef?.(t);let n=t?.getBoundingClientRect(),r=vW(),a=!!(n&&n.width>0&&n.height>0);i?(a&&n&&(ce={width:n.width,height:n.height}),c(i.collapsed),g(WG(i.edge,i.ratio,ce.width,ce.height))):a&&n?(ce={width:n.width,height:n.height},g({x:r.offsetLeft+(r.width-n.width)/2,y:r.offsetTop+r.height-n.height-16}),m(_N)):(g(WG(`bottom`,_N,ce.width,ce.height)),m(_N)),e.onSubscribeToStateChanges&&DR(e.onSubscribeToStateChanges(e=>{if(y()||!t?.getBoundingClientRect())return;let n=s()!==e.collapsed;if(de(d(),e.edge),f(e.edge),n&&!e.collapsed){let t=je();b(!0),c(e.collapsed);let{position:n,ratio:r}=fe(t,e.edge);g(n),m(r),clearTimeout(Ce),Ce=setTimeout(()=>{b(!1),Te()},260)}else n&&(b(!0),clearTimeout(Ce),Ce=setTimeout(()=>{b(!1),Te()},260)),c(e.collapsed),g(WG(e.edge,e.ratio,ce.width,ce.height)),m(e.ratio)})),window.addEventListener(`resize`,ke),window.visualViewport?.addEventListener(`resize`,ke),window.visualViewport?.addEventListener(`scroll`,ke);let l=RM();if(l&&(window.addEventListener(`scroll`,Oe,{passive:!0,capture:!0}),typeof ResizeObserver<`u`)){let e=new ResizeObserver(Oe);e.observe(l),DR(()=>e.disconnect())}if(typeof ResizeObserver<`u`&&t){let e=new ResizeObserver(e=>{let n=e[0];if(!n)return;let r=n.borderBoxSize?.[0],i,a;if(r)i=r.inlineSize,a=r.blockSize;else{let e=t?.getBoundingClientRect();if(!e)return;i=e.width,a=e.height}Ee(i,a)});e.observe(t),DR(()=>e.disconnect())}let u=setTimeout(()=>{o(!0)},500);DR(()=>{clearTimeout(u)})}),DR(()=>{window.removeEventListener(`resize`,ke),window.visualViewport?.removeEventListener(`resize`,ke),window.visualViewport?.removeEventListener(`scroll`,ke),window.removeEventListener(`scroll`,Oe,{capture:!0}),De!==null&&iI(De),clearTimeout(Se),clearTimeout(Ce),r&&k()});let je=()=>s()?xe():h(),Me=()=>s()?`cursor-pointer`:ee.isDragging()?`cursor-grabbing`:`cursor-grab`,Ne=()=>C()||!!e.isContextMenuOpen||ee.isDragging()||ee.isSnapping()||y()||x(),Pe=()=>!!e.isActive&&!Ne(),Fe=()=>l()||ee.isDragging()?``:ee.isSnapping()?`transition-[transform,opacity] duration-300 ease-out`:y()?`transition-[transform,opacity] ${s()?`duration-140`:`duration-220`} ease-drawer`:`transition-[transform,opacity] duration-400 ease-drawer`,Ie=()=>{switch(d()){case`top`:return`center top`;case`bottom`:return`center bottom`;case`left`:return`left center`;case`right`:return`right center`;default:return`center center`}};return(()=>{var r=ZG();r.addEventListener(`mouseleave`,()=>{w(!1),e.onSelectHoverChange?.(!1)}),r.addEventListener(`mouseenter`,()=>{w(!0),s()||e.onSelectHoverChange?.(!0)}),_z(r,`mousedown`,oe),_z(r,`pointerdown`,e=>{oe(e),ee.handlePointerDown(e)});var i=t;return typeof i==`function`?Sz(i,r):t=r,$(r,X(VG,{get isCollapsed(){return s()},get snapEdge(){return d()},get isShaking(){return _()},get isChevronPressed(){return x()},get transformOrigin(){return Ie()},onAnimationEnd:()=>v(!1),onCollapseClick:be,onCollapsePointerDown:()=>S(!0),onCollapsePointerUp:()=>S(!1),onCollapsePointerLeave:()=>S(!1),onPanelClick:e=>{if(s()){e.stopPropagation();let{position:t,ratio:n}=fe(je(),d());g(t),m(n),b(!0),c(!1),Ae({edge:d(),ratio:n,collapsed:!1,enabled:!0}),Ce&&clearTimeout(Ce),Ce=setTimeout(()=>{b(!1),Te()},260)}},get actionButtons(){return[X(IG,rz({actionId:vN,isToggle:!0,ref:e=>n=e,get label(){return re()?`Stop selecting element`:`Copy element`},get isActive(){return re()},class:_e,get wrapperClass(){return ve()},onClick:me,onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),O(null),e.onToggleToolbarMenu?.()}},()=>se(vN),{get icon(){return X(EG,{size:14,get rotationDeg(){return T()},get class(){return ye(re())}})},get tooltipVisible(){return ie(vN)},get tooltipPosition(){return ae()},tooltip:`Copy`})),X(IG,rz({actionId:yN,label:`Comment on element`,get isActive(){return ne(yN)},class:_e,get wrapperClass(){return ve()},onClick:he},()=>se(yN),{get icon(){return X(OG,{size:14,get class(){return ye(ne(yN))}})},get tooltipVisible(){return ie(yN)},get tooltipPosition(){return ae()},tooltip:`Comment`})),X(IG,rz({actionId:bN,label:`Style element`,get isActive(){return ne(bN)},class:_e,get wrapperClass(){return ve()},onClick:ge},()=>se(bN),{get icon(){return X(AG,{size:14,get class(){return ye(ne(bN))}})},get tooltipVisible(){return ie(bN)},get tooltipPosition(){return ae()},tooltip:`Style`}))]}})),yR(e=>{var t=bW(`fixed left-0 top-0 font-sans text-[13px] antialiased select-none`,Me(),Fe(),a()?`pointer-events-auto`:`pointer-events-none`),n=String(ZM),i=`translate(${je().x}px, ${je().y}px) scale(${Pe()?.97:1})`,o=Ie(),s=a()?Pe()?.55:1:0;return t!==e.e&&gz(r,e.e=t),n!==e.t&&bz(r,`z-index`,e.t=n),i!==e.a&&bz(r,`transform`,e.a=i),o!==e.o&&bz(r,`transform-origin`,e.o=o),s!==e.i&&bz(r,`opacity`,e.i=s),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r})()},$G=AR(),eK=()=>{let e=jR($G);if(!e)throw Error(`Menu subcomponents must be rendered inside <Menu.Provider>`);return e},tK=e=>X($G.Provider,{get value(){return e.store},get children(){return e.children}}),nK=e=>X(zW,{get class(){return bW(`flex flex-col w-fit h-fit`,e.class)},get style(){return e.style},get children(){return e.children}}),rK=Z(`<div role=menu aria-orientation=vertical><div aria-hidden=true class="pointer-events-none absolute opacity-0 transition-[top,left,width,height,opacity,border-radius] duration-75 ease-out bg-[var(--rg-surface-hover)]">`),iK=e=>{let t=eK();return(()=>{var n=rK(),r=n.firstChild;n.$$pointermove=()=>t.notePointerMove(),Sz(n=>{t.setHighlightContainer(n),e.ref?.(n)},n);var i=t.setHighlightRail;return typeof i==`function`?Sz(i,r):t.setHighlightRail=r,$(n,()=>e.children,null),yR(r=>{var i=e.label,a=t.keyboardNavigation?t.activeDescendantId():void 0,o=t.keyboardNavigation?-1:void 0,s=bW(`relative flex flex-col`,e.class);return i!==r.e&&Q(n,`aria-label`,r.e=i),a!==r.t&&Q(n,`aria-activedescendant`,r.t=a),o!==r.a&&Q(n,`tabindex`,r.a=o),s!==r.o&&gz(n,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()},pz([`pointermove`]),aK=Z(`<button data-react-grab-ignore-events type=button>`),oK=e=>{let t=eK(),n=t.createItemId(),r=e.value,i=()=>e.role??`menuitem`,a=()=>!e.disabled,o=()=>t.activeValue()===r,s;return ER(()=>{s&&(t.registerItem({value:r,domId:n,element:s,isEnabled:a,onSelect:()=>e.onSelect?.()}),DR(()=>t.unregisterItem(r)))}),(()=>{var c=aK();c.$$click=t=>{t.stopPropagation(),a()&&e.onSelect?.()},c.addEventListener(`pointerleave`,()=>{t.clearActiveOnPointerLeave&&t.setActiveItem(null)}),c.addEventListener(`pointerenter`,()=>{a()&&t.canActivateOnHover()&&t.setActiveItem(r)}),c.$$pointerdown=e=>e.stopPropagation();var l=s;return typeof l==`function`?Sz(l,c):s=c,Q(c,`id`,n),$(c,()=>e.children),yR(n=>{var a=e.dataId??r,s=i(),l=i()===`menuitemradio`?!!e.checked:void 0,u=!!e.disabled,d=t.keyboardNavigation?o()?0:-1:void 0,f=e.disabled,p=bW(`relative z-1 contain-layout flex items-center justify-between w-full px-2 py-1 cursor-pointer text-left border-none bg-transparent disabled:opacity-40 disabled:cursor-default`,e.class);return a!==n.e&&Q(c,`data-react-grab-menu-item`,n.e=a),s!==n.t&&Q(c,`role`,n.t=s),l!==n.a&&Q(c,`aria-checked`,n.a=l),u!==n.o&&Q(c,`aria-disabled`,n.o=u),d!==n.i&&Q(c,`tabindex`,n.i=d),f!==n.n&&(c.disabled=n.n=f),p!==n.s&&gz(c,n.s=p),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),c})()},pz([`pointerdown`,`click`]),sK=Z(`<span>`),cK=e=>(()=>{var t=sK();return $(t,()=>e.children),yR(()=>gz(t,bW(`text-[13px] leading-4 font-sans font-medium`,e.class))),t})(),lK=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M6.5 5C5.67157 5 5 5.67157 5 6.5C5 7.32843 5.67157 8 6.5 8H8V6.5C8 5.67157 7.32843 5 6.5 5ZM10 8V6.5C10 4.567 8.433 3 6.5 3C4.567 3 3 4.567 3 6.5C3 8.433 4.567 10 6.5 10H8V14H6.5C4.567 14 3 15.567 3 17.5C3 19.433 4.567 21 6.5 21C8.433 21 10 19.433 10 17.5V16H14V17.5C14 19.433 15.567 21 17.5 21C19.433 21 21 19.433 21 17.5C21 15.567 19.433 14 17.5 14H16V10H17.5C19.433 10 21 8.433 21 6.5C21 4.567 19.433 3 17.5 3C15.567 3 14 4.567 14 6.5V8H10ZM10 10V14H14V10H10ZM16 8H17.5C18.3284 8 19 7.32843 19 6.5C19 5.67157 18.3284 5 17.5 5C16.6716 5 16 5.67157 16 6.5V8ZM16 16V17.5C16 18.3284 16.6716 19 17.5 19C18.3284 19 19 18.3284 19 17.5C19 16.6716 18.3284 16 17.5 16H16ZM8 16H6.5C5.67157 16 5 16.6716 5 17.5C5 18.3284 5.67157 19 6.5 19C7.32843 19 8 18.3284 8 17.5V16Z">`),uK=e=>{let t=()=>e.size??11;return(()=>{var n=lK();return yR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},dK=Z(`<span>`),fK=Z(`<span style=display:inline-flex;align-items:center;gap:2px>`),pK=Z(`<span>Ctrl+`),mK=e=>{let t=()=>e.shortcut===`Enter`,n=()=>e.modifier!==!1,r=IB();return(()=>{var i=fK();return $(i,X(sz,{get when(){return t()},get children(){return X(WW,{size:8})}}),null),$(i,X(sz,{get when(){return!t()},get children(){return X(sz,{get when(){return n()},get fallback(){return(()=>{var t=dK();return $(t,()=>e.shortcut),t})()},get children(){return X(sz,{when:r,get fallback(){return(()=>{var t=pK();return t.firstChild,$(t,()=>e.shortcut,null),t})()},get children(){return[X(uK,{size:9}),(()=>{var t=dK();return $(t,()=>e.shortcut),t})()]}})}})}}),null),yR(()=>gz(i,e.class)),i})()},hK=e=>X(mK,{get shortcut(){return e.shortcut},get modifier(){return e.modifier},get class(){return bW(`text-[11px] font-sans text-[var(--rg-text-secondary)] ml-4`,e.class)}}),gK=({hiddenOpacity:e=`0`,visibleOpacity:t=`1`}={})=>{let n,r,i,a=e=>{r&&(r.style.opacity=t,r.style.top=`${e.offsetTop}px`,r.style.left=`${e.offsetLeft}px`,r.style.width=`${e.offsetWidth}px`,r.style.height=`${e.offsetHeight}px`)},o=typeof ResizeObserver>`u`?void 0:new ResizeObserver(()=>{i&&a(i)});DR(()=>o?.disconnect());let s=()=>{i=void 0,o?.disconnect(),r&&(r.style.opacity=e)};return{containerRef:e=>{n=e},followerRef:e=>{r=e},followElement:e=>{if(!(!r||!n)){if(!e){s();return}i=e,a(e),o?.disconnect(),o?.observe(e),o?.observe(n)}},hideFollower:s}},_K=(e,t)=>e!==t&&e instanceof HTMLElement,vK=(e,t)=>{let n=[];for(let r of Array.from(e.children))_K(r,t)&&n.push(r);return n},yK=(e={})=>{let{topCornerRadiusPx:t,bottomCornerRadiusPx:n,cornerShape:r}=e,i=t!==void 0||n!==void 0,a,o=!1,s=e=>{if(!a||!i)return;let s=e.parentElement;if(!s)return;let c=vK(s,a),l=c[0]===e,u=c[c.length-1]===e,d=l&&t!==void 0?`${t}px`:`0px`,f=u&&n!==void 0?`${n}px`:`0px`;a.style.borderTopLeftRadius=d,a.style.borderTopRightRadius=d,a.style.borderBottomLeftRadius=f,a.style.borderBottomRightRadius=f,r&&!o&&(a.style.setProperty(`corner-shape`,r),o=!0)},{containerRef:c,followerRef:l,followElement:u,hideFollower:d}=gK();return{containerRef:c,highlightRef:e=>{a=e,o=!1,l(e)},updateHighlight:e=>{u(e),e&&s(e)},clearHighlight:d}},bK=(e={})=>{let t=new Map,n=[],r=`react-grab-menu-${Math.random().toString(36).slice(2,8)}`,i=0,a=!1,o=e.value!==void 0,[s,c]=J(null),[l,u]=J(0),d=Y(()=>o?e.value?.()??null:s()),f=t=>{if(o){e.onValueChange?.(t);return}c(t)},p=yK(e.highlight??{});bR(TR([d,l],([e])=>{if(e===null){p.clearHighlight();return}let n=t.get(e);n?p.updateHighlight(n.element):p.clearHighlight()}));let m=()=>n.filter(e=>t.get(e)?.isEnabled()),h=()=>{let e=m();e.length>0&&f(e[0])},g=()=>{let e=m();e.length>0&&f(e[e.length-1])},_=()=>{let e=m();if(e.length===0)return;let t=e.indexOf(d()??``);f(e[t===-1?0:(t+1)%e.length])},v=()=>{let e=m();if(e.length===0)return;let t=e.indexOf(d()??``);f(e[t===-1?e.length-1:(t-1+e.length)%e.length])},y=Y(()=>{l();let e=d();if(e!==null)return t.get(e)?.domId});return{keyboardNavigation:e.keyboardNavigation??!1,clearActiveOnPointerLeave:e.clearActiveOnPointerLeave??!1,activeValue:d,activeDescendantId:y,setActiveItem:f,createItemId:()=>`${r}-item-${i++}`,canActivateOnHover:()=>!(e.requirePointerMove??!1)||a,notePointerMove:()=>{a=!0},resetPointerMove:()=>{a=!1},registerItem:e=>{t.set(e.value,e),n.includes(e.value)||n.push(e.value),u(e=>e+1)},unregisterItem:e=>{t.delete(e);let r=n.indexOf(e);r!==-1&&n.splice(r,1),o||c(t=>t===e?null:t),u(e=>e+1)},getActiveItem:()=>{let e=d();return e===null?void 0:t.get(e)},selectFirst:h,selectLast:g,selectNext:_,selectPrevious:v,setHighlightContainer:p.containerRef,setHighlightRail:p.highlightRef}},xK={Provider:tK,Panel:nK,List:iK,Item:oK,Label:cK,Shortcut:hK},SK=e=>e??!0,CK=(e,t)=>typeof e.enabled==`function`?t?e.enabled(t):!1:SK(e.enabled),wK=e=>{e.type===`contextmenu`&&e.preventDefault(),e.stopImmediatePropagation()},TK=e=>{let t=BM(t=>{e.isOpen()&&(e.shouldIgnoreKeyboardEvent?.(t)||e.shouldIgnoreInputEvents&&dB(t)||t.code===`Escape`&&(t.preventDefault(),t.stopImmediatePropagation(),e.onDismiss(`keyboard`)))}),n=BM(t=>{e.isOpen()&&(LB(t,`data-react-grab-ignore-events`)||e.shouldIgnoreRightClick&&t instanceof MouseEvent&&t.button===2||e.onDismiss(`pointer`))}),r=rI(()=>{window.addEventListener(`mousedown`,n,{capture:!0}),window.addEventListener(`touchstart`,n,{capture:!0})});return window.addEventListener(`keydown`,t,{capture:!0}),()=>{iI(r),window.removeEventListener(`keydown`,t,{capture:!0}),window.removeEventListener(`mousedown`,n,{capture:!0}),window.removeEventListener(`touchstart`,n,{capture:!0})}},EK=Z(`<div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2">`),DK=Z(`<div data-react-grab-ignore-events data-react-grab-context-menu class="fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none"style=pointer-events:auto>`),OK=e=>{let t,n,r=null,i=bK({keyboardNavigation:!0,highlight:{bottomCornerRadiusPx:14,cornerShape:xN}}),[a,o]=J(0),[s,c]=J(0),l=Y(()=>e.position!==null),u=Y(()=>xW({tagName:e.tagName,componentName:e.componentName})),d=()=>{if(t){let e=t.getBoundingClientRect();o(e.width),c(e.height)}};bR(()=>{l()&&rI(d)});let f=Y(()=>{let t=e.selectionBounds,n=e.position,r=a(),i=s();if(r===0||i===0||!t||!n)return{left:wN.left,top:wN.top,arrowLeft:0,arrowPosition:`bottom`};let o=n.x??t.x+t.width/2,c=Math.max(4,Math.min(o-r/2,window.innerWidth-r-4)),l=Math.max(8,Math.min(o-c,r-8)),u=t.y+t.height+8+4,d=t.y-i-8-4,f=u+i>window.innerHeight,p=d>=0,m=f&&p,h=m?d:u,g=m?`top`:`bottom`;if(f&&!p){let e=n.y??t.y+t.height/2;h=Math.max(4,Math.min(e+4,window.innerHeight-i-4)),g=`top`}return{left:c,top:h,arrowLeft:l,arrowPosition:g}}),p=Y(()=>{let t=e.actions??[],n=e.actionContext;return t.map(e=>({id:e.id,label:e.label,action:()=>{n&&e.onAction(n)},enabled:CK(e,n),shortcut:e.shortcut,shortcutModifier:e.shortcutModifier}))});bR(TR(l,e=>{if(e){let e=t?.getRootNode(),i=e instanceof ShadowRoot?e.activeElement:null,a=document.activeElement;r=a instanceof HTMLElement&&i===null&&!(t instanceof Element&&t.contains(a))?a:null,n?.focus({preventScroll:!0});return}i.setActiveItem(null);let a=r;r=null,!(!(a instanceof HTMLElement)||!document.contains(a))&&rI(()=>{let e=document.activeElement;(e===null||e===document.body)&&a.focus({preventScroll:!0})})})),ER(()=>{d();let t=t=>{if(!l())return;let n=t.key===`ArrowDown`,r=t.key===`ArrowUp`,a=t.key===`Home`,o=t.key===`End`,s=t.key===`Tab`;if(n||r||a||o||s){t.preventDefault(),t.stopPropagation();let e=n||s&&!t.shiftKey;a?i.selectFirst():o?i.selectLast():e?i.selectNext():i.selectPrevious();return}let c=e.actions??[],u=e.actionContext,d=n=>{u&&CK(n,u)&&(t.preventDefault(),t.stopPropagation(),n.onAction(u),e.onHide())};if(t.key===`Enter`){let e=i.getActiveItem();if(e){t.preventDefault(),t.stopPropagation(),e.isEnabled()&&e.onSelect();return}}let f=GV(c,t,{includeModifierShortcuts:!0});f&&d(f)},n=TK({isOpen:l,onDismiss:e.onDismiss,shouldIgnoreRightClick:!0}),r=BM(t);window.addEventListener(`keydown`,r,{capture:!0}),DR(()=>{n(),window.removeEventListener(`keydown`,r,{capture:!0})})});let m=Y(()=>{let{tagName:e,componentName:t}=u();return`Actions for ${t?`${t}.${e}`:e}`});return X(sz,{get when(){return l()},get children(){var r=DK();_z(r,`contextmenu`,wK,!0),_z(r,`click`,wK,!0),_z(r,`mousedown`,wK,!0),_z(r,`pointerdown`,wK,!0);var a=t;return typeof a==`function`?Sz(a,r):t=r,bz(r,`z-index`,`${ZM}`),$(r,X(DW,{get position(){return f().arrowPosition},leftPercent:0,get leftOffsetPx(){return f().arrowLeft}}),null),$(r,X(xK.Panel,{class:`justify-center items-start min-w-[100px]`,get children(){return[(()=>{var t=EK();return $(t,X(NW,{get tagName(){return u().tagName},get componentName(){return u().componentName},get isClickable(){return e.hasFilePath},onClick:t=>{t.stopPropagation(),e.hasFilePath&&e.actionContext&&(e.actions?.find(e=>e.id===`open`))?.onAction(e.actionContext)},shrink:!0})),t})(),X(FW,{get children(){return X(xK.Provider,{store:i,get children(){return X(xK.List,{ref:e=>n=e,get label(){return m()},class:`w-[calc(100%+16px)] -mx-2 -my-1.5 outline-none`,get children(){return X(az,{get each(){return p()},children:t=>X(xK.Item,{get value(){return t.id},get dataId(){return t.label.toLowerCase()},get disabled(){return!t.enabled},onSelect:()=>{t.action(),e.onHide()},get children(){return[X(xK.Label,{class:`text-[var(--rg-text-primary)]`,get children(){return t.label}}),X(sz,{get when(){return t.shortcut},children:e=>X(xK.Shortcut,{get shortcut(){return e()},get modifier(){return t.shortcutModifier}})})]}})})}})}})}})]}}),null),yR(e=>{var t=`${f().top}px`,n=`${f().left}px`;return t!==e.e&&bz(r,`top`,e.e=t),n!==e.t&&bz(r,`left`,e.t=n),e},{e:void 0,t:void 0}),r}})},pz([`pointerdown`,`mousedown`,`click`,`contextmenu`]),kK=(e,t,n,r)=>Math.max(r,Math.min(e,n-t-r)),AK=({anchor:e,measuredWidth:t,measuredHeight:n,viewportLeft:r=0,viewportTop:i=0,viewportWidth:a,viewportHeight:o,anchorGapPx:s,viewportPaddingPx:c,offscreenPosition:l})=>{if(!e||t===0||n===0)return l;let u,d;return e.edge===`left`||e.edge===`right`?(u=e.edge===`left`?e.x+s:e.x-t-s,d=e.y-n/2):(u=e.x-t/2,d=e.edge===`top`?e.y+s:e.y-n-s),{left:r+kK(u-r,t,a,c),top:i+kK(d-i,n,o,c)}},jK=(e,t)=>{let[n,r]=J(0),[i,a]=J(0),[o,s]=J(!1),[c,l]=J(!1),[u,d]=J(0),[f,p]=J(`bottom`),m,h,g=()=>{clearTimeout(m),h!==void 0&&(iI(h),h=void 0)},_=()=>{let t=e();t&&(r(t.offsetWidth),a(t.offsetHeight))},v=()=>{CR(()=>{d(e=>e+1),_()})},y=Y(()=>t()!==null);return bR(()=>{let n=t();n?(p(n.edge),clearTimeout(m),s(!0),h!==void 0&&iI(h),h=rI(()=>{_(),e()?.offsetHeight,l(!0)})):(h!==void 0&&iI(h),l(!1),m=setTimeout(()=>{s(!1)},120)),DR(g)}),bR(()=>{if(!y())return;window.addEventListener(`resize`,v),window.visualViewport?.addEventListener(`resize`,v),window.visualViewport?.addEventListener(`scroll`,v);let e=RM(),t;e&&typeof ResizeObserver<`u`&&(t=new ResizeObserver(v),t.observe(e)),DR(()=>{window.removeEventListener(`resize`,v),window.visualViewport?.removeEventListener(`resize`,v),window.visualViewport?.removeEventListener(`scroll`,v),t?.disconnect()})}),{shouldMount:o,isAnimatedIn:c,lastAnchorEdge:f,displayPosition:Y(e=>{u();let r=vW(),a=AK({anchor:t(),measuredWidth:n(),measuredHeight:i(),viewportLeft:r.offsetLeft,viewportTop:r.offsetTop,viewportWidth:r.width,viewportHeight:r.height,anchorGapPx:8,viewportPaddingPx:8,offscreenPosition:wN});return a.left===wN.left?e:a},wN),measure:_,clearAnimationHandles:g}},MK={padding:{prefix:`p`,scale:`spacing`},"padding-top,padding-bottom":{prefix:`py`,scale:`spacing`},"padding-left,padding-right":{prefix:`px`,scale:`spacing`},"padding-top":{prefix:`pt`,scale:`spacing`},"padding-right":{prefix:`pr`,scale:`spacing`},"padding-bottom":{prefix:`pb`,scale:`spacing`},"padding-left":{prefix:`pl`,scale:`spacing`},margin:{prefix:`m`,scale:`spacing`},"margin-top,margin-bottom":{prefix:`my`,scale:`spacing`},"margin-left,margin-right":{prefix:`mx`,scale:`spacing`},"margin-top":{prefix:`mt`,scale:`spacing`},"margin-right":{prefix:`mr`,scale:`spacing`},"margin-bottom":{prefix:`mb`,scale:`spacing`},"margin-left":{prefix:`ml`,scale:`spacing`},gap:{prefix:`gap`,scale:`spacing`},"column-gap":{prefix:`gap-x`,scale:`spacing`},"row-gap":{prefix:`gap-y`,scale:`spacing`},"width,height":{prefix:`size`,scale:`spacing`},width:{prefix:`w`,scale:`spacing`},height:{prefix:`h`,scale:`spacing`},"min-width":{prefix:`min-w`,scale:`spacing`},"max-width":{prefix:`max-w`,scale:`spacing`},"min-height":{prefix:`min-h`,scale:`spacing`},"max-height":{prefix:`max-h`,scale:`spacing`},"top,right,bottom,left":{prefix:`inset`,scale:`spacing`},"top,bottom":{prefix:`inset-y`,scale:`spacing`},"left,right":{prefix:`inset-x`,scale:`spacing`},top:{prefix:`top`,scale:`spacing`},right:{prefix:`right`,scale:`spacing`},bottom:{prefix:`bottom`,scale:`spacing`},left:{prefix:`left`,scale:`spacing`},"border-width":{prefix:`border`,scale:`border-width`},"border-top-width":{prefix:`border-t`,scale:`border-width`},"border-right-width":{prefix:`border-r`,scale:`border-width`},"border-bottom-width":{prefix:`border-b`,scale:`border-width`},"border-left-width":{prefix:`border-l`,scale:`border-width`},"z-index":{prefix:`z`,scale:`z-index`},opacity:{prefix:`opacity`,scale:`opacity`}},NK=(e,t)=>{let n=MK[e];if(!n)return null;let{prefix:r,scale:i}=n;if(i===`spacing`){if(t<0)return null;let e=t/4;return!Number.isInteger(e)||e>96?null:`${r}-${e}`}return i===`border-width`?!Number.isInteger(t)||t<0||t>8?null:t===1?r:`${r}-${t}`:i===`z-index`?!Number.isInteger(t)||t<0||t>50?null:`${r}-${t}`:!Number.isFinite(t)||t<0||t>100||t%5!=0?null:`${r}-${t}`},PK=e=>{let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement:e.ownerDocument?.activeElement??document.activeElement},FK=e=>e.toLowerCase()===`#00000000`?ON:e.toUpperCase(),IK=Z(`<input data-react-grab-ignore-events data-react-grab-input type=text autocapitalize=none autocorrect=off autocomplete=off>`),LK=e=>{let[t,n]=iz(e,[`class`,`ref`,`autoFocusSelect`]);return(()=>{var e=IK();return Sz(e=>{t.autoFocusSelect&&queueMicrotask(()=>{e.focus(),e.select()}),t.ref?.(e)},e),Q(e,`spellcheck`,!1),xz(e,rz({get class(){return bW(`bg-transparent border-none outline-none text-[var(--rg-text-primary)] p-0 m-0`,t.class)}},n),!1,!1),e})()},RK=`text-[13px] leading-4 font-medium`,zK={position:`absolute`,opacity:0,"pointer-events":`none`,width:`0`,height:`0`,margin:`0`,padding:`0`,overflow:`hidden`},BK=Z(`<div class="flex items-center gap-2 w-full px-2 h-[20px]"><div class="flex items-center gap-1 ml-auto shrink-0"><button type=button data-react-grab-ignore-events aria-label="Pick color"class="size-[16px] rounded-[4px] border-[var(--rg-border-button)] [border-width:0.5px] border-solid p-0 m-0 cursor-pointer shrink-0"></button><input data-react-grab-ignore-events type=color aria-hidden=true tabindex=-1 class="absolute opacity-0 pointer-events-none size-0">`),VK=Z(`<span>`),HK=Z(`<span class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)] cursor-text">`),UK=e=>e.length===9?e.slice(0,7):e,WK=e=>{let[t,n]=J(null),r=()=>t()!==null,i=()=>FK(e.value),a,o=!0;DR(()=>{o=!1}),ER(()=>{let t=e.onRegisterTrigger?.(()=>a?.click());DR(()=>t?.())});let s=()=>{let r=t();if(r===null)return;n(null);let i=MB(r);i?i.toLowerCase()!==e.value.toLowerCase()&&e.onCommit(i,`keyboard`):e.onInvalidCommit?.(),e.onEditComplete?.()},c=()=>{r()&&(n(null),e.onEditComplete?.())},l=e=>{if(!(e.isComposing||e.keyCode===229)){if(e.stopImmediatePropagation(),e.key===`Enter`){e.preventDefault(),s();return}e.key===`Escape`&&(e.preventDefault(),c())}},u=t=>{t.preventDefault(),t.stopPropagation(),e.onInteract?.(),a?.click()};return(()=>{var c=BK(),d=c.firstChild,f=d.firstChild,p=f.nextSibling;$(c,X(sz,{get when(){return e.label},children:e=>(()=>{var t=VK();return gz(t,`${RK} text-[var(--rg-text-primary)] truncate min-w-0`),$(t,e),t})()}),d),$(d,X(sz,{get when(){return r()},get fallback(){return(()=>{var e=HK();return e.$$click=e=>{e.preventDefault(),e.stopPropagation(),n(i())},e.$$pointerdown=e=>e.stopPropagation(),$(e,i),yR(()=>Q(e,`data-react-grab-value`,i())),e})()},get children(){return X(LK,{autoFocusSelect:!0,inputmode:`text`,"aria-label":`Style color hex`,class:`text-[12px] leading-4 font-medium tabular-nums text-right`,get style(){return{"field-sizing":`content`,"min-width":`32px`,"max-width":e.emphasized?`100px`:`72px`}},get value(){return t()??``},onInput:e=>n(e.currentTarget.value),onKeyDown:l,onBlur:s,onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})}}),f),f.$$click=u,f.$$mousedown=e=>e.preventDefault(),f.$$pointerdown=e=>e.stopPropagation(),p.$$input=t=>{if(!o)return;let n=t.currentTarget.value,r=e.value.length===9?e.value.slice(7):``,i=n+(r.toLowerCase()===`00`?``:r);e.onInteract?.(),i&&i.toLowerCase()!==e.value.toLowerCase()&&e.onCommit(i,`pointer`)};var m=a;return typeof m==`function`?Sz(m,p):a=p,yR(t=>bz(f,`background-color`,e.value)),yR(()=>p.value=UK(e.value)),c})()},pz([`pointerdown`,`mousedown`,`click`,`input`]),GK=Z(`<svg width=1em height=1em viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true style=width:16px;height:16px;flex-shrink:0;cursor:pointer><path fill-rule=evenodd clip-rule=evenodd>`),KK=e=>{let t=()=>e.active?`var(--rg-text-primary)`:`var(--rg-text-secondary)`,n=()=>e.active?e.direction===`left`?-2:2:0,r=()=>e.active?1.12:1,i=()=>e.direction===`left`?`M2.54282 10.5427C1.76177 11.3238 1.76177 12.5901 2.54282 13.3712L9.70183 20.5302C11.1193 21.9476 13.5428 20.9437 13.5428 18.9392V16.9573H21.0428C22.1474 16.9573 23.0428 16.0619 23.0428 14.9573V8.95733C23.0428 7.85276 22.1474 6.95733 21.0428 6.95733L13.5428 6.95733V4.97473C13.5428 2.9702 11.1193 1.96631 9.70183 3.38373L2.54282 10.5427Z`:`M14.2983 20.5302L21.4573 13.3712C22.2383 12.5901 22.2383 11.3238 21.4573 10.5427L14.2983 3.38374C12.8808 1.96631 10.4573 2.97019 10.4573 4.97473V6.95659L3.95728 6.95659C2.85271 6.95659 1.95728 7.85202 1.95728 8.95659V14.9566C1.95728 16.0612 2.85271 16.9566 3.95727 16.9566H10.4573V18.9392C10.4573 20.9437 12.8808 21.9476 14.2983 20.5302Z`;return(()=>{var a=GK(),o=a.firstChild;return _z(a,`pointerdown`,e.onPointerDown,!0),yR(s=>{var c=`translateX(${n()}px) scale(${r()})`,l=e.active?`transform 30ms cubic-bezier(0, 0, 0.2, 1)`:`transform 450ms cubic-bezier(0.34, 1.8, 0.64, 1)`,u=i(),d=t(),f=e.active?`fill 50ms ease`:`fill 300ms ease`;return c!==s.e&&bz(a,`transform`,s.e=c),l!==s.t&&bz(a,`transition`,s.t=l),u!==s.a&&Q(o,`d`,s.a=u),d!==s.o&&Q(o,`fill`,s.o=d),f!==s.i&&bz(o,`transition`,s.i=f),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},pz([`pointerdown`]),qK=Z(`<span>`),JK=Z(`<div class="flex items-center gap-2 w-full px-2 h-[20px]"><div class="ml-auto shrink-0 flex items-center gap-1"><span data-react-grab-ignore-events role=button tabindex=-1 class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)] cursor-pointer select-none min-w-[36px] text-center">`),YK=e=>{let t=()=>e.options.find(t=>t.value===e.value)?.label??e.value;return(()=>{var n=JK(),r=n.firstChild,i=r.firstChild;return $(n,X(sz,{get when(){return e.label},get children(){var t=qK();return gz(t,`${RK} text-[var(--rg-text-primary)] truncate min-w-0`),$(t,()=>e.label),t}}),r),$(r,X(KK,{direction:`left`,get active(){return e.activeKey===`left`},onPointerDown:()=>e.onStep(-1)}),i),i.$$contextmenu=t=>{t.preventDefault(),t.stopPropagation(),e.onStep(-1)},i.$$click=t=>{t.preventDefault(),t.stopPropagation(),e.onStep(1)},i.$$mousedown=e=>e.preventDefault(),i.$$pointerdown=e=>e.stopPropagation(),$(i,t),$(r,X(KK,{direction:`right`,get active(){return e.activeKey===`right`},onPointerDown:()=>e.onStep(1)}),null),yR(t=>{var n=`Cycle ${e.label??`value`}`,r=`Click to cycle (${e.options.length} options)`;return n!==t.e&&Q(i,`aria-label`,t.e=n),r!==t.t&&Q(i,`title`,t.t=r),t},{e:void 0,t:void 0}),n})()},pz([`pointerdown`,`mousedown`,`click`,`contextmenu`]),XK=e=>e.kind===`numeric`?e:null,ZK=e=>e.kind===`color`?e:null,QK=e=>e.kind===`enum`?e:null,$K=/^[0-9]$/,eq=e=>{let t=Array.from(e),n=t.findIndex(e=>$K.test(e));if(n<0)return{prefixLiterals:t,rightAlignedSegments:[]};let r=t.slice(0,n),i=[],a=0;for(let e=t.length-1;e>=n;e--){let n=t[e],r=$K.test(n)?`digit`:`literal`;i.push({kind:r,value:n,digitDistanceFromRight:a}),r===`digit`&&(a+=1)}return{prefixLiterals:r,rightAlignedSegments:i}},tq=Z(`<span class=rg-slot-column aria-hidden=true><span class=rg-slot-sizer>0</span><span class=rg-slot-cell>`),nq=Z(`<span class="rg-slot-cell rg-slot-exit">`),rq=Z(`<span><span class=inline-flex style=flex-direction:row-reverse>`),iq=Z(`<span class="inline-block whitespace-pre"aria-hidden=true>`),aq=e=>typeof e==`number`?e:Number.parseFloat(String(e).replace(/[^0-9.-]/g,``))||0,oq=e=>{let t,[n,r]=J(null),i=null;bR(TR(()=>e.digit,(n,a)=>{a===void 0||n===a||(t&&(t.classList.remove(`rg-slot-enter`),t.offsetWidth,t.classList.add(`rg-slot-enter`)),r({digit:a,direction:e.direction}),i!==null&&clearTimeout(i),i=setTimeout(()=>r(null),350))},{defer:!0})),DR(()=>{i!==null&&clearTimeout(i)});let a=()=>({"animation-delay":`${e.delayMs}ms`});return(()=>{var r=tq(),i=r.firstChild.nextSibling,o=t;return typeof o==`function`?Sz(o,i):t=i,$(i,()=>e.digit),$(r,X(sz,{get when(){return n()},keyed:!0,children:e=>(()=>{var t=nq();return $(t,()=>e.digit),yR(n=>{var r=String(e.direction),i=a();return r!==n.e&&Q(t,`data-dir`,n.e=r),n.t=yz(t,i,n.t),n},{e:void 0,t:void 0}),t})()}),null),yR(t=>{var n=String(e.direction),r=a();return n!==t.e&&Q(i,`data-dir`,t.e=n),t.t=yz(i,r,t.t),t},{e:void 0,t:void 0}),r})()},sq=e=>{let t=Y(()=>String(e.children??``)),n=Y(()=>eq(t())),r=Y(TR(()=>aq(e.children),(e,t)=>t===void 0||e===t?0:e>t?1:-1)),i=Y(()=>e.direction??r());return(()=>{var r=rq(),a=r.firstChild;return $(r,X(oz,{get each(){return n().prefixLiterals},children:e=>(()=>{var t=iq();return $(t,e),t})()}),a),$(a,X(oz,{get each(){return n().rightAlignedSegments},children:e=>X(sz,{get when(){return e().kind===`digit`},get fallback(){return(()=>{var t=iq();return $(t,()=>e().value),t})()},get children(){return X(oq,{get digit(){return Number(e().value)},get direction(){return i()},get delayMs(){return e().digitDistanceFromRight*18}})}})})),yR(n=>{var i=t(),a=`inline-flex ${e.class??``}`,o={...e.style,"--rg-slot-dur":`350ms`};return i!==n.e&&Q(r,`aria-label`,n.e=i),a!==n.t&&gz(r,n.t=a),n.a=yz(r,o,n.a),n},{e:void 0,t:void 0,a:void 0}),r})()},cq=Z(`<div data-react-grab-slider-base aria-hidden=true class="absolute inset-y-0 left-0 right-0 rounded-[6px] bg-[var(--rg-surface-active)] pointer-events-none">`),lq=Z(`<div class="flex items-center gap-1 w-full px-1"><div role=slider aria-keyshortcuts="ArrowLeft ArrowRight"tabindex=-1 class="relative flex-1 h-[20px] flex items-center overflow-hidden rounded-[6px]"><div data-react-grab-slider-fill aria-hidden=true class="absolute inset-y-0 left-0 bg-[var(--rg-surface-active)] pointer-events-none"></div><div aria-hidden=true class="absolute inset-0 pointer-events-none"></div><div data-react-grab-slider-handle aria-hidden=true class="absolute top-[2px] bottom-[2px] w-[2px] rounded-[1px] bg-[var(--rg-text-primary)] pointer-events-none"style="transition:opacity 120ms ease"></div><div class="relative z-10 flex items-center justify-between w-full px-2 pointer-events-none">`),uq=Z(`<div data-react-grab-slider-hash-mark class="absolute top-1/2 w-px h-[8px] rounded-[1px] bg-[var(--rg-text-secondary)]"style="transform:translate(-50%, -50%);transition:opacity 200ms ease">`),dq=Z(`<span>`),fq=Z(`<span class="ml-auto flex items-center gap-1 pointer-events-auto"><span data-react-grab-value-text class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)]"><span class="text-[9px] text-[var(--rg-text-secondary)] ml-px">`),pq=Z(`<span data-react-grab-tailwind-label aria-hidden=true class="text-[10px] leading-4 text-[var(--rg-text-secondary)] tabular-nums">`),mq=Array.from({length:9},(e,t)=>(t+1)*100/10),hq=/^(-?(?:\d+\.?\d*|\.\d+))\s*([a-zA-Z%]*)$/,gq=e=>{let[t,n]=J(null),[r,i]=J(0),[a,o]=J(!1),[s,c]=J(!1),l=()=>t()!==null,u,d=null,f=()=>{let t=e.max-e.min;return t<=0?0:(Math.max(e.min,Math.min(e.max,e.value))-e.min)/t*100},p=()=>{e.onCommitValue&&n(sV(e.value))},m=()=>!!e.onCommitValue,h=(t,n)=>{if(n.width<=0)return e.value;let r=Math.max(0,Math.min(1,(t-n.left)/n.width));return e.min+r*(e.max-e.min)},g=(t,n)=>{e.onCommitValue?.(h(t,n),`pointer`)},_=(e,t)=>{let n=Math.max(0,e-t.right)-Math.max(0,t.left-e),r=Math.max(0,Math.abs(n)-32),i=Math.sqrt(Math.min(r/200,1));return Math.sign(n)*8*i},v=t=>{if(!m()||l())return;t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture(t.pointerId);let n=u,r=n!==void 0&&t.target instanceof Node&&n.contains(t.target);d={startX:t.clientX,isDragging:!1,startedOnValueText:r,trackRect:t.currentTarget.getBoundingClientRect()},o(!0),e.onInteract?.()},y=t=>{if(!d)return;let n=t.clientX-d.startX;!d.isDragging&&Math.abs(n)<3||(d.isDragging=!0,e.onInteract?.(),g(t.clientX,d.trackRect),i(_(t.clientX,d.trackRect)))},b=e=>{let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),d&&(d.isDragging||(d.startedOnValueText?p():g(d.startX,d.trackRect)),d=null,o(!1),i(0))},x=e=>{let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),d&&(d=null,o(!1),i(0))};ER(()=>{let e=()=>{d=null,o(!1),c(!1),i(0)};window.addEventListener(`blur`,e),DR(()=>window.removeEventListener(`blur`,e))});let S=()=>!!e.activeKey||a()||s(),C=()=>{let r=t();if(r===null)return;n(null);let i=r.trim().replace(/(\d),(\d)/g,`$1.$2`).match(hq);if(!i){e.onInvalidCommit?.(),e.onEditComplete?.();return}let a=i[2].toLowerCase();if(a&&a!==e.unit){e.onInvalidCommit?.(),e.onEditComplete?.();return}let o=Number.parseFloat(i[1]);Number.isFinite(o)?e.onCommitValue?.(o,`keyboard`):e.onInvalidCommit?.(),e.onEditComplete?.()},w=()=>{l()&&(n(null),e.onEditComplete?.())},T=e=>{if(!(e.isComposing||e.keyCode===229)){if(e.stopImmediatePropagation(),e.key===`Enter`){e.preventDefault(),C();return}e.key===`Escape`&&(e.preventDefault(),w())}},E=()=>{let t=r();return{cursor:m()&&!l()?`ew-resize`:`default`,"touch-action":m()?`none`:`auto`,"user-select":`none`,"-webkit-user-select":`none`,"min-width":e.emphasized?`96px`:void 0,transform:t===0?`translateX(0)`:`translateX(${t}px)`,transition:a()?`none`:`transform 350ms ${AN}`}};return(()=>{var r=lq(),i=r.firstChild,o=i.firstChild,d=o.nextSibling,p=d.nextSibling,m=p.nextSibling;return i.addEventListener(`lostpointercapture`,x),i.addEventListener(`pointercancel`,x),i.$$pointerup=b,i.addEventListener(`pointerleave`,()=>c(!1)),i.addEventListener(`pointerenter`,()=>c(!0)),i.$$pointermove=y,i.$$pointerdown=v,$(i,X(sz,{get when(){return e.emphasized},get children(){var e=cq();return yR(t=>bz(e,`opacity`,l()?0:.55)),e}}),o),$(d,X(oz,{each:mq,children:e=>(()=>{var t=uq();return yR(n=>{var r=`${e()}%`,i=S()?.4:0;return r!==n.e&&bz(t,`left`,n.e=r),i!==n.t&&bz(t,`opacity`,n.t=i),n},{e:void 0,t:void 0}),t})()})),$(m,X(sz,{get when(){return e.label},children:e=>(()=>{var t=dq();return gz(t,`${RK} text-[var(--rg-text-primary)] truncate min-w-0`),$(t,e),t})()}),null),$(m,X(sz,{get when(){return l()},get fallback(){return(()=>{var t=fq(),n=t.firstChild,r=n.firstChild,i=u;return typeof i==`function`?Sz(i,t):u=t,$(t,X(sz,{get when(){return e.tailwindLabel},children:e=>(()=>{var t=pq();return $(t,e),t})()}),n),$(n,X(sq,{get children(){return sV(e.value)}}),r),$(r,()=>e.unit),yR(n=>{var r=`${sV(e.value)}${e.unit}`,i=e.onCommitValue?`text`:`default`;return r!==n.e&&Q(t,`data-react-grab-value`,n.e=r),i!==n.t&&bz(t,`cursor`,n.t=i),n},{e:void 0,t:void 0}),t})()},get children(){return X(LK,{autoFocusSelect:!0,inputmode:`decimal`,"aria-label":`Style value`,class:`text-[12px] leading-4 font-medium tabular-nums text-right pointer-events-auto ml-auto`,get style(){return{"field-sizing":`content`,"min-width":`16px`,"max-width":e.emphasized?`120px`:`60px`}},get value(){return t()??``},onInput:e=>n(e.currentTarget.value),onKeyDown:T,onBlur:C,onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})}}),null),$(r,X(sz,{get when(){return e.emphasized},get children(){return[X(KK,{direction:`left`,get active(){return e.activeKey===`left`},onPointerDown:()=>e.onStep(-1)}),X(KK,{direction:`right`,get active(){return e.activeKey===`right`},onPointerDown:()=>e.onStep(1)})]}}),null),yR(t=>{var n=e.label??`Value`,r=e.min,c=e.max,u=e.value,d=`${sV(e.value)}${e.unit}`,m=E(),h=`${f()}%`,g=+!l(),_=`calc(${f()}% - 1px)`,v=e.activeKey?.9:a()||s()?.35:0;return n!==t.e&&Q(i,`aria-label`,t.e=n),r!==t.t&&Q(i,`aria-valuemin`,t.t=r),c!==t.a&&Q(i,`aria-valuemax`,t.a=c),u!==t.o&&Q(i,`aria-valuenow`,t.o=u),d!==t.i&&Q(i,`aria-valuetext`,t.i=d),t.n=yz(i,m,t.n),h!==t.s&&bz(o,`width`,t.s=h),g!==t.h&&bz(o,`opacity`,t.h=g),_!==t.r&&bz(p,`left`,t.r=_),v!==t.d&&bz(p,`opacity`,t.d=v),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),r})()},pz([`pointerdown`,`pointermove`,`pointerup`]),_q=e=>X(cz,{get children(){return[X(lz,{get when(){return XK(e.property)},children:t=>X(gq,{get label(){return oB(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get min(){return t().min},get max(){return t().max},get unit(){return t().unit},get activeKey(){return e.activeKey},get onStep(){return e.onStep},get onCommitValue(){return e.onCommit},get onEditComplete(){return e.onEditComplete},get onInvalidCommit(){return e.onInvalidCommit},get onInteract(){return e.onInteract},get tailwindLabel(){return e.tailwindLabel},get emphasized(){return e.emphasized}})}),X(lz,{get when(){return ZK(e.property)},children:t=>X(WK,{get label(){return oB(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get onCommit(){return e.onCommit},get onEditComplete(){return e.onEditComplete},get onInvalidCommit(){return e.onInvalidCommit},get onRegisterTrigger(){return e.onColorPickerRegister},get onInteract(){return e.onInteract},get emphasized(){return e.emphasized}})}),X(lz,{get when(){return QK(e.property)},children:t=>X(YK,{get label(){return oB(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get options(){return t().options},get activeKey(){return e.activeKey},get onStep(){return e.onStep}})})]}}),vq=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Copy`),yq=e=>X(qW,{"data-react-grab-ignore-events":!0,"data-react-grab-copy-button":!0,onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onCopy()},get children(){return vq()}}),bq=()=>{let[e,t]=J(!1),n,r=()=>{clearTimeout(n),t(!1)},i=()=>{t(!0),clearTimeout(n),n=setTimeout(()=>{t(!1)},kN)},a=()=>{clearTimeout(n)};return DR(a),{isPending:e,show:i,hide:r,cleanup:a}},xq=Z(`<div role=menu aria-orientation=vertical aria-label="Editable properties"class="relative flex flex-col w-full max-h-[var(--rg-edit-list-max-h)] overflow-y-auto outline-none no-scrollbar"><div aria-hidden=true class="pointer-events-none absolute opacity-0 transition-[top,left,width,height,opacity,border-radius] duration-75 ease-out bg-[var(--rg-surface-hover)]">`),Sq=Z(`<div class="flex items-center w-full h-[24px]">`),Cq=Z(`<button data-react-grab-ignore-events type=button role=menuitem tabindex=-1 class="relative z-1 contain-layout block w-full h-[24px] px-0 py-0 cursor-pointer text-left border-none bg-transparent">`),wq=Z(`<div class="flex items-center justify-between w-full h-[24px] px-2 gap-2"><span class="text-[13px] leading-4 font-sans font-medium text-[var(--rg-text-primary)] truncate min-w-0">`),Tq=Z(`<span class="font-sans text-[var(--rg-text-secondary)] tabular-nums shrink-0"><span class=text-[11px]></span><span class="text-[9px] ml-px">`),Eq=Z(`<span aria-hidden=true class="size-[12px] rounded-[3px] border-[var(--rg-border-button)] [border-width:0.5px] border-solid shrink-0">`),Dq=Z(`<span class="text-[11px] font-sans text-[var(--rg-text-secondary)] shrink-0">`),Oq=e=>{let t=QK(e);return t?t.options.find(e=>e.value===t.value)?.label??t.value:``},kq=e=>{let t=[],n,r=!1,i=null,a=()=>{if(!n)return!1;let e=PK(n);return e instanceof HTMLElement&&e.matches(`input[data-react-grab-input]`)},o=(t,n)=>{n===`move`&&(r=!0);let o=a();if(r&&!o){if(e.isAdjusting()){i=t;return}i=null,t!==e.activeIndex&&e.onHoverIndex(t)}};bR(()=>{if(e.isAdjusting())return;let n=i;if(n===null)return;i=null;let o=t[n],s=a();r&&(s||o?.matches(`:hover`)&&n!==e.activeIndex&&e.onHoverIndex(n))});let{containerRef:s,highlightRef:c,updateHighlight:l,clearHighlight:u}=yK({});bR(()=>{t.length=e.properties.length});let d;return bR(()=>{let r=e.activeIndex,i=t[r];if(!i||r<0){u();return}if(l(i),d!==void 0&&cancelAnimationFrame(d),d=requestAnimationFrame(()=>{d=void 0;let e=t[r];e&&l(e)}),!n)return;let a=n.getBoundingClientRect(),o=i.getBoundingClientRect();(o.top<a.top||o.bottom>a.bottom)&&i.scrollIntoView({block:`nearest`})}),DR(()=>{d!==void 0&&cancelAnimationFrame(d)}),(()=>{var a=xq(),l=a.firstChild;return a.$$pointermove=()=>{r=!0},Sz(e=>{n=e,s(e)},a),Sz(c,l),$(a,X(oz,{get each(){return e.properties},children:(r,a)=>{let s=()=>a===e.activeIndex;return(()=>{var c=Cq();return c.$$click=t=>{t.stopPropagation(),e.onSelect(a)},c.$$mousedown=e=>{let t=n?PK(n):null;t instanceof HTMLElement&&t.matches(`input[data-react-grab-input]`)&&t.blur(),e.preventDefault()},c.addEventListener(`pointerleave`,()=>{i===a&&(i=null)}),c.$$pointermove=()=>{o(a,`move`)},c.addEventListener(`pointerenter`,()=>{o(a,`enter`)}),Sz(e=>{t[a]=e,DR(()=>{t[a]===e&&(t[a]=void 0)})},c),$(c,X(sz,{get when(){return s()},get fallback(){return(()=>{var e=wq(),t=e.firstChild;return $(t,()=>r().label),$(e,X(cz,{get children(){return[X(lz,{get when(){return XK(r())},children:e=>(()=>{var t=Tq(),n=t.firstChild,r=n.nextSibling;return $(n,()=>sV(e().value)),$(r,()=>e().unit),t})()}),X(lz,{get when(){return ZK(r())},children:e=>(()=>{var t=Eq();return yR(n=>bz(t,`background-color`,e().value)),t})()}),X(lz,{get when(){return QK(r())},children:e=>(()=>{var t=Dq();return $(t,()=>Oq(e())),t})()})]}}),null),e})()},get children(){var t=Sq();return $(t,X(_q,{get property(){return r()},get activeKey(){return e.activeKey},get onStep(){return e.onStep},get onCommit(){return e.onCommit},get onEditComplete(){return e.onEditComplete},get onInvalidCommit(){return e.onInvalidCommit},get onInteract(){return e.onInteract},get onColorPickerRegister(){return e.onColorPickerRegister},showLabel:!0,get tailwindLabel(){return e.activeTailwindLabel}})),t}})),yR(e=>{var t=r().key,n=s()?`true`:void 0;return t!==e.e&&Q(c,`data-react-grab-edit-property`,e.e=t),n!==e.t&&Q(c,`aria-current`,e.t=n),e},{e:void 0,t:void 0}),c})()}}),null),a})()},pz([`pointermove`,`mousedown`,`click`]),Aq=(e,t,n)=>e.kind===`color`&&typeof t==`string`&&typeof n==`string`?t.toLowerCase()===n.toLowerCase():t===n,jq=e=>e===`ArrowLeft`?-1:1,Mq=e=>{let[t,n]=J(0),r=null,i=null,a=null,o=()=>{i!==null&&clearTimeout(i),a!==null&&clearInterval(a),i=null,a=null,r=null},s=()=>{o(),n(0)},c=t=>{o(),r=t;let n=jq(t);i=setTimeout(()=>{a=setInterval(()=>{e.step(n,e.isShiftHeld(),e.isAltHeld(),!0)},60)},280)};return ER(()=>{window.addEventListener(`blur`,s),DR(()=>window.removeEventListener(`blur`,s))}),DR(s),{heldDirection:t,pressArrow:(t,r,i,a)=>{if(r)return;let o=jq(t);c(t),n(o),e.step(o,i,a,!1)},releaseKey:e=>{e===r&&s()},cancelRepeat:s}},Nq=(e,t,n)=>{if(e.length===0)return null;let r=e.findIndex(e=>e.value===t),i=e[((r===-1?0:r)+n+e.length)%e.length];return!i||i.value===t?null:i},Pq=(e,t,n,r,i)=>{if(e.kind===`enum`)return Nq(e.options,e.value,t)?.value??null;if(e.kind!==`numeric`)return null;let a=Math.min(e.min,e.value),o=Math.max(e.max,e.value);if(!n&&!r&&e.unit===`px`&&i?.hasTokens){let n=i.stepLength(e.value,t,e.cssProperties[0]);if(n!==null){let t=cV(NB(n,a,o));if(t!==e.value)return t}}let s=n?10:1,c=cV(NB(e.value+t*s,a,o));return c===e.value?null:c},Fq=/^-?\d*\.?\d+$/,Iq=e=>Fq.test(e),Lq=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,``),Rq=e=>{if(e.kind!==`enum`)return[];let t=[];for(let n of e.options){let e=Lq(n.value),r=Lq(n.label);e&&t.push(e),r&&r!==e&&t.push(r)}return t},zq=e=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(let e of r.tailwindAliases){let i=Lq(e);i&&t.push({property:r,originalIndex:n,kind:`alias`,term:i})}for(let e of Rq(r))t.push({property:r,originalIndex:n,kind:`enum-option`,term:e});let i=Lq(r.label);i&&t.push({property:r,originalIndex:n,kind:`name`,term:i});let a=Lq(r.key);a&&a!==i&&t.push({property:r,originalIndex:n,kind:`name`,term:a});let o=Lq(`${r.label} ${r.key}`);o&&t.push({property:r,originalIndex:n,kind:`label`,term:o})}return t},Bq=(e,t)=>{if(t.kind===`alias`||t.kind===`enum-option`||t.kind===`name`)return e===t.term?NN+t.term.length:t.term.startsWith(e)||e.startsWith(t.term)?PN+Math.min(e.length,t.term.length):null;let n=t.term.indexOf(e);return n===-1?null:n===0?FN-t.term.length*1:IN-n*100-t.term.length*1},Vq=(e,t,n,r)=>{let i=e.get(t.key);i&&i.score>=r||e.set(t.key,{property:t,score:r,originalIndex:n})},Hq=e=>{let t=zq(e),n=new Map;for(let t=0;t<e.length;t++)n.set(e[t].key,t);let r=(t,r,i)=>{for(let a=0;a<r.length;a++){let o=r[a],s=n.get(o);if(s===void 0)continue;let c=e[s];Vq(t,c,s,i-a)}};return{search:n=>{let i=Lq(n);if(!i||Iq(i))return e;let a=new Map;r(a,NV(n),jN),r(a,PV(n),MN);for(let e of t){let t=Bq(i,e);t!==null&&Vq(a,e.property,e.originalIndex,t)}return Array.from(a.values()).sort((e,t)=>t.score===e.score?e.originalIndex-t.originalIndex:t.score-e.score).map(e=>e.property)}}},Uq=(e,t)=>e.kind===t.kind&&!Aq(e,t.value,e.original),Wq=e=>{let{initialProperties:t,searchQuery:n}=e,[r,i]=J({}),a=Hq(t),o=Y(()=>{let e=n(),i=r(),o=e?t:t.filter(e=>e.isPrioritized||e.isCanonical&&!e.isDefault||i[e.key]!==void 0);return e?a.search(e):o.slice(0,40)}),s=new Map(t.map(e=>[e.key,e])),c=Y(()=>{let e=r(),t=Object.keys(e);if(t.length===0)return o();let n=new Map;for(let r of t){let t=e[r];if(t.kind!==`numeric`)continue;let i=s.get(r);if(i)for(let e of i.cssProperties)n.set(e,t.value)}return o().map(t=>{let r=e[t.key];if(r!==void 0)return l(t,r);if(t.kind!==`numeric`)return t;let i=n.get(t.cssProperties[0]);return i===void 0?t:t.cssProperties.every(e=>n.get(e)===i)?{...t,value:i}:t})}),l=(e,t)=>e.kind===`numeric`&&t.kind===`numeric`||e.kind===`color`&&t.kind===`color`||e.kind===`enum`&&t.kind===`enum`?{...e,value:t.value}:e;return{filteredProperties:c,applyStyle:(e,t)=>{let n;if(e.kind===`numeric`&&typeof t==`number`)n={kind:`numeric`,value:t};else if(e.kind===`color`&&typeof t==`string`)n={kind:`color`,value:t};else if(e.kind===`enum`&&typeof t==`string`)n={kind:`enum`,value:t};else return;i(t=>{let r=Object.keys(t);if(r[r.length-1]===e.key)return{...t,[e.key]:n};let i={};for(let n of r){if(n===e.key)continue;let r=s.get(n);r!==void 0&&r.cssProperties.every(t=>e.cssProperties.includes(t))||(i[n]=t[n])}return i[e.key]=n,i})},buildPendingEdits:()=>{let e=r(),t=[],n=new Set;for(let r of Object.keys(e)){let i=e[r],a=s.get(r);if(!a||a.kind!==i.kind)continue;let o=Uq(a,i),c=!o&&a.cssProperties.some(e=>n.has(e));if(!(!o&&!c)){if(o)for(let e of a.cssProperties)n.add(e);a.kind===`numeric`&&i.kind===`numeric`?t.push({kind:`numeric`,key:a.key,cssProperties:a.cssProperties,value:i.value,unit:a.unit}):a.kind===`color`&&i.kind===`color`?t.push({kind:`color`,key:a.key,cssProperties:a.cssProperties,value:i.value}):a.kind===`enum`&&i.kind===`enum`&&t.push({kind:`enum`,key:a.key,cssProperties:a.cssProperties,value:i.value})}}return t},hasPendingStyles:()=>{let e=r();for(let n of t){let t=e[n.key];if(t&&Uq(n,t))return!0}return!1},hasChangedStyleFor:e=>{let t=r()[e],n=s.get(e);return!!(t&&n&&Uq(n,t))}}},Gq=new Map;for(let e of ZB)for(let t of e)Gq.set(t.key,t.longhands);Kq=e=>{if(e.includes(`,`))return e.split(`,`);let t=Gq.get(e);return t?[...t]:[e]},qq=/^-?(?:\d+\.?|\d*\.\d*)?$/,Jq=e=>qq.test(e),Yq=e=>{let t=e.startsWith(`-`);return{isNegative:t,base:t?e.slice(1):e}},Xq=/^([a-z-]+)-(-?\d+(?:\.\d+)?)$/,Zq=/^(.+?)-\[(.+)]$/,Qq=/^(-?\d*\.?\d+)\s*([a-zA-Z%]*)$/,$q=/^(-?\d*\.?\d+)(px|rem)?$/i,eJ=/^(?:length|size):/i,tJ=new Set([`opacity`,`border-width`,`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`,`z-index`,`font-weight`]),nJ=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`numeric`)return n;return null},rJ=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`enum`)return n;return null},iJ=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`color`)return n;return null},aJ=e=>{let t=e.replace(/^(?:color|length|size):/i,``).trim();return/(?:var|url)\(/i.test(t)?t:t.replace(/_/g,` `)},oJ=e=>{let t=e.lastIndexOf(`:`),n=t>=0?e.slice(t+1):e;return(n.startsWith(`!`)?n.slice(1):n).toLowerCase()},sJ=(e,t)=>{let n=e.match($q);if(!n)return null;let r=n[2]?.toLowerCase();if(!r&&!t)return null;let i=Number.parseFloat(n[1]);return Number.isFinite(i)?r===`rem`?i*16:i:null},cJ=(e,t)=>{let n=Kq(t),r=new Map;for(let t of n)for(let n of e)n.kind===`numeric`&&n.cssProperties.includes(t)&&r.set(n.key,n);return Array.from(r.values())},lJ=(e,t)=>cV(NB(t,e.min,e.max)),uJ=e=>{let{initialProperties:t,searchQuery:n,isCompact:r,activeProperty:i,commit:a,setIsCompact:o}=e,s=e=>{for(let n of t)if(n.key===e&&(n.kind===`numeric`||n.kind===`enum`))return!0;return cJ(t,e).length>0},c=e=>{let t=e.trim().replace(/(\d),(\d)/g,`$1.$2`).match(Qq);if(!t)return null;let n=Number.parseFloat(t[1]);return Number.isFinite(n)?{value:n,unit:t[2].toLowerCase()}:null},l=(e,t)=>!e||t.toLowerCase().startsWith(e),u=e=>{if(!r())return!1;let t=i();if(t?.kind!==`numeric`)return!1;let n=c(e);return n?l(n.unit,t.unit):Jq(e)},d=Y(()=>u(n())),f=e=>{if(!r())return!1;let t=i();if(t?.kind!==`numeric`)return!1;let n=c(e);if(!n)return!1;let o=t.unit.toLowerCase();if(n.unit!==``&&n.unit!==o)return l(n.unit,t.unit);let s=lJ(t,n.value);return s!==t.value&&a(t,s),!0},p=(e,n)=>{let r=nJ(t,e);if(r)return r.unit===`px`?(o(!0),a(r,lJ(r,n),{shouldCompact:!0}),!0):!1;let i=cJ(t,e);return i.length===0?!1:(o(!0),CR(()=>{for(let e of i)a(e,lJ(e,n),{shouldCompact:!0})}),!0)},m=(e,n)=>{let r=DV(e);if(!r)return!1;let i=iJ(t,r);if(!i)return!1;let s=n===null?kV(e):MB(n);return s?(o(!0),a(i,s,{shouldCompact:!0}),!0):!1},h=e=>{let t=e.trim(),n=t.match(Zq);if(!n)return!1;let r=n[2],i=aJ(r);if(m(t,i))return!0;let a=sJ(i,eJ.test(r.trim()));if(a===null)return!1;let{isNegative:o,base:s}=Yq(n[1]),c=LV(oJ(s));return c?p(c,o?-a:a):!1},g=e=>{if(h(e))return;let n=wV(e),{isNegative:r,base:i}=Yq(n),c=i.replace(/-\d*$/,``).replace(/-$/,``),l=c?LV(c):null;if(l&&s(l)&&o(!0),!r){if(m(n,null))return;let e=RV(n);if(e){let n=rJ(t,e.property);if(!n)return;let r=n.options.find(t=>t.value===e.value);r&&(o(!0),a(n,r.value,{shouldCompact:!0}));return}}let u=i.match(Xq);if(!u)return;let d=LV(u[1]);if(!d)return;let f=Number.parseFloat(u[2]);if(!Number.isFinite(f))return;let p=r?-f:f,g=tJ.has(d)?p:p*4,_=nJ(t,d);if(_){a(_,lJ(_,g),{shouldCompact:!0});return}if(!r){let e=rJ(t,d);if(e){let t=String(f),n=e.options.find(e=>e.value===t);if(n){a(e,n.value,{shouldCompact:!0});return}}}let v=cJ(t,d);v.length!==0&&CR(()=>{for(let e of v)a(e,lJ(e,g),{shouldCompact:!0})})},_=e=>{if(RV(e))return!0;let{base:n}=Yq(e),r=n.match(Xq);if(!r)return!1;let i=LV(r[1]);return i?s(i)?!0:rJ(t,i)!==null:!1};return{isInlineNumericEdit:d,isInlineNumericDraft:u,tryApplyNumericValue:f,applyTailwindClass:e=>{let t=e.trim().replace(/^class\s*=\s*["']/,``).replace(/["']\s*$/,``).replace(/\s+\[/g,`-[`),n=wV(t),r=t.split(/\s+/).filter(Boolean);if(r.length>1&&!_(n)){for(let e of r)g(e);return}g(t)}}},dJ=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">No`),fJ=Z(`<span class="text-[var(--rg-error-text)] text-[13px] leading-3.5 font-sans font-medium">Yes`),pJ=Z(`<div role=alertdialog aria-modal=true aria-labelledby=rg-discard-prompt-title class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-2 w-full self-stretch"><span id=rg-discard-prompt-title class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium">Discard edits?</span><div class="flex items-center gap-[5px]">`),mJ=Z(`<div><textarea data-react-grab-ignore-events data-react-grab-input aria-label="Search properties"aria-keyshortcuts="Enter Escape ArrowUp ArrowDown ArrowLeft ArrowRight Tab"autocapitalize=none autocorrect=off autocomplete=off class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-medium bg-transparent border-none resize-none w-full p-0 m-0 outline-none"rows=1 style=caret-color:var(--rg-text-primary);field-sizing:content;min-height:16px;max-height:16px;scrollbar-width:none>`),hJ=Z(`<div>`),gJ=Z(`<div role=dialog aria-modal=true aria-label="Style element"data-react-grab-ignore-events data-react-grab-edit-panel>`),_J=Z(`<div class="flex items-center justify-center w-full px-3 py-1.5 min-h-[28px]">`),vJ=e=>X(sz,{get when(){return e.state},children:t=>X(sz,{keyed:!0,get when(){return t().element},children:n=>X(yJ,{get state(){return t()},position:()=>e.position,get onDismiss(){return e.onDismiss},get onSubmit(){return e.onSubmit},get onPendingEditsChange(){return e.onPendingEditsChange},get onInteractingChange(){return e.onInteractingChange}})})}),yJ=e=>{let t=e.state.properties,n,r=e.state.preview,[i,a]=J(e.state.initialSearchQuery??``),[o,s]=J(null),[c,l]=J(null),u=Wq({initialProperties:t,searchQuery:()=>o()??i()}),d=()=>{let e=u.filteredProperties().findIndex(e=>e.kind===`numeric`);return e>0?e:0},[f,p]=J(d()),m=Y(()=>u.hasPendingStyles()),h=Y(()=>m()||!!e.state.hasSessionEdits),[g,_]=J(!1),v,y,b,x=!1,[S,C]=J(!1),w=Y(()=>S()||m()),[T,E]=J(!1),D=KV(),O=Y(()=>xW({tagName:e.state.tagName,componentName:e.state.componentName})),k=Y(()=>{let e=u.filteredProperties();return e.length===0?null:e[Math.min(Math.max(0,f()),e.length-1)]}),ee,te=jK(()=>ee,e.position),A=e=>{l(e),clearTimeout(v),v=setTimeout(()=>{l(t=>t===e?null:t)},100)},ne=Y(()=>w()&&!T());bR(()=>{let t=ne();e.onInteractingChange?.(t)});let re=()=>{C(!0),clearTimeout(y),y=setTimeout(()=>{C(!1)},150)},ie=()=>{queueMicrotask(()=>{n&&PK(n)!==n&&gW(n,{preventScroll:!0})})},ae=()=>{o()===null&&s(i())},oe=()=>{x=!1,clearTimeout(b)},se=()=>{x=!1,clearTimeout(b),b=setTimeout(()=>{x=!0},500)},ce=e=>{let t=e.trim(),n=t.replace(/^-/,``).replace(`.`,``);/[a-z%]+$/i.test(t)||n.length>1?se():oe()},le=e=>{if(!x)return e;let t=i();if(!t||!e.startsWith(t))return oe(),e;let n=e.slice(t.length);return/^[-.\d]/.test(n)?(oe(),n):e},ue=e=>{if(!x||e.metaKey||e.ctrlKey||e.altKey||!/^[-.\d]$/.test(e.key))return!1;e.preventDefault(),e.stopImmediatePropagation(),oe();let t=e.key;return n&&(n.value=t),xe.tryApplyNumericValue(t)?(ae(),a(t),ce(t),ie(),!0):(a(t),ie(),!0)},de=()=>{oe(),s(null),_(!1)},fe=(t,n,i={})=>{u.applyStyle(t,n),r.apply(t.cssProperties,lV(t,n)),e.onPendingEditsChange?.(u.buildPendingEdits()),re(),i.isFromKeyRepeat||we.hide(),i.flashDirection&&A(i.flashDirection===1?`right`:`left`),i.shouldFocus&&ie(),i.shouldCompact&&_(!0),i.source===`keyboard`&&D.arm()},pe=HV(e=>e.shiftKey),me=HV(e=>e.altKey),he=(t,n,r,i,a)=>{let o=k();if(!o)return null;let s=Pq(o,t,n,r,e.state.designTokens);return s===null?(A(t===1?`right`:`left`),null):(fe(o,s,{flashDirection:t,shouldFocus:!0,isFromKeyRepeat:i,source:a}),o)},ge=(e,t,n,r)=>{he(e,t,n,r,`keyboard`)&&_(!0)},_e=e=>{he(e,!1,!1,!1,`pointer`)},ve=Mq({step:ge,isShiftHeld:pe,isAltHeld:me}),ye=(e,t)=>{let n=k();if(n){if(n.kind===`numeric`&&typeof e==`number`){let r=cV(NB(e,n.min,n.max));r!==n.value&&fe(n,r,{source:t});return}typeof e==`string`&&(Aq(n,e,n.value)||fe(n,e,{source:t}))}},be=Y(()=>{if(!pe())return null;let e=k();return!e||e.kind!==`numeric`?null:NK(e.key,e.value)}),xe=uJ({initialProperties:t,searchQuery:i,isCompact:g,activeProperty:k,commit:(e,t,n)=>{fe(e,t,{...n,source:`keyboard`})},setIsCompact:_}),Se=Y(()=>g()&&i()!==``&&xe.isInlineNumericEdit()),Ce=()=>{we.hide(),D.clear(),e.onSubmit(u.buildPendingEdits())},we=bq(),Te,Ee=()=>{Te&&(Te.classList.remove(`animate-shake`),Te.offsetWidth,Te.classList.add(`animate-shake`))},De=t=>{we.hide(),t===`discard`&&r.restore(),e.onDismiss()},Oe=e=>{if(ve.cancelRepeat(),e===`pointer`&&D.clear(),we.isPending()){De(`discard`);return}if(!h()){De(r.hasAppliedStyles()?`discard`:`preserve`);return}let t=g();de(),!(e===`keyboard`&&t)&&(we.show(),Ee())},ke=e=>{let t=u.filteredProperties();t.length!==0&&(p(n=>(n+e+t.length)%t.length),de())},Ae=()=>{D.clear(),we.hide()},je=[],Me=e=>(je.push(e),()=>{je=je.filter(t=>t!==e)}),Ne=()=>je[je.length-1]??null,Pe=(e,t)=>{if(k()?.kind===`color`){t.repeat||Ne()?.();return}ve.pressArrow(e,t.repeat,t.shiftKey,t.altKey)},Fe={ArrowUp:()=>ke(-1),ArrowDown:()=>ke(1),ArrowLeft:e=>Pe(`ArrowLeft`,e),ArrowRight:e=>Pe(`ArrowRight`,e),Tab:e=>ke(e.shiftKey?-1:1),Enter:()=>{if(we.isPending())return;let e=k(),t=Ne();if(e?.kind===`color`&&!u.hasChangedStyleFor(e.key)&&t&&!h()){t();return}Ce()},Escape:()=>Oe(`keyboard`)},Ie=e=>{if(e.isComposing||e.keyCode===229)return;if(we.isPending()){let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.closest(`[data-react-grab-discard-button]`)!==null&&(e.key===`Tab`||e.key===`Enter`))return;if(e.key===`Tab`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault(),e.stopImmediatePropagation();return}}let t=Fe[e.key];t&&(e.preventDefault(),e.stopImmediatePropagation(),t(e))};ER(()=>{queueMicrotask(()=>{if(gW(n,{preventScroll:!0}),n){let e=n.value.length;n.setSelectionRange(e,e)}}),te.measure();let e=i();e&&xe.applyTailwindClass(e);let t=TK({isOpen:()=>!0,onDismiss:Oe,shouldIgnoreKeyboardEvent:e=>{let t=e.composedPath()[0];return we.isPending()&&t instanceof HTMLElement&&t.closest(`[data-react-grab-discard-button]`)!==null},shouldIgnoreRightClick:!0,shouldIgnoreInputEvents:!0}),r=BM(e=>{LB(e,`data-react-grab-input`)||ue(e)||Ie(e)}),a=BM(e=>{ve.releaseKey(e.key)}),o=BM(e=>{e.pointerType===`mouse`&&(we.isPending()||D.consume()&&h()&&Oe(`pointer`))});window.addEventListener(`keydown`,r,{capture:!0}),window.addEventListener(`keyup`,a,{capture:!0}),window.addEventListener(`pointermove`,o,{capture:!0}),DR(()=>{t(),window.removeEventListener(`keydown`,r,{capture:!0}),window.removeEventListener(`keyup`,a,{capture:!0}),window.removeEventListener(`pointermove`,o,{capture:!0}),clearTimeout(v),clearTimeout(y),clearTimeout(b),we.cleanup(),te.clearAnimationHandles(),C(!1)})});let j=e=>{p(e),ie()};return X(sz,{get when(){return te.shouldMount()},get children(){var e=gJ();_z(e,`contextmenu`,wK,!0),_z(e,`click`,wK,!0),_z(e,`mousedown`,wK,!0),_z(e,`pointerdown`,wK,!0);var t=ee;return typeof t==`function`?Sz(t,e):ee=e,bz(e,`z-index`,`${ZM}`),bz(e,`--rg-edit-list-max-h`,`280px`),$(e,X(zW,{ref:e=>Te=e,class:`flex flex-col justify-center items-start overflow-hidden w-fit h-fit`,get style(){return{"min-width":g()?void 0:`200px`,"max-width":`320px`,transform:`translateX(${ve.heldDirection()*2}px)`,transition:`transform 280ms ${AN}`}},get children(){return[X(sz,{get when(){return we.isPending()},get fallback(){return X(sz,{get when(){return!g()},get children(){var e=hJ();return e.addEventListener(`mouseleave`,()=>E(!1)),e.addEventListener(`mouseenter`,()=>E(!0)),$(e,X(NW,{get tagName(){return O().tagName},get componentName(){return O().componentName},isClickable:!1,onClick:()=>{},shrink:!0}),null),$(e,X(sz,{get when(){return h()},get children(){return X(yq,{onCopy:Ce})}}),null),yR(()=>gz(e,bW(`contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 h-fit px-2`,h()?`w-full self-stretch justify-between`:`w-fit`))),e}})},get children(){var e=pJ(),t=e.firstChild.nextSibling;return $(t,X(qW,{"data-react-grab-ignore-events":!0,"data-react-grab-discard-button":`cancel`,onClick:e=>{e.preventDefault(),e.stopPropagation(),Ae()},get children(){return dJ()}}),null),$(t,X(qW,{variant:`destructive`,"data-react-grab-ignore-events":!0,"data-react-grab-discard-button":`confirm`,onClick:e=>{e.preventDefault(),e.stopPropagation(),De(`discard`)},get children(){return fJ()}}),null),e}}),(()=>{var e=mJ(),t=e.firstChild;return t.$$keydown=Ie,t.$$input=e=>{let t=le(e.currentTarget.value);if(t!==e.currentTarget.value&&(e.currentTarget.value=t),xe.tryApplyNumericValue(t)){ae(),a(t),ce(t),ie();return}if(oe(),xe.isInlineNumericDraft(t)){ae(),a(t),ie();return}a(t),s(null),p(t.trim()===``?d():0),de(),xe.applyTailwindClass(t)},Sz(e=>{n=e},t),Q(t,`spellcheck`,!1),yR(n=>{var r=Se()?``:`[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-1.5 w-full self-stretch [border-top-width:0.5px] border-t-solid border-t-[var(--rg-border-subtle)] antialiased`,i=Se()?zK:void 0,a=Se()?-1:0,o=g()?k()?.label??`Search property`:`Search property`;return r!==n.e&&gz(e,n.e=r),n.t=yz(e,i,n.t),a!==n.a&&Q(t,`tabindex`,n.a=a),o!==n.o&&Q(t,`placeholder`,n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),yR(()=>t.value=i()),e})(),X(sz,{get when(){return u.filteredProperties().length>0},get children(){var e=hJ();return $(e,X(kq,{get properties(){return u.filteredProperties()},get activeIndex(){return f()},get activeKey(){return c()},onHoverIndex:p,onSelect:j,onStep:_e,onCommit:ye,onColorPickerRegister:Me,onEditComplete:ie,onInvalidCommit:Ee,onInteract:re,isAdjusting:S,get activeTailwindLabel(){return be()}})),yR(t=>{var n=g()?``:`[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start w-full self-stretch antialiased`,r=g()?zK:void 0;return n!==t.e&&gz(e,t.e=n),t.t=yz(e,r,t.t),t},{e:void 0,t:void 0}),e}}),X(sz,{get when(){return oB(()=>!!g())()&&k()},children:e=>(()=>{var t=_J();return t.$$mousedown=e=>e.preventDefault(),$(t,X(_q,{get property(){return e()},get activeKey(){return c()},onStep:_e,onCommit:ye,onEditComplete:ie,onInvalidCommit:Ee,onInteract:re,onColorPickerRegister:Me,showLabel:!1,get tailwindLabel(){return be()},emphasized:!0})),t})()})]}})),yR(t=>{var n=g()?`true`:`false`,r=bW(`fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none`,te.isAnimatedIn()?`transition-[opacity,transform] duration-220 ease-spring`:`transition-[opacity,transform] duration-120 ease-drawer`),i=`${te.displayPosition().top}px`,a=`${te.displayPosition().left}px`,o=te.isAnimatedIn()?`auto`:`none`,s=TN[te.lastAnchorEdge()],c=te.isAnimatedIn()?`1`:`0`,l=te.isAnimatedIn()?`scale(1)`:`scale(0.92)`;return n!==t.e&&Q(e,`data-rg-compact`,t.e=n),r!==t.t&&gz(e,t.t=r),i!==t.a&&bz(e,`top`,t.a=i),a!==t.o&&bz(e,`left`,t.o=a),o!==t.i&&bz(e,`pointer-events`,t.i=o),s!==t.n&&bz(e,`transform-origin`,t.n=s),c!==t.s&&bz(e,`opacity`,t.s=c),l!==t.h&&bz(e,`transform`,t.h=l),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),e}})},pz([`pointerdown`,`mousedown`,`click`,`contextmenu`,`input`,`keydown`]),bJ=Z(`<div data-react-grab-ignore-events>`),xJ=e=>{let t,n=()=>e.interactive!==!1,r=jK(()=>t,()=>e.position);return ER(()=>{r.measure();let t=e.onDismiss?TK({isOpen:()=>!!e.position,onDismiss:e.onDismiss}):void 0;DR(()=>{r.clearAnimationHandles(),t?.()})}),X(sz,{get when(){return r.shouldMount()},get children(){var i=bJ(),a=t;return typeof a==`function`?Sz(a,i):t=i,xz(i,rz(()=>({[e.dataAttribute]:``}),{get class(){return bW(`fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none will-change-[opacity,transform]`,r.isAnimatedIn()?`transition-[opacity,transform] duration-220 ease-spring`:`transition-[opacity,transform] duration-120 ease-drawer`)},get style(){return{top:`${r.displayPosition().top}px`,left:`${r.displayPosition().left}px`,"z-index":`${ZM}`,"pointer-events":n()&&r.isAnimatedIn()?`auto`:`none`,"transform-origin":TN[r.lastAnchorEdge()],opacity:r.isAnimatedIn()?`1`:`0`,transform:r.isAnimatedIn()?`scale(1)`:`scale(0.92)`}},onPointerDown:wK,onMouseDown:wK,onClick:wK,onContextMenu:wK}),!1,!0),$(i,()=>e.children),i}})},SJ=e=>{let t=bK({clearActiveOnPointerLeave:!0,highlight:{topCornerRadiusPx:14,bottomCornerRadiusPx:14,cornerShape:xN}});return X(xJ,{get position(){return e.position},dataAttribute:`data-react-grab-toolbar-menu`,get onDismiss(){return e.onDismiss},get children(){return X(xK.Panel,{class:`overflow-hidden`,style:{"min-width":`100px`},get children(){return X(xK.Provider,{store:t,get children(){return X(xK.List,{label:`Default action`,get children(){return X(az,{get each(){return e.actions},children:t=>{let n=()=>t.id===e.defaultActionId;return X(xK.Item,{get value(){return t.id},role:`menuitemradio`,get checked(){return n()},onSelect:()=>{e.onSetDefaultAction(t.id),e.onDismiss()},get children(){return[X(xK.Label,{get class(){return n()?`text-[var(--rg-text-primary)]`:`text-[var(--rg-text-secondary)]`},get children(){return t.label}}),X(sz,{get when(){return t.shortcut},children:e=>X(xK.Shortcut,{get shortcut(){return e()},get modifier(){return t.shortcutModifier}})})]}})}})}})}})}})}})},CJ=Z(`<span aria-hidden=true class="shrink-0 font-mono text-[11px] leading-4 text-[var(--rg-text-secondary)] opacity-60 mr-1">`),wJ=Z(`<span class=text-[var(--rg-text-secondary)]>.`),TJ=Z(`<span class="flex items-center min-w-0 w-full"><span class="text-[13px] leading-4 h-fit font-medium overflow-hidden text-ellipsis whitespace-nowrap min-w-0 transition-colors">`),EJ=e=>{let t=()=>e.state?.activeIndex??0,n=bK({value:()=>String(t()),highlight:{topCornerRadiusPx:14,bottomCornerRadiusPx:14,cornerShape:xN}});return X(xJ,{get position(){return e.position},dataAttribute:`data-react-grab-hierarchy-menu`,interactive:!1,get children(){return X(xK.Panel,{class:`overflow-hidden`,style:{"min-width":`160px`},get children(){return X(xK.Provider,{store:n,get children(){return X(xK.List,{label:`Navigate element hierarchy`,get children(){return X(az,{get each(){return e.state?.items??[]},children:(e,n)=>X(xK.Item,{get value(){return String(n())},role:`menuitemradio`,get checked(){return n()===t()},get children(){var r=TJ(),i=r.firstChild;return $(r,X(sz,{get when(){return e.depth>0},get children(){var t=CJ();return $(t,()=>e.isLast?`└─`:`├─`),yR(n=>bz(t,`padding-left`,`${(e.depth-1)*12}px`)),t}}),i),$(i,X(sz,{get when(){return e.componentName},get children(){return[oB(()=>e.componentName),wJ()]}}),null),$(i,()=>e.tagName,null),yR(e=>{var r=n()===t(),a=n()!==t();return r!==e.e&&i.classList.toggle(`text-[var(--rg-text-primary)]`,e.e=r),a!==e.t&&i.classList.toggle(`text-[var(--rg-text-secondary)]`,e.t=a),e},{e:void 0,t:void 0}),r}})})}})}})}})}})},DJ=e=>[X(fW,{get selectionVisible(){return e.selectionVisible},get selectionBounds(){return e.selectionBounds},get selectionBoundsMultiple(){return e.selectionBoundsMultiple},get selectionShouldSnap(){return e.selectionShouldSnap},get dragVisible(){return e.dragVisible},get dragBounds(){return e.dragBounds},get grabbedBoxes(){return e.grabbedBoxes},get labelInstances(){return e.labelInstances}}),X(mW,{get visible(){return e.isFrozen??!1}}),X(sz,{get when(){return oB(()=>!!e.selectionLabelVisible)()&&(e.frozenLabelEntries?.length??0)>0},get children(){return X(oz,{get each(){return e.frozenLabelEntries??[]},children:(t,n)=>X(wG,{get tagName(){return t().tagName},get componentName(){return t().componentName},get selectionBounds(){return t().bounds},get mouseX(){return t().mouseX},visible:!0,shouldToggleExpandOnClick:n===0,get onToggleExpand(){return n===0?e.onToggleExpand:void 0}})})}}),X(sz,{get when(){return oB(()=>!!e.selectionLabelVisible)()&&e.pendingShiftPreviewEntry},children:e=>X(wG,{get tagName(){return e().tagName},get componentName(){return e().componentName},get selectionBounds(){return e().bounds},get mouseX(){return e().mouseX},visible:!0})}),X(sz,{get when(){return oB(()=>!!(e.selectionLabelVisible&&e.selectionBounds))()&&(e.frozenLabelEntries?.length??0)===0},get children(){return X(wG,{get tagName(){return e.selectionTagName},get componentName(){return e.selectionComponentName},get elementsCount(){return e.selectionElementsCount},get selectionBounds(){return e.selectionBounds},get mouseX(){return e.mouseX},get visible(){return e.selectionLabelVisible},get isPromptMode(){return e.isPromptMode},get inputValue(){return e.inputValue},get status(){return e.selectionLabelStatus},get filePath(){return e.selectionFilePath},get onInputChange(){return e.onInputChange},get onSubmit(){return e.onInputSubmit},get onToggleExpand(){return e.onToggleExpand},get selectionLabelShakeCount(){return e.selectionLabelShakeCount},get onConfirmDismiss(){return e.onConfirmDismiss},get discardPrompt(){return e.discardPrompt},onOpen:()=>{e.selectionFilePath&&LI(e.selectionFilePath,e.selectionLineNumber)},get isContextMenuOpen(){return e.contextMenuPosition!==null}})}}),X(oz,{get each(){return e.labelInstances??[]},children:t=>X(wG,{get tagName(){return t().tagName},get componentName(){return t().componentName},get elementsCount(){return t().elementsCount},get selectionBounds(){return t().bounds},get mouseX(){return t().mouseX},visible:!0,get status(){return t().status},get statusText(){return t().statusText},get isPromptMode(){return t().isPromptMode},get inputValue(){return t().inputValue},get error(){return t().errorMessage},get hideArrow(){return t().hideArrow},get onShowContextMenu(){let n=t();if(!(!(n.status===`copied`||n.status===`fading`)||!cB(n.element)))return()=>e.onShowContextMenuInstance?.(n.id)},onHoverChange:n=>e.onLabelInstanceHoverChange?.(t().id,n)})}),X(sz,{get when(){return e.toolbarVisible!==!1},get children(){return X(QG,{get isActive(){return e.isActive},get isContextMenuOpen(){return e.contextMenuPosition!==null},get onToggle(){return e.onToggleActive},get onActivateAction(){return e.onActivateAction},get activeActionId(){return e.activeActionId},get enabled(){return e.enabled},get shakeCount(){return e.shakeCount},get onStateChange(){return e.onToolbarStateChange},get onSubscribeToStateChanges(){return e.onSubscribeToToolbarStateChanges},get onSelectHoverChange(){return e.onToolbarSelectHoverChange},get onContainerRef(){return e.onToolbarRef},get onToggleToolbarMenu(){return e.onToggleToolbarMenu}})}}),X(OK,{get position(){return e.contextMenuPosition??null},get selectionBounds(){return e.contextMenuBounds??null},get tagName(){return e.contextMenuTagName},get componentName(){return e.contextMenuComponentName},get hasFilePath(){return e.contextMenuHasFilePath??!1},get actions(){return e.actions},get actionContext(){return e.actionContext},get onDismiss(){return e.onContextMenuDismiss??(()=>{})},get onHide(){return e.onContextMenuHide??(()=>{})}}),X(SJ,{get position(){return e.toolbarMenuPosition??null},get actions(){return e.toolbarMenuActions??[]},get defaultActionId(){return e.defaultActionId??`copy`},get onSetDefaultAction(){return e.onSetDefaultAction??(()=>{})},get onDismiss(){return e.onToolbarMenuDismiss??(()=>{})}}),X(EJ,{get position(){return e.hierarchyMenuPosition??null},get state(){return e.hierarchyState}}),X(vJ,{get state(){return e.editPanelState??null},get position(){return e.editPanelPosition??null},get onDismiss(){return e.onEditPanelDismiss??(()=>{})},get onSubmit(){return e.onEditPanelSubmit??(()=>{})},get onPendingEditsChange(){return e.onEditPanelPendingEditsChange},get onInteractingChange(){return e.onEditPanelInteractingChange}})]}));function kJ(e){let t=e[Fz];if(!t&&(Object.defineProperty(e,Fz,{value:t=new Proxy(e,JJ)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){let a=n[i];r[a].get&&Object.defineProperty(e,a,{enumerable:r[a].enumerable,get:r[a].get.bind(t)})}}return t}function AJ(e){let t;return typeof e==`object`&&!!e&&(e[Fz]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function jJ(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[WJ])return n;if(!AJ(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=jJ(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=jJ(i,t))!==i&&(e[a]=r))}return e}function MJ(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function NJ(e,t,n){if(e[t])return e[t];let[r,i]=J(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function PJ(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Fz||t===GJ?n:(delete n.value,delete n.writable,n.get=()=>e[Fz][t],n)}function FJ(e){OR()&&NJ(MJ(e,GJ),qJ)()}function IJ(e){return FJ(e),Reflect.ownKeys(e)}function LJ(e,t,n,r=!1){if(!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[KJ]&&e[KJ][t]&&i!==void 0&&e[KJ][t].$()):(e[t]=n,e[KJ]&&e[KJ][t]&&i===void 0&&e[KJ][t].$());let o=MJ(e,GJ),s;if((s=NJ(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=NJ(o,`length`,a))&&s.$(e.length)}(s=o[qJ])&&s.$()}function RJ(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];LJ(e,i,t[i])}}function zJ(e,t){if(typeof t==`function`&&(t=t(e)),t=jJ(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&LJ(e,n,r)}LJ(e,`length`,r)}else RJ(e,t)}function BJ(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(Array.isArray(r)){for(let i=0;i<r.length;i++)BJ(e,[r[i]].concat(t),n);return}else if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&BJ(e,[i].concat(t),n);return}else if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)BJ(e,[r].concat(t),n);return}else if(t.length>1){BJ(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=jJ(a),r===void 0||AJ(i)&&AJ(a)&&!Array.isArray(a)?RJ(i,a):LJ(e,r,a))}function VJ(...[e,t]){let n=jJ(e||{}),r=Array.isArray(n),i=kJ(n);function a(...e){CR(()=>{r&&e.length===1?zJ(n,e[0]):BJ(n,e)})}return[i,a]}function HJ(e){return t=>{if(AJ(t)){let n;(n=YJ.get(t))||YJ.set(t,n=new Proxy(t,XJ)),e(n)}return t}}var UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY,UY,WY,GY,KY,qY,JY,YY,XY,ZY,QY,$Y,eX,tX,nX,rX,iX,aX,oX,sX,cX,lX,uX,dX,fX,pX,mX,hX,gX,_X,vX,yX,bX,xX,SX,CX,wX,TX,EX,DX,OX,kX,AX,jX,MX,NX,PX,FX,IX,LX,RX,zX,BX,VX,HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ=t((()=>{qV(),mR(),aW(),UJ=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
259
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:"Geist", ui-sans-serif, system-ui, sans-serif;--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--spacing:4px;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--radius-sm:4px;--ease-out:cubic-bezier(0, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--ease-drawer:cubic-bezier(.32, .72, 0, 1);--ease-spring:cubic-bezier(.34, 1.56, .64, 1)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.a11y-hitbox{position:relative}.a11y-hitbox:before{content:"";pointer-events:auto;width:100%;min-width:24px;height:100%;min-height:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1\\/2{top:50%}.top-\\[2px\\]{top:2px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-full{right:100%}.bottom-\\[2px\\]{bottom:2px}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-full{left:100%}.z-1{z-index:1}.z-10{z-index:10}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.-m-0\\.5{margin:calc(var(--spacing) * -.5)}.-m-4{margin:calc(var(--spacing) * -4)}.m-0{margin:calc(var(--spacing) * 0)}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-my-1\\.5{margin-block:calc(var(--spacing) * -1.5)}.-mt-\\[8px\\]{margin-top:-8px}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-1\\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2\\.5{margin-right:calc(var(--spacing) * 2.5)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2\\.5{margin-left:calc(var(--spacing) * 2.5)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.ml-px{margin-left:1px}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{width:0;height:0;display:none}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.list-item{display:list-item}.size-0{width:calc(var(--spacing) * 0);height:calc(var(--spacing) * 0)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-\\[12px\\]{width:12px;height:12px}.size-\\[16px\\]{width:16px;height:16px}.h-\\[8px\\]{height:8px}.h-\\[17px\\]{height:17px}.h-\\[20px\\]{height:20px}.h-\\[24px\\]{height:24px}.h-fit{height:fit-content}.max-h-\\[var\\(--rg-edit-list-max-h\\)\\]{max-height:var(--rg-edit-list-max-h)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[28px\\]{min-height:28px}.w-\\[2px\\]{width:2px}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\\[36px\\]{min-width:36px}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.-rotate-90{rotate:-90deg}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.96)}.press-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}.press-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.97)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.grid-rows-\\[0fr\\]{grid-template-rows:0fr}.grid-rows-\\[1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:4px}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[6px\\]{border-radius:6px}.rounded-\\[13px\\]{border-radius:13px}.rounded-\\[14px\\]{border-radius:14px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l{border-top-left-radius:4px;border-bottom-left-radius:4px}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tl{border-top-left-radius:4px}.rounded-r{border-top-right-radius:4px;border-bottom-right-radius:4px}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-tr{border-top-right-radius:4px}.rounded-b{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-br{border-bottom-right-radius:4px}.rounded-bl{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[var\\(--rg-border-button\\)\\]{border-color:var(--rg-border-button)}.border-t-\\[var\\(--rg-border-subtle\\)\\]{border-top-color:var(--rg-border-subtle)}.bg-\\[\\#f00\\]{background-color:red}.bg-\\[var\\(--rg-error-bg\\)\\]{background-color:var(--rg-error-bg)}.bg-\\[var\\(--rg-panel-bg\\)\\]{background-color:var(--rg-panel-bg)}.bg-\\[var\\(--rg-submit-bg\\)\\]{background-color:var(--rg-submit-bg)}.bg-\\[var\\(--rg-surface-active\\)\\]{background-color:var(--rg-surface-active)}.bg-\\[var\\(--rg-surface-hover\\)\\]{background-color:var(--rg-surface-hover)}.bg-\\[var\\(--rg-text-primary\\)\\]{background-color:var(--rg-text-primary)}.bg-\\[var\\(--rg-text-secondary\\)\\]{background-color:var(--rg-text-secondary)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.25{padding-inline:calc(var(--spacing) * .25)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-0\\.25{padding-block:calc(var(--spacing) * .25)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-px{padding-block:1px}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.text-center{text-align:center}.text-justify{text-align:justify}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-3\\.5{--tw-leading:calc(var(--spacing) * 3.5);line-height:calc(var(--spacing) * 3.5)}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-extralight{--tw-font-weight:var(--font-weight-extralight);font-weight:var(--font-weight-extralight)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.font-thin{--tw-font-weight:var(--font-weight-thin);font-weight:var(--font-weight-thin)}.break-normal{overflow-wrap:normal;word-break:normal}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.break-keep{word-break:keep-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-break-spaces{white-space:break-spaces}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--rg-error-text\\)\\]{color:var(--rg-error-text)}.text-\\[var\\(--rg-submit-fg\\)\\]{color:var(--rg-submit-fg)}.text-\\[var\\(--rg-text-primary\\)\\]{color:var(--rg-text-primary)}.text-\\[var\\(--rg-text-primary-85\\)\\]{color:var(--rg-text-primary-85)}.text-\\[var\\(--rg-text-secondary\\)\\]{color:var(--rg-text-secondary)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[box-shadow\\:var\\(--rg-shadow\\)\\]{box-shadow:var(--rg-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\\[filter\\:var\\(--rg-drop-shadow\\)\\]{filter:var(--rg-drop-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-columns\\]{transition-property:grid-template-columns;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[padding\\,border-radius\\,transform\\]{transition-property:padding,border-radius,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[top\\,left\\,width\\,height\\,opacity\\,border-radius\\]{transition-property:top,left,width,height,opacity,border-radius;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,color\\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.delay-\\[80ms\\]{transition-delay:80ms}.duration-60{--tw-duration:60ms;transition-duration:60ms}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-140{--tw-duration:.14s;transition-duration:.14s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-180{--tw-duration:.18s;transition-duration:.18s}.duration-220{--tw-duration:.22s;transition-duration:.22s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.ease-\\[cubic-bezier\\(0\\,0\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-drawer{--tw-ease:var(--ease-drawer);transition-timing-function:var(--ease-drawer)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.ease-spring{--tw-ease:var(--ease-spring);transition-timing-function:var(--ease-spring)}.will-change-\\[opacity\\,transform\\]{will-change:opacity,transform}.will-change-transform{will-change:transform}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.group-hover\\:text-\\[var\\(--rg-text-primary\\)\\]:is(:where(.group):hover *){color:var(--rg-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:bg-\\[var\\(--rg-error-bg-hover\\)\\]:hover{background-color:var(--rg-error-bg-hover)}.hover\\:bg-\\[var\\(--rg-surface-active\\)\\]:hover{background-color:var(--rg-surface-active)}.hover\\:bg-\\[var\\(--rg-surface-hover\\)\\]:hover{background-color:var(--rg-surface-hover)}.hover\\:text-\\[var\\(--rg-text-primary\\)\\]:hover{color:var(--rg-text-primary)}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}}:host{all:initial;direction:ltr}:host,[data-rg-theme=dark]{--rg-panel-bg:#161616;--rg-text-primary:#fff;--rg-text-secondary:#a7a7a7;--rg-surface-hover:#ffffff1a;--rg-surface-active:#ffffff26;--rg-border-subtle:#ffffff1a;--rg-border-button:#fff3;--rg-submit-bg:#fff;--rg-submit-fg:#161616;--rg-error-text:#f87171;--rg-error-bg:#3d1515;--rg-error-bg-hover:#4d1f1f;--rg-shadow:0 2px 8px #00000014;--rg-drop-shadow:drop-shadow(0px 2px 8px #00000014);--rg-shimmer-from:#a1a1aa;--rg-shimmer-to:#d4d4d8;--rg-text-primary-85:#ffffffd9}@media (prefers-color-scheme:dark){:host:not([data-rg-theme]){--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}}:host([data-rg-theme=light]),[data-rg-theme=light]{--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}@keyframes rg-slot-enter-up{0%{filter:blur(2px);opacity:0;transform:translateY(.5em)scale(.5)}to{filter:blur();opacity:1;transform:translateY(0)scale(1)}}@keyframes rg-slot-exit-up{0%{filter:blur();opacity:1;transform:translateY(0)scale(1)}to{filter:blur(2px);opacity:0;transform:translateY(-.5em)scale(.5)}}@keyframes rg-slot-enter-down{0%{filter:blur(2px);opacity:0;transform:translateY(-.5em)scale(.5)}to{filter:blur();opacity:1;transform:translateY(0)scale(1)}}@keyframes rg-slot-exit-down{0%{filter:blur();opacity:1;transform:translateY(0)scale(1)}to{filter:blur(2px);opacity:0;transform:translateY(.5em)scale(.5)}}@keyframes rg-slot-enter-fade{0%{filter:blur(2px);opacity:0;transform:scale(.5)}to{filter:blur();opacity:1;transform:scale(1)}}@keyframes rg-slot-exit-fade{0%{filter:blur();opacity:1;transform:scale(1)}to{filter:blur(2px);opacity:0;transform:scale(.5)}}.rg-slot-column{vertical-align:top;display:inline-block;position:relative}.rg-slot-sizer{visibility:hidden;white-space:pre;display:inline-block}.rg-slot-cell{white-space:pre;will-change:transform, filter, opacity;animation-duration:var(--rg-slot-dur,.35s);animation-timing-function:var(--rg-slot-ease,cubic-bezier(.34, 1.56, .64, 1));animation-fill-mode:both;display:inline-block;position:absolute;top:0;left:0}.rg-slot-cell.rg-slot-enter[data-dir="1"]{animation-name:rg-slot-enter-up}.rg-slot-cell.rg-slot-enter[data-dir="-1"]{animation-name:rg-slot-enter-down}.rg-slot-cell.rg-slot-enter[data-dir="0"]{animation-name:rg-slot-enter-fade}.rg-slot-cell.rg-slot-exit[data-dir="1"]{animation-name:rg-slot-exit-up}.rg-slot-cell.rg-slot-exit[data-dir="-1"]{animation-name:rg-slot-exit-down}.rg-slot-cell.rg-slot-exit[data-dir="0"]{animation-name:rg-slot-exit-fade}@media (prefers-reduced-motion:reduce){:host,:host *,:host :before,:host :after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}:host :focus,:host :focus-visible{box-shadow:none!important;outline:none!important}@keyframes shake{0%,to{translate:0}15%,45%{translate:calc(-3px * var(--rg-shake-x,1)) calc(-3px * var(--rg-shake-y,0))}30%,60%{translate:calc(3px * var(--rg-shake-x,1)) calc(3px * var(--rg-shake-y,0))}75%{translate:calc(-2px * var(--rg-shake-x,1)) calc(-2px * var(--rg-shake-y,0))}90%{translate:calc(2px * var(--rg-shake-x,1)) calc(2px * var(--rg-shake-y,0))}}@keyframes icon-loader-spin{0%{opacity:1}50%{opacity:.5}to{opacity:.2}}.icon-loader-bar{animation:.5s linear infinite icon-loader-spin}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-text{background:linear-gradient(90deg, var(--rg-shimmer-from) 0%, var(--rg-shimmer-to) 25%, var(--rg-shimmer-from) 50%, var(--rg-shimmer-to) 75%, var(--rg-shimmer-from) 100%);color:#0000;background-size:200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake,.animate-shake-vertical{will-change:translate;animation:.3s ease-out shake}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.animate-tooltip-fade-in{will-change:transform, opacity;animation:.1s ease-out tooltip-fade-in}.animate-shake-vertical{--rg-shake-x:0;--rg-shake-y:1}@supports (-webkit-touch-callout:none){textarea[data-react-grab-input]{font-size:16px}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}`,WJ=Symbol(`store-raw`),GJ=Symbol(`store-node`),KJ=Symbol(`store-has`),qJ=Symbol(`store-self`),JJ={get(e,t,n){if(t===WJ)return e;if(t===Fz)return n;if(t===Lz)return FJ(e),n;let r=MJ(e,GJ),i=r[t],a=i?i():e[t];if(t===GJ||t===KJ||t===`__proto__`)return a;if(!i){let n=Object.getOwnPropertyDescriptor(e,t);OR()&&(typeof a!=`function`||e.hasOwnProperty(t))&&!(n&&n.get)&&(a=NJ(r,t,a)())}return AJ(a)?kJ(a):a},has(e,t){return t===WJ||t===Fz||t===Lz||t===GJ||t===KJ||t===`__proto__`?!0:(OR()&&NJ(MJ(e,KJ),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:IJ,getOwnPropertyDescriptor:PJ},YJ=new WeakMap,XJ={get(e,t){if(t===WJ)return e;let n=e[t],r;return AJ(n)?YJ.get(n)||(YJ.set(n,r=new Proxy(n,XJ)),r):n},set(e,t,n){return LJ(e,t,jJ(n)),!0},deleteProperty(e,t){return LJ(e,t,void 0,!0),!0}},ZJ=new WeakMap,QJ=new WeakMap,$J=()=>{ZJ=new WeakMap,QJ=new WeakMap},eY=(e,t,n)=>{let r=QJ.get(e);if(r&&n-r.timestamp<200)return r.borderRadius;let i=(t??window.getComputedStyle(e)).borderRadius||`0px`;return QJ.set(e,{borderRadius:i,timestamp:n}),i},tY=e=>{let t=performance.now(),n=ZJ.get(e);if(n&&t-n.timestamp<16)return n.bounds;let r=e.getBoundingClientRect(),i={borderRadius:eY(e,null,t),height:r.height,width:r.width,x:r.left,y:r.top};return ZJ.set(e,{bounds:i,timestamp:t}),i},nY=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),rY=e=>({selectionInteractionLockDepth:0,wasActivatedByToggle:!1,pendingCommentMode:!1,keyHoldDuration:e.keyHoldDuration,dragStart:{x:WM,y:WM},copyStart:{x:WM,y:WM},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],frozenDragRect:null,lastGrabbedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:``,grabbedBoxes:[],labelInstances:[],isTouchMode:!1,activationTimestamp:null,previouslyFocusedElement:null,contextMenuPosition:null,contextMenuElement:null,contextMenuClickOffset:null}),iY=e=>{let[t,n]=VJ(rY(e)),[r,i]=J({x:WM,y:WM}),[a,o]=J(0),[s,c]=J({state:`idle`}),l=e=>{n(HJ(t=>{e(t),t.frozenElement=t.frozenElements.length>0?t.frozenElements[0]:null,t.frozenDragRect=null}))},u=()=>{l(e=>{e.frozenElements=[]})},d=e=>{c(t=>t.state===`active`?{...t,phase:e}:t)},f={startHold:e=>{e!==void 0&&n(`keyHoldDuration`,e),c({state:`holding`,startedAt:Date.now()})},releaseHold:()=>{s().state===`holding`&&c({state:`idle`})},activate:()=>{CR(()=>{c({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1}),n(`activationTimestamp`,Date.now()),n(`previouslyFocusedElement`,document.activeElement)})},deactivate:()=>{CR(()=>{c({state:`idle`}),n(HJ(e=>{e.wasActivatedByToggle=!1,e.pendingCommentMode=!1,e.inputText=``,e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null,e.activationTimestamp=null,e.previouslyFocusedElement=null,e.contextMenuPosition=null,e.contextMenuElement=null,e.contextMenuClickOffset=null,e.isTouchMode&&(e.detectedElement=null)}))})},toggle:()=>{t.activationTimestamp===null?(n(`wasActivatedByToggle`,!0),f.activate()):f.deactivate()},freeze:()=>{if(s().state===`active`){let e=t.frozenElement??t.detectedElement;e&&n(`frozenElement`,e),d(`frozen`)}},unfreeze:()=>{s().state===`active`&&CR(()=>{n(HJ(e=>{e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null})),d(`hovering`)})},startDrag:(e,t)=>{s().state===`active`&&CR(()=>{t||u(),n(`dragStart`,{x:e.x+window.scrollX,y:e.y+window.scrollY}),d(`dragging-select`)})},startDragReposition:()=>{let e=s();e.state===`active`&&e.phase===`dragging-select`&&d(`dragging-reposition`)},stopDragReposition:()=>{let e=s();e.state===`active`&&e.phase===`dragging-reposition`&&d(`dragging-select`)},shiftDragStart:e=>{let t=s();t.state===`active`&&t.phase===`dragging-reposition`&&n(`dragStart`,t=>({x:t.x+e.x,y:t.y+e.y}))},endDrag:()=>{let e=s();e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)&&CR(()=>{n(`dragStart`,{x:-1e3,y:-1e3}),d(`justDragged`)})},cancelDrag:()=>{let e=s();e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)&&CR(()=>{n(`dragStart`,{x:-1e3,y:-1e3}),d(`hovering`)})},finishJustDragged:()=>{let e=s();e.state===`active`&&e.phase===`justDragged`&&d(`hovering`)},startCopy:()=>{let e=s().state===`active`;c({state:`copying`,startedAt:Date.now(),wasActive:e})},completeCopy:()=>{let e=s(),t=e.state===`copying`&&e.wasActive;c({state:`justCopied`,copiedAt:Date.now(),wasActive:t})},finishJustCopied:()=>{let e=s();e.state===`justCopied`&&(e.wasActive&&!t.wasActivatedByToggle?CR(()=>{u(),c({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1})}):f.deactivate())},enterPromptMode:(e,t)=>{let{x:r}=nY(tY(t));CR(()=>{n(`copyStart`,e),n(`copyOffsetFromCenterX`,e.x-r),i(e),n(`frozenElement`,t),n(`wasActivatedByToggle`,!0),s().state===`active`?c(e=>e.state===`active`?{...e,isPromptMode:!0,phase:`frozen`}:e):(c({state:`active`,phase:`frozen`,isPromptMode:!0,isPendingDismiss:!1}),n(`activationTimestamp`,Date.now()),n(`previouslyFocusedElement`,document.activeElement))})},exitPromptMode:()=>{c(e=>e.state===`active`?{...e,isPromptMode:!1,isPendingDismiss:!1}:e)},setInputText:e=>{n(`inputText`,e)},clearInputText:()=>{n(`inputText`,``)},setPendingDismiss:e=>{c(t=>t.state===`active`?{...t,isPendingDismiss:e}:t)},setPointer:e=>{i(t=>t.x===e.x&&t.y===e.y?t:e)},setDetectedElement:e=>{n(`detectedElement`,e)},setFrozenElement:e=>{l(t=>{t.frozenElements=[e]})},setFrozenElements:e=>{l(t=>{t.frozenElements=e})},toggleFrozenElement:e=>{l(t=>{let n=t.frozenElements.indexOf(e);n>=0?t.frozenElements.splice(n,1):t.frozenElements.push(e)})},addFrozenElements:e=>{l(t=>{for(let n of e)t.frozenElements.includes(n)||t.frozenElements.push(n)})},setFrozenDragRect:e=>{n(`frozenDragRect`,e)},setCopyStart:(e,t)=>{let{x:r}=nY(tY(t));n(`copyStart`,e),n(`copyOffsetFromCenterX`,e.x-r)},setLastGrabbed:e=>{n(`lastGrabbedElement`,e)},setWasActivatedByToggle:e=>{n(`wasActivatedByToggle`,e)},setPendingCommentMode:e=>{n(`pendingCommentMode`,e)},setTouchMode:e=>{n(`isTouchMode`,e)},incrementSelectionInteractionLockDepth:()=>{n(`selectionInteractionLockDepth`,e=>e+1)},decrementSelectionInteractionLockDepth:()=>{n(`selectionInteractionLockDepth`,e=>Math.max(0,e-1))},setSelectionSource:(e,t)=>{CR(()=>{n(`selectionFilePath`,e),n(`selectionLineNumber`,t)})},incrementViewportVersion:()=>{o(e=>e+1)},addGrabbedBox:e=>{n(`grabbedBoxes`,t=>[...t,e])},removeGrabbedBox:e=>{n(`grabbedBoxes`,t=>t.filter(t=>t.id!==e))},clearGrabbedBoxes:()=>{n(`grabbedBoxes`,[])},addLabelInstance:e=>{n(`labelInstances`,t=>[...t,e])},updateLabelInstance:(e,r,i)=>{let a=t.labelInstances.findIndex(t=>t.id===e);a!==-1&&CR(()=>{n(`labelInstances`,a,`status`,r),i!==void 0&&n(`labelInstances`,a,`errorMessage`,i)})},removeLabelInstance:e=>{n(`labelInstances`,t=>t.filter(t=>t.id!==e))},clearLabelInstances:()=>{n(`labelInstances`,[])},showContextMenu:(e,t)=>{let{x:r,y:i}=nY(tY(t));CR(()=>{n(`contextMenuPosition`,e),n(`contextMenuElement`,t),n(`contextMenuClickOffset`,{x:e.x-r,y:e.y-i})})},hideContextMenu:()=>{CR(()=>{n(`contextMenuPosition`,null),n(`contextMenuElement`,null),n(`contextMenuClickOffset`,null)})},updateContextMenuPosition:()=>{let e=t.contextMenuElement,r=t.contextMenuClickOffset;if(!e||!r||!cB(e))return;let{x:i,y:a}=nY(tY(e));n(`contextMenuPosition`,{x:i+r.x,y:a+r.y})}};return{store:t,actions:f,pointer:r,viewportVersion:a,current:s}},aY=e=>{if(!document.body)return;let t=document.querySelectorAll(`[${VM}]`);for(let n of t)n!==e&&n.parentNode!==e&&(n.shadowRoot||n.remove());document.body.appendChild(e)},oY=e=>{if(document.body){aY(e);return}let t=()=>{document.removeEventListener(`DOMContentLoaded`,t),aY(e)};document.addEventListener(`DOMContentLoaded`,t,{once:!0})},sY=e=>{let t=document.querySelectorAll(`[${VM}]`);for(let e of t){let t=e.shadowRoot?.querySelector(`[${VM}]`);if(t instanceof HTMLDivElement)return{root:t,host:e};e.remove()}let n=document.createElement(`div`);n.setAttribute(VM,`true`),UN(n),n.style.zIndex=String(ZM),n.style.position=`fixed`,n.style.inset=`0`,n.style.pointerEvents=`none`,n.style.contain=`strict`;let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`),a=VN();a&&(i.nonce=a),i.textContent=`@import url("https://fonts.googleapis.com/css2?family=Geist:wght@500&display=swap");\n${e??``}`,r.appendChild(i);let o=document.createElement(`div`);return o.setAttribute(VM,`true`),r.appendChild(o),oY(n),setTimeout(()=>{aY(n)},CN),{root:o,host:n}},cY=e=>{let[t,n]=J(void 0),r=0;return bR(TR(e,e=>{let t=++r;if(!e){n(void 0);return}let i=HU(e)??void 0;n(i),PU(e).then(e=>{r===t&&n(e??i)}).catch(()=>{r===t&&n(i)})})),[t,n]},lY=[`data-theme`,`data-mode`,`data-color-scheme`,`data-bs-theme`,`data-mui-color-scheme`,`data-mantine-color-scheme`],uY=[{attribute:`data-dark`,theme:`dark`},{attribute:`data-light`,theme:`light`}],dY=(e,t,n)=>{let[r,i,a]=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a},fY=(e,t=0)=>{let n=MB(e),r=n?_B(n):null;return!r||r.alpha<=t?null:dY(r.red,r.green,r.blue)},pY=e=>{let t=fY(e);return t===null?null:t<.18?`dark`:`light`},mY=e=>pY(getComputedStyle(e).backgroundColor),hY=()=>{let e=fY(getComputedStyle(document.documentElement).color,hN);return e===null?null:e>.6?`dark`:null},gY=()=>{let e=document.createElement(`div`);e.style.cssText=`position:fixed;width:0;height:0;background-color:Canvas!important`,document.documentElement.appendChild(e);let t=pY(getComputedStyle(e).backgroundColor);return e.remove(),t},_Y=e=>{let t=e.toLowerCase();return t===`dark`?`dark`:t===`light`?`light`:null},vY=e=>{let t=e.style.colorScheme||getComputedStyle(e).colorScheme;return t?t.trim().toLowerCase().split(/\s+/):[]},yY=e=>{let t=vY(e),n=t.includes(`dark`);return n===t.includes(`light`)?null:n?`dark`:`light`},bY=e=>{if(e.classList.contains(`dark`))return`dark`;if(e.classList.contains(`light`))return`light`;for(let t of lY){let n=e.getAttribute(t);if(!n)continue;let r=_Y(n);if(r)return r}for(let{attribute:t,theme:n}of uY)if(e.hasAttribute(t))return n;return null},xY=(e,t)=>{for(let n of e){if(!n)continue;let e=t(n);if(e)return e}return null},SY=()=>{let e=[document.documentElement,document.body],t=[document.body,document.documentElement];return xY(e,bY)??xY(e,yY)??xY(t,mY)??hY()??gY()??`light`},CY=e=>e===`dark`?`light`:`dark`,wY=()=>{let e=[];for(let t of[document.documentElement,document.body]){if(!t)continue;e.push(t.className);for(let n of lY)e.push(t.getAttribute(n)??``);for(let{attribute:n}of uY)e.push(t.hasAttribute(n)?`1`:``);let n=t.style;e.push(n.colorScheme,n.backgroundColor,n.color);for(let t=0;t<n.length;t++){let r=n[t];r.startsWith(`--`)&&e.push(`${r}:${n.getPropertyValue(r)}`)}}return e.join(`|`)},TY={attributes:!0,attributeFilter:[`class`,`style`,...lY,...uY.map(({attribute:e})=>e)]},EY=(e,t)=>{let n=null,r=null,i=null,a=()=>{let i=wY();if(i===r&&n!==null)return getComputedStyle(document.body??document.documentElement).backgroundColor,n;r=i;let a=CY(SY());return a!==n&&(n=a,e.setAttribute(`data-rg-theme`,a),t?.(a)),a},o=()=>{i===null&&(i=rI(()=>{i=null,a()}))},s=a(),c=new MutationObserver(o);c.observe(document.documentElement,TY);let l=null;document.body?c.observe(document.body,TY):(l=new MutationObserver(()=>{document.body&&(l.disconnect(),l=null,c.observe(document.body,TY),a())}),l.observe(document.documentElement,{childList:!0}));let u=()=>{r=null,o()},d=window.matchMedia(`(prefers-color-scheme: dark)`);return d.addEventListener(`change`,u),{theme:s,cleanup:()=>{l?.disconnect(),c.disconnect(),d.removeEventListener(`change`,u),i!==null&&iI(i)}}},DY=()=>{},OY=()=>({activate:DY,deactivate:DY,toggle:DY,comment:DY,isActive:()=>!1,isEnabled:()=>!1,setEnabled:DY,getToolbarState:()=>null,setToolbarState:DY,onToolbarStateChange:()=>DY,reset:DY,dispose:DY,copyElement:()=>Promise.resolve(!1),getSource:()=>Promise.resolve(null),getStackContext:()=>Promise.resolve(``),getState:()=>({isActive:!1,isDragging:!1,isCopying:!1,isPromptMode:!1,isSelectionBoxVisible:!1,isDragBoxVisible:!1,targetElement:null,dragBounds:null,grabbedBoxes:[],labelInstances:[],selectionFilePath:null,toolbarState:null}),setOptions:DY,registerPlugin:DY,unregisterPlugin:DY,getPlugins:()=>[],getDisplayName:()=>null}),kY=()=>{let e=new AbortController;return{signal:e.signal,abort:()=>e.abort(),addWindowListener:(t,n,r={})=>{window.addEventListener(t,n,{...r,signal:e.signal})},addDocumentListener:(t,n,r={})=>{document.addEventListener(t,n,{...r,signal:e.signal})}}},AY=(e,t=`Unknown error`)=>e instanceof Error&&e.message?e.message:t,jY=e=>e instanceof Error?e:Error(String(e)),MY=e=>({functionName:e.functionName,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,isServer:e.isServer,isSymbolicated:e.isSymbolicated}),NY=async(e,t)=>{let n={maxLines:t},[r,i,a,o]=await Promise.all([tW(e,n),$U(e,n),VU(e),NU(e)]);return{tagName:zN(e),componentName:a?.componentName??void 0,content:`[${r}]`,source:a,stackContext:i,frames:(o??[]).map(MY)}},PY=async(e,t)=>{let n=await Promise.all(e.map(e=>NY(e,t))),r=new Map;for(let e of n)r.has(e.content)||r.set(e.content,e);let i=[...r.values()];return i.length>0?{content:i.map(e=>e.content).join(`
260
- `),entries:i}:null},FY=(e,t,n)=>{if(e?.entries)return t===e.content?e.entries:e.entries.length===1?[{...e.entries[0],content:t,commentText:n}]:e.entries.map(e=>({...e,commentText:n}))},IY=async(e,t,n,r)=>{await t.onBeforeCopy(n);let i=!1,a=``;try{let o=e.getContent?{content:await e.getContent(n)}:await PY(n,e.maxContextLines),s=o?.content;if(s?.trim()){let c=await t.transformCopyContent(s,n);a=r?`${r}\n${c}`:c,i=iW(a,{componentName:e.componentName,entries:FY(o,a,r)})}}catch(e){t.onCopyError(jY(e))}return i&&t.onCopySuccess(n,a),t.onAfterCopy(n,i),i},LY=(e,t)=>{let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return Math.max(0,i-n)*Math.max(0,a-r)},RY=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top,zY=e=>e.sort((e,t)=>{if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}),BY=e=>{if(e.width<=0||e.height<=0)return[];let t=window.innerWidth,n=window.innerHeight,r=e.x,i=e.y,a=e.x+e.width,o=e.y+e.height,s=r+e.width/2,c=i+e.height/2,l=NB(Math.ceil(e.width/32),3,20),u=NB(Math.ceil(e.height/32),3,20),d=l*u,f=d>100?Math.sqrt(100/d):1,p=NB(Math.floor(l*f),3,20),m=NB(Math.floor(u*f),3,20),h=new Set,g=[],_=(e,r)=>{let i=NB(Math.round(e),0,t-1),a=NB(Math.round(r),0,n-1),o=`${i}:${a}`;h.has(o)||(h.add(o),g.push({x:i,y:a}))};_(r+1,i+1),_(a-1,i+1),_(r+1,o-1),_(a-1,o-1),_(s,i+1),_(s,o-1),_(r+1,c),_(a-1,c),_(s,c);for(let t=0;t<p;t+=1){let n=r+(t+.5)/p*e.width;for(let t=0;t<m;t+=1)_(n,i+(t+.5)/m*e.height)}return g},VY=(e,t,n)=>{let r={left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height},i=new Set,a=BY(e);wI();try{for(let e of a){let t=document.elementsFromPoint(e.x,e.y);for(let e of t)i.add(e)}}finally{TI()}let o=[];for(let e of i)!n&&sI(e)||zM(e)&&t(e)&&o.push(e);let s=new Map;for(let e of o)s.set(e,e.getBoundingClientRect());let c=[];for(let e of o){let t=s.get(e);if(t.width<=0||t.height<=0)continue;let i={left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height};if(n){let n=LY(r,i),a=t.width*t.height;a>0&&n/a>=.75&&c.push(e)}else RY(i,r)&&c.push(e)}return zY(c)},HY=e=>{let t=new Set(e);return e.filter(e=>{for(let n=e.parentElement;n;n=n.parentElement)if(t.has(n))return!1;return!0})},UY=(e,t,n=!0)=>HY(VY(e,t,n)),WY=(e,t)=>e.width<=0?0:NB((t.x-e.x)/e.width,0,1),GY=()=>{$J(),FI(),gI()},KY=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.pageX-window.scrollX,y:e.pageY-window.scrollY}),qY=e=>({pageX:e.x+window.scrollX,pageY:e.y+window.scrollY,width:e.width,height:e.height}),JY=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.x,y:e.y}),YY=(e,t,n)=>{let r=(e,t,n,r)=>{let i=[],a=e,o=0;for(;a&&i.length<n&&o<100;)r(a)&&i.push(a),a=t(a),o+=1;return i},i=r(e.parentElement,e=>e.parentElement,6,t);i.reverse();let a=i.map((e,t)=>({element:e,depth:t,isLast:!0})),o=i.length,s=r(e.previousElementSibling,e=>e.previousElementSibling,7,n),c=r(e.nextElementSibling,e=>e.nextElementSibling,7,n),l=Math.min(s.length,Math.max(3,7-c.length)),u=Math.min(c.length,7-l),d=[...s.slice(0,l).reverse(),e,...c.slice(0,u)],f=r(e.firstElementChild,e=>e.nextElementSibling,6,t),p=d.length-1,m=f.length-1;return d.forEach((t,n)=>{a.push({element:t,depth:o,isLast:n===p}),t===e&&f.forEach((e,t)=>{a.push({element:e,depth:o+1,isLast:t===m})})}),a},XY=e=>e instanceof SVGElement&&!(e instanceof SVGSVGElement),ZY=e=>{let t=e.getBoundingClientRect();return t.width>=16||t.height>=16},QY=(e,t)=>t(e)&&!XY(e)&&ZY(e),$Y=new Set([`c`,`C`,`с`,`С`,`ȼ`,`Ȼ`,`ↄ`,`Ↄ`,`ᴄ`,`ᶜ`,`ⱼ`,`ⅽ`,`Ⅽ`,`ç`,`Ç`,`ć`,`Ć`,`č`,`Č`,`ĉ`,`Ĉ`,`ċ`,`Ċ`]),eX=(e,t)=>t===`KeyC`?!0:!e||e.length!==1?!1:$Y.has(e),tX=(e,t)=>{if(!e||!t)return!1;let n=e.toLowerCase();return t===`Space`?n===`space`||n===` `:t.startsWith(`Key`)?t.slice(3).toLowerCase()===n:t.startsWith(`Digit`)?t.slice(5)===n:!1},nX={meta:`metaKey`,cmd:`metaKey`,command:`metaKey`,win:`metaKey`,windows:`metaKey`,ctrl:`ctrlKey`,control:`ctrlKey`,shift:`shiftKey`,alt:`altKey`,option:`altKey`,opt:`altKey`},rX=e=>{let t=e.split(`+`).map(e=>e.trim().toLowerCase()),n={metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1,key:null};for(let e of t){let t=nX[e];t?n[t]=!0:n.key=e}return n},iX=e=>{if(typeof e==`function`)return e;let t=rX(e),n=t.key;return e=>{if(n===null){let n=!t.metaKey||e.metaKey||e.key===`Meta`,r=!t.ctrlKey||e.ctrlKey||e.key===`Control`,i=!t.shiftKey||e.shiftKey||e.key===`Shift`,a=!t.altKey||e.altKey||e.key===`Alt`,o=n&&r&&i&&a,s=[t.metaKey,t.ctrlKey,t.shiftKey,t.altKey].filter(Boolean).length,c=[e.metaKey||e.key===`Meta`,e.ctrlKey||e.key===`Control`,e.shiftKey||e.key===`Shift`,e.altKey||e.key===`Alt`].filter(Boolean).length;return o&&c>=s}let r=e.key?.toLowerCase()===n||tX(n,e.code),i=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?(!t.metaKey||e.metaKey)&&(!t.ctrlKey||e.ctrlKey)&&(!t.shiftKey||e.shiftKey)&&(!t.altKey||e.altKey):!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;return r&&i}},aX=e=>!e||typeof e==`function`?{metaKey:IB(),ctrlKey:!IB(),shiftKey:!1,altKey:!1,key:null}:rX(e),oX=(e,t)=>{if(t.activationKey)return iX(t.activationKey)(e);let n=(IB()?e.metaKey:e.ctrlKey)&&!e.shiftKey&&!e.altKey;return!!(e.key&&n&&eX(e.key,e.code))},sX=e=>{if(e.length===0)return{x:0,y:0,width:0,height:0};if(e.length===1)return e[0];let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),i=Math.max(i,a.y+a.height);return{x:t,y:n,width:r-t,height:i-n}},cX=e=>{let t=getComputedStyle(e),n={};for(let e of RB)n[e]=t.getPropertyValue(e);return n},lX=e=>{let t={};for(let n of iV)t[n]=e.getPropertyValue(n);return t},uX=e=>{try{let t=e.parentElement;if(!t)return null;let n=e.namespaceURI,r=e.tagName.toLowerCase(),i=n&&n!==`http://www.w3.org/1999/xhtml`?e.ownerDocument.createElementNS(n,r):e.ownerDocument.createElement(r),a=`style`in i?i.style:null;a instanceof CSSStyleDeclaration&&a.setProperty(`display`,`none`,`important`),t.appendChild(i);try{return lX(getComputedStyle(i))}finally{i.remove()}}catch{return null}},dX=new Set([`display`,`width`,`height`]),fX=(e,t,n)=>e.kind===`color`?!1:e.cssProperties.some(e=>dX.has(e))?pX(e):e.cssProperties.every(e=>{let r=t[e],i=n[e];return r===void 0||i===void 0?!1:r===i}),pX=e=>{if(e.kind===`color`)return!1;if(e.kind===`enum`)return e.key===`font-weight`?e.original===`400`:e.options[0]?.value===e.original;let{key:t,original:n}=e;return t.startsWith(`padding`)||t.startsWith(`margin`)||t.includes(`gap`)||t===`border-width`||t.endsWith(`-radius`)||t===`border-radius`?n===0:t===`opacity`?n===100:t===`letter-spacing`||t===`z-index`?n===0:!XB.has(t)&&!!(t===`width`||t===`height`||t===`width,height`||t.startsWith(`max-`)||t.startsWith(`min-`)||t===`line-height`)},mX=e=>{let t=e.trim();if(!t||t===`auto`||t===`normal`||t===`none`)return null;let n=Number.parseFloat(t);return Number.isFinite(n)?t.endsWith(`%`)?{value:n,unit:`%`}:t.endsWith(`rem`)||t.endsWith(`em`)?{value:n*16,unit:`px`}:t.endsWith(`px`)?{value:n,unit:`px`}:{value:n,unit:``}:null},hX=(e,t)=>{let n=mX(e[t]);if(n)return n;if(t===`line-height`){let t=mX(e[`font-size`]);return t?{value:cV(t.value*LN),unit:t.unit||`px`}:null}return UB.has(t)?{value:0,unit:`px`}:null},gX=(e,t)=>{let n=hX(e,t[0]);if(!n)return null;for(let r=1;r<t.length;r++){let i=hX(e,t[r]);if(!i||i.unit!==n.unit||Math.abs(i.value-n.value)>=.5)return null}return n},_X=(e,t)=>e===`opacity`?{value:Math.round(t.value*100),unit:`%`}:WB.has(e)?{value:cV(t.value),unit:``}:{value:cV(t.value),unit:t.unit||`px`},vX=e=>e!==null,yX=(e,t)=>{let n=t.map(t=>{let n=t.longhands.length===1?hX(e,t.longhands[0]):gX(e,t.longhands);return n?{definition:t,value:n}:null}).filter(vX),r=new Map;for(let e of n)for(let t of e.definition.longhands){let n=r.get(t);(!n||e.definition.longhands.length>n.definition.longhands.length)&&r.set(t,e)}let i=new Set(r.values());return n.map(e=>({...e,isCanonical:i.has(e)}))},bX=(e,t,n)=>e===`opacity`?{min:0,max:100}:e===`z-index`?{min:VB,max:HB}:e===`letter-spacing`?{min:-10,max:20}:e===`font-size`?{min:8,max:96}:e===`line-height`?{min:0,max:120}:e.includes(`radius`)?{min:0,max:96}:e===`width`||e===`height`||e===`width,height`||e.startsWith(`min-`)||e.startsWith(`max-`)?{min:0,max:Math.max(512,Math.ceil(t*2))}:XB.has(e)?{min:BB,max:512}:n===`%`?{min:0,max:100}:{min:e.startsWith(`margin`)?zB:0,max:384},xX=(e,t,n)=>{let r=_X(e.key,t),i=r.unit===`px`&&Math.abs(r.value)>1e7,a=bX(e.key,i?0:r.value,r.unit),o=r.value<0?a.min:a.max,s=i?o:r.value;return{kind:`numeric`,key:e.key,label:e.label,cssProperties:e.longhands,min:a.min,max:a.max,value:s,original:s,unit:r.unit,tailwindAliases:IV(e.key),isPrioritized:!1,isDefault:!1,isCanonical:n}},SX=(e,t,n,r=!1)=>{let i=MB(n),a=i?_B(i):null,o=a!==null&&a.alpha!==0;if(!o&&!r)return null;let s=o&&i?i:DN;return{kind:`color`,key:e,label:t,cssProperties:[e],value:s,original:s,tailwindAliases:IV(e),isPrioritized:r,isDefault:!1,isCanonical:!0}},CX=(e,t,n)=>{let r=t.trim(),i=n??e.options;return!i||!i.some(e=>e.value===r)?null:{kind:`enum`,key:e.key,label:e.label,cssProperties:[e.key],value:r,original:r,options:i,tailwindAliases:IV(e.key),isPrioritized:!1,isDefault:!1,isCanonical:!0}},wX=new Map(`background-color.color.padding.padding-left,padding-right.padding-top,padding-bottom.padding-top.padding-right.padding-bottom.padding-left.margin.margin-left,margin-right.margin-top,margin-bottom.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-transform.text-align.text-decoration-line.white-space.word-break.overflow-wrap.font-variant-numeric.border-radius.border-top-left-radius,border-top-right-radius.border-bottom-left-radius,border-bottom-right-radius.border-top-left-radius,border-bottom-left-radius.border-top-right-radius,border-bottom-right-radius.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.width,height.width.height.max-width.max-height.min-width.min-height.opacity.gap.row-gap.column-gap.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.border-color.align-items.justify-content.top,right,bottom,left.left,right.top,bottom.top.right.bottom.left.z-index`.split(`.`).map((e,t)=>[e,t])),TX=e=>wX.get(e.key)??1/0,EX=e=>e.map((e,t)=>({property:e,index:t})).sort((e,t)=>{let n=TX(e.property)-TX(t.property);return n===0?e.index-t.index:n}).map(e=>e.property),DX=e=>{let t=cX(e),n=getComputedStyle(e),r=lX(n),i=uX(e),a=[],o=new Set,s=e=>{o.has(e.key)||(a.push(e),o.add(e.key))};for(let e of ZB)for(let n of yX(t,e))s(xX(n.definition,n.value,n.isCanonical));for(let e of QB){let n=hX(t,e.key);n&&s(xX({key:e.key,label:e.label,longhands:[e.key]},n,!0))}for(let{key:e,label:t,alwaysShow:r}of $B){let i=n.getPropertyValue(e);if(!r&&(!i||yB(i)))continue;let a=SX(e,t,i,r);a&&s(a)}let c=n.getPropertyValue(nV.key);if(c){let e=CX(nV,c,tV(c));e&&s(e)}for(let e of rV){let t=n.getPropertyValue(e.key);if(!t)continue;let r=CX(e,t);r&&s(r)}return OX(a,FV(e),r,i)},OX=(e,t,n,r)=>{let i=[],a=[];for(let o of e)if(o.isPrioritized||t.has(o.key))i.push({...o,isPrioritized:!0,isDefault:!1});else{let e=r?fX(o,n,r):pX(o);a.push({...o,isDefault:e})}return[...EX(i),...EX(a)]},kX=[{keyword:`letter`,family:`letter-spacing`},{keyword:`tracking`,family:`letter-spacing`},{keyword:`leading`,family:`line-height`},{keyword:`line-height`,family:`line-height`},{keyword:`lineheight`,family:`line-height`},{keyword:`radius`,family:`radius`},{keyword:`rounded`,family:`radius`},{keyword:`corner`,family:`radius`},{keyword:`font-size`,family:`font-size`},{keyword:`fontsize`,family:`font-size`},{keyword:`text`,family:`font-size`},{keyword:`stroke`,family:`border-width`},{keyword:`border-width`,family:`border-width`},{keyword:`borderwidth`,family:`border-width`},{keyword:`space`,family:`spacing`},{keyword:`gap`,family:`spacing`},{keyword:`gutter`,family:`spacing`},{keyword:`inset`,family:`spacing`},{keyword:`padding`,family:`spacing`},{keyword:`margin`,family:`spacing`},{keyword:`size`,family:`size`},{keyword:`width`,family:`size`},{keyword:`height`,family:`size`}],AX=e=>{let t=e.toLowerCase();for(let{keyword:e,family:n}of kX)if(t.includes(e))return n;return null},jX=e=>e.includes(`radius`)?`radius`:e.endsWith(`-width`)&&e.includes(`border`)?`border-width`:e===`font-size`?`font-size`:e===`line-height`?`line-height`:e===`letter-spacing`?`letter-spacing`:e.startsWith(`padding`)||e.startsWith(`margin`)||e.endsWith(`gap`)||e===`top`||e===`right`||e===`bottom`||e===`left`||e.startsWith(`inset`)?`spacing`:e===`width`||e===`height`||e.startsWith(`min-`)||e.startsWith(`max-`)?`size`:null,MX=e=>{let t=mX(e);return!t||t.unit!==`px`?null:cV(t.value)},NX=(e,t)=>t===null?!0:e.length===t.length?e<t:e.length<t.length,PX=(e,t,n)=>{if(n===1){for(let n of e)if(n>t)return n;return null}for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null},FX=(e,t,n)=>{let r=(t===1?Math.floor(e/n)+1:Math.ceil(e/n)-1)*n;return r<0?null:r},IX=null,LX=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),RX=()=>{let e=Array.from(document.adoptedStyleSheets??[]),t=document.styleSheets.length;if(IX&&IX.documentSheetCount===t&&LX(IX.adoptedSheets,e))return IX.names;let n=new Set;for(let t of[...document.styleSheets,...e]){let e;try{e=t.cssRules}catch{continue}zX(e,n)}return IX={documentSheetCount:t,adoptedSheets:e,names:n},n},zX=(e,t)=>{for(let n of Array.from(e))if(n instanceof CSSStyleRule){let e=n.style;for(let n=0;n<e.length;n++){let r=e.item(n);r.startsWith(`--`)&&t.add(r)}}else n instanceof CSSGroupingRule&&zX(n.cssRules,t)},BX={hasTokens:!1,matchColor:()=>null,matchLength:()=>null,stepLength:()=>null},VX=e=>{if(typeof document>`u`)return BX;let t=RX();if(t.size===0)return BX;let n=getComputedStyle(e),r=new Map,i=new Map,a=new Map,o=null;for(let e of t){let t=n.getPropertyValue(e).trim();if(!t)continue;let s=MX(t);if(s!==null){e===`--spacing`&&s>0&&(o=s);let t=AX(e);if(t!==null){let n=i.get(s);n?n.push({name:e,family:t}):i.set(s,[{name:e,family:t}]);let r=a.get(t);r?r.add(s):a.set(t,new Set([s]))}continue}let c=MB(t);if(c){let t=c.toLowerCase();NX(e,r.get(t)??null)&&r.set(t,e)}}if(r.size===0&&i.size===0)return BX;let s=new Map;for(let[e,t]of a)s.set(e,Array.from(t).sort((e,t)=>e-t));return{hasTokens:!0,matchColor:e=>{let t=MB(e)?.toLowerCase();return t?r.get(t)??null:null},matchLength:(e,t)=>{let n=jX(t);if(n===null)return null;let r=i.get(Math.round(e));if(!r)return null;let a=null;for(let e of r)e.family===n&&NX(e.name,a)&&(a=e.name);return a},stepLength:(e,t,n)=>{let r=jX(n);if(r===null)return null;let i=Math.round(e),a=s.get(r);return a&&a.length>=2?PX(a,i,t):(r===`spacing`||r===`size`)&&o?FX(i,t,o):a?PX(a,i,t):null}}},HX=e=>e.kind===`color`||e.kind===`enum`?e.value:e.key===`opacity`&&e.unit===`%`?sV(e.value/100):`${sV(e.value)}${e.unit}`,UX=(e,t,n)=>{if(!n?.hasTokens)return null;let{edit:r}=t;return r.kind===`color`?n.matchColor(r.value):r.kind===`numeric`&&r.unit===`px`?n.matchLength(r.value,e):null},WX=e=>{let t=new Map;for(let n of e.edits){let e=HX(n);for(let r of n.cssProperties)t.set(r,{edit:n,cssValue:e})}let n=!1;return{lines:Array.from(t,([t,r])=>{let i=UX(t,r,e.designTokens);i&&(n=!0);let a=i?` /* var(${i}) */`:``;return`${t}: ${r.cssValue};${a}`}),usesToken:n}},GX=e=>e.filePath?`${e.filePath}:${e.lineNumber}`:``,KX=e=>["```css",...e,"```"].join(`
261
- `),qX=e=>{if(e.length===0)return``;let t=e.map(e=>{let{lines:t,usesToken:n}=WX(e);return{header:GX(e),cssLines:t,usesToken:n}}),n=[`Apply these style changes canonically (CSS = visual intent; choose the source change that best expresses the underlying layout intent):`];if(t.some(e=>e.usesToken)&&n.push("Prefer the design token shown in each `/* var(--token) */` comment over the raw value when it matches the project's intent."),t.length===1){let[e]=t;return e.header&&n.push(`\n${e.header}`),n.push(KX(e.cssLines)),n.join(`
262
- `)}for(let e of t)n.push(e.header?`\n${e.header}`:``),n.push(KX(e.cssLines));return n.join(`
263
- `)},JX=e=>`style`in e&&e.style instanceof CSSStyleDeclaration,YX=e=>{let t=new Map,n=JX(e)?e:null;return{apply:(e,r)=>{if(n)for(let i of e)t.has(i)||t.set(i,{value:n.style.getPropertyValue(i),priority:n.style.getPropertyPriority(i)}),n.style.setProperty(i,r)},restore:()=>{if(!n){t.clear();return}for(let[e,{value:r,priority:i}]of t)r?n.style.setProperty(e,r,i):n.style.removeProperty(e);t.clear()},hasAppliedStyles:()=>t.size>0}},XX=(e,t)=>{for(let n of t){let t=e.edits.findIndex(e=>e.key===n.key);t>=0?e.edits[t]=n:e.edits.push(n)}},ZX=(e,t)=>({element:e.element,preview:e.preview,filePath:e.filePath??``,lineNumber:e.lineNumber??0,edits:t,designTokens:e.designTokens}),QX=e=>{let[t,n]=J(null),[r,i]=J(!1),a=[],o=[],s=e=>{o=e},c=()=>{let r=t()!==null;n(null),i(!1),a=[],o=[],r&&e.onClose?.()},l=()=>{t()?.preview.restore();for(let e=a.length-1;e>=0;e--)a[e].preview.restore();c()},u=e=>{PU(e).then(t=>{t&&n(n=>!n||n.element!==e||n.componentName?n:{...n,componentName:t})})},d=(r,i,a={})=>{if(t()!==null)return!1;let o=DX(r);if(o.length===0)return!1;let s=a.filePath??e.store.selectionFilePath??void 0,c=a.lineNumber??e.store.selectionLineNumber??void 0;return n({element:r,position:i,selectionBounds:tY(r),properties:o,preview:YX(r),filePath:s,lineNumber:c,componentName:a.componentName,tagName:a.tagName??zN(r),initialSearchQuery:a.initialSearchQuery,designTokens:VX(r)}),u(r),e.isActivated()||e.activateRenderer(),e.actions.setPointer(i),e.actions.setFrozenElement(r),e.actions.freeze(),e.onOpen?.(),!0},f=(r,i)=>{let s=t();if(!s||s.element===r)return!1;let c=DX(r);return c.length===0?!1:((o.length>0||s.preview.hasAppliedStyles())&&a.push(ZX(s,o)),o=[],n({element:r,position:i,selectionBounds:tY(r),properties:c,preview:YX(r),tagName:zN(r),hasSessionEdits:a.some(e=>e.edits.length>0),designTokens:VX(r)}),VU(r).then(e=>{if(e){for(let t of a)t.element===r&&!t.filePath&&(t.filePath=e.filePath,t.lineNumber=e.lineNumber??0);n(t=>!t||t.element!==r||t.filePath?t:{...t,filePath:e.filePath,lineNumber:e.lineNumber??void 0})}}).catch(()=>void 0),u(r),e.actions.setPointer(i),e.actions.setFrozenElement(r),!0)},p=(e,t)=>[...a,ZX(e,t)],m=e=>{let t=new Map;for(let n of e){if(n.edits.length===0)continue;let e=t.get(n.element);if(e){!e.filePath&&n.filePath&&(e.filePath=n.filePath,e.lineNumber=n.lineNumber),XX(e,n.edits);continue}t.set(n.element,{filePath:n.filePath,lineNumber:n.lineNumber,edits:[...n.edits],designTokens:n.designTokens})}return Array.from(t.values())},h=e=>{let t=new Set;for(let n of e)n.edits.length>0&&t.add(n.element);for(let n=e.length-1;n>=0;n--){let r=e[n];r.edits.length===0&&!t.has(r.element)&&r.preview.restore()}};return{state:t,trigger:d,switchToElement:f,setPendingEdits:s,dismiss:()=>{t()!==null&&(l(),e.store.wasActivatedByToggle?e.deactivateRenderer():e.actions.unfreeze())},closePreservingRenderer:()=>{t()!==null&&(l(),e.actions.unfreeze())},submit:n=>{let r=t();if(!r)return;let i=r.element,a=p(r,n),o=qX(m(a));h(a),c(),e.store.wasActivatedByToggle||e.actions.unfreeze(),e.performCopyWithLabel({element:i,cursorX:r.position.x,extraPrompt:o||void 0,shouldDeactivateAfter:e.store.wasActivatedByToggle})},resetWithDiscard:l,isOpen:()=>t()!==null,isInteracting:r,setInteracting:i}},$X={enabled:!0,hue:0,selectionBox:{enabled:!0},dragBox:{enabled:!0},grabbedBoxes:{enabled:!0},elementLabel:{enabled:!0},toolbar:{enabled:!0}},eZ=(e,t)=>({enabled:t.enabled??e.enabled,hue:t.hue??e.hue,selectionBox:{enabled:t.selectionBox?.enabled??e.selectionBox.enabled},dragBox:{enabled:t.dragBox?.enabled??e.dragBox.enabled},grabbedBoxes:{enabled:t.grabbedBoxes?.enabled??e.grabbedBoxes.enabled},elementLabel:{enabled:t.elementLabel?.enabled??e.elementLabel.enabled},toolbar:{enabled:t.toolbar?.enabled??e.toolbar.enabled}}),tZ={activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,activationKey:void 0,getContent:void 0,maxContextLines:3,freezeReactUpdates:!0},nZ=(e={})=>{let t=new Map,n={},[r,i]=VJ({theme:$X,options:{...tZ,...e},actions:[]}),a=()=>{let r=$X,a={...tZ,...e},o=[];for(let{config:e}of t.values())if(e.theme&&(r=eZ(r,e.theme)),e.options&&(a={...a,...e.options}),e.actions)for(let t of e.actions)o.push(t);a={...a,...n},i(`theme`,r),i(`options`,a),i(`actions`,o)},o=(e,t)=>{n[e]=t,i(`options`,e,t)},s=[`activationMode`,`keyHoldDuration`,`allowActivationInsideInput`,`activationKey`,`getContent`,`maxContextLines`,`freezeReactUpdates`],c=e=>{for(let t of s)e[t]!==void 0&&o(t,e[t])},l=(e,n)=>{t.has(e.name)&&u(e.name);let r=e.setup?.(n,_)??{};e.theme&&(r.theme=r.theme?eZ(eZ($X,e.theme),r.theme):e.theme),e.actions&&(r.actions=[...e.actions,...r.actions??[]]),e.hooks&&(r.hooks=r.hooks?{...e.hooks,...r.hooks}:e.hooks),e.options&&(r.options=r.options?{...e.options,...r.options}:e.options),t.set(e.name,{plugin:e,config:r}),a()},u=e=>{let n=t.get(e);n&&(n.config.cleanup&&n.config.cleanup(),t.delete(e),a())},d=()=>Array.from(t.keys()),f=(e,...n)=>{for(let{config:r}of t.values()){let t=r.hooks?.[e];t&&t(...n)}},p=(e,...n)=>{let r=!1;for(let{config:i}of t.values()){let t=i.hooks?.[e];t&&t(...n)===!0&&(r=!0)}return r},m=async(e,...n)=>{for(let{config:r}of t.values()){let t=r.hooks?.[e];t&&await t(...n)}},h=async(e,n,...r)=>{let i=n;for(let{config:n}of t.values()){let t=n.hooks?.[e];t&&(i=await t(i,...r))}return i},g=(e,n,...r)=>{let i=n;for(let{config:n}of t.values()){let t=n.hooks?.[e];t&&(i=t(i,...r))}return i},_={onActivate:()=>f(`onActivate`),onDeactivate:()=>f(`onDeactivate`),onElementHover:e=>f(`onElementHover`,e),onElementSelect:e=>{let n=!1,r;for(let{config:i}of t.values()){let t=i.hooks?.onElementSelect;if(t){let i=t(e);i===!0?n=!0:i instanceof Promise&&(n=!0,r=i)}}return{wasIntercepted:n,pendingResult:r}},onDragStart:(e,t)=>f(`onDragStart`,e,t),onDragEnd:(e,t)=>f(`onDragEnd`,e,t),onBeforeCopy:async e=>m(`onBeforeCopy`,e),transformCopyContent:async(e,t)=>h(`transformCopyContent`,e,t),onAfterCopy:(e,t)=>f(`onAfterCopy`,e,t),onCopySuccess:(e,t)=>f(`onCopySuccess`,e,t),onCopyError:e=>f(`onCopyError`,e),onStateChange:e=>f(`onStateChange`,e),onPromptModeChange:(e,t)=>f(`onPromptModeChange`,e,t),onSelectionBox:(e,t,n)=>f(`onSelectionBox`,e,t,n),onDragBox:(e,t)=>f(`onDragBox`,e,t),onGrabbedBox:(e,t)=>f(`onGrabbedBox`,e,t),onElementLabel:(e,t,n)=>f(`onElementLabel`,e,t,n),onContextMenu:(e,t)=>f(`onContextMenu`,e,t),onOpenFile:(e,t)=>p(`onOpenFile`,e,t),transformHtmlContent:async(e,t)=>h(`transformHtmlContent`,e,t),transformAgentContext:async(e,t)=>h(`transformAgentContext`,e,t),transformActionContext:e=>g(`transformActionContext`,e),transformOpenFileUrl:(e,t,n)=>g(`transformOpenFileUrl`,e,t,n)};return{register:l,unregister:u,getPluginNames:d,setOptions:c,store:r,hooks:_}},rZ=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,iZ=e=>{let t=e.bounds.x+e.bounds.width/2,n=e.bounds.width/2,r=e.mouseX===void 0?void 0:e.mouseX-t;return{id:rZ(`label`),bounds:e.bounds,boundsMultiple:e.boundsMultiple,tagName:e.tagName,componentName:e.componentName,status:e.status,createdAt:Date.now(),element:e.element,elements:e.elements,mouseX:e.mouseX,mouseXOffsetFromCenter:r,mouseXOffsetRatio:r!==void 0&&n>0?r/n:void 0,hideArrow:e.hideArrow}},aZ=(e,t)=>{let n=new Map,r=e=>{let t=n.get(e);t!==void 0&&(window.clearTimeout(t),n.delete(e))},i=()=>{for(let e of n.values())window.clearTimeout(e);n.clear()},a=()=>{i(),e.clearLabelInstances()},o=t=>{r(t);let i=window.setTimeout(()=>{e.updateLabelInstance(t,`fading`);let r=window.setTimeout(()=>{n.delete(t),e.removeLabelInstance(t)},125);n.set(t,r)},KM);n.set(t,i)};return{createInstance:(t,n,r,i,o)=>{a();let s=iZ({bounds:t,tagName:n,componentName:r,status:i,element:o?.element,mouseX:o?.mouseX,elements:o?.elements,boundsMultiple:o?.boundsMultiple,hideArrow:o?.hideArrow});return e.addLabelInstance(s),s.id},createPerElementInstances:(t,n)=>{a();let r=[];for(let i of t){let t=iZ({bounds:tY(i.element),tagName:i.tagName,componentName:i.componentName,status:n,element:i.element,mouseX:i.mouseX});e.addLabelInstance(t),r.push(t.id)}return r},updateAfterCopy:(t,n,r)=>{n?e.updateLabelInstance(t,`copied`):e.updateLabelInstance(t,`error`,r||`Unknown error`),o(t)},cancelAllFades:i,clearAll:a,handleHoverChange:(e,n)=>{if(n){r(e);return}let i=t().find(t=>t.id===e);i&&(i.status===`copied`||i.status===`error`||i.status===`fading`)&&o(e)}}},oZ=e=>{let t=window.innerWidth,n=window.innerHeight,r=Math.max(0,e.x),i=Math.min(t,e.x+e.width),a=Math.max(0,e.y),o=Math.min(n,e.y+e.height);return{x:(r+i)/2,y:(a+o)/2}},sZ=(e,t,n)=>{let r=[],i=(t,r)=>{let i=oZ(n(t)),a=NI(i.x,i.y).filter(e),o=a.indexOf(t);return o===-1?null:a[o+r]??null},a=e=>{let t=i(e,1);return t&&(r.push(e),r.length>50&&(r=r.slice(-50))),t},o=e=>{if(r.length>0){let e=r.pop();if(cB(e))return e}return i(e,-1)},s=(e,n)=>{let i=e=>n?e.nextElementSibling:e.previousElementSibling,a=i(e);for(;a;){if(t(a))return r=[],a;a=i(a)}return null};return{findNext:(e,t)=>{switch(e){case`ArrowUp`:return a(t);case`ArrowDown`:return o(t);case`ArrowRight`:return s(t,!0);case`ArrowLeft`:return s(t,!1);default:return null}},clearHistory:()=>{r=[]}}},cZ=e=>{let{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}=aX(e.activationKey);return{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}},lZ=()=>{let e=new WeakSet,t=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,`key`),n=!1;if(t?.get&&!t.get.__reactGrabPatched){n=!0;let r=t.get,i=function(){return e.has(this)?``:r.call(this)};i.__reactGrabPatched=!0,Object.defineProperty(KeyboardEvent.prototype,"key",{get:i,configurable:!0})}return{claimedEvents:e,originalKeyDescriptor:t,restore:()=>{n&&t&&Object.defineProperty(KeyboardEvent.prototype,"key",t)}}},uZ=(e,t)=>({top:t<25,bottom:t>window.innerHeight-25,left:e<25,right:e>window.innerWidth-25}),dZ=(e,t,n)=>{let r=null,i=()=>{if(!t()){a();return}let o=e(),s=uZ(o.x,o.y),c=0,l=0;if(s.top&&(l-=10),s.bottom&&(l+=10),s.left&&(c-=10),s.right&&(c+=10),c!==0||l!==0){let e=window.scrollX,t=window.scrollY;window.scrollBy(c,l);let r=window.scrollX-e,i=window.scrollY-t;(r!==0||i!==0)&&n?.({x:r,y:i})}r=s.top||s.bottom||s.left||s.right?rI(i):null},a=()=>{r!==null&&(iI(r),r=null)};return{start:i,stop:a,isActive:()=>r!==null}},fZ=()=>{let e=globalThis;return!!(e.chrome?.runtime?.id||e.browser?.runtime?.id)},pZ=e=>{try{let t=`0.1.48`,n=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 294 294"><path fill="#ff40e0" d="M145 47c25-20 50-27 67-17 16 9 23 30 20 60 0 2-1 5-1 7l-2 13h-1l-12-4c-8-3-17-5-25-6l-17-3c-10-1-20-1-29-1-10 0-20 0-29 1-6 8-11 16-16 24-5 9-9 17-13 26 4 9 8 18 13 26s10 16 16 24l11 14c5 7 11 13 18 19l10 8s-1 0 0 0l-11 9c-17 14-35 22-49 22-6 0-13-2-18-5-16-9-23-30-20-59 1-3 1-5 1-8-30-12-48-29-48-50 0-18 14-35 41-47 2-1 5-2 7-3 0-2 0-5-1-7-3-30 4-51 20-60 18-10 42-3 68 17M71 201c-1 2-1 4-1 5-2 24 3 41 13 47h1c11 7 30 1 51-15-10-9-18-18-26-29-13-1-26-4-38-8m9-38c-3 9-5 17-7 26 8 2 17 4 25 6-3-5-6-10-9-16-3-5-6-10-9-16m-19-53c-2 1-3 1-5 2-21 10-34 23-34 35 0 13 14 27 39 37 3-12 7-25 12-37-5-12-9-24-12-37m37-10c-8 1-17 3-25 6 2 8 4 16 7 25 3-5 6-11 9-16zm-3-61c-4-1-8 0-12 2-10 7-15 24-13 47 0 2 0 3 1 5 12-4 25-6 38-8 8-10 16-20 26-29-15-11-29-17-40-17m111 2c-4-2-8-3-12-2-11 0-25 5-40 17 10 9 19 19 26 29 13 2 26 4 39 8v-5c3-23-2-40-13-47m-61 23c-7 6-13 13-19 19h37c-6-6-12-13-18-19"/><mask id="a"><path fill="#fff" d="m235 85-133 27 28 133 133-27Z"/></mask><path fill="#ff40e0" d="m137 130 76 11c8 1 9 11 3 15l-28 16-4 32c-1 8-10 10-14 4l-41-66c-3-6 1-13 8-12" mask="url(#a)"/></svg>`)}`;console.log(`%cReact Grab${` v${t}`}%c\nhttps://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${n}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,``),e&&navigator.onLine&&!fZ()&&fetch(`https://www.react-grab.com/api/version?source=browser&v=${t}&t=${Date.now()}`,{referrerPolicy:`origin`,keepalive:!0,priority:`low`,cache:`no-store`}).then(e=>e.text()).then(e=>{e&&e!==t&&console.warn(`[React Grab] v${t} is outdated (latest: v${e}). Run \`npx grab@latest upgrade\` to upgrade.`)}).catch(()=>null)}catch{}},mZ=e=>typeof e==`object`&&!!e,hZ=e=>{if(!mZ(e))return null;let t={};return typeof e.enabled==`boolean`&&(t.enabled=e.enabled),(e.activationMode===`toggle`||e.activationMode===`hold`)&&(t.activationMode=e.activationMode),typeof e.keyHoldDuration==`number`&&Number.isFinite(e.keyHoldDuration)&&(t.keyHoldDuration=e.keyHoldDuration),typeof e.allowActivationInsideInput==`boolean`&&(t.allowActivationInsideInput=e.allowActivationInsideInput),typeof e.activationKey==`string`&&(t.activationKey=e.activationKey),typeof e.maxContextLines==`number`&&Number.isFinite(e.maxContextLines)&&(t.maxContextLines=e.maxContextLines),typeof e.freezeReactUpdates==`boolean`&&(t.freezeReactUpdates=e.freezeReactUpdates),typeof e.telemetry==`boolean`&&(t.telemetry=e.telemetry),Object.keys(t).length===0?null:t},gZ=()=>{if(typeof window>`u`)return null;try{let e=(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)?.getAttribute(`data-options`);return e?hZ(JSON.parse(e)):null}catch{return null}},_Z=e=>e===`Enter`||e===`NumpadEnter`,vZ=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,yZ=(e=>({name:e.name,setup:(t,n)=>({actions:[typeof e.contextMenuAction==`function`?e.contextMenuAction(t,n):e.contextMenuAction],cleanup:e.cleanup})}))({name:`copy`,contextMenuAction:{id:`copy`,label:`Copy`,shortcut:`C`,showInToolbarMenu:!0,onAction:e=>{e.copy?.()}}}),bZ={name:`comment`,setup:()=>({actions:[{id:`comment`,label:`Comment`,shortcut:`Enter`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterPromptMode?.()}}]})},xZ={name:`edit`,setup:()=>({actions:[{id:`edit`,label:`Style`,shortcut:`S`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterEditMode?.()}}]})},SZ={name:`open`,actions:[{id:`open`,label:`Open`,shortcut:`O`,enabled:e=>!!e.filePath,onAction:e=>{e.filePath&&(e.hooks.onOpenFile(e.filePath,e.lineNumber)||LI(e.filePath,e.lineNumber,e.hooks.transformOpenFileUrl),e.hideContextMenu(),e.cleanup())}}]},CZ=e=>{let t=e.left+e.width/2,n=e.top+e.height/2,r=n,i=window.innerHeight-n,a=t,o=window.innerWidth-t,s=Math.min(r,i,a,o);return s===r?`top`:s===a?`left`:s===o?`right`:`bottom`},wZ=()=>{let[e,t]=J(!1),[n,r]=J(null),i=KV(),a=()=>{let e=n();return cB(e)?e:null},o=()=>{r(null),i.clear(),t(!1)};return{selectedElement:a,isPendingDismiss:e,select:(e,n)=>{r(e),t(!1),n?.shouldPromptBeforeMouseHandoff?i.arm():i.clear()},clear:o,consumeMouseHandoff:()=>i.consume()&&a()!==null,showDismissPrompt:()=>a()?e()?!1:(t(!0),!0):(o(),!1),takeSelection:e=>{let t=a()??(cB(e)?e:null);return o(),t}}},TZ=async(e,t={})=>(await Promise.allSettled(e.map(e=>nW(e,t)))).map(e=>e.status===`fulfilled`?e.value:``),EZ=[yZ,xZ,bZ,SZ],DZ=!1,OZ=new Set,kZ=e=>{if(typeof window>`u`)return OY();let t={enabled:!0,activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,...gZ(),...e};if(t.enabled===!1||DZ)return OY();DZ=!0,LM(t.container??null),pZ(t.telemetry!==!1);let{enabled:n,telemetry:r,container:i,...a}=t;return _R(e=>{let t=!1,n,r=nZ(a),{store:i,actions:o,pointer:s,viewportVersion:c,current:l}=iY({keyHoldDuration:r.store.options.keyHoldDuration??100}),u=Y(()=>l().state===`holding`),d=Y(()=>l().state===`active`),f=Y(()=>{let e=l();return e.state===`active`&&e.phase===`frozen`}),p=Y(()=>{let e=l();return e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)}),m=Y(()=>{if(!p())return!1;let e=Math.abs(s().x+window.scrollX-i.dragStart.x),t=Math.abs(s().y+window.scrollY-i.dragStart.y);return e>2||t>2}),h=Y(()=>{let e=l();return e.state===`active`&&e.phase===`dragging-reposition`}),g=Y(()=>{let e=l();return e.state===`active`&&e.phase===`justDragged`}),_=Y(()=>l().state===`copying`),v=Y(()=>i.selectionInteractionLockDepth>0),y=Y(()=>l().state===`justCopied`),b=Y(()=>{let e=l();return e.state===`active`&&!!e.isPromptMode}),x=Y(()=>i.pendingCommentMode||b()),S=Y(()=>{let e=l();return e.state===`active`&&!!e.isPromptMode&&!!e.isPendingDismiss}),C=(e,t)=>{document.body.style[e]=t};bR(TR(d,(e,t)=>{e&&!t?(IL(s().x,s().y),C(`touchAction`,`none`)):!e&&t&&(LL(),C(`touchAction`,``))}));let w=BV(),[T,E]=J(!w||!w.collapsed),[D,O]=J(0),[k,ee]=J(0),[te,A]=J(w),[ne,re]=J(!1),ie=HV(e=>e.shiftKey),[ae,oe]=J(null),[se,ce]=J(null),[le,ue]=J(null),de=QX({store:i,actions:o,isActivated:d,activateRenderer:()=>Gt(),deactivateRenderer:()=>Kt(),performCopyWithLabel:e=>dt(e),onOpen:()=>{kr(),ge?.(),ge=Or(Dr,ce)},onClose:()=>{ge?.(),ge=null,ce(null)}}),fe=Y(()=>i.contextMenuPosition!==null||de.isOpen()),pe=Y(()=>fe()||ae()!==null),me,he=null,ge=null,_e=!1,ve=new WeakMap,ye=wZ(),be=()=>!T()||b()||v()||fe()||ye.isPendingDismiss(),xe=()=>{ve=new WeakMap},Se=()=>{Le(!1),xe()},Ce=e=>{let t=te()??BV(),n={edge:t?.edge??`bottom`,ratio:t?.ratio??.5,collapsed:t?.collapsed??!1,enabled:t?.enabled??!0,defaultAction:t?.defaultAction??`copy`,...e};VV(n),A(n);for(let e of OZ)e(n)},we=()=>{Fe.timerId!==null&&(clearTimeout(Fe.timerId),Fe.timerId=null)},Te=()=>{Fe.copyWaiting=!1,Fe.holdTimerFired=!1,Fe.startTimestamp=null};bR(()=>{if(l().state!==`holding`){we();return}Fe.startTimestamp=Date.now(),Fe.timerId=window.setTimeout(()=>{if(Fe.timerId=null,Fe.copyWaiting){Fe.holdTimerFired=!0;return}o.activate()},i.keyHoldDuration),DR(we)}),bR(()=>{let e=l();if(e.state!==`active`||e.phase!==`justDragged`)return;let t=setTimeout(()=>{o.finishJustDragged()},KM);DR(()=>clearTimeout(t))}),bR(()=>{if(l().state!==`justCopied`)return;let e=setTimeout(()=>{o.finishJustCopied()},KM);DR(()=>clearTimeout(e))}),bR(TR(u,(e,t=!1)=>{!t||e||!d()||(r.store.options.activationMode!==`hold`&&o.setWasActivatedByToggle(!0),r.hooks.onActivate())}));let Ee=(e,t,n)=>{Oe(e,t,n),o.clearInputText()},De=()=>{let e=i.frozenElement||pt();e&&o.enterPromptMode({x:s().x,y:s().y},e)},Oe=(e,t,n)=>{o.setCopyStart({x:t,y:n},e)},ke={lastDetectionTimestamp:0,pendingDetectionScheduledAt:0,latestPointerX:0,latestPointerY:0},Ae=null,[je,Me]=J(null),Ne=(e,t)=>{Ae!==null&&clearTimeout(Ae),Me(null),Ae=window.setTimeout(()=>{Me({x:e,y:t}),Ae=null},32)},Pe=null,Fe={timerId:null,startTimestamp:null,copyWaiting:!1,holdTimerFired:!1},Ie=null,[j,Le]=J(!1),Re=0,ze=!1,Be=null,Ve=()=>{ze=!0,Be!==null&&window.clearTimeout(Be),Be=window.setTimeout(()=>{ze=!1,Be=null},KM)},He=()=>{Be!==null&&(window.clearTimeout(Be),Be=null),ze=!1},Ue=0,We=null,Ge=null,[M,Ke]=J(!1),[qe,Je]=J(null),[Ye,Xe]=J(null),[Ze,Qe]=cY(Ye),$e=Y(()=>de.isOpen()?bN:x()?yN:M()?qe():d()?vN:null),et=e=>QY(e,_I),tt=sZ(_I,et,tY),nt=dZ(s,()=>p(),e=>{if(h()){if(o.shiftDragStart(e),Ie){Ie={x:Ie.x+e.x,y:Ie.y+e.y};return}let{pageX:t,pageY:n}=Et(s().x,s().y);Ie={x:t,y:n}}}),N=Y(()=>d()&&!_()),rt=new Map,it=(e,t)=>{let n=rZ(`grabbed`),i={id:n,bounds:e,createdAt:Date.now(),element:t};o.addGrabbedBox(i),r.hooks.onGrabbedBox(e,t);let a=window.setTimeout(()=>{rt.delete(n),o.removeGrabbedBox(n)},KM+125);rt.set(n,a)},at=async e=>{let t=await Promise.all(e.map(async e=>{let t=await VU(e),n=t?.componentName??null,r=t?.filePath,i=t?.lineNumber??void 0,a=t?.columnNumber??void 0;n||=HU(e);let o=e instanceof HTMLElement?e.innerText?.slice(0,100):void 0;return{tagName:zN(e),id:e.id||void 0,className:e.getAttribute(`class`)||void 0,textContent:o,componentName:n??void 0,filePath:r,lineNumber:i,columnNumber:a}}));window.dispatchEvent(new CustomEvent(`react-grab:element-selected`,{detail:{elements:t}}))},ot=aZ(o,()=>i.labelInstances),st=async(e,t,n)=>{He(),l().state!==`copying`&&o.startCopy();let r=!1,i;try{r=await e(),r||(i=`Failed to copy`)}catch(e){i=AY(e,`Action failed`)}if(t)for(let e of t)ot.updateAfterCopy(e,r,i);l().state===`copying`&&(r&&o.completeCopy(),n?Kt():r?(o.activate(),Ve()):o.unfreeze())},ct=(e,t,n)=>{let i=e[0],a=n??(i?HU(i):null),o=i?zN(i):null,s=a??o??void 0;return IY({getContent:r.store.options.getContent,componentName:s,maxContextLines:r.store.options.maxContextLines},r.hooks,e,t)},lt=async(e,t,n)=>{if(e.length===0)return!1;let i=[],a=[];for(let t of e){let{wasIntercepted:e,pendingResult:n}=r.hooks.onElementSelect(t);e||i.push(t),n&&a.push(n),r.store.theme.grabbedBoxes.enabled&&it(tY(t),t)}await aI();let o=!0;if(i.length>0&&(o=await ct(i,t,n)),a.length>0&&!(await Promise.all(a)).every(Boolean))throw new QV;return at(e),o},ut=e=>{PU(e.primaryElement).then(async t=>{await st(()=>lt(e.targetElements,e.extraPrompt,t??void 0),e.labelInstanceIds.length>0?e.labelInstanceIds:null,e.shouldDeactivateAfter),e.onComplete?.()}).catch(t=>{let n=AY(t,`Action failed`);for(let t of e.labelInstanceIds)ot.updateAfterCopy(t,!1,n);l().state===`copying`&&o.unfreeze()})},dt=e=>{let{element:t,cursorX:n,selectedElements:r,extraPrompt:a,shouldDeactivateAfter:s,onComplete:c,dragRect:l}=e,u=r??[t],d=l??i.frozenDragRect,f=u.length>1,p=!f&&t===yt()?Tt():void 0,m=d&&f?KY(d):p??tY(t),h=f?m.x+m.width/2:n,g=zN(t);He(),o.startCopy();let _=g?ot.createInstance(m,g,void 0,`copying`,{element:t,mouseX:h,elements:r}):null;ut({primaryElement:t,targetElements:u,labelInstanceIds:_?[_]:[],extraPrompt:a,shouldDeactivateAfter:s,onComplete:c})},ft=e=>{let{elements:t,labelEntries:n,shouldDeactivateAfter:r,onComplete:i}=e,a=t[0];He(),o.startCopy(),ut({primaryElement:a,targetElements:t,labelInstanceIds:ot.createPerElementInstances(n,`copying`),shouldDeactivateAfter:r,onComplete:i})},pt=Y(()=>{if(c(),!N()||m()||v()||ye.isPendingDismiss())return null;let e=i.detectedElement;return cB(e)?e:null}),P=Y(()=>i.frozenElement||(f()?null:pt())),mt=Y(()=>!d()||b()||j()||_()||pe()||ye.isPendingDismiss()?null:ie()?f()?P():pt()??i.frozenElement:ye.selectedElement()),ht=Y(()=>{let e=mt();return e?YY(e,_I,et):[]}),gt=Y(()=>{let e=mt();return e?Math.max(0,ht().findIndex(t=>t.element===e)):0}),_t=Y(()=>mt()!==null);bR(()=>{let e=i.detectedElement;if(!e)return;let t=setInterval(()=>{cB(e)||o.setDetectedElement(null)},100);DR(()=>clearInterval(t))}),bR(TR(P,e=>{if(We!==null&&(clearTimeout(We),We=null),!e){Xe(null);return}We=window.setTimeout(()=>{We=null,Xe(e)},100)})),DR(()=>{We!==null&&(clearTimeout(We),We=null)}),bR(()=>{let e=i.frozenElements;DR(hL(e))}),bR(TR(d,e=>{e&&r.store.options.freezeReactUpdates&&DR(pR())}));let vt=()=>{if(i.isTouchMode&&p()){let e=i.detectedElement;return!e||sI(e)?void 0:e}let e=P();if(!(!e||sI(e)))return e},yt=Y(()=>vt()),bt=()=>yt()?i.isTouchMode&&p()?N():N()&&!m():!1,xt=QR(()=>i.frozenElements,e=>Y(()=>(c(),tY(e)))),St=Y(()=>{let e=i.frozenElements;if(e.length===0)return[];let t=i.frozenDragRect;return t&&e.length>1?[KY(t)]:xt().map(e=>e())}),Ct=Y(()=>{if(!j()||i.pendingCommentMode||M())return null;let e=i.detectedElement;return!cB(e)||sI(e)||i.frozenElements.includes(e)?null:e}),wt=Y(()=>{c();let e=Ct();if(e)return tY(e)}),Tt=Y(()=>{c();let e=i.frozenElements;if(e.length>0){let t=St();if(e.length===1){let e=t[0];if(e)return e}let n=i.frozenDragRect;return n?t[0]??KY(n):JY(sX(t))}let t=yt();if(t)return tY(t)}),Et=(e,t)=>({pageX:e+window.scrollX,pageY:t+window.scrollY}),Dt=(e,t)=>{let{pageX:n,pageY:r}=Et(e,t);return{x:Math.abs(n-i.dragStart.x),y:Math.abs(r-i.dragStart.y)}},Ot=Y(()=>{if(!p())return!1;let e=Dt(s().x,s().y);return e.x>2||e.y>2}),kt=(e,t)=>{let{pageX:n,pageY:r}=Et(e,t),a=Math.min(i.dragStart.x,n),o=Math.min(i.dragStart.y,r),s=Math.abs(n-i.dragStart.x),c=Math.abs(r-i.dragStart.y);return{x:a-window.scrollX,y:o-window.scrollY,width:s,height:c}},At=e=>e.code===`Space`||e.key===` `,jt=()=>{if(!p())return;o.startDragReposition();let{pageX:e,pageY:t}=Et(s().x,s().y);Ie={x:e,y:t}},Mt=()=>{o.stopDragReposition(),Ie=null},Nt=Y(()=>{if(c(),Ot())return JY(kt(s().x,s().y))}),Pt=Y(()=>{if(c(),!Ot())return[];let e=je();if(!e)return[];let t=kt(e.x,e.y),n=UY(t,_I);return(n.length>0?n:UY(t,_I,!1)).map(e=>tY(e))}),Ft=Y(()=>{let e=Pt();if(e.length>0)return e;let t=wt();return t?[...St(),t]:St()}),It=QR(()=>i.frozenElements,e=>{let t=zN(e)||`element`,n=HU(e)??void 0;return Y(()=>{if(c(),!cB(e))return null;let r=tY(e),i=ve.get(e);return{tagName:t,componentName:n,bounds:r,mouseX:i===void 0?void 0:r.x+r.width*i}})}),Lt=Y(()=>{if(b()||i.frozenElements.length<2)return[];let e=[];for(let t of It()){let n=t();n!==null&&e.push(n)}return e}),Rt=Y(()=>{if(b())return null;let e=Ct();return e?(c(),{tagName:zN(e)||`element`,componentName:HU(e)??void 0,bounds:tY(e),mouseX:s().x}):null}),zt=Y(()=>{if(_()||b()){c();let e=i.frozenElement||pt();return e?{x:nY(tY(e)).x+i.copyOffsetFromCenterX,y:i.copyStart.y}:{x:i.copyStart.x,y:i.copyStart.y}}return{x:s().x,y:s().y}}),Bt=Y(()=>{if(!j()||i.frozenElements.length!==1)return;c();let e=i.frozenElements[0];if(!cB(e))return;let t=ve.get(e);if(t===void 0)return;let n=tY(e);return n.x+n.width*t});bR(TR(()=>[pt(),i.lastGrabbedElement],([e,t])=>{t&&e&&t!==e&&o.setLastGrabbed(null),e&&r.hooks.onElementHover(e)})),bR(TR(()=>pt(),e=>{let t=++Ue,n=()=>{Ue===t&&o.setSelectionSource(null,null)};if(!e){n();return}VU(e).then(e=>{if(Ue===t){if(!e){n();return}o.setSelectionSource(e.filePath,e.lineNumber)}}).catch(()=>{Ue===t&&o.setSelectionSource(null,null)})}));let Vt=Y(()=>i.grabbedBoxes.map(e=>({id:e.id,bounds:e.bounds,createdAt:e.createdAt}))),Ht=Y(()=>i.labelInstances.map(e=>({id:e.id,status:e.status,tagName:e.tagName,componentName:e.componentName,createdAt:e.createdAt})));bR(TR(Y(()=>{let e=d(),t=p(),n=_(),a=b(),o=pt(),s=Nt(),c=r.store.theme.enabled,l=r.store.theme.selectionBox.enabled,u=r.store.theme.dragBox.enabled,f=Ot(),m=P(),h=y();return{isActive:e,isDragging:t,isCopying:n,isPromptMode:a,isSelectionBoxVisible:!!(c&&l&&e&&!n&&!h&&!t&&m!=null),isDragBoxVisible:!!(c&&u&&e&&!n&&f),targetElement:o,dragBounds:s?{x:s.x,y:s.y,width:s.width,height:s.height}:null,grabbedBoxes:[...Vt()],labelInstances:[...Ht()],selectionFilePath:i.selectionFilePath,toolbarState:te()}}),e=>{r.hooks.onStateChange(e)})),bR(TR(()=>{let e=b();return{inputMode:e,position:e?s():wR(s),target:e?pt():wR(pt)}},({inputMode:e,position:t,target:n})=>{r.hooks.onPromptModeChange(e,{x:t.x,y:t.y,targetElement:n})})),bR(TR(()=>[ar(),Tt(),pt()],([e,t,n])=>{r.hooks.onSelectionBox(!!e,t??null,n)})),bR(TR(()=>[fr(),Nt()],([e,t])=>{r.hooks.onDragBox(!!e,t??null)})),bR(TR(()=>{let e=mr();return[e,pr(),e?zt():wR(zt),e?pt():wR(pt),i.selectionFilePath,i.selectionLineNumber]},([e,t,n,i,a,o])=>{r.hooks.onElementLabel(e,t,{x:n.x,y:n.y,content:``,element:i??void 0,tagName:i&&zN(i)||void 0,filePath:a??void 0,lineNumber:o??void 0})}));let Ut=null,Wt=e=>{if(e){if(!Ut){Ut=document.createElement(`style`),Ut.setAttribute(`data-react-grab-cursor`,``);let e=VN();e&&(Ut.nonce=e),UN(Ut),document.head.appendChild(Ut)}Ut.textContent=`* { cursor: ${e} !important; }`}else Ut&&=(Ut.remove(),null)};bR(TR(()=>[d(),_(),b()],([e,t,n])=>{Wt(t?`progress`:e&&!n?`crosshair`:null)}));let Gt=()=>{let e=u();o.activate(),e||r.hooks.onActivate()},Kt=()=>{let e=p(),t=i.previouslyFocusedElement;Mt(),o.deactivate(),de.resetWithDiscard(),kr(),Se(),wn(),ye.clear(),Ke(!1),Je(null),e&&C(`userSelect`,``),Pe&&window.clearTimeout(Pe),nt.stop(),t instanceof HTMLElement&&t!==document.body&&t!==document.activeElement&&cB(t)&&t.focus({preventScroll:!0}),r.hooks.onDeactivate()},qt=()=>{u()&&o.releaseHold(),d()&&Kt(),He()},Jt=()=>{o.setWasActivatedByToggle(!0),Gt()},Yt=()=>{let e=[...i.frozenElements],t=i.frozenElement||pt(),n=b()?i.inputText.trim():``;if(!t){Kt();return}let r=e.length>0?e:[t],a=r.map(e=>tY(e))[0],{x:s,y:c}=nY(a),l=s+i.copyOffsetFromCenterX;o.setPointer({x:s,y:c}),o.exitPromptMode(),o.clearInputText(),dt({element:t,cursorX:l,selectedElements:r,extraPrompt:n||void 0,shouldDeactivateAfter:!0})},Xt=()=>{if(b()){if(S()){o.clearInputText(),Kt();return}o.setPendingDismiss(!0),ee(e=>e+1)}},Zt=()=>{if(ye.isPendingDismiss()){Dn();return}o.clearInputText(),Kt()},Qt=()=>{o.setPendingDismiss(!1)},$t=()=>{if(de.isOpen()){de.dismiss();return}let e=i.frozenElement||pt();e&&en(e,{x:s().x,y:s().y})},en=(e,t,n={})=>de.trigger(e,t,n),tn=(e,t)=>{if(!de.isOpen()||i.contextMenuPosition!==null)return!1;let n=NI(e,t).find(_I);if(!n)return!1;let r=de.switchToElement(n,{x:e,y:t});return r&&pL([n]),r},nn=e=>({filePath:i.selectionFilePath??void 0,lineNumber:i.selectionLineNumber??void 0,componentName:Ze(),tagName:zN(e)||void 0}),rn=()=>{Ge=null,Ke(!1),o.setPendingCommentMode(!1),Je(null)},an=e=>{let t=i.frozenElement||pt();if(!t)return!1;let n={x:s().x,y:s().y},a=r.store.actions.find(t=>t.id===e);return a?e===`edit`?en(t,n,nn(t))?(o.clearInputText(),o.exitPromptMode(),rn(),!0):!0:(o.clearInputText(),o.exitPromptMode(),rn(),a.onAction(Nn(t,n)),!0):(o.clearInputText(),o.exitPromptMode(),rn(),Mr(vN),ln(t,n),!0)},on=e=>{if(d()){if($e()!==e&&b()&&an(e))return;if($e()!==e&&i.pendingCommentMode){o.setPendingCommentMode(!1),Ge=e,Je(e),Ke(!0);return}if($e()!==e&&M()){Ge=e,Je(e);return}Kt();return}T()&&(Ge=e,Je(e),Ke(!0),Jt())},sn=()=>{on(te()?.defaultAction??`copy`)},cn=(e,t,n)=>{rn(),o.clearInputText(),o.enterPromptMode({x:t,y:n},e)},ln=(e,t)=>{Se(),Ar(),o.showContextMenu(t,e),wn(),r.hooks.onContextMenu(e,t)},un=(e,t)=>{let n=Ge;if(Ge=null,Je(null),!n)return;if(n===`edit`){en(e,t,nn(e));return}let i=r.store.actions.find(e=>e.id===n);if(!i){Mr(vN),ln(e,t);return}i.onAction(Nn(e,t))},dn=()=>{if(T()){if(d()&&x()){Kt();return}o.setPendingCommentMode(!0),d()||Jt()}},fn=(e,t,n)=>{let r=n&&j()&&!p()&&!i.pendingCommentMode&&!M();if(be()||f()&&!r)return;if(o.setPointer({x:e,y:t}),ke.latestPointerX=e,ke.latestPointerY=t,r){let n=PI(e,t);n!==i.detectedElement&&o.setDetectedElement(n);return}let a=performance.now(),s=ke.pendingDetectionScheduledAt>0&&a-ke.pendingDetectionScheduledAt<200;if(a-ke.lastDetectionTimestamp>=32&&!s&&(ke.lastDetectionTimestamp=a,ke.pendingDetectionScheduledAt=a,setTimeout(()=>{if(be()){ke.pendingDetectionScheduledAt=0;return}let e=PI(ke.latestPointerX,ke.latestPointerY);e!==i.detectedElement&&o.setDetectedElement(e),ke.pendingDetectionScheduledAt=0})),p()){if(h()){let{pageX:n,pageY:r}=Et(e,t);Ie&&o.shiftDragStart({x:n-Ie.x,y:r-Ie.y}),Ie={x:n,y:r}}Ne(e,t);let n=uZ(e,t),r=n.top||n.bottom||n.left||n.right;r&&!nt.isActive()?nt.start():!r&&nt.isActive()&&nt.stop()}},pn=(e,t,n)=>{if(!N()||v())return!1;!n&&j()&&Se();let i=ye.selectedElement()!==null;return o.startDrag({x:e,y:t},n||i),o.setPointer({x:e,y:t}),C(`userSelect`,`none`),Ne(e,t),r.hooks.onDragStart(e+window.scrollX,t+window.scrollY),!0},mn=(e,t)=>{let n=i.frozenElements.includes(e),r=i.frozenElements.length===0;if(!n){let n=WY(tY(e),t);ve.set(e,n),r&&Qe(HU(e)??void 0)}o.toggleFrozenElement(e),FI();let a=i.frozenElements.includes(e);if(a||ve.delete(e),i.frozenElements.length===0){Se(),o.unfreeze();return}pL(i.frozenElements),Le(!0),o.setPointer(t),o.setLastGrabbed(a?e:i.frozenElements[i.frozenElements.length-1]),o.freeze(),wn()},hn=()=>{let e=i.frozenElements.filter(cB),t=e.map(e=>{let t=zN(e)||`element`,n=HU(e)??void 0,r=ve.get(e),i=tY(e);return{element:e,tagName:t,componentName:n,mouseX:r===void 0?i.x+i.width/2:i.x+i.width*r}});if(Se(),e.length===0){o.unfreeze();return}if(e.length===1){dt({element:e[0],cursorX:t[0].mouseX,selectedElements:e,shouldDeactivateAfter:i.wasActivatedByToggle});return}ft({elements:e,labelEntries:t,shouldDeactivateAfter:i.wasActivatedByToggle})},gn=(e,t,n)=>{let a=UY(e,_I),s=a.length>0?a:UY(e,_I,!1);if(s.length===0)return;let c=n&&!i.pendingCommentMode&&!M();if(c&&o.addFrozenElements(s),pL(c?i.frozenElements:s),r.hooks.onDragEnd(s,e),c){let e=s[s.length-1];Le(!0),FI(),o.setPointer(nY(tY(e))),o.setLastGrabbed(e),o.freeze(),wn();return}let l=s[0],u=nY(tY(l));o.setPointer(u),o.setFrozenElements(s);let d=qY(e);if(o.setFrozenDragRect(d),o.freeze(),o.setLastGrabbed(l),i.pendingCommentMode){cn(l,u.x,u.y);return}if(M()){Ke(!1),Ge?un(l,u):ln(l,u);return}let f=i.wasActivatedByToggle&&!t;dt({element:l,cursorX:u.x,selectedElements:s,shouldDeactivateAfter:f,dragRect:d})},_n=e=>{for(let t of i.frozenElements)if(cB(t)&&vZ(e,tY(t)))return t;return null},vn=(e,t,n,a)=>{let c=cB(i.frozenElement)?i.frozenElement:null,l=ye.selectedElement(),u=()=>NI(e,t).find(_I)??null;if(a&&!i.pendingCommentMode&&!M()){let n=u();n!==null&&mn(n,{x:e,y:t});return}let d=u()??(cB(i.detectedElement)?i.detectedElement:null),f=l??d??c;if(!f)return;let p,m,h=d===null&&c===f,g=l===f;if(h)p=s().x,m=s().y;else if(g){let e=nY(tY(f));p=e.x,m=e.y}else p=e,m=t;if(i.pendingCommentMode){cn(f,p,m),ye.clear();return}if(M()){Ke(!1);let{wasIntercepted:e}=r.hooks.onElementSelect(f);if(e)return;ye.clear(),pL([f]),o.setFrozenElement(f);let t={x:p,y:m};o.setPointer(t),o.freeze(),Ge?un(f,t):ln(f,t);return}let _=i.wasActivatedByToggle&&!n;o.setLastGrabbed(f),dt({element:f,cursorX:p,shouldDeactivateAfter:_}),ye.clear()},yn=()=>{p()&&(Mt(),o.cancelDrag(),nt.stop(),C(`userSelect`,``))},bn=(e,t,n,r)=>{if(!p())return;Ae!==null&&(clearTimeout(Ae),Ae=null),Me(null);let i=Dt(e,t),a=i.x>2||i.y>2,s=a?kt(e,t):null;a?o.endDrag():o.cancelDrag(),Mt(),nt.stop(),C(`userSelect`,``),s?gn(s,n,r):vn(e,t,n,r)},xn=kY(),Sn=lZ(),Cn=e=>{let t;try{t=Sn.originalKeyDescriptor?.get?Sn.originalKeyDescriptor.get.call(e):e.key}catch{return!1}let n=t===`Enter`||_Z(e.code),r=d()||u();return n&&r&&!b()&&!ye.isPendingDismiss()&&!i.wasActivatedByToggle?LB(e,`data-react-grab-input`)?!1:(Sn.claimedEvents.add(e),e.preventDefault(),e.stopImmediatePropagation(),!0):!1};xn.addDocumentListener(`keydown`,BM(Cn),{capture:!0}),xn.addDocumentListener(`keyup`,BM(Cn),{capture:!0}),xn.addDocumentListener(`keypress`,BM(Cn),{capture:!0});let wn=()=>{tt.clearHistory(),ye.clear()},Tn=(e,t=!1)=>{o.setFrozenElement(e),o.freeze(),ye.select(e,{shouldPromptBeforeMouseHandoff:t});let n=nY(tY(e));o.setPointer(n),i.contextMenuPosition!==null&&o.showContextMenu(n,e)},En=()=>{ye.showDismissPrompt()&&ee(e=>e+1)},Dn=()=>{ye.clear(),o.unfreeze(),wn()},On=()=>{let e=ye.takeSelection(i.frozenElement);if(!e){Dn();return}let t=nY(tY(e));wn(),o.setLastGrabbed(e),dt({element:e,cursorX:t.x,shouldDeactivateAfter:i.wasActivatedByToggle})},kn=e=>pN.has(e.key)?e.key:e.key===`Tab`?e.shiftKey?`ArrowLeft`:`ArrowRight`:null,An=(e,t={})=>{if(!d()||b()||j()||ye.isPendingDismiss()&&!t.allowPendingKeyboardSelection)return!1;let n=kn(e);if(!n||pe())return!1;let r=P(),i=!r;if(!r){let e=RM()?.getBoundingClientRect();r=e?PI(e.left+e.width/2,e.top+e.height/2):PI(window.innerWidth/2,window.innerHeight/2)}if(!r)return!1;let a=n===`ArrowUp`||n===`ArrowDown`,o=tt.findNext(n,r);if(!o&&!a&&!i)return!1;let s=o??r;return e.preventDefault(),e.stopPropagation(),Tn(s,!0),!0},jn=e=>e.metaKey||e.ctrlKey||e.altKey||e.repeat||dB(e)||!d()||_()||v()||pe()?null:i.frozenElement||pt(),Mn=e=>{let t=jn(e);if(!t)return null;let n=GV(r.store.actions,e);return n?{element:t,action:n}:null},Nn=(e,t)=>{let n=tY(e);return Cr({element:e,filePath:i.selectionFilePath??void 0,lineNumber:i.selectionLineNumber??void 0,tagName:zN(e)||void 0,componentName:Ze(),position:t,shouldDeferHideContextMenu:!1,performWithFeedbackOptions:{fallbackBounds:n,fallbackSelectionBounds:[n],position:t}})},Pn=/^[a-zA-Z0-9-]$/,Fn=e=>{if(!e.key||e.key.length!==1||!Pn.test(e.key))return!1;let t=jn(e);return!t||!de.trigger(t,{x:s().x,y:s().y},{initialSearchQuery:e.key})?!1:(rn(),e.preventDefault(),e.stopImmediatePropagation(),!0)},In=e=>{let t=Mn(e);if(!t)return!1;let{element:n,action:r}=t;if(b())return an(r.id)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1;let i={x:s().x,y:s().y};return r.onAction(Nn(n,i)),e.preventDefault(),e.stopImmediatePropagation(),!0},Ln=e=>{if(e.key?.toLowerCase()!==`o`||!d()||!(e.metaKey||e.ctrlKey))return!1;let t=i.selectionFilePath,n=i.selectionLineNumber;return t?(e.preventDefault(),e.stopPropagation(),r.hooks.onOpenFile(t,n??void 0)||LI(t,n??void 0,r.hooks.transformOpenFileUrl),!0):!1},Rn=e=>{if(!d()||_()||i.contextMenuPosition!==null||de.isOpen())return!1;let t=e.key===`F10`&&e.shiftKey,n=e.key===`ContextMenu`;if(!t&&!n)return!1;let r=i.frozenElements,a=r.length>1,s=(a?r[0]:null)||i.frozenElement||pt();if(!s)return!1;e.preventDefault(),e.stopPropagation();let c=nY(tY(s));return a?pL(r):(pL([s]),o.setFrozenElement(s)),o.setPointer(c),o.freeze(),ln(s,c),!0},zn=Y(()=>ht().map(e=>({tagName:zN(e.element)||`element`,componentName:HU(e.element)??void 0,depth:e.depth,isLast:e.isLast}))),Bn=Y(()=>({items:zn(),activeIndex:gt()})),Vn=e=>{if(!(!r.store.options.allowActivationInsideInput&&dB(e))&&!(!oX(e,r.store.options)&&((e.metaKey||e.ctrlKey)&&!fN.includes(e.key)&&!_Z(e.code)&&(d()&&!i.wasActivatedByToggle?Kt():u()&&(we(),Te(),o.releaseHold())),!_Z(e.code)||!u()))){if((d()||u())&&!b()&&(e.preventDefault(),_Z(e.code)&&e.stopImmediatePropagation()),d()){if(i.wasActivatedByToggle&&r.store.options.activationMode!==`hold`||e.repeat)return;Pe!==null&&window.clearTimeout(Pe),Pe=window.setTimeout(()=>{Kt()},200);return}if(u()&&e.repeat){if(Fe.copyWaiting){let e=Fe.holdTimerFired;Te(),e&&o.activate()}return}if(!(_()||y())&&!u()){let t=r.store.options.keyHoldDuration??100;dB(e)?fB(e)?t+=600:t+=400:pB()&&(t+=600),Te(),o.startHold(t)}}},Hn=e=>{if(!ye.isPendingDismiss())return!1;if(_Z(e.code))return!0;let t=pN.has(e.key),n=Mn(e)!==null;return!t&&!n?!1:t?An(e,{allowPendingKeyboardSelection:!0}):In(e)?(wn(),!0):!1};xn.addWindowListener(`keydown`,BM(e=>{if(kn(e)&&dB(e)||Hn(e))return;if(Cn(e),!T()){oX(e,r.store.options)&&!e.repeat&&O(e=>e+1);return}let t=_Z(e.code)&&u()&&!b(),n=LB(e,gN);if(b()&&oX(e,r.store.options)&&!e.repeat&&!n){e.preventDefault(),e.stopPropagation(),Xt();return}if(e.key===`Escape`&&pe()){ae()!==null&&kr();return}let a=LB(e,`data-react-grab-ignore-events`)&&!t;if(b()||a)return b()&&!n&&In(e)||(e.key===`Escape`&&(b()?Xt():i.wasActivatedByToggle&&Kt()),a&&pN.has(e.key)&&An(e)),void 0;if(p()&&At(e)){e.repeat||jt(),e.preventDefault(),e.stopPropagation();return}if(e.key===`Escape`&&(u()||i.wasActivatedByToggle)){Kt();return}d()&&!fN.includes(e.key)&&e.preventDefault();let o=Date.now()-Re<200;An(e)||Ln(e)||Rn(e)||In(e)||Fn(e)||o||Vn(e)}),{capture:!0}),xn.addWindowListener(`keyup`,BM(e=>{if(Cn(e))return;if(At(e)&&h()&&(Mt(),e.preventDefault(),e.stopPropagation()),e.key===`Shift`&&j()){p()&&yn(),hn();return}if(LB(e,`data-react-grab-ignore-events`))return;let t=cZ(r.store.options),n=t.metaKey||t.ctrlKey?IB()?!e.metaKey:!e.ctrlKey:t.shiftKey&&!e.shiftKey||t.altKey&&!e.altKey,a=r.store.options.activationKey?typeof r.store.options.activationKey==`function`?r.store.options.activationKey(e):iX(r.store.options.activationKey)(e):eX(e.key,e.code);if(y()||ze){(a||n)&&(He(),Kt());return}if(!u()&&!d()||b())return;let s=!!r.store.options.activationKey,c=r.store.options.activationMode===`hold`,l=p();if(d()){let e=fe();if(n){if(i.wasActivatedByToggle&&r.store.options.activationMode!==`hold`||e)return;Kt()}else if(c&&a){if(Pe!==null&&(window.clearTimeout(Pe),Pe=null),e||l)return;Kt()}else!s&&a&&Pe!==null&&(window.clearTimeout(Pe),Pe=null);return}if(a||n){if(i.wasActivatedByToggle&&r.store.options.activationMode!==`hold`)return;if(u()||Fe.holdTimerFired&&n){we();let t=(Fe.startTimestamp?Date.now()-Fe.startTimestamp:0)>=200,n=Fe.holdTimerFired&&t&&(r.store.options.allowActivationInsideInput||!dB(e));Te(),n?o.activate():o.releaseHold()}else Kt()}}),{capture:!0}),xn.addDocumentListener(`copy`,()=>{u()&&(Fe.copyWaiting=!0)}),xn.addWindowListener(`keypress`,BM(Cn),{capture:!0}),xn.addWindowListener(`pointermove`,BM(e=>{if(!e.isPrimary)return;let t=e.pointerType===`touch`;if(o.setTouchMode(t),!LB(e,`data-react-grab-ignore-events`)&&!be()&&!(t&&!u()&&!d())){if((t?u():d())&&!b()&&f()&&!e.shiftKey&&!j()){if(ye.consumeMouseHandoff()){En();return}o.unfreeze(),wn()}fn(e.clientX,e.clientY,e.shiftKey)}}),{passive:!0}),xn.addWindowListener(`pointerdown`,BM(e=>{if(e.button===0&&e.isPrimary&&(o.setTouchMode(e.pointerType===`touch`),_e=!1,!LB(e,`data-react-grab-ignore-events`))){if(fe()){tn(e.clientX,e.clientY)&&(_e=!0,e.preventDefault(),e.stopImmediatePropagation());return}if(b()){let t=Tt();t&&e.clientX>=t.x&&e.clientX<=t.x+t.width&&e.clientY>=t.y&&e.clientY<=t.y+t.height?Yt():Xt();return}if(ye.isPendingDismiss()){e.preventDefault(),e.stopImmediatePropagation();return}if(v()){e.preventDefault(),e.stopImmediatePropagation();return}pn(e.clientX,e.clientY,e.shiftKey)&&(e.pointerId!==void 0&&document.documentElement.setPointerCapture(e.pointerId),e.preventDefault(),e.stopImmediatePropagation())}}),{capture:!0}),xn.addWindowListener(`pointerup`,BM(e=>{if(e.button!==0||!e.isPrimary||LB(e,`data-react-grab-ignore-events`)||fe())return;let t=N()||v()||p(),n=e.metaKey||e.ctrlKey;bn(e.clientX,e.clientY,n,e.shiftKey),t&&(e.preventDefault(),e.stopImmediatePropagation())}),{capture:!0}),xn.addWindowListener(`contextmenu`,BM(e=>{if(!N()||_()||b()||de.isOpen())return;let t=LB(e,`data-react-grab-ignore-events`),n={x:e.clientX,y:e.clientY},r=t&&i.frozenElements.length>1?_n(n):null,a=ye.isPendingDismiss();if(t&&!r&&!a&&!_t())return;if(fe()){e.preventDefault();return}e.preventDefault(),e.stopPropagation();let s=r??PI(e.clientX,e.clientY);if(!s)return;let c=i.frozenElements;c.length>1&&c.includes(s)?pL(c):(pL([s]),o.setFrozenElement(s)),o.setPointer(n),o.freeze(),ln(s,n)}),{capture:!0}),xn.addWindowListener(`pointercancel`,BM(e=>{e.isPrimary&&yn()})),xn.addWindowListener(`click`,BM(e=>{if(!LB(e,`data-react-grab-ignore-events`)){if(_e){_e=!1,e.preventDefault(),e.stopImmediatePropagation();return}fe()||(N()||g())&&(e.preventDefault(),e.stopImmediatePropagation(),i.wasActivatedByToggle&&!b()&&!e.shiftKey&&(u()?o.setWasActivatedByToggle(!1):Kt()))}}),{capture:!0}),xn.addDocumentListener(`visibilitychange`,()=>{if(document.hidden){o.clearGrabbedBoxes();let e=i.activationTimestamp;d()&&!b()&&e!==null&&Date.now()-e>500&&Kt()}}),xn.addWindowListener(`blur`,()=>{yn(),u()&&(we(),o.releaseHold(),Te()),Se()}),xn.addWindowListener(`focus`,()=>{Re=Date.now()}),xn.addWindowListener(`focusin`,e=>{LB(e,VM)&&e.stopPropagation()},{capture:!0});let Un=()=>{if(!(i.isTouchMode&&!u()&&!d())&&!be()&&!f()&&!p()&&i.frozenElements.length===0){let e=PI(s().x,s().y);o.setDetectedElement(e)}},Wn=null,Gn=null,Kn=()=>{GY(),Un(),o.incrementViewportVersion(),o.updateContextMenuPosition()};xn.addWindowListener(`scroll`,Kn,{capture:!0});let qn=window.innerWidth,Jn=window.innerHeight;xn.addWindowListener(`resize`,()=>{let e=window.innerWidth,t=window.innerHeight;if(qn>0&&Jn>0){let n=e/qn,r=t/Jn,i=Math.abs(n-r)<SN,a=Math.abs(n-1)>SN;i&&a&&o.setPointer({x:s().x*n,y:s().y*r})}qn=e,Jn=t,Kn()});let Yn=window.visualViewport;if(Yn){let{signal:e}=xn;Yn.addEventListener(`resize`,Kn,{signal:e}),Yn.addEventListener(`scroll`,Kn,{signal:e})}let Xn=()=>{Gn===null&&(Gn=rI(()=>{Gn=null,o.incrementViewportVersion()}))};bR(()=>{if(r.store.theme.enabled&&(d()||_()||i.labelInstances.length>0||i.grabbedBoxes.length>0)){if(Wn!==null)return;Wn=window.setInterval(()=>{Xn()},100);return}Wn!==null&&(window.clearInterval(Wn),Wn=null),Gn!==null&&(iI(Gn),Gn=null)}),DR(()=>{Wn!==null&&window.clearInterval(Wn),Gn!==null&&iI(Gn)}),xn.addDocumentListener(`copy`,BM(e=>{b()||LB(e,`data-react-grab-ignore-events`)||N()&&e.preventDefault()}),{capture:!0}),DR(()=>{xn.abort(),Ae!==null&&window.clearTimeout(Ae),Pe&&window.clearTimeout(Pe),He(),he?.(),he=null,ge?.(),ge=null,rt.forEach(e=>window.clearTimeout(e)),rt.clear(),ot.cancelAllFades(),nt.stop(),C(`userSelect`,``),C(`touchAction`,``),Wt(null),Sn.restore(),LM(null)});let{root:Zn,host:Qn}=sY(UJ);DR(EY(Qn).cleanup);let $n=Y(()=>r.store.theme.enabled),er=Y(()=>r.store.theme.selectionBox.enabled),tr=Y(()=>r.store.theme.elementLabel.enabled),nr=Y(()=>r.store.theme.dragBox.enabled),rr=Y(()=>y()||ne()&&!f()||de.isInteracting()),ir=Y(()=>Pt().length>0),ar=Y(()=>!$n()||!er()||rr()?!1:ir()?!0:bt()),or=Y(()=>{let e=yt();if(e)return zN(e)||void 0}),sr=Y(()=>!$n()||fe()||!tr()||rr()?!1:bt()),cr=new Map,lr=e=>{let t=e.elements?.filter(cB)??[],n=e.element,r=null;t.length>0?r=t.map(tY):n&&cB(n)&&(r=[tY(n)]);let i=e.bounds,a=e.boundsMultiple;r&&(i=r.length>1?JY(sX(r)):r[0],e.boundsMultiple!==void 0&&(a=e.boundsMultiple.length>1&&e.boundsMultiple.length===e.elements?.length?r:[i]));let o=cr.get(e.id),s=o?.boundsMultiple,c=s===a||s!==void 0&&a!==void 0&&s.length===a.length&&s.every((e,t)=>e.x===a[t].x&&e.y===a[t].y&&e.width===a[t].width&&e.height===a[t].height);if(o&&o.status===e.status&&o.errorMessage===e.errorMessage&&o.bounds.x===i.x&&o.bounds.y===i.y&&o.bounds.width===i.width&&o.bounds.height===i.height&&c)return o;let l=i.x+i.width/2,u=i.width/2,d;d=e.mouseXOffsetRatio!==void 0&&u>0?l+e.mouseXOffsetRatio*u:e.mouseXOffsetFromCenter===void 0?e.mouseX??l:l+e.mouseXOffsetFromCenter;let f={...e,bounds:i,boundsMultiple:a,mouseX:d};return cr.set(e.id,f),f},ur=Y(()=>{if(!$n()||!r.store.theme.grabbedBoxes.enabled)return[];c();let e=new Set(i.labelInstances.map(e=>e.id));for(let t of cr.keys())e.has(t)||cr.delete(t);return i.labelInstances.map(lr)}),dr=Y(()=>!$n()||!r.store.theme.grabbedBoxes.enabled?[]:(c(),i.grabbedBoxes.map(e=>!e.element||!document.body.contains(e.element)?e:{...e,bounds:tY(e.element)}))),fr=Y(()=>$n()&&nr()&&N()&&Ot()),pr=Y(()=>_()?`processing`:`hover`),mr=Y(()=>{if(!$n())return!1;let e=tr(),t=b(),n=_(),r=N(),i=p(),a=!!P(),o=ne(),s=f();return!e||t||o&&!s?!1:n?!0:r&&!i&&a}),hr=Y(()=>{c();let e=i.contextMenuElement;return e?tY(e):null}),gr=Y(()=>(c(),i.contextMenuPosition)),_r=Y(()=>{let e=i.contextMenuElement;if(!e)return;let t=i.frozenElements.length;return t>1?`${t} elements`:zN(e)||void 0}),[vr]=cY(()=>i.frozenElements.length>1?null:i.contextMenuElement),[yr]=SR(()=>i.contextMenuElement,async e=>e?VU(e):null),br=async e=>{o.incrementSelectionInteractionLockDepth();try{return await e()}finally{o.decrementSelectionInteractionLockDepth()}},xr=(e,t,n,r,a)=>async c=>{await br(async()=>{let l=a?.fallbackBounds??null,u=a?.fallbackSelectionBounds??[],d=a?.position??i.contextMenuPosition??s(),f=St(),p=hr()??l,m=t.length>1,h=m?JY(sX(f)):p,g=i.wasActivatedByToggle,_;if(_=m?f:p?[p]:u,o.hideContextMenu(),h){let i=m?h.x+h.width/2:d.x,a=ot.createInstance(h,n||`element`,r,`copying`,{element:e,mouseX:i,elements:m?t:void 0,boundsMultiple:_}),o=!1,s;try{o=await c(),o||(s=`Failed to copy`)}catch(e){s=AY(e,`Action failed`)}ot.updateAfterCopy(a,o,s)}else try{await c()}catch{}g?Kt():o.unfreeze()})},Sr=()=>{setTimeout(()=>{o.hideContextMenu()},0)},Cr=e=>{let{element:t,filePath:n,lineNumber:a,tagName:s,componentName:c,position:l,performWithFeedbackOptions:u,shouldDeferHideContextMenu:f,onBeforeCopy:p,onBeforePrompt:m,customEnterPromptMode:h}=e,g=i.frozenElements.length>0?i.frozenElements:[t],_=f?Sr:o.hideContextMenu,v={element:t,elements:g,filePath:n,lineNumber:a,componentName:c,tagName:s,enterPromptMode:h??(()=>{ot.clearAll(),rn(),m?.(),Ee(t,l.x,l.y),o.setPointer({x:l.x,y:l.y}),o.setFrozenElement(t),De(),d()||Gt(),_()}),enterEditMode:()=>{en(t,l,{filePath:n,lineNumber:a,componentName:c,tagName:s})&&rn(),_()},copy:()=>{rn(),p?.(),dt({element:t,cursorX:l.x,selectedElements:g.length>1?g:void 0,shouldDeactivateAfter:i.wasActivatedByToggle}),_()},hooks:{transformHtmlContent:r.hooks.transformHtmlContent,onOpenFile:r.hooks.onOpenFile,transformOpenFileUrl:r.hooks.transformOpenFileUrl},performWithFeedback:xr(t,g,s,c,u),hideContextMenu:_,cleanup:()=>{i.wasActivatedByToggle?Kt():o.unfreeze()}},y=r.hooks.transformActionContext(v);return{...v,...y}},wr=Y(()=>{let e=i.contextMenuElement;if(!e)return;let t=yr(),n=i.contextMenuPosition??s();return Cr({element:e,filePath:t?.filePath,lineNumber:t?.lineNumber??void 0,tagName:_r(),componentName:vr(),position:n,shouldDeferHideContextMenu:!0,onBeforeCopy:()=>{ye.clear()},customEnterPromptMode:()=>{ot.clearAll(),rn(),o.clearInputText(),o.enterPromptMode(n,e),Sr()}})}),Tr=()=>{setTimeout(()=>{o.hideContextMenu(),Kt()},0)},Er=()=>{if(!me)return null;let e=me.getBoundingClientRect(),t=CZ(e);return t===`left`||t===`right`?{x:t===`left`?e.right:e.left,y:e.top+e.height/2,edge:t}:{x:e.left+e.width/2,y:t===`top`?e.bottom:e.top,edge:t}},Dr=()=>{let e=Er();if(e)return e;let t=de.state();return t?{x:t.position.x,y:t.position.y,edge:`bottom`}:null},Or=(e,t)=>{let n=null,r=()=>{let i=e();i&&t(i),n=rI(r)};return r(),()=>{n!==null&&(iI(n),n=null)}};bR(()=>{if(!_t())return;let e=Or(Er,ue);DR(()=>{e(),ue(null)})});let kr=()=>{he?.(),he=null,oe(null)},Ar=()=>{o.hideContextMenu(),kr(),de.dismiss()},jr=()=>{ae()===null?(o.hideContextMenu(),de.isOpen()&&de.closePreservingRenderer(),he?.(),he=Or(Er,oe)):kr()},Mr=e=>{Ce({defaultAction:e})},Nr=e=>{let t=i.labelInstances.find(t=>t.id===e);if(!t?.element||!cB(t.element))return;let n=t.element,r=nY(tY(n)),a={x:t.mouseX??r.x,y:r.y},s=t.elements&&t.elements.length>0?t.elements.filter(e=>cB(e)):[n];setTimeout(()=>{kr(),de.isOpen()&&de.closePreservingRenderer(),d()||(o.setWasActivatedByToggle(!0),Gt()),o.setPointer(a),o.setFrozenElements(s),s.length>1&&t.bounds&&o.setFrozenDragRect(qY(t.bounds)),o.freeze(),o.showContextMenu(a,n)},0)};bR(()=>{let e=r.store.theme.hue;e===0?Zn.style.filter=``:Zn.style.filter=`hue-rotate(${e}deg)`}),r.store.theme.enabled&&Promise.resolve().then(()=>(OJ(),oW)).then(({ReactGrabRenderer:e})=>{t||(n=fz(()=>X(e,{get selectionVisible(){return ar()},get selectionBounds(){return Tt()},get selectionBoundsMultiple(){return Ft()},get selectionShouldSnap(){return i.frozenElements.length>0||Pt().length>0},get selectionElementsCount(){return i.frozenElements.length},get frozenLabelEntries(){return Lt()},get pendingShiftPreviewEntry(){return Rt()??void 0},get selectionFilePath(){return i.selectionFilePath??void 0},get selectionLineNumber(){return i.selectionLineNumber??void 0},get selectionTagName(){return or()},get selectionComponentName(){return Ze()},get selectionLabelVisible(){return sr()},selectionLabelStatus:`idle`,get hierarchyState(){return Bn()},get hierarchyMenuPosition(){return le()},get labelInstances(){return ur()},get dragVisible(){return fr()},get dragBounds(){return Nt()},get grabbedBoxes(){return dr()},get mouseX(){return oB(()=>i.frozenElements.length>1)()?void 0:Bt()??zt().x},get isFrozen(){return f()||d()||ne()},get inputValue(){return i.inputText},get isPromptMode(){return b()},onShowContextMenuInstance:Nr,get onLabelInstanceHoverChange(){return ot.handleHoverChange},get onInputChange(){return o.setInputText},onInputSubmit:()=>void Yt(),onToggleExpand:$t,get selectionLabelShakeCount(){return k()},onConfirmDismiss:Zt,get discardPrompt(){return oB(()=>!!ye.isPendingDismiss())()?{isKeyboardSelection:!0,onConfirm:Zt,onCopy:On}:S()?{onConfirm:Zt,onCancel:Qt}:void 0},get toolbarVisible(){return r.store.theme.toolbar.enabled},get isActive(){return d()},onToggleActive:sn,onActivateAction:on,get activeActionId(){return $e()},get enabled(){return T()},get shakeCount(){return D()},onToolbarStateChange:e=>{A(e),e.enabled!==T()&&(E(e.enabled),e.enabled||(qt(),Ar())),OZ.forEach(t=>t(e))},onSubscribeToToolbarStateChanges:e=>(OZ.add(e),()=>{OZ.delete(e)}),onToolbarSelectHoverChange:re,onToolbarRef:e=>{me=e},get contextMenuPosition(){return gr()},get contextMenuBounds(){return hr()},get contextMenuTagName(){return _r()},get contextMenuComponentName(){return vr()},get contextMenuHasFilePath(){return!!yr()?.filePath},get actions(){return r.store.actions},get actionContext(){return wr()},onContextMenuDismiss:Tr,onContextMenuHide:Sr,get toolbarMenuPosition(){return ae()},get toolbarMenuActions(){return r.store.actions.filter(e=>e.showInToolbarMenu===!0)},get defaultActionId(){return te()?.defaultAction??`copy`},onSetDefaultAction:Mr,onToggleToolbarMenu:jr,onToolbarMenuDismiss:kr,get editPanelState(){return de.state()},get editPanelPosition(){return se()},get onEditPanelDismiss(){return de.dismiss},get onEditPanelSubmit(){return de.submit},get onEditPanelPendingEditsChange(){return de.setPendingEdits},get onEditPanelInteractingChange(){return de.setInteracting}}),Zn))}).catch(e=>{console.warn(`[react-grab] Failed to load renderer:`,e)});let Pr={activate:()=>{o.setPendingCommentMode(!1),!d()&&T()&&Jt()},deactivate:()=>{(d()||_())&&Kt()},toggle:()=>{d()?Kt():T()&&Jt()},comment:dn,isActive:()=>d(),isEnabled:()=>T(),setEnabled:e=>{e!==T()&&(E(e),Ce({enabled:e,collapsed:!e}),e||(qt(),Ar()))},getToolbarState:()=>te()??BV(),setToolbarState:e=>{let t=te()??BV(),n=e.collapsed??t?.collapsed??!1,r={edge:e.edge??t?.edge??`bottom`,ratio:e.ratio??t?.ratio??.5,collapsed:n,enabled:e.enabled??!n,defaultAction:e.defaultAction??t?.defaultAction??`copy`};VV(r),A(r),r.enabled!==T()&&(E(r.enabled),r.enabled||(qt(),Ar())),OZ.forEach(e=>e(r))},onToolbarStateChange:e=>(OZ.add(e),()=>{OZ.delete(e)}),reset:()=>{qt(),Ar(),o.clearGrabbedBoxes(),o.clearLabelInstances(),o.setSelectionSource(null,null)},dispose:()=>{t=!0,DZ=!1,n?.(),he?.(),he=null,ge?.(),ge=null,OZ.clear(),e()},copyElement:async e=>{let t=Array.isArray(e)?e:[e];return t.length!==0&&await ct(t)},getSource:async e=>{let t=await VU(e);return t?{filePath:t.filePath,lineNumber:t.lineNumber,componentName:t.componentName}:null},getStackContext:e=>$U(e,{maxLines:r.store.options.maxContextLines}),getState:()=>({isActive:d(),isDragging:p(),isCopying:_(),isPromptMode:b(),isSelectionBoxVisible:!!ar(),isDragBoxVisible:!!fr(),targetElement:pt(),dragBounds:Nt()??null,grabbedBoxes:[...Vt()],labelInstances:[...Ht()],selectionFilePath:i.selectionFilePath,toolbarState:te()}),setOptions:e=>{r.setOptions(e)},registerPlugin:e=>{r.register(e,Pr)},unregisterPlugin:e=>{r.unregister(e)},getPlugins:()=>r.getPluginNames(),getDisplayName:HU};for(let e of EZ)r.register(e,Pr);return setTimeout(()=>{ZF(!0)},EN),Pr})}})),jZ=r({DEFAULT_THEME:()=>$X,commentPlugin:()=>bZ,formatElementInfo:()=>nW,generateSnippet:()=>TZ,getGlobalApi:()=>NZ,getStack:()=>NU,init:()=>kZ,isInstrumentationActive:()=>fP,openPlugin:()=>SZ,registerPlugin:()=>LZ,setGlobalApi:()=>PZ,unregisterPlugin:()=>RZ}),MZ,NZ,PZ,FZ,IZ,LZ,RZ,zZ=t((()=>{AZ(),mR(),aW(),MZ=null,NZ=()=>typeof window>`u`?MZ:window.__REACT_GRAB__??MZ??null,PZ=e=>{MZ=e,typeof window<`u`&&(e?window.__REACT_GRAB__=e:delete window.__REACT_GRAB__)},FZ=[],IZ=e=>{for(;FZ.length>0;){let t=FZ.shift();t&&e.registerPlugin(t)}},LZ=e=>{let t=NZ();if(t){t.registerPlugin(e);return}FZ.push(e)},RZ=e=>{let t=NZ();if(t){t.unregisterPlugin(e);return}let n=FZ.findIndex(t=>t.name===e);n!==-1&&FZ.splice(n,1)},typeof window<`u`&&!window.__REACT_GRAB_DISABLED__&&(window.__REACT_GRAB__?MZ=window.__REACT_GRAB__:(MZ=kZ(),window.__REACT_GRAB__=MZ),IZ(MZ),window.dispatchEvent(new CustomEvent(`react-grab:init`,{detail:MZ})))}));Sr(),Br(),vD();var BZ=`linear-grab:context-copied`,VZ=`linear-grab:picker-activated`,HZ=`linear-grab:picker-finished`,UZ=0,WZ=null;function GZ(e){!e||e.grabbedAt===UZ||Tr().then(t=>{if(t.workflowMode!==`local`||e.grabbedAt===UZ)return;let n=()=>{UZ=e.grabbedAt,navigator.clipboard.writeText(mD(e,t)).then(()=>window.dispatchEvent(new CustomEvent(BZ))).catch(()=>{UZ=0})};e.source?.filePath?(WZ&&clearTimeout(WZ),WZ=null,n()):(WZ&&clearTimeout(WZ),WZ=setTimeout(n,900))})}function KZ(e,t=Date.now()){return{tagName:e.tagName||void 0,componentName:e.componentName||void 0,content:e.textContent?e.textContent.slice(0,500):``,source:e.filePath?{filePath:e.filePath,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null,componentName:e.componentName??null}:null,stackContext:void 0,pageUrl:location.href,grabbedAt:t}}function qZ(e,t){let n=null,r=0;return{plugin:{name:`linear-grab`,hooks:{onElementSelect:i=>{r=Date.now(),n=Tr().then(e=>e.captureShots?XA(i):null);let a=t?.(),o={tagName:i.tagName?.toLowerCase()||void 0,componentName:a?.getDisplayName?.(i)||void 0,content:(i.textContent??``).slice(0,500),source:null,stackContext:void 0,pageUrl:location.href,grabbedAt:r};e([o]);try{a?.getSource?.(i)?.then(t=>{t?.filePath&&e([{...o,source:{filePath:t.filePath,lineNumber:t.lineNumber??null,columnNumber:t.columnNumber??null,componentName:t.componentName??o.componentName??null}}])})}catch{}}}},handleSelection(t){let i=r&&Date.now()-r<4e3?r:Date.now(),a=t.map((e,t)=>KZ(e,i+t));if(!a.length)return;e(a);let o=n;n=null,o&&o.then(t=>{t&&e([{...a[0],screenshotDataUrl:t},...a.slice(1)])})}}}var JZ=!1;async function YZ(){if(xr||JZ)return;JZ=!0;let e=await Promise.resolve().then(()=>(zZ(),jZ));try{e.init()}catch{JZ=!1;return}let t=qZ(e=>{kr(e),GZ(e[0])},()=>e.getGlobalApi());e.registerPlugin(t.plugin),qA(),window.addEventListener(`react-grab:element-selected`,e=>{t.handleSelection(e.detail.elements??[])})}async function XZ(){if(xr){let e=await chrome.runtime.sendMessage({type:`grab/activate`});if(e&&e.ok===!1)throw Error(e.error??`Cannot activate the picker on this page.`);return}await YZ();let e=await Promise.resolve().then(()=>(zZ(),jZ));window.dispatchEvent(new CustomEvent(VZ));let t=e.getGlobalApi();if(t?.activate?.(),typeof t?.isActive==`function`){let e=!1,n=0,r=setInterval(()=>{n+=1;let i=!1;try{i=t.isActive()}catch{}if(i){e=!0;return}(e||n>=8)&&(clearInterval(r),window.dispatchEvent(new CustomEvent(HZ)))},250);setTimeout(()=>clearInterval(r),3e5)}}function ZZ(e){if(!xr)return()=>{};let t=t=>{t?.type===`grab/updated`&&e()};return chrome.runtime.onMessage.addListener(t),()=>chrome.runtime.onMessage.removeListener(t)}var QZ=2500;function $Z(e){let t=e.x+e.w/2,n=e.y+e.h/2,r=document.elementFromPoint(t,n)??document.body,i=t=>{let n=t.getBoundingClientRect();return n.left<=e.x&&n.top<=e.y&&n.right>=e.x+e.w&&n.bottom>=e.y+e.h};for(;r!==document.body&&!i(r);)r=r.parentElement??document.body;return r}async function eQ(e){let t=null,n=document.createElement(`video`);try{t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:`browser`},audio:!1,preferCurrentTab:!0,selfBrowserSurface:`include`}),n.srcObject=t,n.muted=!0,n.playsInline=!0,await n.play(),await new Promise(e=>setTimeout(e,250));let r=n.videoWidth/window.innerWidth,i=n.videoHeight/window.innerHeight;if(!n.videoWidth||r<=0||i<=0)return null;let a=document.createElement(`canvas`);a.width=Math.max(1,Math.round(e.w*r)),a.height=Math.max(1,Math.round(e.h*i));let o=a.getContext(`2d`);return o?(o.drawImage(n,e.x*r,e.y*i,e.w*r,e.h*i,0,0,a.width,a.height),a.toDataURL(`image/png`)):null}catch(e){return console.warn(`[linear-grab] tab-frame region capture failed:`,e),null}finally{n.srcObject=null,t?.getTracks().forEach(e=>e.stop())}}function tQ(){return new Promise(e=>{let t=document.createElement(`div`);t.setAttribute(`data-linear-grab`,`true`),t.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:crosshair;user-select:none;`;let n=document.createElement(`div`);n.style.cssText=`position:fixed;display:none;border:2px solid #5e6ad2;border-radius:4px;box-shadow:0 0 0 100000px rgba(0,0,0,0.35);pointer-events:none;`,t.appendChild(n),document.body.appendChild(t);let r=0,i=0,a=!1,o=e=>({x:Math.min(r,e.clientX),y:Math.min(i,e.clientY),w:Math.abs(e.clientX-r),h:Math.abs(e.clientY-i)}),s=()=>{t.remove(),window.removeEventListener(`keydown`,l,!0)},c=()=>{s(),e(null)},l=e=>{e.key===`Escape`&&(e.stopPropagation(),c())};window.addEventListener(`keydown`,l,!0),t.addEventListener(`pointerdown`,e=>{a=!0,r=e.clientX,i=e.clientY,t.setPointerCapture(e.pointerId)}),t.addEventListener(`pointermove`,e=>{if(!a)return;let t=o(e);n.style.display=`block`,n.style.left=`${t.x}px`,n.style.top=`${t.y}px`,n.style.width=`${t.w}px`,n.style.height=`${t.h}px`}),t.addEventListener(`pointerup`,t=>{let n=o(t);if(s(),n.w<8||n.h<8)return e(null);($Z(n).querySelectorAll(`*`).length>QZ?eQ(n):Promise.race([ZA(n),new Promise(e=>setTimeout(()=>{console.warn(`[linear-grab] region capture timed out after 4s — trying a tab frame`),e(null)},4e3))]).then(e=>e??eQ(n))).then(t=>{if(!t)return e(null);e({tagName:`region`,componentName:void 0,content:`Region capture ${Math.round(n.w)}×${Math.round(n.h)}`,source:null,stackContext:void 0,screenshotDataUrl:t,pageUrl:location.href,grabbedAt:Date.now()})})})})}Br(),Sr(),vD();var nQ=N(`<span class="text-text-faint ml-auto text-[10.5px] font-normal normal-case tabular-nums">`),rQ=N(`<details open class=group><summary class="text-text-dim hover:text-text flex cursor-pointer items-center gap-1.5 text-[11px] font-semibold tracking-wide uppercase select-none"><span aria-hidden class="text-text-faint inline-block w-3 text-center transition-transform group-open:rotate-90">›</span></summary><div class="flex flex-col gap-2 pt-2 pl-4">`),iQ=N(`<p class="text-warn text-[10.5px] leading-snug">Several captures resolve to the same source — this page region likely renders inside an iframe/canvas the picker can't see into. Use <b>Capture region</b> for visual pointers there.`),aQ=N(`<span class="inline-block min-w-[8ch] text-center">`),oQ=N(`<div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5"><span class="text-text-faint text-[10.5px] leading-snug">All elements post into ONE issue. Shift+click / drag selects several at once.</span><div class="flex items-center justify-end gap-1.5">`),sQ=N(`<div class="flex flex-col gap-1.5"><div class="flex gap-1.5">`),cQ=N(`<span class=text-danger>●`),lQ=N(`<div class="flex flex-col gap-1.5"><span class="text-text-faint text-[10.5px] leading-snug">Captures your screen as a looping GIF (max 30s) the coding agent can watch. Pick this tab in the share dialog, then reproduce the issue.`),uQ=N(`<span class="inline-block min-w-[4ch] text-center">Stop`),dQ=N(`<div class="bg-surface border-border flex items-center gap-2 rounded-lg border p-2.5"><span aria-hidden class="bg-danger size-2 shrink-0 animate-pulse rounded-full"></span><span class="text-text min-w-[5ch] text-[12px] tabular-nums"></span><span class="text-text-faint text-[10.5px]">max 0:30`),fQ=N(`<div class="bg-surface border-border flex items-center gap-2 rounded-lg border p-2.5"><span class="text-text-dim text-[12px]">Encoding GIF…`),pQ=N(`<div class="flex h-full flex-col gap-4 overflow-y-auto pt-3 pb-4 pl-3 pr-4">`),mQ=N(`<span class="text-success text-[12px] leading-none">✓`),hQ=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M4 4l8 8M12 4l-8 8">`),gQ=N(`<span class="font-mono text-text-dim break-all text-[11px] leading-snug">`),_Q=N(`<img alt="Element location screenshot"class="border-border bg-bg max-h-32 w-full rounded-md border object-contain">`),vQ=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex items-center justify-between gap-2"><span class="font-mono text-accent min-w-0 truncate text-[12px]"></span><div class="flex shrink-0 items-center gap-1">`),yQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),bQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><rect x=2 y=2.5 width=12 height=11 rx=1.5></rect><path d="m2 10.5 3.5-3 3 2.5 3-2 2.5 2"></path><circle cx=6 cy=6 r=1 fill=currentColor stroke=none>`),xQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 2.5v8M4.5 7.5 8 11l3.5-3.5M2.5 13.5h11">`),SQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M2.5 4h11M6.5 4V2.5h3V4M4 4l.7 9a1.5 1.5 0 0 0 1.5 1.4h3.6A1.5 1.5 0 0 0 11.3 13l.7-9M6.5 7v4.5M9.5 7v4.5">`),CQ=N(`<div class="bg-surface border-border flex flex-col gap-2 rounded-lg border p-2.5"><img alt="Screen recording preview"class="border-border bg-bg max-h-44 w-full rounded-md border object-contain"><span class="text-text-faint text-[10.5px] tabular-nums"> KB · <!>s · <!>×</span><label class="flex cursor-pointer items-center gap-2 select-none"><input type=checkbox class="accent-accent rounded"><span class="text-text text-[12px]">Attach to issue on create</span></label><div class="flex items-center gap-1">`),wQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M6.5 9.5 9.5 6.5M7.5 4.5 9 3a2.5 2.5 0 0 1 3.5 3.5L11 8M8.5 11.5 7 13a2.5 2.5 0 0 1-3.5-3.5L5 8">`);function TQ(e){return(()=>{var t=rQ(),n=t.firstChild;n.firstChild;var r=n.nextSibling;return P(n,()=>e.title,null),P(n,j(M,{get when(){return e.badge},get children(){var t=nQ();return P(t,()=>e.badge),t}}),null),P(r,()=>e.children),t})()}function EQ(){let e=sr(),t=_r(()=>({queryKey:[`grab`],queryFn:Dr})),n=_r(()=>({queryKey:[`settings`],queryFn:Tr})),r=()=>t.data??[],i=()=>!!(n.data?.linearApiKey||n.data?.linearAccessToken),[a,o]=T(null),s=()=>{o(null),XZ().catch(e=>{o(e instanceof Error&&e.message?e.message:`Cannot activate the picker — open your dev app in the active tab first.`)})},c=async()=>{await jr(),e.invalidateQueries({queryKey:[`grab`]})},[l,u]=T(!1),d=async()=>{let e=(r()??[]).map(e=>`- <${e.componentName??e.tagName??`element`}>${e.source?.filePath?` — ${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}`:``}${e.screenshotDataUrl?` (screenshot captured — use Copy PNG to paste it)`:``}`),t=`Captured on ${r()?.[0]?.pageUrl??location.href}:\n${e.join(`
264
- `)}`;try{await navigator.clipboard.writeText(t),u(!0),setTimeout(()=>u(!1),1800)}catch{}},[f,p]=T(null),m=async(e,t)=>{try{await navigator.clipboard.write([new ClipboardItem({"image/png":rj(t)})]),p(e),setTimeout(()=>p(null),1800)}catch{}},[h,g]=T(null),_=async e=>{try{await navigator.clipboard.writeText(mD(e,n.data??{})),g(e.grabbedAt),setTimeout(()=>g(null),1800)}catch{o(`Clipboard was blocked — click the button again.`)}},v=async t=>{await Ar(t),e.invalidateQueries({queryKey:[`grab`]})},[y,b]=T(!1),x=async()=>{o(null),b(!0),window.dispatchEvent(new CustomEvent(VZ));try{let e=await tQ();e?await kr([e]):o(`Region capture failed or was cancelled. On heavy pages a "share this tab" prompt appears — pick THIS tab to capture. Details in the console ([linear-grab]).`)}finally{b(!1),window.dispatchEvent(new CustomEvent(`linear-grab:picker-finished`))}},[S,C]=T(WD());ae(GD(C));let[w,E]=T(0);O(()=>{if(S().phase!==`recording`)return;let e=setInterval(()=>E(Date.now()-(WD().startedAt??Date.now())),250);ae(()=>clearInterval(e))});let k=e=>{let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},[ee,te]=T(`idle`),[A,ne]=T(null),re=async()=>{let e=WD().result;if(!e)throw Error(`No recording available.`);if(e.assetUrl)return e.assetUrl;let t=await Promise.race([kO(e.blob,`recording-${Date.now()}.gif`),new Promise((e,t)=>setTimeout(()=>t(Error(`upload timed out`)),6e4))]);return aO(t),t},ie=async()=>{ne(null),te(`busy`);try{let e=re().then(e=>new Blob([`![Screen recording](${e})`],{type:`text/plain`}));try{await navigator.clipboard.write([new ClipboardItem({"text/plain":e})])}catch{let t=await e;await navigator.clipboard.writeText(await t.text())}te(`copied`),setTimeout(()=>te(`idle`),2e3)}catch{te(`idle`),await le(),ne(`Direct upload is blocked in this browser — copied the GIF instead. Paste it into a Linear comment and Linear uploads it.`)}},oe=()=>{let e=S().result;if(!e)return;let t=document.createElement(`a`);t.href=e.url,t.download=`linear-grab-recording.gif`,t.click()},[se,ce]=T(`idle`),le=async()=>{let e=S().result;if(e){ne(null),ce(`busy`);try{try{await navigator.clipboard.write([new ClipboardItem({"image/gif":e.blob})])}catch{let t=await createImageBitmap(e.blob),n=document.createElement(`canvas`);n.width=t.width,n.height=t.height,n.getContext(`2d`).drawImage(t,0,0);let r=await new Promise((e,t)=>n.toBlob(n=>n?e(n):t(Error(`PNG encode failed`)),`image/png`));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]),ne(`Browser blocks GIF clipboard — copied the first frame as PNG. Use Download for the animation.`)}ce(`copied`),setTimeout(()=>ce(`idle`),2e3)}catch(e){ce(`idle`),ne(e instanceof Error?e.message:`Copy failed.`)}}};return(()=>{var e=pQ();return P(e,j(TQ,{title:`Captured elements`,get badge(){return $e(()=>!!r().length)()?`${r().length}/8`:void 0},get children(){return[j(M,{get when(){return r().length>0},get fallback(){return j(Hj,{title:`No elements captured`,children:`Click "Pick element" below, then use the react-grab overlay on your dev app. Every pick ADDS to this list — Shift+click or drag in the overlay selects several at once. Source info needs a dev build.`})},get children(){var e=oQ(),t=e.firstChild,n=t.firstChild.nextSibling;return P(e,j(We,{get each(){return r()},children:e=>(()=>{var t=vQ(),n=t.firstChild.firstChild,r=n.nextSibling;return P(n,(()=>{var t=$e(()=>!!e.componentName);return()=>t()?`<${e.componentName}>`:$e(()=>!!e.tagName)()?`<${e.tagName}>`:`Element`})()),P(r,j(q,{class:`size-7 px-0`,variant:`ghost`,title:`Copy context for a local agent (Claude Code / Cursor) — includes skills & memory paths`,"aria-label":`Copy context`,onClick:()=>void _(e),get children(){return j(M,{get when(){return h()===e.grabbedAt},get fallback(){return yQ()},get children(){return mQ()}})}}),null),P(r,j(M,{get when(){return e.screenshotDataUrl},get children(){return j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return f()===e.grabbedAt?`Copied!`:`Copy PNG — paste into Claude Code, Linear, Slack…`},"aria-label":`Copy capture as PNG`,onClick:()=>void m(e.grabbedAt,e.screenshotDataUrl),get children(){return j(M,{get when(){return f()===e.grabbedAt},get fallback(){return bQ()},get children(){return mQ()}})}})}}),null),P(r,j(q,{class:`size-7 px-0`,variant:`ghost`,title:`Remove this element`,"aria-label":`Remove element`,onClick:()=>void v(e.grabbedAt),get children(){return hQ()}}),null),P(t,j(M,{get when(){return e.source?.filePath},get children(){var t=gQ();return P(t,()=>e.source.filePath,null),P(t,(()=>{var t=$e(()=>e.source?.lineNumber!=null);return()=>t()?`:${e.source.lineNumber}`:``})(),null),t}}),null),P(t,j(M,{get when(){return e.screenshotDataUrl},get children(){var t=_Q();return D(()=>it(t,`src`,e.screenshotDataUrl)),t}}),null),t})()}),t),P(e,j(M,{get when(){return new Set(r().filter(e=>e.source?.filePath).map(e=>`${e.source.filePath}:${e.source.lineNumber??``}`)).size<r().filter(e=>e.source?.filePath).length},get children(){return iQ()}}),t),P(n,j(q,{class:`h-6 shrink-0 px-2 text-[11px]`,variant:`ghost`,title:`Copy all captures as plain text — paste into a Claude Code session`,onClick:()=>void d(),get children(){var e=aQ();return P(e,()=>l()?`Copied ✓`:`Copy all`),e}}),null),P(n,j(q,{class:`h-6 shrink-0 px-2 text-[11px]`,variant:`ghost`,onClick:c,children:`Clear all`}),null),e}}),(()=>{var e=sQ(),t=e.firstChild;return P(t,j(q,{variant:`primary`,class:`min-w-0 flex-1`,onClick:s,children:`Pick element`}),null),P(t,j(M,{when:!xr,get children(){return j(q,{variant:`ghost`,class:`min-w-0 flex-1`,get loading(){return y()},title:`Drag a rectangle over any part of the page — the shot attaches to the issue`,onClick:()=>void x(),children:`Capture region`})}}),null),P(e,j(M,{get when(){return a()},get children(){return j(Uj,{get message(){return a()}})}}),null),e})()]}}),null),P(e,j(TQ,{title:`Recording`,get badge(){return $e(()=>!!S().result)()?`${(S().result.durationMs/1e3).toFixed(1)}s`:void 0},get children(){return[j(M,{get when(){return S().phase===`idle`||S().phase===`error`},get children(){var e=lQ(),t=e.firstChild;return P(e,j(q,{variant:`ghost`,onClick:()=>void tO(),get children(){return[cQ(),` Record interaction`]}}),t),P(e,j(M,{get when(){return $e(()=>S().phase===`error`)()&&S().error},get children(){return j(Uj,{get message(){return S().error}})}}),null),e}}),j(M,{get when(){return S().phase===`recording`},get children(){var e=dQ(),t=e.firstChild.nextSibling;return t.nextSibling,P(t,()=>k(w())),P(e,j(q,{variant:`primary`,class:`ml-auto`,onClick:()=>void nO(),get children(){return uQ()}}),null),e}}),j(M,{get when(){return S().phase===`processing`},get children(){var e=fQ(),t=e.firstChild;return P(e,j(jj,{}),t),e}}),j(M,{get when(){return $e(()=>S().phase===`ready`)()&&S().result},children:e=>(()=>{var t=CQ(),n=t.firstChild,r=n.nextSibling,a=r.firstChild,o=a.nextSibling,s=o.nextSibling.nextSibling;s.nextSibling;var c=r.nextSibling,l=c.firstChild,u=c.nextSibling;return P(r,()=>(e().blob.size/1024).toFixed(0),a),P(r,()=>(e().durationMs/1e3).toFixed(1),o),P(r,()=>e().width,s),P(r,()=>e().height,null),l.addEventListener(`change`,e=>iO(e.currentTarget.checked)),P(u,j(q,{variant:`ghost`,class:`size-7 px-0`,get loading(){return ee()===`busy`},get disabled(){return!i()},get title(){return i()?`Copy markdown — uploads to Linear, copies embeddable link`:`Connect Linear in Settings first`},"aria-label":`Copy markdown`,onClick:()=>void ie(),get children(){return j(M,{get when(){return ee()===`copied`},get fallback(){return wQ()},get children(){return mQ()}})}}),null),P(u,j(q,{variant:`ghost`,class:`size-7 px-0`,get loading(){return se()===`busy`},title:`Copy GIF — paste into a Linear comment and Linear uploads it`,"aria-label":`Copy GIF`,onClick:()=>void le(),get children(){return j(M,{get when(){return se()===`copied`},get fallback(){return yQ()},get children(){return mQ()}})}}),null),P(u,j(q,{variant:`ghost`,class:`size-7 px-0`,title:`Download GIF`,"aria-label":`Download GIF`,onClick:oe,get children(){return xQ()}}),null),P(u,j(q,{variant:`danger`,class:`ml-auto size-7 px-0`,title:`Discard recording`,"aria-label":`Discard recording`,onClick:rO,get children(){return SQ()}}),null),P(t,j(M,{get when(){return A()},get children(){return j(Uj,{get message(){return A()}})}}),null),D(()=>it(n,`src`,e().url)),D(()=>l.checked=S().attachOnCreate),t})()})]}}),null),e})()}function DQ(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function OQ(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function kQ(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var AQ=(e,t)=>Math.abs(e-t)<1.01,jQ=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},MQ,NQ=()=>{if(MQ!==void 0)return MQ;if(typeof navigator>`u`)return MQ=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return MQ=!0;let e=navigator.maxTouchPoints;return MQ=navigator.platform===`MacIntel`&&e!==void 0&&e>0},PQ=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},FQ=e=>e,IQ=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},LQ=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(PQ(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(PQ(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},RQ={passive:!0},zQ=typeof window>`u`||`onscrollend`in window,BQ=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&zQ,o=0,s=a?null:jQ(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,RQ),a&&r.addEventListener(`scrollend`,u,RQ),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},VQ=(e,t)=>BQ(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),HQ=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},UQ=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},WQ=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:FQ,rangeExtractor:IQ,onChange:()=>{},measureElement:HQ,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=OQ(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!NQ()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,RQ),e.addEventListener(`touchend`,n,RQ),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(NQ()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=OQ(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=OQ(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=DQ(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=OQ(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=qQ(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=OQ(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=OQ(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return kQ(t[GQ(0,t.length-1,r?e=>n[e*2]:e=>kQ(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(NQ()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&AQ(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},GQ=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function KQ(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function qQ(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=KQ(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=GQ(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}function JQ(e){let t=Ve(e),n=new WQ(t),[r,i]=tr(n.getVirtualItems()),[a,o]=T(n.getTotalSize()),s=new Proxy(n,{get(e,t){switch(t){case`getVirtualItems`:return()=>r;case`getTotalSize`:return()=>a();default:return Reflect.get(e,t)}}});return s.setOptions(t),ie(()=>{let e=s._didMount();s._willUpdate(),ae(e)}),E(()=>{s.setOptions(Ve(t,e,{onChange:(t,n)=>{var r;t._willUpdate(),i(ar(t.getVirtualItems(),{key:`index`})),o(t.getTotalSize()),(r=e.onChange)==null||r.call(e,t,n)}})),s._willUpdate(),i(ar(n.getVirtualItems(),{key:`index`})),o(n.getTotalSize())}),s}function YQ(e){return JQ(Ve({observeElementRect:LQ,observeElementOffset:VQ,scrollToFn:UQ},e))}Br();var XQ=3e4,ZQ=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i,QQ={running:[],review:[]},$Q=null,e$=new Set;function t$(e){return e$.add(e),$Q||($Q=setInterval(()=>void i$(),XQ),i$()),()=>{e$.delete(e),!e$.size&&$Q&&(clearInterval($Q),$Q=null)}}function n$(){i$()}function r$(e){return{id:e.id,identifier:e.identifier,title:e.title,stateName:e.state.name,stateColor:e.state.color,delegateName:e.delegate?.displayName??`Agent`,updatedAt:e.updatedAt,prUrl:e.attachments?.find(e=>ZQ.test(e.url))?.url}}async function i$(){try{let e=await Tr();if(!e.linearApiKey&&!e.linearAccessToken)return;let t=(await mO()).filter(e=>!!e.delegate&&e.state.type===`started`).map(r$);QQ={running:t.filter(e=>!e.prUrl),review:t.filter(e=>!!e.prUrl)};for(let e of e$)e(QQ)}catch{}}var a$=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M2.5 8a5.5 5.5 0 1 1 1.6 3.9"></path><path d="M2.5 12.5V8.9h3.6">`),o$=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="m2.5 4 3.5 4-3.5 4M8 12.5h5.5">`),s$=N(`<pre class="font-mono max-h-56 overflow-auto px-2.5 py-2 pr-3 text-[10px] leading-relaxed whitespace-pre-wrap"style=background:#0b0c0e;color:#8b8e98>`),c$=N(`<div class="border-border overflow-clip rounded-lg border"><div class="bg-surface-2 flex h-8 items-center gap-2 pl-2.5 pr-1.5"><span class="text-[11px] font-medium"></span><span class="text-text-faint font-mono text-[10px]"></span><span class=ml-auto>`),l$=N(`<span aria-hidden class="size-2 shrink-0 rounded-full">`),u$=N(`<p class="text-text-faint px-2.5 py-2 text-[10.5px]">No deployment URL yet — logs appear once Vercel picks up the branch.`);function d$(e){let t=sr(),n=_r(()=>({queryKey:[`stage-status`,e.url,e.base],queryFn:()=>KO(e.url,e.base),refetchInterval:e=>e.state.data?.state===`success`||e.state.data?.state===`failure`||e.state.data?.state===`error`?!1:8e3,retry:0})),r=()=>![`success`,`failure`,`error`].includes(n.data?.state??`pending`),[i,a]=T(!1),o=_r(()=>({queryKey:[`deploy-logs`,n.data?.url??e.url],queryFn:()=>qO(n.data.url),enabled:i()&&!!n.data?.url,refetchInterval:()=>r()?1e4:!1,retry:0})),s,c=!0;O(()=>{o.data?.logs,!(!s||!c)&&requestAnimationFrame(()=>{s&&(s.scrollTop=s.scrollHeight)})});let l=vr(()=>({mutationFn:()=>JO(e.url,e.base),onSuccess:()=>void t.invalidateQueries({queryKey:[`stage-status`,e.url,e.base]})})),u=()=>{let e=n.data?.state;return e===`success`?{label:`Ready`,color:`var(--color-success)`}:e===`failure`||e===`error`?{label:`Failed`,color:`var(--color-danger)`}:e===`none`||e===`unknown`?{label:`Waiting for deploy…`,color:`var(--color-text-dim)`}:{label:`Building…`,color:`var(--color-accent)`}};return(()=>{var t=c$(),d=t.firstChild,f=d.firstChild,p=f.nextSibling;return p.nextSibling,P(d,j(M,{get when(){return r()},get fallback(){return(()=>{var e=l$();return D(t=>dt(e,`background`,u().color)),e})()},get children(){return j(jj,{size:11})}}),f),P(f,()=>u().label),P(p,()=>e.base,null),P(p,(()=>{var e=$e(()=>!!n.data?.sha);return()=>e()?` @ ${n.data.sha}`:``})(),null),P(d,j(M,{get when(){return $e(()=>n.data?.state===`success`)()&&n.data?.url},get children(){return j(Lj,{get href(){return n.data.url},class:`shrink-0`,title:`Open the staging deployment`,children:`Open`})}}),null),P(d,j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get loading(){return l.isPending},get title(){return`Reset ${e.base} — delete + recreate from the default branch (drifted or conflicted staging)`},"aria-label":`Reset staging branch`,onClick:()=>l.mutate(),get children(){return a$()}}),null),P(d,j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return i()?`Hide build logs`:`Show build logs (vercel inspect --logs via the bridge)`},get"aria-label"(){return i()?`Hide build logs`:`Show build logs`},onClick:()=>a(e=>!e),get children(){return o$()}}),null),P(t,j(M,{get when(){return i()},get children(){return j(M,{get when(){return n.data?.url},get fallback(){return u$()},get children(){var e=s$();e.addEventListener(`scroll`,()=>{s&&(c=s.scrollTop+s.clientHeight>=s.scrollHeight-40)});var t=s;return typeof t==`function`?pt(t,e):s=e,P(e,j(M,{get when(){return o.data},get fallback(){return j(jj,{size:12})},get children(){return o.data.logs||`No log output.`}})),e}})}}),null),D(e=>dt(f,`color`,u().color)),t})()}Br();function f$(e,t=6e3){return Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(Error(`upload timeout`)),t))])}async function p$(){let e=[],t=[];for(let n of await Dr()??[]){let r=n.source?.filePath?` — \`${n.source.filePath}${n.source.lineNumber==null?``:`:${n.source.lineNumber}`}\``:``;if(e.push(`- \`<${n.componentName??n.tagName??`element`}>\`${r}`),n.screenshotDataUrl)try{let t=await f$(kO(rj(n.screenshotDataUrl),`capture-${n.grabbedAt}.png`),15e3);e.push(` ![capture](${t})`)}catch{t.push(`element screenshot upload failed — the ref line still landed`)}}let n=WD();if(n.result)try{let t=n.result.assetUrl??await f$(kO(n.result.blob,`recording-${Date.now()}.gif`),6e4);aO(t),e.push(`![recording](${t})`)}catch(e){t.push(`recording upload failed (${e instanceof Error?e.message:`error`}) — Copy GIF from the Capture tab and paste it instead`)}return{block:e.length?`Captured context:\n${e.join(`
265
- `)}`:null,failed:t}}function m$(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var h$=/^(https?:\/\/|mailto:)/i,g$=/\.(mp4|mov|webm|m4v)(\?|#|$)/i,_$=/\.(png|jpe?g|gif|webp|avif|svg)(\?|#|$)/i,v$=class extends HTMLElement{objectUrl=null;connectedCallback(){let e=this.getAttribute(`src`)??``,t=this.getAttribute(`alt`)??``;(async()=>{try{let n=await fetch(e);if(!n.ok)throw Error(String(n.status));let r=await n.blob();if(this.objectUrl=URL.createObjectURL(r),this.textContent=``,r.type.startsWith(`video/`)){let e=document.createElement(`video`);e.controls=!0,e.preload=`metadata`,e.src=this.objectUrl,this.appendChild(e)}else{let e=document.createElement(`img`);e.src=this.objectUrl,e.alt=t,this.appendChild(e)}}catch{this.textContent=``;let e=document.createElement(`span`);e.textContent=`🖼 ${t||`media`} — start the bridge (npx linear-grab-bridge) to view Linear-hosted media here`,e.style.cssText=`font-size:10.5px;color:var(--color-text-faint);`,this.appendChild(e)}})()}disconnectedCallback(){this.objectUrl&&URL.revokeObjectURL(this.objectUrl)}};typeof customElements<`u`&&!customElements.get(`lg-media`)&&customElements.define(`lg-media`,v$);var y$=null;function b$(e){y$=e?e.replace(/\/$/,``):null}function x$(e){try{if(y$&&new URL(e).hostname.endsWith(`uploads.linear.app`))return`${y$}/fetch?url=${encodeURIComponent(e)}`}catch{}return e}function S$(e){let t=e;return t=t.replace(/`([^`]+)`/g,(e,t)=>`<code>${t}</code>`),t=t.replace(/!\[([^\]]*)\]\((?:&lt;)?([^()\s]+?)(?:&gt;)?\)/g,(e,t,n)=>{if(!h$.test(n))return t;let r=x$(n);return g$.test(n)?`<video controls preload="metadata" src="${r}"></video>`:r!==n&&!_$.test(n)?`<lg-media src="${r}" alt="${t}"></lg-media>`:`<img src="${r}" alt="${t}" loading="lazy" />`}),t=t.replace(/\[([^\]]+)\]\((?:&lt;)?([^()\s]+?)(?:&gt;)?\)/g,(e,t,n)=>h$.test(n)?`<a href="${n}" target="_blank" rel="noopener noreferrer">${t}</a>`:t),t=t.replace(/&lt;(https?:\/\/[^\s&]+)&gt;/g,`<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>`),t=t.replace(/(^|[\s(])((?:https?:\/\/)[^\s<>()"']+)/g,(e,t,n)=>`${t}<a href="${n}" target="_blank" rel="noopener noreferrer">${n}</a>`),t=t.replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|\W)\*([^*\n]+)\*(?=\W|$)/g,`$1<em>$2</em>`),t}function C$(e){let t=m$(e.trim()).split(`
267
+ `;let e=[];for(let t of document.getAnimations())SL(t)||e.push(t);xL(e),dL=!1}else{for(let e of uL)try{e.finish()}catch{try{e.play()}catch{}}uL=[]}cL.remove(),cL=null,yL(lL),lL=[],nL()}},kL=[`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`],AL=[`focus`,`blur`,`focusin`,`focusout`],jL=[`background-color`,`color`,`border-color`,`box-shadow`,`transform`,`opacity`,`outline`,`filter`,`scale`,`visibility`],ML=[`background-color`,`color`,`border-color`,`box-shadow`,`outline`,`outline-offset`,`outline-width`,`outline-color`,`outline-style`,`filter`,`opacity`,`ring-color`,`ring-width`],NL=new Map,PL=new Map,FL=e=>{e.stopImmediatePropagation()},IL=e=>{e.preventDefault(),e.stopImmediatePropagation()},LL=(e,t)=>{let n=new Map;for(let r of t){let t=e.style.getPropertyValue(r);t&&n.set(r,t)}return n},RL=(e,t,n)=>{if(n?.has(e))return null;let r=getComputedStyle(e),i=e.style.cssText,a=LL(e,t);for(let e of t){let t=r.getPropertyValue(e);t&&(i+=`${e}: ${t} !important; `)}return{element:e,frozenStyles:i,originalPropertyValues:a}},zL=(e,t)=>{let n=[],r=document.elementFromPoint(e,t);for(;r&&r!==document.documentElement;)r instanceof HTMLElement&&n.push(r),r=r.parentElement;return n},BL=()=>{let e=[],t=document.activeElement;for(;t&&t!==document.body;)t instanceof HTMLElement&&e.push(t),t=t.shadowRoot?.activeElement??null;return e},VL=(e,t)=>{for(let{element:n,frozenStyles:r,originalPropertyValues:i}of e)t.set(n,i),n.style.cssText=r},HL=(e,t)=>{for(let[n,r]of e)for(let e of t){let t=r.get(e);t?n.style.setProperty(e,t):n.style.removeProperty(e)}e.clear()},UL=(e,t)=>{if(jI())return null;let n=[],r=e!==void 0&&t!==void 0&&e>=0&&t>=0&&e<window.innerWidth&&t<window.innerHeight?zL(e,t):Array.from(document.querySelectorAll(`:hover`)).filter(e=>e instanceof HTMLElement);for(let e of r){let t=RL(e,jL);t&&n.push(t)}let i=[];for(let e of BL()){let t=RL(e,ML,PL);t&&i.push(t)}return{hoverStates:n,focusStates:i}},WL=e=>{if(e){for(let e of kL)document.addEventListener(e,FL,!0);for(let e of AL)document.addEventListener(e,IL,!0);VL(e.hoverStates,NL),VL(e.focusStates,PL),MI()}},GL=()=>{GI();for(let e of kL)document.removeEventListener(e,FL,!0);for(let e of AL)document.removeEventListener(e,IL,!0);HL(NL,jL),HL(PL,ML),NI()},KL=(e,t)=>{let n=UL(e,t),r=EL();WL(n),DL(r)},qL=()=>{GL(),OL()},JL=!1,YL=(e,t,n)=>{let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i},XL=new WeakMap,ZL=new WeakMap,QL=new WeakMap,$L=new Set,eR=[],tR=[],nR=new WeakMap,rR=new WeakMap,iR=new WeakSet,aR=wP,oR=e=>{let t=e;for(;t.return;)t=t.return;return t.stateNode??null},sR=()=>{if(aR.size>0)return aR;let e=new Set,t=n=>{let r=CP(n);if(r){let t=oR(r);t&&e.add(t);return}for(let r of Array.from(n.children))if(t(r),e.size>0)return};return t(document.body),e},cR=(e,t)=>{if(!e)return t;if(!t)return e;if(!e.next||!t.next)return t;let n=e.next,r=t.next,i=e===n,a=t===r;return i&&a?(e.next=t,t.next=e):i?(e.next=r,t.next=e):a?(t.next=n,e.next=t):(e.next=r,t.next=n),t},lR=e=>{if(!e||nR.has(e))return;let t={originalPendingDescriptor:Object.getOwnPropertyDescriptor(e,`pending`),pendingValueAtPause:e.pending,bufferedPending:null};typeof e.getSnapshot==`function`&&(t.originalGetSnapshot=e.getSnapshot,t.snapshotValueAtPause=e.getSnapshot(),e.getSnapshot=()=>JL?t.snapshotValueAtPause:t.originalGetSnapshot());let n=t.pendingValueAtPause;Object.defineProperty(e,"pending",{configurable:!0,enumerable:!0,get:()=>JL?null:n,set:e=>{if(JL){e!==null&&(t.bufferedPending=cR(t.bufferedPending??null,e));return}n=e}}),nR.set(e,t)},uR=e=>{if(!e)return[];let t=[],n=e.next;if(!n)return[];let r=n;do r&&=(t.push(r.action),r.next);while(r&&r!==n);return t},dR=e=>{let t=nR.get(e);if(!t)return;t.originalGetSnapshot&&(e.getSnapshot=t.originalGetSnapshot),t.originalPendingDescriptor?Object.defineProperty(e,"pending",t.originalPendingDescriptor):delete e.pending,e.pending=null;let n=e.dispatch;if(typeof n==`function`){let e=uR(t.pendingValueAtPause??null),r=uR(t.bufferedPending??null);for(let t of[...e,...r])tR.push(()=>n(t))}nR.delete(e)},fR=e=>{if(rR.has(e))return;let t={originalDescriptor:Object.getOwnPropertyDescriptor(e,`memoizedValue`),frozenValue:e.memoizedValue};Object.defineProperty(e,"memoizedValue",{configurable:!0,enumerable:!0,get(){return JL?t.frozenValue:t.originalDescriptor?.get?t.originalDescriptor.get.call(this):this._memoizedValue},set(e){if(JL){t.pendingValue=e,t.didReceivePendingValue=!0;return}t.originalDescriptor?.set?t.originalDescriptor.set.call(this,e):this._memoizedValue=e}}),t.originalDescriptor?.get||(e._memoizedValue=t.frozenValue),rR.set(e,t)},pR=e=>{let t=rR.get(e);t&&(t.originalDescriptor?Object.defineProperty(e,"memoizedValue",t.originalDescriptor):delete e.memoizedValue,t.didReceivePendingValue&&(e.memoizedValue=t.pendingValue),rR.delete(e))},mR=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&lR(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)fR(n),n=n.next},hR=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&dR(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)pR(n),n=n.next},gR=e=>{let t=e;for(;t;){if(_P(t)&&mR(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},_R=e=>{let t=e;for(;t;){if(_P(t)&&hR(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},vR=e=>{if(XL.has(e))return;let t=e,n={useState:t.useState,useReducer:t.useReducer,useTransition:t.useTransition,useSyncExternalStore:t.useSyncExternalStore};XL.set(e,n),t.useState=(...t)=>{let r=n.useState.apply(e,t);if(!JL||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,YL(ZL,a,()=>(...e)=>{JL?tR.push(()=>a(...e)):a(...e)})]},t.useReducer=(...t)=>{let r=n.useReducer.apply(e,t);if(!JL||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,YL(ZL,a,()=>(...e)=>{JL?tR.push(()=>a(...e)):a(...e)})]},t.useTransition=(...t)=>{let r=n.useTransition.apply(e,t);if(!JL||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,YL(QL,a,()=>e=>{JL?eR.push(()=>a(e)):a(e)})]},t.useSyncExternalStore=((e,t,r)=>JL?n.useSyncExternalStore(t=>e(()=>{JL?$L.add(t):t()}),t,r):n.useSyncExternalStore(e,t,r))},yR=e=>{let t=e.currentDispatcherRef;if(!t||typeof t!=`object`)return;let n=`H`in t?`H`:`current`,r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>(r&&typeof r==`object`&&vR(r),r),set:e=>{r=e}})},bR=e=>{queueMicrotask(()=>{try{for(let t of mP().renderers.values())if(typeof t.scheduleUpdate==`function`){for(let n of e)if(n.current)try{t.scheduleUpdate(n.current)}catch{}}}catch{}})},xR=e=>{for(let t of e)try{t()}catch{}},SR=()=>{for(let e of mP().renderers.values())iR.has(e)||(yR(e),iR.add(e))},CR=()=>{if(JL)return()=>{};SR(),JL=!0;let e=sR();for(let t of e)gR(t.current);return()=>{if(JL)try{let e=sR();for(let t of e)_R(t.current);let t=Array.from($L),n=eR.slice(),r=tR.slice();JL=!1,xR(t),xR(n),xR(r),bR(e)}finally{$L.clear(),eR.length=0,tR.length=0}}}}));function TR(e){let t=String(e),n=t.length-1;return Uz.context.id+(n?String.fromCharCode(96+n):``)+t}function ER(e){Uz.context=e}function DR(e,t){let n=eB,r=Qz,i=e.length===0,a=t===void 0?r:t,o=i?Xz:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>PR(()=>tz(o)));Qz=o,eB=null;try{return YR(s,!0)}finally{eB=n,Qz=r}}function J(e,t){t=t?Object.assign({},Jz,t):Jz;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[UR.bind(n),e=>(typeof e==`function`&&(e=$z&&$z.running&&$z.sources.has(n)?e(n.tValue):e(n.value)),WR(n,e))]}function OR(e,t,n){GR(qR(e,t,!0,1))}function kR(e,t,n){GR(qR(e,t,!1,1))}function AR(e,t,n){Yz=QR;let r=qR(e,t,!1,1),i=oB&&VR(oB);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),nB?nB.push(r):GR(r)}function Y(e,t,n){n=n?Object.assign({},Jz,n):Jz;let r=qR(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,GR(r),UR.bind(r)}function jR(e){return e&&typeof e==`object`&&`then`in e}function MR(e,t,n){let r,i,a;typeof t==`function`?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=Zz,c=null,l=!1,u=!1,d=`initialValue`in a,f=typeof r==`function`&&Y(r),p=new Set,[m,h]=(a.storage||J)(a.initialValue),[g,_]=J(void 0),[v,y]=J(void 0,{equals:!1}),[b,x]=J(d?`ready`:`unresolved`);Uz.context&&(c=Uz.getNextContextId(),a.ssrLoadFrom===`initial`?s=a.initialValue:Uz.load&&Uz.has(c)&&(s=Uz.load(c)));function S(e,t,n,r){return o===e&&(o=null,r!==void 0&&(d=!0),(e===s||t===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(r,{value:t})),s=Zz,$z&&e&&l?($z.promises.delete(e),l=!1,YR(()=>{$z.running=!0,C(t,n)},!1)):C(t,n)),t}function C(e,t){YR(()=>{t===void 0&&h(()=>e),x(t===void 0?d?`ready`:`unresolved`:`errored`),_(t);for(let e of p.keys())e.decrement();p.clear()},!1)}function w(){let e=oB&&VR(oB),t=m(),n=g();if(n!==void 0&&!o)throw n;return eB&&!eB.user&&e&&OR(()=>{v(),o&&(e.resolved&&$z&&l?$z.promises.add(o):p.has(e)||(e.increment(),p.add(e)))}),t}function T(e=!0){if(e!==!1&&u)return;u=!1;let t=f?f():r;if(l=$z&&$z.running,t==null||t===!1){S(o,PR(m));return}$z&&o&&$z.promises.delete(o);let n,a=s===Zz?PR(()=>{try{return i(t,{value:m(),refetching:e})}catch(e){n=e}}):s;if(n!==void 0){S(o,void 0,rz(n),t);return}else if(!jR(a))return S(o,a,void 0,t),a;return o=a,`v`in a?(a.s===1?S(o,a.v,void 0,t):S(o,void 0,rz(a.v),t),a):(u=!0,queueMicrotask(()=>u=!1),YR(()=>{x(d?`refreshing`:`pending`),y()},!1),a.then(e=>S(a,e,void 0,t),e=>S(a,void 0,rz(e),t)))}Object.defineProperties(w,{state:{get:()=>b()},error:{get:()=>g()},loading:{get(){let e=b();return e===`pending`||e===`refreshing`}},latest:{get(){if(!d)return w();let e=g();if(e&&!o)throw e;return m()}}});let E=Qz;return f?OR(()=>(E=Qz,T(!1))):T(!1),[w,{refetch:e=>zR(E,()=>T(e)),mutate:h}]}function NR(e){return YR(e,!1)}function PR(e){if(eB===null)return e();let t=eB;eB=null;try{return e()}finally{eB=t}}function FR(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=PR(()=>t(o,i,n));return i=o,s}}function IR(e){AR(()=>PR(e))}function LR(e){return Qz===null||(Qz.cleanups===null?Qz.cleanups=[e]:Qz.cleanups.push(e)),e}function RR(){return eB}function zR(e,t){let n=Qz,r=eB;Qz=e,eB=null;try{return YR(t,!0)}catch(e){iz(e)}finally{Qz=n,eB=r}}function BR(e,t){let n=Symbol(`context`);return{id:n,Provider:oz(n),defaultValue:e}}function VR(e){let t;return Qz&&Qz.context&&(t=Qz.context[e.id])!==void 0?t:e.defaultValue}function HR(e){let t=Y(e),n=Y(()=>az(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}function UR(){let e=$z&&$z.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===1)GR(this);else{let e=tB;tB=null,YR(()=>$R(this),!1),tB=e}if(eB){let e=this.observers?this.observers.length:0;eB.sources?(eB.sources.push(this),eB.sourceSlots.push(e)):(eB.sources=[this],eB.sourceSlots=[e]),this.observers?(this.observers.push(eB),this.observerSlots.push(eB.sources.length-1)):(this.observers=[eB],this.observerSlots=[eB.sources.length-1])}return e&&$z.sources.has(this)?this.tValue:this.value}function WR(e,t,n){let r=$z&&$z.running&&$z.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if($z){let r=$z.running;(r||!n&&$z.sources.has(e))&&($z.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&YR(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=$z&&$z.running;r&&$z.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?tB.push(n):nB.push(n),n.observers&&ez(n)),r?n.tState=1:n.state=1)}if(tB.length>1e6)throw tB=[],Error()},!1)}return t}function GR(e){if(!e.fn)return;tz(e);let t=rB;KR(e,$z&&$z.running&&$z.sources.has(e)?e.tValue:e.value,t),$z&&!$z.running&&$z.sources.has(e)&&queueMicrotask(()=>{YR(()=>{$z&&($z.running=!0),eB=Qz=e,KR(e,e.tValue,t),eB=Qz=null},!1)})}function KR(e,t,n){let r,i=Qz,a=eB;eB=Qz=e;try{r=e.fn(t)}catch(t){return e.pure&&($z&&$z.running?(e.tState=1,e.tOwned&&e.tOwned.forEach(tz),e.tOwned=void 0):(e.state=1,e.owned&&e.owned.forEach(tz),e.owned=null)),e.updatedAt=n+1,iz(t)}finally{eB=a,Qz=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?WR(e,r,!0):$z&&$z.running&&e.pure?($z.sources.has(e)||(e.value=r),$z.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function qR(e,t,n,r=1,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Qz,context:Qz?Qz.context:null,pure:n};return $z&&$z.running&&(a.state=0,a.tState=r),Qz===null||Qz!==Xz&&($z&&$z.running&&Qz.pure?Qz.tOwned?Qz.tOwned.push(a):Qz.tOwned=[a]:Qz.owned?Qz.owned.push(a):Qz.owned=[a]),a}function JR(e){let t=$z&&$z.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===2)return $R(e);if(e.suspense&&PR(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<rB);){if(t&&$z.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if($z.disposed.has(t))return}if((t?e.tState:e.state)===1)GR(e);else if((t?e.tState:e.state)===2){let t=tB;tB=null,YR(()=>$R(e,n[0]),!1),tB=t}}}function YR(e,t){if(tB)return e();let n=!1;t||(tB=[]),nB?n=!0:nB=[],rB++;try{let t=e();return XR(n),t}catch(e){n||(nB=null),tB=null,iz(e)}}function XR(e){if(tB&&=(ZR(tB),null),e)return;let t;if($z){if(!$z.promises.size&&!$z.queue.size){let e=$z.sources,n=$z.disposed;nB.push.apply(nB,$z.effects),t=$z.resolve;for(let e of nB)`tState`in e&&(e.state=e.tState),delete e.tState;$z=null,YR(()=>{for(let e of n)tz(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)tz(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}aB(!1)},!1)}else if($z.running){$z.running=!1,$z.effects.push.apply($z.effects,nB),nB=null,aB(!0);return}}let n=nB;nB=null,n.length&&YR(()=>Yz(n),!1),t&&t()}function ZR(e){for(let t=0;t<e.length;t++)JR(e[t])}function QR(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:JR(r)}if(Uz.context){if(Uz.count){Uz.effects||=[],Uz.effects.push(...e.slice(0,n));return}ER()}for(Uz.effects&&(Uz.done||!Uz.count)&&(e=[...Uz.effects,...e],n+=Uz.effects.length,delete Uz.effects),t=0;t<n;t++)JR(e[t])}function $R(e,t){let n=$z&&$z.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===1?i!==t&&(!i.updatedAt||i.updatedAt<rB)&&JR(i):e===2&&$R(i,t)}}}function ez(e){let t=$z&&$z.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=2:r.state=2,r.pure?tB.push(r):nB.push(r),r.observers&&ez(r))}}function tz(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)tz(e.tOwned[t]);delete e.tOwned}if($z&&$z.running&&e.pure)nz(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)tz(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}$z&&$z.running?e.tState=0:e.state=0}function nz(e,t){if(t||(e.tState=0,$z.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)nz(e.owned[t])}function rz(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function iz(e,t=Qz){throw rz(e)}function az(e){if(typeof e==`function`&&!e.length)return az(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=az(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function oz(e,t){return function(t){let n;return kR(()=>n=PR(()=>(Qz.context={...Qz.context,[e]:t.value},HR(()=>t.children))),void 0),n}}function sz(e){for(let t=0;t<e.length;t++)e[t]()}function cz(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return LR(()=>sz(a)),()=>{let c=e()||[],l=c.length,u,d;return c[qz],PR(()=>{let e,t,p,m,h,g,_,v,y;if(l===0)o!==0&&(sz(a),a=[],r=[],i=[],o=0,s&&=[]),n.fallback&&(r=[sB],i[0]=DR(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(l),d=0;d<l;d++)r[d]=c[d],i[d]=DR(f);o=l}else{for(p=Array(l),m=Array(l),s&&(h=Array(l)),g=0,_=Math.min(o,l);g<_&&r[g]===c[g];g++);for(_=o-1,v=l-1;_>=g&&v>=g&&r[_]===c[v];_--,v--)p[v]=i[_],m[v]=a[_],s&&(h[v]=s[_]);for(e=new Map,t=Array(v+1),d=v;d>=g;d--)y=c[d],u=e.get(y),t[d]=u===void 0?-1:u,e.set(y,d);for(u=g;u<=_;u++)y=r[u],d=e.get(y),d!==void 0&&d!==-1?(p[d]=i[u],m[d]=a[u],s&&(h[d]=s[u]),d=t[d],e.set(y,d)):a[u]();for(d=g;d<l;d++)d in p?(i[d]=p[d],a[d]=m[d],s&&(s[d]=h[d],s[d](d))):i[d]=DR(f);i=i.slice(0,o=l),r=c.slice(0)}return i});function f(e){if(a[d]=e,s){let[e,n]=J(d);return s[d]=n,t(c[d],e)}return t(c[d])}}}function lz(e,t,n={}){let r=[],i=[],a=[],o=[],s=0,c;return LR(()=>sz(a)),()=>{let l=e()||[],u=l.length;return l[qz],PR(()=>{if(u===0)return s!==0&&(sz(a),a=[],r=[],i=[],s=0,o=[]),n.fallback&&(r=[sB],i[0]=DR(e=>(a[0]=e,n.fallback())),s=1),i;for(r[0]===sB&&(a[0](),a=[],r=[],i=[],s=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?o[c](()=>l[c]):c>=r.length&&(i[c]=DR(d));for(;c<r.length;c++)a[c]();return s=o.length=a.length=u,r=l.slice(0),i=i.slice(0,s)});function d(e){a[c]=e;let[n,r]=J(l[c]);return o[c]=r,t(n,c)}}}function X(e,t){return PR(()=>e(t||{}))}function uz(){return!0}function dz(e){return(e=typeof e==`function`?e():e)?e:{}}function fz(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function pz(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&Gz in r,e[n]=typeof r==`function`?(t=!0,Y(r)):r}if(Kz&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=dz(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in dz(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(dz(e[n])));return[...new Set(t)]}},cB);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:fz.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},a=Object.keys(r);for(let e=a.length-1;e>=0;e--){let t=a[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function mz(e,...t){let n=t.length;if(Kz&&Gz in e){let r=n>1?t.flat():t[0],i=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},cB));return i.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},cB)),i}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function hz(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return Y(cz(()=>e.each,e.children,t||void 0))}function gz(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return Y(lz(()=>e.each,e.children,t||void 0))}function _z(e){let t=e.keyed,n=Y(()=>e.when,void 0,void 0),r=t?n:Y(n,void 0,{equals:(e,t)=>!e==!t});return Y(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?PR(()=>a(t?i:()=>{if(!PR(r))throw lB(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function vz(e){let t=HR(()=>e.children),n=Y(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=Y(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:Y(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return Y(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?PR(()=>o(a.keyed?i():()=>{if(PR(n)()?.[0]!==r)throw lB(`Match`);return i()})):o},void 0,void 0)}function yz(e){return e}function bz(e,t){let n=pB[e];return typeof n==`object`?n[t]?n.$:void 0:n}function xz(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}function Sz(e,t,n,r={}){let i;return DR(r=>{i=r,t===document?e():$(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function Z(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>PR(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Cz(e,t=window.document){let n=t[_B]||(t[_B]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Rz))}}function Q(e,t,n){Pz(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function wz(e,t,n,r){Pz(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Tz(e,t,n){Pz(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function Ez(e,t){Pz(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function Dz(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function Oz(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(Iz(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(Iz(e,i,!0),n[i]=o)}return n}function kz(e,t,n){if(!t)return n?Q(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Az(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function jz(e,t={},n,r){let i={};return r||kR(()=>i.children=zz(e,t.children,i.children)),kR(()=>typeof t.ref==`function`&&Mz(t.ref,e)),kR(()=>Nz(e,t,n,!0,i,!0)),i}function Mz(e,t,n){return PR(()=>e(t,n))}function $(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return zz(e,t,r,n);kR(r=>zz(e,t(),r,n),r)}function Nz(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=Lz(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||zz(e,t.children);continue}let s=t[o];i[o]=Lz(e,o,s,i[o],n,a,t)}}function Pz(e){return!!Uz.context&&!Uz.done&&(!e||e.isConnected)}function Fz(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Iz(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function Lz(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return kz(e,n,r);if(t===`classList`)return Oz(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=mB.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(Dz(e,i,n,a),a&&Cz([i]))}else if(t.slice(0,5)===`attr:`)Q(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)Tz(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=dB.has(t))||!i&&((u=bz(t,e.tagName))||(c=uB.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(Pz(e))return n;t===`class`||t===`className`?Ez(e,n):s&&!c&&!l?e[Fz(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&hB[t.split(`:`)[0]];r?wz(e,r,t,n):Q(e,fB[t]||t,n)}return n}function Rz(e){if(Uz.registry&&Uz.events&&Uz.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Uz.registry&&!Uz.done&&(Uz.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function zz(e,t,n,r,i){let a=Pz(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Hz(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Hz(e,n,r)}else if(o===`function`)return kR(()=>{let i=t();for(;typeof i==`function`;)i=i();n=zz(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(Bz(o,t,n,i))return kR(()=>n=zz(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Hz(e,n,r),s)return n}else c?n.length===0?Vz(e,o,r):xz(e,n,o):(n&&Hz(e),Vz(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Hz(e,n,r,t);Hz(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function Bz(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=Bz(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=Bz(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function Vz(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Hz(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var Uz,Wz,Gz,Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB,oB,sB,cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB,yB,bB,xB,SB,CB,wB,TB,EB,DB,OB,kB,AB,jB,MB,NB,PB,FB,IB,LB,RB,zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,QB,$B,eV,tV,nV,rV,iV,aV,oV,sV,cV,lV,uV,dV,fV,pV,mV,hV,gV,_V,vV,yV,bV,xV,SV,CV,wV,TV,EV,DV,OV,kV,AV,jV,MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,GV,KV,qV,JV,YV,XV,ZV,QV,$V,eH,tH,nH,rH=t((()=>{wR(),Uz={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return TR(this.context.count)},getNextContextId(){return TR(this.context.count++)}},Wz=(e,t)=>e===t,Gz=Symbol(`solid-proxy`),Kz=typeof Proxy==`function`,qz=Symbol(`solid-track`),Jz={equals:Wz},Yz=ZR,Xz={owned:null,cleanups:null,context:null,owner:null},Zz={},Qz=null,$z=null,eB=null,tB=null,nB=null,rB=0,[iB,aB]=J(!1),sB=Symbol(`fallback`),cB={get(e,t,n){return t===Gz?n:e.get(t)},has(e,t){return t===Gz||e.has(t)},set:uz,deleteProperty:uz,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:uz,deleteProperty:uz}},ownKeys(e){return e.keys()}},lB=e=>`Stale read from <${e}>.`,uB=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),dB=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),fB=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),pB=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}}),mB=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),hB={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},gB=e=>Y(()=>e()),_B=`_$DX_DELEGATE`,vB=e=>!!(e?.isConnected??e?.ownerDocument?.contains(e)),yB=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`,`combobox`],bB=e=>{if(e.composed){let t=e.composedPath()[0];if(t instanceof HTMLElement)return t}else if(e.target instanceof HTMLElement)return e.target},xB=e=>{if(document.designMode===`on`)return!0;let t=bB(e);if(!t)return!1;if(t.isContentEditable)return!0;let n=YN(t);return yB.some(e=>e===n||e===t.role)},SB=e=>{let t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=t.selectionStart??0;return(t.selectionEnd??0)-e>0}return!1},CB=()=>{let e=window.getSelection();return e?e.toString().length>0:!1},wB=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/,TB=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`),EB=(e,t,n,r=1)=>{let i=TB(e),a=TB(t),o=TB(n);return r>=1?`#${i}${a}${o}`:`#${i}${a}${o}${TB(r*255)}`},DB=e=>{if(!e.startsWith(`#`))return null;let t=e.slice(1);if(t.length!==6&&t.length!==8)return null;let n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16),a=t.length===8?parseInt(t.slice(6,8),16)/255:1;return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)?null:{red:n,green:r,blue:i,alpha:a}},OB=e=>{let t=e.match(wB);if(!t)return null;let n=1;if(t[4]!==void 0){let e=t[4];n=e.endsWith(`%`)?Number(e.slice(0,-1))/100:Number(e)}return EB(Number(t[1]),Number(t[2]),Number(t[3]),n)},kB=e=>{let t=e.match(wB);return!t||t[4]===void 0?!1:(t[4].endsWith(`%`)?Number(t[4].slice(0,-1))/100:Number(t[4]))===0},AB=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,jB=e=>{let t=e.match(AB);if(!t)return null;let n=t[1];return n.length===3?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`:n.length===4?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`:`#${n}`},MB=`rgba(0, 0, 0, 0)`,NB=/^oklch\(\s*([+-]?\d*\.?\d+%?)\s+([+-]?\d*\.?\d+%?)\s+([+-]?\d*\.?\d+)(deg|grad|rad|turn)?(?:\s*\/\s*([+-]?\d*\.?\d+%?))?\s*\)$/i,PB=180/Math.PI,FB=(e,t)=>e.endsWith(`%`)?Number(e.slice(0,-1))/100*t:Number(e),IB=(e,t)=>{let n=Number(e);return t===`grad`?n*.9:t===`rad`?n*PB:t===`turn`?n*360:n},LB=e=>{let t=Math.max(0,Math.min(1,e));return(t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055)*255},RB=e=>{let t=e.match(NB);if(!t)return null;let n=FB(t[1],1),r=FB(t[2],.4),i=IB(t[3],t[4])*Math.PI/180,a=t[5]===void 0?1:FB(t[5],1);if(![n,r,i,a].every(Number.isFinite))return null;let o=r*Math.cos(i),s=r*Math.sin(i),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,g=-.0041960863*d-.7034186147*f+1.707614701*p;return EB(LB(m),LB(h),LB(g),Math.max(0,Math.min(1,a)))},zB=null,BB=()=>zB||(typeof document>`u`?null:(zB=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0}),zB)),VB=(e,t)=>{e.clearRect(0,0,1,1),e.fillStyle=t,e.fillRect(0,0,1,1);let n=e.getImageData(0,0,1,1).data;return n[3]===0?LN:EB(n[0],n[1],n[2],n[3]/255)},HB=e=>{let t=e.trim();if(!t)return null;if(t.toLowerCase()===`transparent`)return LN;let n=jB(t);if(n)return n;let r=RB(t);if(r)return r;let i=BB();if(!i)return null;i.fillStyle=MB,i.fillStyle=t;let a=i.fillStyle;return typeof a==`string`?a.toLowerCase()===MB?t.toLowerCase().replace(/\s+/g,``)===`rgba(0,0,0,0)`?LN:null:a.startsWith(`#`)&&a.length===7?a:a.startsWith(`rgb`)?OB(a):VB(i,t):null},UB=(e,t,n)=>Math.max(t,Math.min(e,n)),WB=null,GB=()=>{if(typeof navigator>`u`||!(`userAgentData`in navigator))return null;let e=navigator.userAgentData;if(typeof e!=`object`||!e||!(`platform`in e))return null;let t=e.platform;return typeof t==`string`?t:null},KB=()=>{if(WB===null){if(typeof navigator>`u`)return WB=!1,WB;let e=navigator.platform??GB()??navigator.userAgent;WB=/Mac|iPhone|iPad|iPod/i.test(e)}return WB},qB=(e,t)=>{try{return e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute(t))}catch{return!1}},JB=`padding-top.padding-right.padding-bottom.padding-left.margin-top.margin-right.margin-bottom.margin-left.gap.row-gap.column-gap.font-size.line-height.letter-spacing.border-radius.border-top-left-radius.border-top-right-radius.border-bottom-right-radius.border-bottom-left-radius.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.opacity.width.height.min-width.min-height.max-width.max-height.top.right.bottom.left.z-index`.split(`.`),YB=-128,XB=-512,ZB=-9999,QB=9999,$B=new Set([`letter-spacing`,`gap`,`row-gap`,`column-gap`]),eV=new Set([`z-index`]),tV=[{key:`padding`,label:`padding`,longhands:[`padding-top`,`padding-right`,`padding-bottom`,`padding-left`]},{key:`padding-top,padding-bottom`,label:`padding-y`,longhands:[`padding-top`,`padding-bottom`]},{key:`padding-left,padding-right`,label:`padding-x`,longhands:[`padding-left`,`padding-right`]},{key:`padding-top`,label:`padding top`,longhands:[`padding-top`]},{key:`padding-right`,label:`padding right`,longhands:[`padding-right`]},{key:`padding-bottom`,label:`padding bottom`,longhands:[`padding-bottom`]},{key:`padding-left`,label:`padding left`,longhands:[`padding-left`]}],nV=[{key:`margin`,label:`margin`,longhands:[`margin-top`,`margin-right`,`margin-bottom`,`margin-left`]},{key:`margin-top,margin-bottom`,label:`margin-y`,longhands:[`margin-top`,`margin-bottom`]},{key:`margin-left,margin-right`,label:`margin-x`,longhands:[`margin-left`,`margin-right`]},{key:`margin-top`,label:`margin top`,longhands:[`margin-top`]},{key:`margin-right`,label:`margin right`,longhands:[`margin-right`]},{key:`margin-bottom`,label:`margin bottom`,longhands:[`margin-bottom`]},{key:`margin-left`,label:`margin left`,longhands:[`margin-left`]}],rV=[{key:`gap`,label:`gap`,longhands:[`row-gap`,`column-gap`]},{key:`row-gap`,label:`row gap`,longhands:[`row-gap`]},{key:`column-gap`,label:`column gap`,longhands:[`column-gap`]}],iV=[{key:`border-radius`,label:`border radius`,longhands:[`border-top-left-radius`,`border-top-right-radius`,`border-bottom-right-radius`,`border-bottom-left-radius`]},{key:`border-top-left-radius,border-top-right-radius`,label:`top corners`,longhands:[`border-top-left-radius`,`border-top-right-radius`]},{key:`border-bottom-left-radius,border-bottom-right-radius`,label:`bottom corners`,longhands:[`border-bottom-left-radius`,`border-bottom-right-radius`]},{key:`border-top-left-radius,border-bottom-left-radius`,label:`left corners`,longhands:[`border-top-left-radius`,`border-bottom-left-radius`]},{key:`border-top-right-radius,border-bottom-right-radius`,label:`right corners`,longhands:[`border-top-right-radius`,`border-bottom-right-radius`]},{key:`border-top-left-radius`,label:`top left radius`,longhands:[`border-top-left-radius`]},{key:`border-top-right-radius`,label:`top right radius`,longhands:[`border-top-right-radius`]},{key:`border-bottom-right-radius`,label:`bottom right radius`,longhands:[`border-bottom-right-radius`]},{key:`border-bottom-left-radius`,label:`bottom left radius`,longhands:[`border-bottom-left-radius`]}],aV=[{key:`top,right,bottom,left`,label:`inset`,longhands:[`top`,`right`,`bottom`,`left`]},{key:`top,bottom`,label:`inset-y`,longhands:[`top`,`bottom`]},{key:`left,right`,label:`inset-x`,longhands:[`left`,`right`]},{key:`top`,label:`top`,longhands:[`top`]},{key:`right`,label:`right`,longhands:[`right`]},{key:`bottom`,label:`bottom`,longhands:[`bottom`]},{key:`left`,label:`left`,longhands:[`left`]}],oV=new Set(aV.map(e=>e.key)),sV=[tV,nV,rV,iV,[{key:`border-width`,label:`border width`,longhands:[`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`]},{key:`border-top-width`,label:`border top width`,longhands:[`border-top-width`]},{key:`border-right-width`,label:`border right width`,longhands:[`border-right-width`]},{key:`border-bottom-width`,label:`border bottom width`,longhands:[`border-bottom-width`]},{key:`border-left-width`,label:`border left width`,longhands:[`border-left-width`]}],[{key:`width,height`,label:`size`,longhands:[`width`,`height`]},{key:`width`,label:`width`,longhands:[`width`]},{key:`height`,label:`height`,longhands:[`height`]}],aV],cV=[{key:`font-size`,label:`font size`},{key:`line-height`,label:`line height`},{key:`letter-spacing`,label:`letter spacing`},{key:`min-width`,label:`min width`},{key:`min-height`,label:`min height`},{key:`max-width`,label:`max width`},{key:`max-height`,label:`max height`},{key:`z-index`,label:`z-index`},{key:`opacity`,label:`opacity`}],lV=[{key:`color`,label:`text color`,alwaysShow:!0},{key:`background-color`,label:`background`,alwaysShow:!0},{key:`border-color`,label:`border color`},{key:`fill`,label:`fill`},{key:`stroke`,label:`stroke`}],uV=[{value:`ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,label:`sans`},{value:`ui-serif, Georgia, Cambria, "Times New Roman", Times, serif`,label:`serif`},{value:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`,label:`mono`},{value:`system-ui, sans-serif`,label:`system`},{value:`serif`,label:`serif`},{value:`monospace`,label:`mono`}],dV=e=>{let t=e.trim();return uV.some(e=>e.value===t)?uV:[{value:t,label:`current`},...uV]},fV={key:`font-family`,label:`font family`},pV=[{key:`display`,label:`display`,options:[{value:`block`,label:`block`},{value:`flex`,label:`flex`},{value:`inline-block`,label:`inline-block`},{value:`inline`,label:`inline`},{value:`grid`,label:`grid`},{value:`none`,label:`none`}]},{key:`text-align`,label:`text align`,options:[{value:`left`,label:`left`},{value:`center`,label:`center`},{value:`right`,label:`right`},{value:`justify`,label:`justify`}]},{key:`font-style`,label:`font style`,options:[{value:`normal`,label:`normal`},{value:`italic`,label:`italic`}]},{key:`text-transform`,label:`text transform`,options:[{value:`none`,label:`none`},{value:`uppercase`,label:`uppercase`},{value:`lowercase`,label:`lowercase`},{value:`capitalize`,label:`capitalize`}]},{key:`white-space`,label:`white space`,options:[{value:`normal`,label:`normal`},{value:`nowrap`,label:`nowrap`},{value:`pre`,label:`pre`},{value:`pre-wrap`,label:`pre-wrap`},{value:`pre-line`,label:`pre-line`},{value:`break-spaces`,label:`break-spaces`}]},{key:`word-break`,label:`word break`,options:[{value:`normal`,label:`normal`},{value:`break-all`,label:`break-all`},{value:`keep-all`,label:`keep-all`}]},{key:`overflow-wrap`,label:`wrap`,options:[{value:`normal`,label:`normal`},{value:`break-word`,label:`break-word`},{value:`anywhere`,label:`anywhere`}]},{key:`font-variant-numeric`,label:`number style`,options:[{value:`normal`,label:`normal`},{value:`tabular-nums`,label:`tabular`},{value:`proportional-nums`,label:`proportional`},{value:`lining-nums`,label:`lining`},{value:`oldstyle-nums`,label:`oldstyle`},{value:`slashed-zero`,label:`slashed zero`}]},{key:`text-decoration-line`,label:`decoration`,options:[{value:`none`,label:`none`},{value:`underline`,label:`underline`},{value:`line-through`,label:`strike`}]},{key:`border-style`,label:`border style`,options:[{value:`none`,label:`none`},{value:`solid`,label:`solid`},{value:`dashed`,label:`dashed`},{value:`dotted`,label:`dotted`}]},{key:`visibility`,label:`visibility`,options:[{value:`visible`,label:`visible`},{value:`hidden`,label:`hidden`}]},{key:`align-items`,label:`align items`,options:[{value:`stretch`,label:`stretch`},{value:`flex-start`,label:`start`},{value:`center`,label:`center`},{value:`flex-end`,label:`end`},{value:`baseline`,label:`baseline`}]},{key:`justify-content`,label:`justify content`,options:[{value:`flex-start`,label:`start`},{value:`center`,label:`center`},{value:`flex-end`,label:`end`},{value:`space-between`,label:`between`},{value:`space-around`,label:`around`},{value:`space-evenly`,label:`evenly`}]},{key:`font-weight`,label:`font weight`,options:[{value:`100`,label:`thin`},{value:`200`,label:`extra-light`},{value:`300`,label:`light`},{value:`400`,label:`normal`},{value:`500`,label:`medium`},{value:`600`,label:`semibold`},{value:`700`,label:`bold`},{value:`800`,label:`extra-bold`},{value:`900`,label:`black`}]}],mV=[...JB,`color`,`background-color`,`border-color`,`fill`,`stroke`,`font-family`,`display`,`text-align`,`font-style`,`text-transform`,`white-space`,`word-break`,`overflow-wrap`,`font-variant-numeric`,`text-decoration-line`,`border-style`,`visibility`,`align-items`,`justify-content`,`font-weight`],hV=e=>Number.isInteger(e)?e:Math.round(e*100)/100,gV=e=>Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,``),_V=e=>Number.isFinite(e)?gV(hV(e)):String(e),vV=e=>Math.round(e),yV=(e,t)=>{if(e.kind===`color`||e.kind===`enum`)return typeof t==`string`?t:e.value;let n=typeof t==`number`?t:e.value;return e.key===`opacity`&&e.unit===`%`?gV(hV(n/100)):`${gV(hV(n))}${e.unit}`},bV={slate:{50:`#f8fafc`,100:`#f1f5f9`,200:`#e2e8f0`,300:`#cbd5e1`,400:`#94a3b8`,500:`#64748b`,600:`#475569`,700:`#334155`,800:`#1e293b`,900:`#0f172a`,950:`#020617`},gray:{50:`#f9fafb`,100:`#f3f4f6`,200:`#e5e7eb`,300:`#d1d5db`,400:`#9ca3af`,500:`#6b7280`,600:`#4b5563`,700:`#374151`,800:`#1f2937`,900:`#111827`,950:`#030712`},zinc:{50:`#fafafa`,100:`#f4f4f5`,200:`#e4e4e7`,300:`#d4d4d8`,400:`#a1a1aa`,500:`#71717a`,600:`#52525b`,700:`#3f3f46`,800:`#27272a`,900:`#18181b`,950:`#09090b`},neutral:{50:`#fafafa`,100:`#f5f5f5`,200:`#e5e5e5`,300:`#d4d4d4`,400:`#a3a3a3`,500:`#737373`,600:`#525252`,700:`#404040`,800:`#262626`,900:`#171717`,950:`#0a0a0a`},stone:{50:`#fafaf9`,100:`#f5f5f4`,200:`#e7e5e4`,300:`#d6d3d1`,400:`#a8a29e`,500:`#78716c`,600:`#57534e`,700:`#44403c`,800:`#292524`,900:`#1c1917`,950:`#0c0a09`},red:{50:`#fef2f2`,100:`#fee2e2`,200:`#fecaca`,300:`#fca5a5`,400:`#f87171`,500:`#ef4444`,600:`#dc2626`,700:`#b91c1c`,800:`#991b1b`,900:`#7f1d1d`,950:`#450a0a`},orange:{50:`#fff7ed`,100:`#ffedd5`,200:`#fed7aa`,300:`#fdba74`,400:`#fb923c`,500:`#f97316`,600:`#ea580c`,700:`#c2410c`,800:`#9a3412`,900:`#7c2d12`,950:`#431407`},amber:{50:`#fffbeb`,100:`#fef3c7`,200:`#fde68a`,300:`#fcd34d`,400:`#fbbf24`,500:`#f59e0b`,600:`#d97706`,700:`#b45309`,800:`#92400e`,900:`#78350f`,950:`#451a03`},yellow:{50:`#fefce8`,100:`#fef9c3`,200:`#fef08a`,300:`#fde047`,400:`#facc15`,500:`#eab308`,600:`#ca8a04`,700:`#a16207`,800:`#854d0e`,900:`#713f12`,950:`#422006`},lime:{50:`#f7fee7`,100:`#ecfccb`,200:`#d9f99d`,300:`#bef264`,400:`#a3e635`,500:`#84cc16`,600:`#65a30d`,700:`#4d7c0f`,800:`#3f6212`,900:`#365314`,950:`#1a2e05`},green:{50:`#f0fdf4`,100:`#dcfce7`,200:`#bbf7d0`,300:`#86efac`,400:`#4ade80`,500:`#22c55e`,600:`#16a34a`,700:`#15803d`,800:`#166534`,900:`#14532d`,950:`#052e16`},emerald:{50:`#ecfdf5`,100:`#d1fae5`,200:`#a7f3d0`,300:`#6ee7b7`,400:`#34d399`,500:`#10b981`,600:`#059669`,700:`#047857`,800:`#065f46`,900:`#064e3b`,950:`#022c22`},teal:{50:`#f0fdfa`,100:`#ccfbf1`,200:`#99f6e4`,300:`#5eead4`,400:`#2dd4bf`,500:`#14b8a6`,600:`#0d9488`,700:`#0f766e`,800:`#115e59`,900:`#134e4a`,950:`#042f2e`},cyan:{50:`#ecfeff`,100:`#cffafe`,200:`#a5f3fc`,300:`#67e8f9`,400:`#22d3ee`,500:`#06b6d4`,600:`#0891b2`,700:`#0e7490`,800:`#155e75`,900:`#164e63`,950:`#083344`},sky:{50:`#f0f9ff`,100:`#e0f2fe`,200:`#bae6fd`,300:`#7dd3fc`,400:`#38bdf8`,500:`#0ea5e9`,600:`#0284c7`,700:`#0369a1`,800:`#075985`,900:`#0c4a6e`,950:`#082f49`},blue:{50:`#eff6ff`,100:`#dbeafe`,200:`#bfdbfe`,300:`#93c5fd`,400:`#60a5fa`,500:`#3b82f6`,600:`#2563eb`,700:`#1d4ed8`,800:`#1e40af`,900:`#1e3a8a`,950:`#172554`},indigo:{50:`#eef2ff`,100:`#e0e7ff`,200:`#c7d2fe`,300:`#a5b4fc`,400:`#818cf8`,500:`#6366f1`,600:`#4f46e5`,700:`#4338ca`,800:`#3730a3`,900:`#312e81`,950:`#1e1b4b`},violet:{50:`#f5f3ff`,100:`#ede9fe`,200:`#ddd6fe`,300:`#c4b5fd`,400:`#a78bfa`,500:`#8b5cf6`,600:`#7c3aed`,700:`#6d28d9`,800:`#5b21b6`,900:`#4c1d95`,950:`#2e1065`},purple:{50:`#faf5ff`,100:`#f3e8ff`,200:`#e9d5ff`,300:`#d8b4fe`,400:`#c084fc`,500:`#a855f7`,600:`#9333ea`,700:`#7e22ce`,800:`#6b21a8`,900:`#581c87`,950:`#3b0764`},fuchsia:{50:`#fdf4ff`,100:`#fae8ff`,200:`#f5d0fe`,300:`#f0abfc`,400:`#e879f9`,500:`#d946ef`,600:`#c026d3`,700:`#a21caf`,800:`#86198f`,900:`#701a75`,950:`#4a044e`},pink:{50:`#fdf2f8`,100:`#fce7f3`,200:`#fbcfe8`,300:`#f9a8d4`,400:`#f472b6`,500:`#ec4899`,600:`#db2777`,700:`#be185d`,800:`#9d174d`,900:`#831843`,950:`#500724`},rose:{50:`#fff1f2`,100:`#ffe4e6`,200:`#fecdd3`,300:`#fda4af`,400:`#fb7185`,500:`#f43f5e`,600:`#e11d48`,700:`#be123c`,800:`#9f1239`,900:`#881337`,950:`#4c0519`}},xV={p:`padding`,px:`padding-left,padding-right`,py:`padding-top,padding-bottom`,pt:`padding-top`,pr:`padding-right`,pb:`padding-bottom`,pl:`padding-left`,ps:`padding-left`,pe:`padding-right`,m:`margin`,mx:`margin-left,margin-right`,my:`margin-top,margin-bottom`,mt:`margin-top`,mr:`margin-right`,mb:`margin-bottom`,ml:`margin-left`,ms:`margin-left`,me:`margin-right`,gap:`gap`,"gap-x":`column-gap`,"gap-y":`row-gap`,text:`font-size`,leading:`line-height`,tracking:`letter-spacing`,rounded:`border-radius`,"rounded-t":`border-top-left-radius,border-top-right-radius`,"rounded-b":`border-bottom-left-radius,border-bottom-right-radius`,"rounded-l":`border-top-left-radius,border-bottom-left-radius`,"rounded-r":`border-top-right-radius,border-bottom-right-radius`,"rounded-tl":`border-top-left-radius`,"rounded-tr":`border-top-right-radius`,"rounded-bl":`border-bottom-left-radius`,"rounded-br":`border-bottom-right-radius`,border:`border-width`,"border-t":`border-top-width`,"border-r":`border-right-width`,"border-b":`border-bottom-width`,"border-l":`border-left-width`,w:`width`,h:`height`,size:`width,height`,"max-w":`max-width`,"max-h":`max-height`,"min-w":`min-width`,"min-h":`min-height`,opacity:`opacity`,inset:`top,right,bottom,left`,"inset-x":`left,right`,"inset-y":`top,bottom`,top:`top`,right:`right`,bottom:`bottom`,left:`left`,z:`z-index`,items:`align-items`,justify:`justify-content`,font:`font-weight`,whitespace:`white-space`},SV={"font-size":[`font-size`,`font size`,`text-size`,`text size`],color:[`color`,`text-color`,`text color`,`text-colour`,`text colour`,`foreground`,`fg`],"background-color":[`background`,`background-color`,`background color`,`bg`,`bg-color`,`bg color`],"border-color":[`border-color`,`border color`],fill:[`fill`,`fill-color`,`fill color`],stroke:[`stroke`,`stroke-color`,`stroke color`],"font-family":[`font`,`font-sans`,`font-serif`,`font-mono`,`family`,`sans`,`serif`,`mono`],"font-style":[`italic`,`not-italic`],"text-align":[`text-left`,`text-center`,`text-right`,`text-justify`],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-decoration-line":[`underline`,`line-through`,`no-underline`],"white-space":[`whitespace`,`whitespace-normal`,`whitespace-nowrap`,`whitespace-pre`],"word-break":[`break-normal`,`break-all`,`break-keep`],"overflow-wrap":[`break-words`,`break-anywhere`],"font-variant-numeric":[`tabular-nums`,`proportional-nums`,`lining-nums`,`oldstyle-nums`],"border-style":[`border-solid`,`border-dashed`,`border-dotted`,`border-none`]},CV=(()=>{let e={};for(let[t,n]of Object.entries(xV))n!==void 0&&(e[n]??=new Set).add(t);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=Array.from(r));for(let[e,n]of Object.entries(SV)){let r=new Set([...t[e]??[],...n]);t[e]=Array.from(r)}return t})(),wV={text:`color`,bg:`background-color`,border:`border-color`,"border-x":`border-color`,"border-y":`border-color`,"border-t":`border-color`,"border-r":`border-color`,"border-b":`border-color`,"border-l":`border-color`,"border-s":`border-color`,"border-e":`border-color`,fill:`fill`,stroke:`stroke`},TV=e=>xV[e]!==void 0||wV[e]!==void 0,EV=e=>{let t=0,n=-1;for(let r=0;r<e.length;r++){let i=e[r];i===`[`?t++:i===`]`?t--:i===`:`&&t===0&&(n=r)}let r=n>=0?e.slice(n+1):e;return r.startsWith(`!`)?r.slice(1):r},DV=e=>{let t=EV(e);if(!t)return null;let n=t.indexOf(`[`);if(n>0)return t.slice(0,n).replace(/-$/,``)||null;let r=t.split(`-`).filter(Boolean);if(r.length===0)return null;for(let e=r.length;e>=1;e--){let t=r.slice(0,e).join(`-`);if(TV(t))return t}return r[0]},OV=/-(red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone|black|white|transparent|current|inherit)\b/,kV=(e,t)=>e!==`text`&&e!==`bg`&&e!==`border`&&!e.startsWith(`border-`)?!1:OV.test(t),AV=new Set(`color.red.orange.amber.yellow.lime.green.emerald.teal.cyan.sky.blue.indigo.violet.purple.fuchsia.pink.rose.slate.gray.grey.zinc.neutral.stone.black.white.transparent.current.currentcolor.inherit.primary.secondary.accent.muted.foreground.background.destructive.success.warning.error.info.card.popover.input.ring`.split(`.`)),jV=new Set([`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`,`8xl`,`9xl`]),MV=/^(#|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color:|color\(|var\(--.*color)/,NV=/^(-?\d|length:|size:)/,PV=e=>e.trim().toLowerCase().replace(/\s+/g,`-`).replace(/([a-z])(\d)/g,`$1-$2`),FV=e=>MV.test(e)&&!NV.test(e),IV=(e,t)=>{if(e===t)return``;let n=`${t}-`;return e.startsWith(n)?e.slice(n.length):null},LV=e=>{let t=EV(PV(e)),n=DV(t);if(!n)return null;let r=wV[n];if(!r)return null;let i=t.indexOf(`[`);if(i>=0)return FV(t.slice(i+1).replace(/\]$/,``))?r:null;let a=IV(t,n);if(a===null)return null;if(n===`bg`&&a===``||(n===`fill`||n===`stroke`)&&a===``)return r;let o=a.split(`-`)[0];return n===`text`&&jV.has(o)?null:AV.has(o)?r:null},RV={black:`#000000`,white:`#ffffff`,transparent:LN},zV=e=>{let t=EV(PV(e)),n=DV(t);if(!n||wV[n]===void 0||t.includes(`[`))return null;let r=IV(t,n);if(!r)return null;let i=RV[r];if(i)return i;let a=r.lastIndexOf(`-`);if(a<0)return null;let o=r.slice(0,a),s=o===`grey`?`gray`:o,c=Number.parseInt(r.slice(a+1),10);return bV[s]?.[c]??null},BV=/^-?\d/,VV=(e,t)=>{if(t===``||t.startsWith(`[`)||BV.test(t))return!0;let n=t.split(`-`)[0];return e===`text`?jV.has(n):e===`font`||e===`border`||e.startsWith(`border-`)?!1:(e===`rounded`||e.startsWith(`rounded-`),!0)},HV={"font-sans":{property:`font-family`,value:`ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`},"font-serif":{property:`font-family`,value:`ui-serif, Georgia, Cambria, "Times New Roman", Times, serif`},"font-mono":{property:`font-family`,value:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`},"font-thin":{property:`font-weight`,value:`100`},"font-extralight":{property:`font-weight`,value:`200`},"font-light":{property:`font-weight`,value:`300`},"font-normal":{property:`font-weight`,value:`400`},"font-medium":{property:`font-weight`,value:`500`},"font-semibold":{property:`font-weight`,value:`600`},"font-bold":{property:`font-weight`,value:`700`},"font-extrabold":{property:`font-weight`,value:`800`},"font-black":{property:`font-weight`,value:`900`},"text-left":{property:`text-align`,value:`left`},"text-center":{property:`text-align`,value:`center`},"text-right":{property:`text-align`,value:`right`},"text-justify":{property:`text-align`,value:`justify`},italic:{property:`font-style`,value:`italic`},"not-italic":{property:`font-style`,value:`normal`},uppercase:{property:`text-transform`,value:`uppercase`},lowercase:{property:`text-transform`,value:`lowercase`},capitalize:{property:`text-transform`,value:`capitalize`},"normal-case":{property:`text-transform`,value:`none`},underline:{property:`text-decoration-line`,value:`underline`},"line-through":{property:`text-decoration-line`,value:`line-through`},"no-underline":{property:`text-decoration-line`,value:`none`},"whitespace-normal":{property:`white-space`,value:`normal`},"whitespace-nowrap":{property:`white-space`,value:`nowrap`},"whitespace-pre":{property:`white-space`,value:`pre`},"whitespace-pre-line":{property:`white-space`,value:`pre-line`},"whitespace-pre-wrap":{property:`white-space`,value:`pre-wrap`},"whitespace-break-spaces":{property:`white-space`,value:`break-spaces`},"break-normal":{property:`word-break`,value:`normal`},"break-all":{property:`word-break`,value:`break-all`},"break-keep":{property:`word-break`,value:`keep-all`},"break-words":{property:`overflow-wrap`,value:`break-word`},"break-anywhere":{property:`overflow-wrap`,value:`anywhere`},"tabular-nums":{property:`font-variant-numeric`,value:`tabular-nums`},"proportional-nums":{property:`font-variant-numeric`,value:`proportional-nums`},"lining-nums":{property:`font-variant-numeric`,value:`lining-nums`},"oldstyle-nums":{property:`font-variant-numeric`,value:`oldstyle-nums`},"slashed-zero":{property:`font-variant-numeric`,value:`slashed-zero`},"border-solid":{property:`border-style`,value:`solid`},"border-dashed":{property:`border-style`,value:`dashed`},"border-dotted":{property:`border-style`,value:`dotted`},"border-none":{property:`border-style`,value:`none`}},UV=e=>{let t=PV(e);if(!t)return[];let n=JV(t);if(n)return[n.property];let r=LV(t);return r?[r]:[]},WV=e=>{let t=PV(e);if(!t)return[];let n=DV(t);if(!n)return[];let r=IV(EV(t),n);if(r===null||!VV(n,r))return[];let i=qV(n);return i?[i]:[]},GV=e=>{let t=e.getAttribute(`class`);if(!t)return new Set;let n=t.split(/\s+/).filter(Boolean),r=new Set;for(let e of n){let t=DV(e);if(!t||kV(t,e))continue;let n=JV(e);if(n){r.add(n.property);continue}let i=qV(t);i&&r.add(i)}return r},KV=e=>CV[e]??[],qV=e=>{let t=xV[e];return t===void 0?null:t},JV=e=>{let t=HV[EV(e)];return t===void 0?null:t},YV=`react-grab-toolbar-state`,XV=()=>{try{let e=localStorage.getItem(YV);if(!e)return null;let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t,r=typeof n.collapsed==`boolean`&&n.collapsed;return{edge:n.edge===`top`||n.edge===`bottom`||n.edge===`left`||n.edge===`right`?n.edge:`bottom`,ratio:typeof n.ratio==`number`?n.ratio:DN,collapsed:r,enabled:!r,defaultAction:typeof n.defaultAction==`string`?n.defaultAction:ON}}catch(e){console.warn(`[react-grab] Failed to load toolbar state from localStorage:`,e)}return null},ZV=e=>{try{localStorage.setItem(YV,JSON.stringify(e))}catch(e){console.warn(`[react-grab] Failed to save toolbar state to localStorage:`,e)}},QV=e=>{let[t,n]=J(!1);return IR(()=>{let t=XM(t=>n(e(t))),r=()=>n(!1);window.addEventListener(`keydown`,t,{capture:!0}),window.addEventListener(`keyup`,t,{capture:!0}),window.addEventListener(`blur`,r),LR(()=>{window.removeEventListener(`keydown`,t,{capture:!0}),window.removeEventListener(`keyup`,t,{capture:!0}),window.removeEventListener(`blur`,r)})}),t},$V=e=>e.key===`Enter`,eH=e=>e.metaKey||e.ctrlKey,tH=(e,t,n={})=>{if(!t.key)return null;if($V(t))return e.find(e=>e.shortcut===`Enter`)??null;if(t.repeat)return null;let r=t.key.toLowerCase();return eH(t)?n.includeModifierShortcuts===!0?e.find(e=>e.shortcut!==void 0&&e.shortcut!==`Enter`&&e.shortcutModifier!==!1&&r===e.shortcut.toLowerCase())??null:null:e.find(e=>e.shortcut!==void 0&&e.shortcutModifier===!1&&r===e.shortcut.toLowerCase())??null},nH=()=>{let e=!1;return{arm:()=>{e=!0},clear:()=>{e=!1},consume:()=>e?(e=!1,!0):!1}}})),iH,aH,oH,sH,cH,lH,uH,dH,fH,pH,mH,hH,gH,_H,vH,yH,bH,xH,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU,NU,PU,FU,IU,LU,RU,zU,BU,VU,HU,UU,WU,GU,KU,qU,JU,YU,XU,ZU,QU,$U,eW,tW,nW,rW,iW,aW,oW,sW,cW,lW,uW,dW,fW,pW,mW,hW=t((()=>{wR(),iH=class extends Error{constructor(e){super(e),this.name=`ReactGrabError`}},aH=class extends iH{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},oH=class extends iH{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},sH=class extends iH{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},cH=class extends iH{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}},lH=e=>e===void 0||!Number.isFinite(e)?3:Math.max(0,Math.floor(e)),uH=e=>{try{return decodeURIComponent(e)}catch{return e}},dH=/(?:^|[/\\])node_modules[/\\]/,fH=/[/\\]\.vite[/\\]deps[^/\\]*[/\\]/,pH=/\.[mc]?[jt]sx?$/i,mH=/^chunk-[A-Za-z0-9_-]+$/,hH=/[/\\]/,gH=/^(.+?)@v?\d/,_H=e=>e.split(hH).filter(Boolean),vH=e=>{let[t,n]=_H(e);return!t||t.startsWith(`.`)?null:t.startsWith(`@`)?n?`${t}/${n}`:null:t},yH=e=>{let t=_H(e)[0];if(!t)return null;let n=t.replace(pH,``);if(mH.test(n))return null;if(!n.startsWith(`@`))return n;let r=n.indexOf(`_`);return r===-1?null:`${n.slice(0,r)}/${n.slice(r+1)}`},bH=(e,t,n)=>{let r=e.split(t);return r.length>1?n(r[r.length-1]):null},xH=e=>e?.match(gH)?.[1]??null,SH=e=>{let t;try{t=new URL(e)}catch{return null}if(!t.hostname)return null;let n=_H(t.pathname).map(uH);for(let[e,t]of n.entries()){if(t.startsWith(`@`)){let r=xH(n[e+1]);if(r)return`${t}/${r}`;continue}let r=xH(t);if(r)return r}return null},CH=e=>bH(e,fH,yH)??bH(e,dH,vH),wH=e=>{if(!e)return null;let t=EF(e);return t&&(CH(uH(t))||SH(e))||null},TH=/^@[A-Za-z0-9][A-Za-z0-9._-]*$/,EH=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,DH=new Set([`app`,`web`,`website`,`frontend`,`client`,`src`]),OH=new Set([`app`,`src`,`components`,`pages`,`features`,`modules`,`hooks`,`lib`,`utils`,`ui`,`shared`,`common`,`core`,`styles`,`assets`]),kH=e=>{let t=e;for(;t.startsWith(`../`)||t.startsWith(`./`);)t=t.slice(t.startsWith(`../`)?3:2);return t},AH=e=>{let t=kH(uH(EF(e)));if(t.startsWith(`/`))return null;let[n,r,...i]=_H(t);return!n||!r||i.length===0||!TH.test(n)||OH.has(n.slice(1))||!EH.test(r)||pH.test(r)||DH.has(r)?null:`${n}/${r}`},jH=e=>e?wH(e)??AH(e):null,MH=e=>{if(!e)return{origin:`unknown`,packageName:null};let t=jH(e);return t?{origin:`package`,packageName:t}:DF(e)?{origin:`app`,packageName:null}:{origin:`unknown`,packageName:null}},NH=new Set([`role`,`name`,`aria-label`,`rel`,`href`]),PH=e=>{if(!/^[a-z-]{3,}$/i.test(e))return!1;let t=e.split(/-|[A-Z]/);for(let e of t)if(e.length<=2||/[^aeiou]{4,}/i.test(e))return!1;return!0},FH=(e,t)=>{let n=NH.has(e)||e.startsWith(`data-`)&&PH(e),r=PH(t)&&t.length<100||t.startsWith(`#`)&&PH(t.slice(1));return n&&r},IH=e=>{let t=e[0].name;for(let n=1;n<e.length;n++)t=`${e[n].name} > ${t}`;return t},LH=e=>{let t=0;for(let n of e)t+=n.penalty;return t},RH=(e,t)=>LH(e)-LH(t),zH=(e,t)=>{let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let i=0;for(;r&&(r instanceof Element&&(t===void 0||r.tagName.toLowerCase()===t)&&i++,r!==e);)r=r.nextSibling;return i},BH=(e,t)=>e===`html`?`html`:`${e}:nth-child(${t})`,VH=(e,t)=>e===`html`?`html`:`${e}:nth-of-type(${t})`,HH=(e,t)=>{let n=[],r=e.getAttribute(`id`),i=e.tagName.toLowerCase();r&&PH(r)&&n.push({name:`#${CSS.escape(r)}`,penalty:0});for(let t of e.classList)PH(t)&&n.push({name:`.${CSS.escape(t)}`,penalty:1});for(let r of e.attributes)t(r.name,r.value)&&n.push({name:`[${CSS.escape(r.name)}="${CSS.escape(r.value)}"]`,penalty:2});n.push({name:i,penalty:5});let a=zH(e,i);a!==void 0&&n.push({name:VH(i,a),penalty:10});let o=zH(e);return o!==void 0&&n.push({name:BH(i,o),penalty:50}),n},UH=(e,t=oN,n=[])=>{if(t<=0)return[];if(e.length===0)return[n];let r=[];for(let i of e[0]){let a=t-r.length;if(a<=0)break;r.push(...UH(e.slice(1),a,[...n,i]))}return r},WH=(e,t)=>{let n=t.getRootNode?.();return n instanceof ShadowRoot?n:e instanceof Document?e:e.ownerDocument},GH=(e,t)=>t.querySelectorAll(IH(e)).length===1,KH=(e,t)=>{let n=e,r=[];for(;n&&n!==t;){let e=n.tagName.toLowerCase(),t=zH(n,e);if(t===void 0)return;r.push({name:VH(e,t),penalty:10}),n=n.parentElement}return GH(r,t)?r:void 0},qH=(e,t,n,r)=>{if(e.nodeType!==Node.ELEMENT_NODE)throw new aH;if(e.tagName.toLowerCase()===`html`)return`html`;let i=WH(t,e),a=Date.now(),o=[],s=e,c=0,l;for(;s&&s!==i&&!l;)if(o.push(HH(s,r)),s=s.parentElement,c++,c>=3){let t=UH(o);t.sort(RH);for(let r of t){if(Date.now()-a>n){let t=KH(e,i);if(!t)throw new oH(n);return IH(t)}if(GH(r,i)){l=r;break}}}if(!l&&c<3){let e=UH(o);e.sort(RH);for(let t of e){if(Date.now()-a>n)break;if(GH(t,i)){l=t;break}}}if(!l)throw new sH;return IH(l)},JH=e=>e.ownerDocument.body??e.ownerDocument.documentElement,YH=new Set([`data-testid`,`data-test-id`,`data-test`,`data-cy`,`data-qa`,`aria-label`,`href`,`src`,`role`,`name`,`title`,`alt`]),XH=e=>e.length>0&&e.length<=120,ZH=(e,t)=>{try{let n=e.ownerDocument.querySelectorAll(t);return n.length===1&&n[0]===e}catch{return!1}},QH=e=>{if(e instanceof HTMLElement&&e.id){let t=`#${CSS.escape(e.id)}`;if(ZH(e,t))return t}for(let t of YH){let n=e.getAttribute(t);if(!n||!XH(n))continue;let r=`[${t}=${JSON.stringify(n)}]`;if(ZH(e,r))return r;let i=`${e.tagName.toLowerCase()}${r}`;if(ZH(e,i))return i}return null},$H=e=>{let t=[],n=JH(e),r=e;for(;r;){if(r instanceof HTMLElement&&r.id){t.unshift(`#${CSS.escape(r.id)}`);break}let e=r.parentElement;if(!e){t.unshift(r.tagName.toLowerCase());break}let i=Array.from(e.children).indexOf(r)+1;if(t.unshift(`${r.tagName.toLowerCase()}:nth-child(${i})`),e===n){t.unshift(n.tagName.toLowerCase());break}r=e}return t.join(` > `)},eU=e=>{let t=QH(e);if(t)return t;try{let t=qH(e,JH(e),200,(e,t)=>FH(e,t)||YH.has(e)&&XH(t));if(t)return t}catch{}return $H(e)},tU=e=>{if(!e)return!1;let t=`/${aI(e)}/`.toLowerCase();return rN.some(e=>t.includes(e))},nU=e=>e.map(e=>`\n in ${e}`).join(``),rU=[`about://React/`,`rsc://React/`],iU=e=>rU.some(t=>e.startsWith(t)),aU=e=>{for(let t of rU){if(!e.startsWith(t))continue;let n=e.indexOf(`/`,t.length);if(n===-1)continue;let r=n+1,i=e.lastIndexOf(`?`);return uH(i>r?e.slice(r,i):e.slice(r))}return e},oU=e=>{if(typeof e!=`object`||!e||!(`status`in e)||e.status!==`fulfilled`||!(`value`in e)||typeof e.value!=`object`||e.value===null||!(`originalStackFrame`in e.value))return null;let t=e.value.originalStackFrame;return typeof t!=`object`||!t||!(`file`in t)||typeof t.file!=`string`||!t.file||`ignored`in t&&t.ignored?null:{file:t.file,line1:`line1`in t&&typeof t.line1==`number`?t.line1:null,column1:`column1`in t&&typeof t.column1==`number`?t.column1:null}},sU=async(e,t)=>{let n=[],r=[];for(let t=0;t<e.length;t++){let i=e[t];!i.isServer||!i.fileName||(n.push(t),r.push({file:aU(i.fileName),methodName:i.functionName??`<unknown>`,line1:i.lineNumber??null,column1:i.columnNumber??null,arguments:[]}))}if(r.length===0)return e;let i=new AbortController,a=setTimeout(()=>i.abort(),iN),o=()=>i.abort();t?.aborted&&i.abort(),t?.addEventListener(`abort`,o);try{let t=await fetch(`${lI()}/__nextjs_original-stack-frames`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({frames:r,isServer:!0,isEdgeServer:!1,isAppDirectory:!0}),priority:`high`,signal:i.signal});if(!t.ok)return e;let a=await t.json();if(!Array.isArray(a))return e;let o=[...e];for(let t=0;t<n.length;t++){let r=oU(a[t]);if(!r)continue;let i=n[t];o[i]={...e[i],fileName:r.file,lineNumber:r.line1??void 0,columnNumber:r.column1??void 0,isSymbolicated:!0}}return o}catch{return e}finally{clearTimeout(a),t?.removeEventListener(`abort`,o)}},cU=e=>{let t=new Map;return IM(e,e=>{if(!aF(e))return!1;let n=mF(e._debugStack.stack);if(!n)return!1;for(let e of FP(n))!e.functionName||!e.fileName||iU(e.fileName)&&(t.has(e.functionName)||t.set(e.functionName,{...e,isServer:!0}));return!1},!0),t},lU=(e,t)=>{if(!t.some(e=>e.isServer&&!e.fileName&&e.functionName))return t;let n=cU(e);return n.size===0?t:t.map(e=>{if(!e.isServer||e.fileName||!e.functionName)return e;let t=n.get(e.functionName);return t?{...e,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber}:e})},uU=0,dU=[],fU=()=>uU<3?(uU+=1,Promise.resolve()):new Promise(e=>{dU.push(e)}),pU=()=>{let e=dU.shift();if(e){e();return}--uU},mU=async(e,t,n=aN)=>{await fU();let r=new AbortController,i,a=new Promise(e=>{i=setTimeout(()=>{r.abort(),e(t)},n)}),o=e(r.signal);o.catch(()=>{});try{return await Promise.race([o,a])}finally{clearTimeout(i),pU()}},hU=(e,t)=>e.length>t?`${e.slice(0,t)}...`:e,gU=e=>e.startsWith(`data-react-grab-`),_U=e=>e.replace(/\s+/g,` `).trim(),vU=e=>{let t=[];for(let n of e.childNodes){if(n.nodeType!==Node.TEXT_NODE)continue;let e=_U(n.textContent??``);e&&t.push(e)}return t.join(` `)},yU=e=>e.getAttribute(`aria-hidden`)===`true`||e.hasAttribute(`hidden`)?!0:xN.has(e.tagName.toLowerCase()),bU=(e,t,n)=>{if(e.nodeType===Node.TEXT_NODE){let r=_U(e.textContent??``);return r?(t.push(r),n-r.length):n}if(!(e instanceof Element)||yU(e))return n;for(let r of e.childNodes)if(n=bU(r,t,n),n<=0)break;return n},xU=(e,t)=>{if(yU(e))return``;let n=vU(e);if(!bN.has(t)||n&&e.children.length===0)return n;let r=[];return bU(e,r,100),r.join(` `)},SU=e=>hU(e,15),CU=e=>{let t=[];for(let n of vN){let r=e.getAttribute(n);r&&t.push(`${n}="${r}"`)}return t.length>0?` ${t.join(` `)}`:``},wU=e=>e===`class`||e===`className`||e===`style`,TU=e=>{let t=[],n=[],r=``;for(let{name:i,value:a}of e.attributes)if(!gU(i)){if(wU(i)){i!==`style`&&a&&(r=` class="${SU(a)}"`);continue}yN.has(i)?t.push(a?` ${i}="${a}"`:` ${i}`):a&&n.push(` ${i}="${SU(a)}"`)}return t.join(``)+n.join(``)+r},EU=e=>e.length===0?``:e.length<=2?e.map(e=>`<${YN(e)} ...>`).join(`
268
+ `):`(${e.length} elements)`,DU=e=>{let t=YN(e);if(!(e instanceof HTMLElement))return`<${t}${CU(e)} />`;let n=TU(e),r=hU(xU(e,t),100);return r?`<${t}${n}>${r}</${t}>`:`<${t}${n} />`},OU=e=>{let t=YN(e),n=TU(e),r=xU(e,t),i=[],a=[],o=!1;for(let t of e.childNodes)t.nodeType!==Node.COMMENT_NODE&&(t.nodeType===Node.TEXT_NODE?t.textContent&&t.textContent.trim().length>0&&(o=!0):t instanceof Element&&(o?a.push(t):i.push(t)));let s=r.length>0&&bN.has(t),c=``,l=EU(i);l&&!s&&(c+=`\n ${l}`),r&&(c+=`\n ${hU(r,100)}`);let u=EU(a);return u&&!s&&(c+=`\n ${u}`),c.length>0?`<${t}${n}>${c}\n</${t}>`:`<${t}${n} />`},kU=new Set([`_`,`$`,`motion.`,`styled.`,`chakra.`,`ark.`,`Primitive.`,`Slot.`]),AU=new Set(`AppRouter.AppRouterAnnouncer.AppDevOverlay.AppDevOverlayErrorBoundary.ClientPageRoot.ClientSegmentRoot.DevRootHTTPAccessFallbackBoundary.ErrorBoundary.ErrorBoundaryHandler.GracefulDegradeBoundary.HTTPAccessErrorFallback.HTTPAccessFallbackBoundary.HTTPAccessFallbackErrorBoundary.HandleRedirect.Head.HistoryUpdater.HotReload.InnerLayoutRouter.InnerScrollAndFocusHandler.InnerScrollAndFocusHandlerOld.InnerScrollAndMaybeFocusHandler.InnerScrollHandlerNew.LoadableComponent.LoadingBoundary.LoadingBoundaryProvider.NotAllowedRootHTTPFallbackError.OfflineProvider.OuterLayoutRouter.RedirectBoundary.RedirectErrorBoundary.RenderFromTemplateContext.RenderValidationBoundaryAtThisLevel.ReplaySsrOnlyErrors.RootErrorBoundary.RootLevelDevOverlayElement.Router.ScrollAndFocusHandler.ScrollAndMaybeFocusHandler.SegmentBoundaryTrigger.SegmentBoundaryTriggerNode.SegmentStateProvider.SegmentTrieNode.SegmentViewNode.SegmentViewStateNode.ServerRoot.body.html`.split(`.`)),jU=new Set([`Suspense`,`Fragment`,`StrictMode`,`Profiler`,`SuspenseList`]),MU=new Set([`MotionDOMComponent`]),NU=e=>{if(AU.has(e)||jU.has(e)||MU.has(e))return!0;for(let t of kU)if(e.startsWith(t))return!0;return!1},PU=e=>!(!e||NU(e)||e===`SlotClone`||e===`Slot`),FU=e=>!(e.length<=1||NU(e)||e[0]!==e[0].toUpperCase()||e.endsWith(`Provider`)||e.endsWith(`Context`)),IU=e=>e&&FU(e)?e:null,LU=e=>{if(!SP())return e;let t=e;for(;t;){if(CP(t))return t;t=t.parentElement}return e},RU=e=>{if(!SP())return null;let t=CP(LU(e)),n=0;for(;t;){if(t.key)return t.key;if(_P(t)&&(n+=1,n===2))break;t=t.return}return null},zU=new WeakMap,BU=new WeakMap,VU=e=>t=>fetch(t,{signal:e,priority:`high`}),HU=e=>mU(async t=>{try{let n=CP(e);if(!n)return null;let r=await bF(n,!0,VU(t));return sI()?await sU(lU(n,r),t):r}catch{return null}},null),UU=e=>{if(!SP())return Promise.resolve([]);let t=LU(e),n=zU.get(t);if(n)return n;let r=HU(t).then(e=>(e===null&&zU.delete(t),e));return zU.set(t,r),r},WU=async e=>{if(!SP())return null;let t=await UU(e);if(!t)return null;for(let e of t){let t=IU(e.functionName);if(t)return t}return null},GU=e=>e.find(e=>!!IU(e.functionName))??e[0]??null,KU=e=>!e||!_P(e)?null:IU(xP(e.type)),qU=e=>mU(async t=>{let n=CP(LU(e));if(!n)return null;try{let e=await SF(n,!0,VU(t));return e?.fileName?{filePath:aI(e.fileName),lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null,componentName:IU(e.functionName)??KU(n._debugOwner),origin:MH(e.fileName).origin}:null}catch{return null}},null),JU=e=>{let t=LU(e),n=BU.get(t);if(n)return n;let r=qU(t).then(e=>(e||BU.delete(t),e));return BU.set(t,r),r},YU=[`app`,`package`],XU=(e,t)=>{for(let n of YU){if(e?.origin===n)return e;let r=GU(t.filter(e=>MH(e.fileName).origin===n));if(r?.fileName)return{filePath:aI(r.fileName),lineNumber:r.lineNumber??null,columnNumber:r.columnNumber??null,componentName:IU(r.functionName),origin:n}}return null},ZU=async e=>{let t=await JU(e);return t?.origin===`app`?t:XU(t,await UU(e)??[])},QU=e=>$U(LU(e),1)[0]??null,$U=(e,t,n=()=>!0)=>{if(!SP())return[];let r=CP(e);if(!r)return[];let i=[];return IM(r,e=>{if(i.length>=t)return!0;if(_P(e)){let t=xP(e.type);t&&PU(t)&&n(t)&&i.push(t)}return!1},!0),i},eW=[`/src/app/`,`/src/pages/`,`/app/`,`/pages/`],tW=(e,t)=>{let n=aI(e);if(!t||!n.startsWith(`/`))return n;for(let e of eW){let t=n.indexOf(e);if(t!==-1)return`/./${n.slice(t+1)}`}return n},nW=(e,t)=>{let n=tW(e.filePath,t),r=t&&e.lineNumber?`${n}:${e.lineNumber}${e.columnNumber?`:${e.columnNumber}`:``}`:n;return e.componentName?`\n in ${e.componentName} (at ${r})`:`\n in ${r}`},rW={isAppSource:!1,consumesBudget:!1},iW=(e,t,n,r)=>{let i=t.packageName,a=t.origin===`app`?e.fileName:null;if(e.isServer&&!a&&(n||!e.functionName)){let e=i?`${i} at Server`:`at Server`;return{text:`\n in ${n??`<anonymous>`} (${e})`,...rW}}return!a&&n?{text:i?`\n in ${n} (${i})`:`\n in ${n}`,...rW}:i?{text:`\n in ${i}`,...rW}:a?{text:nW({componentName:n,filePath:a,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null},r),isAppSource:!0,consumesBudget:!tU(a)}:null},aW=(e,t={},n=null)=>{let r=lH(t.maxLines),i=Math.max(r,20),a=sI(),o=[],s=new Set,c=null,l=!1,u=!1,d=!1,f=0,p=e=>{e&&s.add(e)};n&&(u=n.origin===`app`,tU(n.filePath)||(f+=1),p(n.componentName),o.push(nW(n,a)));for(let t of e){if(f>=r||o.length>=i)break;let e=MH(t.fileName),s=IU(t.functionName),m=e.packageName?`${e.packageName}:${s??``}:${t.isServer?`server`:`client`}`:null;if(m&&m===c)continue;if(!l&&s&&s===n?.componentName){l=!0;continue}let h=iW(t,e,s,a);h!==null&&h.text!==o[o.length-1]&&(h.isAppSource&&(u=!0),h.consumesBudget&&(f+=1,d=!0),p(s),o.push(h.text),c=m)}return{text:o.join(``),shouldAppendSelectorHint:!u,hasBudgetedStackFrame:d,renderedComponentNames:s}},oW=async e=>{let t=await JU(e);return t?.origin===`app`?t:null},sW=(e,t,n)=>{let r=$U(LU(e),n,e=>FU(e)&&!t.renderedComponentNames.has(e));return r.length===0?t:{...t,text:`${t.text}${nU(r)}`}},cW=async(e,t={})=>{let n=await oW(e),r=await UU(e),i=lH(t.maxLines),a=aW(r??[],t,n);if(a.text)return a.hasBudgetedStackFrame?a:sW(e,a,i);let o=$U(LU(e),i);return{text:nU(o),shouldAppendSelectorHint:!0,hasBudgetedStackFrame:!1,renderedComponentNames:new Set(o)}},lW=async(e,t={})=>(await cW(e,t)).text,uW=(e,t)=>{let n=RU(e),r=n===null?``:`\n key: "${n}"`,i=t.shouldAppendSelectorHint?`\n selector: ${eU(e)}`:``;return`${t.text}${r}${i}`},dW=async(e,t={})=>{let n=await cW(e,t);return`${DU(e)}${uW(e,n).replace(/\n\s+/g,` `)}`},fW=async(e,t={})=>{let n=LU(e);return`${OU(n)}${uW(n,await cW(n,t))}`},pW=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`),mW=(e,t)=>{let n=t?.componentName??`div`,r={version:QM,content:e,entries:t?.entries??[{tagName:t?.tagName,componentName:n,content:e,commentText:t?.commentText}],timestamp:Date.now()},i=t=>{t.preventDefault(),t.clipboardData?.setData(`text/plain`,e),t.clipboardData?.setData(`text/html`,`<meta charset='utf-8'><pre><code>${pW(e)}</code></pre>`),t.clipboardData?.setData(`application/x-react-grab`,JSON.stringify(r))};document.addEventListener(`copy`,i);let a=document.createElement(`textarea`);a.value=e,a.style.position=`fixed`,a.style.left=`-9999px`,a.ariaHidden=`true`,document.body.appendChild(a),a.select();try{return typeof document.execCommand==`function`&&document.execCommand(`copy`)}finally{document.removeEventListener(`copy`,i),a.remove()}}})),gW=r({ReactGrabRenderer:()=>LJ}),_W,vW,yW,bW,xW,SW,CW,wW,TW,EW,DW,OW,kW,AW,jW,MW,NW,PW,FW,IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW,qW,JW,YW,XW,ZW,QW,$W,eG,tG,nG,rG,iG,aG,oG,sG,cG,lG,uG,dG,fG,pG,mG,hG,gG,_G,vG,yG,bG,xG,SG,CG,wG,TG,EG,DG,OG,kG,AG,jG,MG,NG,PG,FG,IG,LG,RG,zG,BG,VG,HG,UG,WG,GG,KG,qG,JG,YG,XG,ZG,QG,$G,eK,tK,nK,rK,iK,aK,oK,sK,cK,lK,uK,dK,fK,pK,mK,hK,gK,_K,vK,yK,bK,xK,SK,CK,wK,TK,EK,DK,OK,kK,AK,jK,MK,NK,PK,FK,IK,LK,RK,zK,BK,VK,HK,UK,WK,GK,KK,qK,JK,YK,XK,ZK,QK,$K,eq,tq,nq,rq,iq,aq,oq,sq,cq,lq,uq,dq,fq,pq,mq,hq,gq,_q,vq,yq,bq,xq,Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ=t((()=>{rH(),wR(),_W=(e,t,n)=>e+(t-e)*n,vW=(e,t)=>{let n=Math.max(t,1);return 1-(1-e)**(n/uN)},yW=Z(`<canvas data-react-grab-overlay-canvas style=position:fixed;top:0;left:0;pointer-events:none>`),bW={borderColor:mN,fillColor:hN,lerpFactor:tN},xW={drag:{borderColor:fN,fillColor:pN,lerpFactor:lN},selection:bW,grabbed:bW},SW=e=>{let t,n=null,r=0,i=0,a=1,o=null,s=null,c={drag:{canvas:null,context:null},selection:{canvas:null,context:null},grabbed:{canvas:null,context:null}},l=[],u=null,d=[],f=UM()?`display-p3`:`srgb`,p=(e,t,n)=>{let r=new OffscreenCanvas(e*n,t*n),i=r.getContext(`2d`,{colorSpace:f});return i&&i.scale(n,n),{canvas:r,context:i}},m=()=>{if(t){a=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,i=window.innerHeight,t.width=r*a,t.height=i*a,t.style.width=`${r}px`,t.style.height=`${i}px`,n=t.getContext(`2d`,{colorSpace:f}),n&&n.scale(a,a);for(let e of Object.keys(c))c[e]=p(r,i,a)}},h=e=>{if(!e)return 0;let t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):0},g=(e,t,n)=>({id:e,current:{x:t.x,y:t.y,width:t.width,height:t.height},target:{x:t.x,y:t.y,width:t.width,height:t.height},borderRadius:h(t.borderRadius),opacity:n?.opacity??1,targetOpacity:n?.targetOpacity??n?.opacity??1,createdAt:n?.createdAt,fadeStartTimestamp:null,isInitialized:!0}),_=(e,t,n)=>{let r=e.target;r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height,e.borderRadius=h(t.borderRadius),n!==void 0&&(e.targetOpacity=n)},v=e=>e.boundsMultiple??[e.bounds],y=(e,t,n,r,i,a,o,s,c=1)=>{if(r<=0||i<=0)return;let l=Math.min(r/2,i/2),u=Math.min(a,l),d=c!==1;d&&(e.globalAlpha=c),e.beginPath(),u>0?e.roundRect(t,n,r,i,u):e.rect(t,n,r,i),e.fillStyle=o,e.fill(),e.strokeStyle=s,e.lineWidth=1,e.stroke(),d&&(e.globalAlpha=1)},b=()=>{let t=c.drag;if(!t.context)return;let n=t.context;if(n.clearRect(0,0,r,i),!e.dragVisible||!u)return;let a=xW.drag;y(n,u.current.x,u.current.y,u.current.width,u.current.height,u.borderRadius,a.fillColor,a.borderColor)},x=()=>{let t=c.selection;if(!t.context)return;let n=t.context;if(n.clearRect(0,0,r,i),!e.selectionVisible)return;let a=xW.selection;for(let e of l)y(n,e.current.x,e.current.y,e.current.width,e.current.height,e.borderRadius,a.fillColor,a.borderColor,e.opacity)},S=(e,t)=>{let n=c[e];if(!n.context)return;let a=n.context;a.clearRect(0,0,r,i);let o=xW[e];for(let e of t)y(a,e.current.x,e.current.y,e.current.width,e.current.height,e.borderRadius,o.fillColor,o.borderColor,e.opacity)},C=()=>{if(!(!n||!t)&&!(r<=0||i<=0)){n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.width,t.height),n.setTransform(a,0,0,a,0,0),b(),x(),S(`grabbed`,d);for(let e of[`drag`,`selection`,`grabbed`]){let t=c[e];t.canvas&&n.drawImage(t.canvas,0,0,r,i)}}},w=(e,t,n)=>{let r=_W(e.current.x,e.target.x,t),i=_W(e.current.y,e.target.y,t),a=_W(e.current.width,e.target.width,t),o=_W(e.current.height,e.target.height,t),s=Math.abs(r-e.target.x)<.5&&Math.abs(i-e.target.y)<.5&&Math.abs(a-e.target.width)<.5&&Math.abs(o-e.target.height)<.5;e.current.x=s?e.target.x:r,e.current.y=s?e.target.y:i,e.current.width=s?e.target.width:a,e.current.height=s?e.target.height:o;let c=!0;if(n?.interpolateOpacity){let n=_W(e.opacity,e.targetOpacity,t);c=Math.abs(n-e.targetOpacity)<dN,e.opacity=c?e.targetOpacity:n}return!s||!c},T=()=>{let e=performance.now(),t=s===null?uN:e-s;s=e;let n=vW(xW.drag.lerpFactor,t),r=vW(xW.selection.lerpFactor,t),i=vW(xW.grabbed.lerpFactor,t),a=!1;u?.isInitialized&&w(u,n)&&(a=!0);for(let e of l)e.isInitialized&&w(e,r)&&(a=!0);let c=Date.now();d=d.filter(t=>{let n=t.id.startsWith(`label-`);if(t.isInitialized&&w(t,i)&&(a=!0),n&&t.targetOpacity===0){t.fadeStartTimestamp===null&&(t.fadeStartTimestamp=e);let n=e-t.fadeStartTimestamp,r=Math.min(1,n/125),i=1-(1-r)*(1-r);return t.opacity=Math.max(0,1-i),r>=1?!1:(a=!0,!0)}else n&&(t.fadeStartTimestamp=null);if(t.createdAt){let e=c-t.createdAt;if(e>=1625)return!1;if(e>1500){let n=Math.min(1,(e-nN)/125);t.opacity=1-(1-(1-n)*(1-n)),a=!0}return!0}return n?!0:t.opacity>0}),C(),a?o=pI(T):(o=null,s=null)},E=()=>{o===null&&(o=pI(T))},D=()=>{m(),E()};return AR(FR(()=>[e.selectionVisible,e.selectionBounds,e.selectionBoundsMultiple,e.selectionShouldSnap],([e,t,n,r])=>{if(!e||!t&&(!n||n.length===0)){l=[],E();return}let i;i=n&&n.length>0?n:t?[t]:[];let a=new Map;for(let e of l)a.set(e.id,e);l=i.map((e,t)=>{let n=`selection-${t}`,i=a.get(n);return i?(_(i,e),r&&(i.current.x=i.target.x,i.current.y=i.target.y,i.current.width=i.target.width,i.current.height=i.target.height),i):g(n,e)}),E()})),AR(FR(()=>[e.dragVisible,e.dragBounds],([e,t])=>{if(!e||!t){u=null,E();return}u?_(u,t):u=g(`drag`,t),E()})),AR(FR(()=>[e.grabbedBoxes,e.labelInstances],([e,t])=>{let n=e??[],r=t??[],i=new Map;for(let e of n)i.set(e.id,e);let a=new Map;for(let e of d)a.set(e.id,e);for(let e of n)if(!a.has(e.id)){let t=g(e.id,e.bounds,{createdAt:e.createdAt});d.push(t),a.set(e.id,t)}for(let e of d){let t=i.get(e.id);t&&_(e,t.bounds)}let o=new Set;for(let e of r){let t=v(e),n=e.status===`fading`?0:1;for(let r=0;r<t.length;r++){let i=t[r],s=`label-${e.id}-${r}`;o.add(s);let c=a.get(s);if(c)_(c,i,n);else{let e=g(s,i,{opacity:1,targetOpacity:n});d.push(e),a.set(s,e)}}}d=d.filter(e=>e.id.startsWith(`label-`)?o.has(e.id):i.has(e.id)),E()})),IR(()=>{m(),E(),window.addEventListener(`resize`,D);let e=null,t=()=>{Math.max(window.devicePixelRatio||1,2)!==a&&(D(),n())},n=()=>{e&&e.removeEventListener(`change`,t),e=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),e.addEventListener(`change`,t)};n(),LR(()=>{window.removeEventListener(`resize`,D),e&&e.removeEventListener(`change`,t),o!==null&&mI(o)})}),(()=>{var e=yW(),n=t;return typeof n==`function`?Mz(n,e):t=e,kR(t=>Az(e,`z-index`,String(cN))),e})()},CW=Z(`<div style=position:fixed;pointer-events:none;will-change:opacity;contain:strict;transform:translateZ(0)>`),wW=e=>{let t=JM(),n=t?getComputedStyle(t).borderRadius:`0px`,r=()=>t?.getBoundingClientRect()??null,[i,a]=J(r());if(t){let n=()=>a(r());IR(()=>{let e=new ResizeObserver(n);e.observe(t),window.addEventListener(`scroll`,n,{capture:!0,passive:!0}),window.addEventListener(`resize`,n),LR(()=>{e.disconnect(),window.removeEventListener(`scroll`,n,{capture:!0}),window.removeEventListener(`resize`,n)})}),AR(()=>{e.visible&&n()})}let o=()=>{let e=i();return e?`${e.top}px`:`0`},s=()=>{let e=i();return e?`${e.left}px`:`0`},c=()=>{let e=i();return e?`${e.width}px`:`100%`},l=()=>{let e=i();return e?`${e.height}px`:`100%`};return(()=>{var t=CW();return Az(t,`border-radius`,n),Az(t,`z-index`,cN),Az(t,`transition`,`opacity 125ms ease-out`),Az(t,`box-shadow`,`inset 0 0 50px ${gN}`),kR(n=>{var r=o(),i=s(),a=c(),u=l(),d=+!!e.visible;return r!==n.e&&Az(t,`top`,n.e=r),i!==n.t&&Az(t,`left`,n.t=i),a!==n.a&&Az(t,`width`,n.a=a),u!==n.o&&Az(t,`height`,n.o=u),d!==n.i&&Az(t,`opacity`,n.i=d),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),t})()},TW=(e,t)=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,t)}px`},EW=(e,t)=>{e&&e.focus(t)},DW=e=>{if(e<=0)return 8;let t=e*_N;return Math.round(Math.max(4,Math.min(8,t)))},OW=()=>{let e=JM();if(e){let t=e.getBoundingClientRect();return{width:t.width,height:t.height,offsetLeft:t.left,offsetTop:t.top}}let t=window.visualViewport;return t?{width:t.width,height:t.height,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop}:{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0}},kW=e=>{if(typeof e==`string`||typeof e==`number`)return String(e);if(!e||typeof e!=`object`)return``;if(Array.isArray(e)){let t=``;for(let n of e){if(!n)continue;let e=kW(n);e&&(t=t?`${t} ${e}`:e)}return t}let t=``;for(let n in e)e[n]&&(t=t?`${t} ${n}`:n);return t},AW=(...e)=>{let t=``;for(let n of e){if(!n)continue;let e=kW(n);e&&(t=t?`${t} ${e}`:e)}return t},jW=e=>e.elementsCount&&e.elementsCount>1?{tagName:`${e.elementsCount} elements`,componentName:void 0}:{tagName:e.tagName||e.componentName||`element`,componentName:e.tagName?e.componentName:void 0},MW=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M19.2929 12.7071C19.6834 13.0976 20.3166 13.0976 20.7071 12.7071C21.0976 12.3166 21.0976 11.6834 20.7071 11.2929L12.7071 3.29289C12.5196 3.10536 12.2652 3 12 3C11.7348 3 11.4804 3.10536 11.2929 3.29289L3.29289 11.2929C2.90237 11.6834 2.90237 12.3166 3.29289 12.7071C3.68342 13.0976 4.31658 13.0976 4.70711 12.7071L11 6.41421L11 20C11 20.5523 11.4477 21 12 21C12.5523 21 13 20.5523 13 20L13 6.41422L19.2929 12.7071Z">`),NW=e=>{let t=()=>e.size??10;return(()=>{var n=MW();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},PW=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path class=icon-loader-bar d="M12 2v4"style=animation-delay:0ms></path><path class=icon-loader-bar d="M15 6.8l2-3.5"style=animation-delay:-42ms></path><path class=icon-loader-bar d="M17.2 9l3.5-2"style=animation-delay:-83ms></path><path class=icon-loader-bar d="M18 12h4"style=animation-delay:-125ms></path><path class=icon-loader-bar d="M17.2 15l3.5 2"style=animation-delay:-167ms></path><path class=icon-loader-bar d="M15 17.2l2 3.5"style=animation-delay:-208ms></path><path class=icon-loader-bar d="M12 18v4"style=animation-delay:-250ms></path><path class=icon-loader-bar d="M9 17.2l-2 3.5"style=animation-delay:-292ms></path><path class=icon-loader-bar d="M6.8 15l-3.5 2"style=animation-delay:-333ms></path><path class=icon-loader-bar d="M2 12h4"style=animation-delay:-375ms></path><path class=icon-loader-bar d="M6.8 9l-3.5-2"style=animation-delay:-417ms></path><path class=icon-loader-bar d="M9 6.8l-2-3.5"style=animation-delay:-458ms>`),FW=e=>{let t=()=>e.size??16;return(()=>{var n=PW();return n.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling,kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},IW=Z(`<svg data-react-grab-arrow class="absolute block z-10"><path>`),LW=e=>{let t=()=>e.color??`var(--rg-panel-bg)`,n=()=>e.position===`bottom`,r=()=>DW(e.labelWidth??0),i=()=>r()*2,a=()=>r(),o=()=>{let e=i(),t=a(),r=1*Math.SQRT1_2,o=e/2,s=n()?t:0,c=n()?r:t-r,l=+!!n();return`M0 ${s} L${o-r} ${c} A1 1 0 0 ${l} ${o+r} ${c} L${e} ${s} Z`};return(()=>{var r=IW(),s=r.firstChild;return kR(c=>{var l=i(),u=a(),d=`0 0 ${i()} ${a()}`,f=`calc(${e.leftPercent}% + ${e.leftOffsetPx}px)`,p=n()?`0`:void 0,m=n()?void 0:`0`,h=n()?`translateX(-50%) translateY(calc(-100% + 1px))`:`translateX(-50%) translateY(calc(100% - 1px))`,g=o(),_=t();return l!==c.e&&Q(r,`width`,c.e=l),u!==c.t&&Q(r,`height`,c.t=u),d!==c.a&&Q(r,`viewBox`,c.a=d),f!==c.o&&Az(r,`left`,c.o=f),p!==c.i&&Az(r,`top`,c.i=p),m!==c.n&&Az(r,`bottom`,c.n=m),h!==c.s&&Az(r,`transform`,c.s=h),g!==c.h&&Q(s,`d`,c.h=g),_!==c.r&&Q(s,`fill`,c.r=_),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),r})()},RW=Z(`<span class=text-[var(--rg-text-primary)]>`),zW=Z(`<span class=text-[var(--rg-text-secondary)]>.`),BW=Z(`<span class="text-[13px] leading-4 h-fit font-medium overflow-hidden text-ellipsis whitespace-nowrap min-w-0">`),VW=Z(`<button type=button>`),HW=Z(`<div>`),UW=e=>{let t=()=>{e.onHoverChange?.(!0)},n=()=>{e.onHoverChange?.(!1)},r=()=>e.componentName?`${e.componentName}.${e.tagName}`:e.tagName,i=()=>(()=>{var t=BW();return $(t,X(_z,{get when(){return e.componentName},get children(){return[(()=>{var t=RW();return $(t,()=>e.componentName),t})(),(()=>{var t=zW();return t.firstChild,$(t,()=>e.tagName,null),t})()]}}),null),$(t,X(_z,{get when(){return!e.componentName},get children(){var t=RW();return $(t,()=>e.tagName),t}}),null),t})();return X(_z,{get when(){return e.isClickable},get fallback(){return(()=>{var r=HW();return Dz(r,`click`,e.onClick,!0),r.addEventListener(`mouseleave`,n),r.addEventListener(`mouseenter`,t),$(r,i),kR(()=>Ez(r,AW(`contain-layout flex items-center gap-1 max-w-[280px] overflow-hidden`,e.shrink&&`shrink-0`))),r})()},get children(){var a=VW();return Dz(a,`click`,e.onClick,!0),a.addEventListener(`mouseleave`,n),a.addEventListener(`mouseenter`,t),$(a,i),kR(t=>{var n=`Open source for ${r()}`,i=AW(`contain-layout flex items-center gap-1 max-w-[280px] overflow-hidden cursor-pointer bg-transparent border-none p-0 m-0 text-left`,e.shrink&&`shrink-0`);return n!==t.e&&Q(a,`aria-label`,t.e=n),i!==t.t&&Ez(a,t.t=i),t},{e:void 0,t:void 0}),a}})},Cz([`click`]),WW=Z(`<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-1.5 w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[var(--rg-border-subtle)] antialiased rounded-t-none rounded-b-[6px]">`),GW=e=>(()=>{var t=WW();return $(t,()=>e.children),t})(),KW=(e,t={})=>(n={})=>{let r=t.variants;if(!r)return e;let i=[e];for(let e in r){let a=n[e]??t.defaultVariants?.[e];if(a===void 0)continue;let o=r[e][String(a)];o&&i.push(o)}return AW(...i)},qW=Z(`<div>`),JW=KW(`contain-layout antialiased [font-synthesis:none] bg-[var(--rg-panel-bg)]`,{variants:{shape:{panel:`rounded-[14px] [corner-shape:superellipse(1.25)]`,pill:`rounded-full`}},defaultVariants:{shape:`panel`}}),YW=e=>{let[t,n]=mz(e,[`shape`,`class`]);return(()=>{var e=qW();return jz(e,pz({get class(){return AW(JW({shape:t.shape}),t.class)}},n),!1,!1),e})()},XW=null,ZW={claim:e=>{XW=e},release:e=>{XW===e&&(XW=null)},isActive:e=>XW===e},QW=e=>{let t=Symbol(),n=XM(n=>{ZW.isActive(t)&&(xB(n)||(n.code===`Enter`?e.onEnter?.(n):n.code===`Escape`&&e.onEscape?.(n)))});return IR(()=>{ZW.claim(t),window.addEventListener(`keydown`,n,{capture:!0})}),LR(()=>{ZW.release(t),window.removeEventListener(`keydown`,n,{capture:!0})}),{claimFocus:()=>ZW.claim(t)}},$W=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M10.7071 21.2071C10.3166 21.5976 9.68342 21.5976 9.29289 21.2071L3.29289 15.2071C2.90237 14.8166 2.90237 14.1834 3.29289 13.7929L9.29289 7.79289C9.68342 7.40237 10.3166 7.40237 10.7071 7.79289C11.0976 8.18342 11.0976 8.81658 10.7071 9.20711L6.41421 13.5H16C16.5523 13.5 17 13.0523 17 12.5V3.5C17 2.94772 17.4477 2.5 18 2.5C18.5523 2.5 19 2.94772 19 3.5V12.5C19 14.1569 17.6569 15.5 16 15.5H6.41421L10.7071 19.7929C11.0976 20.1834 11.0976 20.8166 10.7071 21.2071Z">`),eG=e=>{let t=()=>e.size??10;return(()=>{var n=$W();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},tG=Z(`<button>`),nG=KW(`contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all press-scale`,{variants:{variant:{chip:`px-[3px] py-px h-[17px] rounded-sm bg-[var(--rg-surface-hover)] [border-width:0.5px] border-solid border-[var(--rg-border-button)] hover:bg-[var(--rg-surface-active)] text-[var(--rg-text-primary)]`,destructive:`px-[3px] py-px h-[17px] rounded-sm bg-[var(--rg-error-bg)] hover:bg-[var(--rg-error-bg-hover)] text-[var(--rg-error-text)]`,ghost:`rounded-sm bg-transparent hover:bg-[var(--rg-surface-hover)] border-none outline-none p-0`}},defaultVariants:{variant:`chip`}}),rG=e=>{let[t,n]=mz(e,[`variant`,`class`,`type`]);return(()=>{var e=tG();return jz(e,pz({get type(){return t.type??`button`},get class(){return AW(nG({variant:t.variant}),t.class)}},n),!1,!1),e})()},iG=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">No`),aG=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Copy`),oG=Z(`<span class="text-[var(--rg-error-text)] text-[13px] leading-3.5 font-sans font-medium">Yes`),sG=Z(`<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit">`),cG=Z(`<div data-react-grab-discard-prompt class="contain-layout shrink-0 flex flex-col justify-center items-end w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">`),lG=e=>{let t=()=>e.showCancel??!0,{claimFocus:n}=QW({onEnter:t=>{t.preventDefault(),t.stopPropagation();let n=t.composedPath()[0],r=n instanceof HTMLElement?n:null;if(r?.closest(`[data-react-grab-discard-copy]`)){e.onCopy?.();return}if(r?.closest(`[data-react-grab-discard-no]`)){e.onCancel?.();return}if(r?.closest(`[data-react-grab-discard-yes]`)){e.onConfirm?.();return}e.onConfirm?.()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.cancelOnEscape?e.onCancel?.():e.onConfirm?.()}});return(()=>{var r=cG(),i=r.firstChild.firstChild;return Dz(r,`click`,n,!0),Dz(r,`pointerdown`,n,!0),$(i,()=>e.label??`Discard?`),$(r,X(GW,{get children(){var n=sG();return $(n,X(_z,{get when(){return t()},get children(){return X(rG,{"data-react-grab-discard-no":!0,get onClick(){return e.onCancel},get children(){return iG()}})}}),null),$(n,X(_z,{get when(){return e.onCopy},get children(){return X(rG,{"data-react-grab-discard-copy":!0,get onClick(){return e.onCopy},get children(){return aG()}})}}),null),$(n,X(rG,{variant:`destructive`,class:`gap-0.5`,"data-react-grab-discard-yes":!0,get onClick(){return e.onConfirm},get children(){return[oG(),X(eG,{size:10,class:`text-[var(--rg-error-text)] opacity-50`})]}}),null),n}}),null),r})()},Cz([`pointerdown`,`click`]),uG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M7 2C4.23858 2 2 4.23858 2 7V15C2 17.7614 4.23858 20 7 20H8C8.55228 20 9 19.5523 9 19C9 18.4477 8.55228 18 8 18H7C5.34315 18 4 16.6569 4 15V7C4 5.34315 5.34315 4 7 4H17C18.6569 4 20 5.34315 20 7V15C20 16.6569 18.6569 18 17 18H14.4142L16.2071 16.2071C16.5976 15.8166 16.5976 15.1834 16.2071 14.7929C15.8166 14.4024 15.1834 14.4024 14.7929 14.7929L11.2929 18.2929C11.197 18.3888 11.1247 18.4993 11.0759 18.6172C11.027 18.7351 11 18.8644 11 19C11 19.2728 11.1093 19.5201 11.2864 19.7005C11.2889 19.7031 11.2914 19.7056 11.2939 19.7081L14.7929 23.2071C15.1834 23.5976 15.8166 23.5976 16.2071 23.2071C16.5976 22.8166 16.5976 22.1834 16.2071 21.7929L14.4142 20H17C19.7614 20 22 17.7614 22 15V7C22 4.23858 19.7614 2 17 2H7Z">`),dG=e=>{let t=()=>e.size??12;return(()=>{var n=uG();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},fG=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Retry`),pG=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Ok`),mG=Z(`<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit">`),hG=Z(`<div data-react-grab-error role=alert aria-live=assertive class="contain-layout shrink-0 flex flex-col justify-center items-end w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-start gap-1 px-2 w-full h-fit"><span class="text-[var(--rg-error-text)] text-[13px] leading-4 font-sans font-medium overflow-hidden line-clamp-5">`),gG=e=>{let{claimFocus:t}=QW({onEnter:t=>{t.preventDefault(),t.stopPropagation(),e.onRetry?.()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.onAcknowledge?.()}}),n=()=>!!(e.onRetry||e.onAcknowledge);return(()=>{var r=hG(),i=r.firstChild,a=i.firstChild;return Dz(r,`click`,t,!0),Dz(r,`pointerdown`,t,!0),$(a,()=>e.error),$(r,X(_z,{get when(){return n()},get children(){return X(GW,{get children(){var t=mG();return $(t,X(_z,{get when(){return e.onRetry},get children(){return X(rG,{"data-react-grab-retry":!0,class:`gap-1`,"aria-keyshortcuts":`Enter`,get onClick(){return e.onRetry},get children(){return[fG(),X(dG,{size:10,"aria-hidden":`true`,class:`text-[var(--rg-text-secondary)]`})]}})}}),null),$(t,X(_z,{get when(){return e.onAcknowledge},get children(){return X(rG,{"data-react-grab-error-ok":!0,class:`gap-1`,"aria-keyshortcuts":`Escape`,get onClick(){return e.onAcknowledge},get children(){return pG()}})}}),null),t}})}}),null),kR(t=>{var r={"pt-1.5 pb-1":n(),"py-1.5":!n()},o=e.error;return t.e=Oz(i,r,t.e),o!==t.t&&Q(a,`title`,t.t=o),t},{e:void 0,t:void 0}),r})()},Cz([`pointerdown`,`click`]),_G=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M7.5 12C7.5 13.3807 6.38071 14.5 5 14.5C3.61929 14.5 2.5 13.3807 2.5 12C2.5 10.6193 3.61929 9.5 5 9.5C6.38071 9.5 7.5 10.6193 7.5 12ZM14.5 12C14.5 13.3807 13.3807 14.5 12 14.5C10.6193 14.5 9.5 13.3807 9.5 12C9.5 10.6193 10.6193 9.5 12 9.5C13.3807 9.5 14.5 10.6193 14.5 12ZM19 14.5C20.3807 14.5 21.5 13.3807 21.5 12C21.5 10.6193 20.3807 9.5 19 9.5C17.6193 9.5 16.5 10.6193 16.5 12C16.5 13.3807 17.6193 14.5 19 14.5Z">`),vG=e=>{let t=()=>e.size??14;return(()=>{var n=_G();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},yG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM17.7071 10.7071C18.0976 10.3166 18.0976 9.68342 17.7071 9.29289C17.3166 8.90237 16.6834 8.90237 16.2929 9.29289L11 14.5858L8.70711 12.2929C8.31658 11.9024 7.68342 11.9024 7.29289 12.2929C6.90237 12.6834 6.90237 13.3166 7.29289 13.7071L10.2929 16.7071C10.6834 17.0976 11.3166 17.0976 11.7071 16.7071L17.7071 10.7071Z">`),bG=e=>{let t=()=>e.size??14;return(()=>{var n=yG();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},xG=Z(`<button data-react-grab-ignore-events data-react-grab-more-options>`),SG=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Keep`),CG=Z(`<div class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap min-w-0"></span><div class="contain-layout shrink-0 flex items-center gap-2 h-fit">`),wG=Z(`<div class="contain-layout shrink-0 flex items-center gap-0.5 py-1.5 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap min-w-0">`),TG=e=>(()=>{var t=xG();return Dz(t,`click`,t=>{t.stopImmediatePropagation(),e.onClick()}),Dz(t,`pointerdown`,e=>{e.stopImmediatePropagation()}),$(t,X(vG,{size:14,class:`opacity-50 group-hover:opacity-100 transition-opacity`})),kR(()=>Ez(t,AW(nG({variant:`ghost`}),`group size-4 text-[var(--rg-text-secondary)] hover:text-[var(--rg-text-primary)]`))),t})(),EG=e=>{let t,n,[r,i]=J(!1),[a,o]=J(!1),s=()=>r()?`Copied`:e.statusText,c=()=>{t!==void 0&&window.clearTimeout(t),n!==void 0&&window.clearTimeout(n),o(!0),e.onFadingChange?.(!0),e.onShowContextMenu?.()},l=()=>{r()||(i(!0),t=window.setTimeout(()=>{o(!0),e.onFadingChange?.(!0),n=window.setTimeout(()=>{e.onDismiss?.()},125)},1375))},{claimFocus:u}=QW({onEnter:e=>{e.preventDefault(),e.stopPropagation(),l()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.onDismiss?.()}});return LR(()=>{t!==void 0&&window.clearTimeout(t),n!==void 0&&window.clearTimeout(n)}),X(YW,{shape:`pill`,"data-react-grab-completion":!0,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,class:`shrink-0 flex flex-col justify-center items-end w-fit h-fit max-w-[280px] transition-opacity duration-100 ease-out`,get style(){return{opacity:+!a()}},onPointerDown:u,onClick:u,get children(){return[X(_z,{get when(){return gB(()=>!r())()&&e.onDismiss},get children(){var t=CG(),n=t.firstChild,i=n.nextSibling;return $(n,s),$(i,X(_z,{get when(){return e.onShowContextMenu},get children(){return X(TG,{onClick:c})}}),null),$(i,X(_z,{get when(){return e.onDismiss},get children(){return X(rG,{"data-react-grab-dismiss":!0,class:`gap-1`,"aria-keyshortcuts":`Enter`,onClick:l,get disabled(){return r()},get"aria-disabled"(){return r()},get children(){return[SG(),X(_z,{get when(){return!r()},get children(){return X(eG,{size:10,class:`text-[var(--rg-text-secondary)]`})}})]}})}}),null),t}}),X(_z,{get when(){return r()||!e.onDismiss},get children(){var t=wG(),n=t.firstChild;return $(t,X(bG,{size:14,"aria-hidden":`true`,class:`text-[var(--rg-text-primary-85)] shrink-0`}),n),$(n,s),$(t,X(_z,{get when(){return e.onShowContextMenu},get children(){return X(TG,{onClick:c})}}),null),t}})]}})},DG=Z(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 py-1.5 px-2 w-full h-fit"><span class="shimmer-text text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap">`),OG=Z(`<div class="contain-layout shrink-0 flex flex-col items-start w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 w-fit h-fit px-2 py-1.5">`),kG=Z(`<button data-react-grab-submit type=button aria-label="Submit context"class="contain-layout shrink-0 flex items-center justify-center size-4 rounded-full bg-[var(--rg-submit-bg)] cursor-pointer ml-1 interactive-scale a11y-hitbox">`),AG=Z(`<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events data-react-grab-input aria-label="Add context for selected element"aria-keyshortcuts="Enter Escape"class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-medium bg-transparent border-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="Add context"rows=1 style=field-sizing:content;min-height:16px;scrollbar-width:none>`),jG=Z(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit min-w-[150px] max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2 max-w-full">`),MG=Z(`<div data-react-grab-ignore-events data-react-grab-selection-label>`),NG={left:JN,top:JN,arrowLeftPercent:50,arrowLeftOffset:0,edgeOffsetX:0},PG=e=>{let t,n,r,i=!1,[a,o]=J(0),[s,c]=J(0),[l,u]=J(0),[d,f]=J(0),[p,m]=J(!1),[h,g]=J(!1),_=()=>e.status!==`copying`&&e.status!==`copied`&&e.status!==`fading`&&e.status!==`error`,v=()=>e.status===`copied`||e.status===`fading`,y=()=>!!e.shouldToggleExpandOnClick&&!!e.onToggleExpand&&_()&&!e.discardPrompt&&!e.isPromptMode,b=()=>!!(e.isPromptMode||e.discardPrompt||y()||v()&&(e.onDismiss||e.onShowContextMenu)||e.status===`error`&&(e.onAcknowledgeError||e.onRetry)),x,S=e=>{i=e},C=()=>{f(e=>e+1)},w=XM(t=>{xB(t)||t.code===`Enter`&&!e.isPromptMode&&!e.discardPrompt&&_()&&(t.preventDefault(),t.stopImmediatePropagation(),e.onToggleExpand?.())});IR(()=>{let r=JM();if(x=new ResizeObserver(e=>{for(let a of e){let e=a.target.getBoundingClientRect();a.target===t&&!i?(o(e.width),c(e.height)):a.target===n?u(e.width):a.target===r&&C()}}),r&&x.observe(r),t){let e=t.getBoundingClientRect();o(e.width),c(e.height),x.observe(t)}n&&(u(n.getBoundingClientRect().width),x.observe(n)),window.addEventListener(`scroll`,C,!0),window.addEventListener(`resize`,C),window.visualViewport?.addEventListener(`resize`,C),window.visualViewport?.addEventListener(`scroll`,C),e.onToggleExpand&&window.addEventListener(`keydown`,w,{capture:!0})}),LR(()=>{x?.disconnect(),window.removeEventListener(`scroll`,C,!0),window.removeEventListener(`resize`,C),window.visualViewport?.removeEventListener(`resize`,C),window.visualViewport?.removeEventListener(`scroll`,C),window.removeEventListener(`keydown`,w,{capture:!0})});let T=()=>`${e.tagName??``}:${e.componentName??``}`,E=Y(t=>{d();let n=T(),r=n===t.elementIdentity?t:{position:NG,computedArrowPosition:null,hadValidBounds:!1,elementIdentity:n},i=e.selectionBounds,o=a(),c=s(),u=o>0&&c>0,f=i&&i.width>0&&i.height>0;if(!u||!f)return{position:r.hadValidBounds?r.position:NG,computedArrowPosition:r.computedArrowPosition,hadValidBounds:r.hadValidBounds,elementIdentity:n};let p=OW(),m=p.offsetLeft,h=p.offsetTop,g=m+p.width,_=h+p.height;if(!(i.x+i.width>m&&i.x<g&&i.y+i.height>h&&i.y<_))return{position:NG,computedArrowPosition:r.computedArrowPosition,hadValidBounds:r.hadValidBounds,elementIdentity:n};let v=i.x+i.width/2,y=e.mouseX??v,b=i.y+i.height,x=i.y,S=e.hideArrow?0:DW(l()),C=y,w=0,E=b+S+4;if(o>0){let e=C-o/2,t=C+o/2;t>g-8&&(w=g-8-t),e+w<m+8&&(w=m+8-e)}let D=c+S+4,O=E+c<=_-8;O||(E=x-D),E<h+8&&(E=h+8);let k=o/2,ee=k-w,te=Math.min(16,k),A=Math.max(o-16,k),ne=Math.max(te,Math.min(A,ee))-k;return{position:{left:C,top:E,arrowLeftPercent:50,arrowLeftOffset:ne,edgeOffsetX:w},computedArrowPosition:O?`bottom`:`top`,hadValidBounds:!0,elementIdentity:n}},{position:NG,computedArrowPosition:null,hadValidBounds:!1,elementIdentity:``}),D=()=>E().computedArrowPosition??`bottom`,O=()=>E().hadValidBounds;AR(FR(()=>e.selectionLabelShakeCount,()=>g(!0),{defer:!0}));let k=t=>{if(t.isComposing||t.keyCode===229)return;t.stopImmediatePropagation();let n=t.code===`Enter`&&!t.shiftKey,r=t.code===`Escape`;n?(t.preventDefault(),e.onSubmit?.()):r&&(t.preventDefault(),e.onConfirmDismiss?.())},ee=t=>{let n=t.target;n instanceof HTMLTextAreaElement&&(TW(n,95),e.onInputChange?.(n.value))},te=()=>jW({tagName:e.tagName,componentName:e.componentName,elementsCount:e.elementsCount}),A=Y(()=>!(e.error||e.discardPrompt||_()&&e.isPromptMode)),ne=t=>{if(t.stopImmediatePropagation(),e.filePath&&e.onOpen){e.onOpen();return}y()&&e.onToggleExpand?.()},re=t=>{t.stopImmediatePropagation(),_()&&e.isPromptMode&&!e.discardPrompt&&e.onSubmit&&r&&EW(r,{preventScroll:!0})},ie=()=>O()&&(v()||e.status===`error`);return X(_z,{get when(){return gB(()=>e.visible!==!1)()&&(e.selectionBounds||ie())},get children(){var i=MG();i.addEventListener(`mouseleave`,()=>e.onHoverChange?.(!1)),i.addEventListener(`mouseenter`,()=>e.onHoverChange?.(!0)),i.$$click=e=>{e.stopImmediatePropagation()},i.$$pointerdown=re;var a=t;return typeof a==`function`?Mz(a,i):t=i,Az(i,`z-index`,`${sN}`),Az(i,`transition`,`opacity 125ms ease-out, filter 125ms ease-out`),$(i,X(_z,{get when(){return!e.hideArrow},get children(){return X(LW,{get position(){return D()},get leftPercent(){return E().position.arrowLeftPercent},get leftOffsetPx(){return E().position.arrowLeftOffset},get labelWidth(){return l()}})}}),null),$(i,X(_z,{get when(){return gB(()=>!!v())()&&!e.error},get children(){return X(EG,{get statusText(){return e.statusText??`Copied`},get onDismiss(){return e.onDismiss},onFadingChange:m,get onShowContextMenu(){return e.onShowContextMenu}})}}),null),$(i,X(YW,{ref:e=>n=e,get shape(){return A()?`pill`:`panel`},get class(){return AW(`flex items-center gap-[5px] w-fit h-fit p-0`,h()&&`animate-shake`)},get style(){return{display:v()&&!e.error?`none`:void 0}},onAnimationEnd:()=>g(!1),get children(){return[X(_z,{get when(){return e.status===`copying`},get children(){var t=DG(),n=t.firstChild,r=n.firstChild;return $(n,X(FW,{size:13,class:`text-[var(--rg-text-secondary)] shrink-0`}),r),$(r,()=>e.statusText??`Grabbing…`),t}}),X(_z,{get when(){return gB(()=>!!(_()&&!e.isPromptMode))()&&!e.discardPrompt},get children(){var t=OG(),n=t.firstChild;return $(n,X(UW,{get tagName(){return te().tagName},get componentName(){return te().componentName},get isClickable(){return!!(e.filePath&&e.onOpen)},onClick:ne,onHoverChange:S,shrink:!0})),t}}),X(_z,{get when(){return gB(()=>!!(_()&&e.isPromptMode))()&&!e.discardPrompt},get children(){var t=jG(),n=t.firstChild;return $(n,X(UW,{get tagName(){return te().tagName},get componentName(){return te().componentName},get isClickable(){return!!(e.filePath&&e.onOpen)},onClick:ne,onHoverChange:S})),$(t,X(GW,{get children(){var t=AG(),n=t.firstChild;return n.$$keydown=k,n.$$input=ee,Mz(t=>{r=t,e.onSubmit&&queueMicrotask(()=>{EW(t,{preventScroll:!0}),TW(t,95)})},n),Az(n,`max-height`,`95px`),$(t,X(_z,{get when(){return e.onSubmit},get children(){var t=kG();return t.$$click=()=>e.onSubmit?.(),$(t,X(NW,{size:10,"aria-hidden":`true`,class:`text-[var(--rg-submit-fg)]`})),t}}),null),kR(()=>n.readOnly=!e.onSubmit),kR(()=>n.value=e.inputValue??``),t}}),null),t}}),X(_z,{get when(){return e.discardPrompt},keyed:!0,children:e=>X(lG,{get label(){return gB(()=>!!e.isKeyboardSelection)()?`Discard selection?`:e.label},get showCancel(){return!e.isKeyboardSelection},get cancelOnEscape(){return e.cancelOnEscape},get onConfirm(){return e.onConfirm},get onCopy(){return e.onCopy},onCancel:()=>{e.isKeyboardSelection||e.onCancel?.(),EW(r,{preventScroll:!0})}})}),X(_z,{get when(){return e.error},get children(){return X(gG,{get error(){return e.error},get onAcknowledge(){return e.onAcknowledgeError},get onRetry(){return e.onRetry}})}})]}}),null),kR(t=>{var n=AW(`fixed font-sans text-[13px] antialiased select-none ease-out`),r=`${E().position.top}px`,a=`${E().position.left}px`,o=`translateX(calc(-50% + ${E().position.edgeOffsetX}px))`,s=b()?`auto`:`none`,c=e.status===`fading`||p()?0:1,l=`drop-shadow(${$M}) blur(${e.status===`fading`||p()?`3px`:`0`})`;return n!==t.e&&Ez(i,t.e=n),r!==t.t&&Az(i,`top`,t.t=r),a!==t.a&&Az(i,`left`,t.a=a),o!==t.o&&Az(i,`transform`,t.o=o),s!==t.i&&Az(i,`pointer-events`,t.i=s),c!==t.n&&Az(i,`opacity`,t.n=c),l!==t.s&&Az(i,`filter`,t.s=l),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i}})},Cz([`pointerdown`,`click`,`input`,`keydown`]),FG=Z(`<span style="transition-property:transform;transition-timing-function:cubic-bezier(0.32, 0.72, 0, 1)"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M20.8977 4.02356L21.8277 4.39121C22.3784 2.99813 21.0382 1.60206 19.6238 2.09546L3.47334 7.72936C1.38661 8.45728 1.49021 11.443 3.6224 12.0245L10.1289 13.799L11.2331 19.8724C11.638 22.0991 14.7072 22.4019 15.5393 20.2972L21.8277 4.39121L20.8977 4.02356Z">`),IG=e=>{let t=()=>e.size??14,n=()=>e.rotationDeg??0;return(()=>{var r=FG(),i=r.firstChild;return Az(r,`transition-duration`,`180ms`),kR(a=>{var o=AW(`inline-flex items-center justify-center will-change-transform`,e.class),s=`rotate(${n()}deg)`,c=t(),l=t();return o!==a.e&&Ez(r,a.e=o),s!==a.t&&Az(r,`transform`,a.t=s),c!==a.a&&Q(i,`width`,a.a=c),l!==a.o&&Q(i,`height`,a.o=l),a},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()},LG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 12 12"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M1 6C1 3.239 3.239 1 6 1C8.761 1 11 3.239 11 6C11 8.761 8.761 11 6 11C5.103 11 4.261 10.764 3.532 10.35C2.959 10.759 2.257 11 1.5 11C1.376 11 1.253 10.993 1.132 10.981C0.923 10.959 0.75 10.809 0.699 10.605C0.648 10.402 0.729 10.188 0.903 10.07C1.347 9.768 1.688 9.328 1.865 8.812C1.319 8.011 1 7.042 1 6Z">`),RG=e=>{let t=()=>e.size??14;return(()=>{var n=LG();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},zG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 13.867 20.345 14.992 18.77 14.992H16.029C14.739 14.992 13.823 16.248 14.218 17.476L14.48 18.295C14.751 19.139 14.643 20.041 14.211 20.751C13.769 21.479 12.985 22 12 22C6.477 22 2 17.523 2 12ZM12.21 6.783C12.416 7.585 11.933 8.403 11.131 8.609C10.328 8.815 9.511 8.332 9.305 7.529C9.099 6.727 9.582 5.909 10.384 5.703C11.187 5.497 12.004 5.981 12.21 6.783ZM7.59 9.207C8.388 9.43 8.853 10.258 8.63 11.055C8.407 11.853 7.579 12.319 6.782 12.096C5.984 11.873 5.518 11.045 5.741 10.247C5.964 9.449 6.792 8.983 7.59 9.207ZM9.497 14.446C8.918 13.854 7.968 13.844 7.376 14.423C6.784 15.002 6.773 15.952 7.353 16.544C7.932 17.136 8.882 17.147 9.474 16.567C10.066 15.988 10.076 15.039 9.497 14.446ZM16.624 9.575C16.032 10.155 15.082 10.144 14.503 9.552C13.923 8.96 13.934 8.01 14.526 7.431C15.118 6.852 16.068 6.862 16.647 7.454C17.226 8.046 17.216 8.996 16.624 9.575Z">`),BG=e=>{let t=()=>e.size??14;return(()=>{var n=zG();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},VG=Z(`<div>`),HG=0,UG=()=>Date.now()-HG<800,WG=e=>{let[t,n]=J(!1),[r,i]=J(!0),a;AR(FR(()=>e.visible,e=>{a!==void 0&&(clearTimeout(a),a=void 0),e?UG()?(i(!1),n(!0)):(i(!0),a=setTimeout(()=>{n(!0)},400)):(t()&&(HG=Date.now()),n(!1))})),LR(()=>{a!==void 0&&clearTimeout(a),t()&&(HG=Date.now())});let o=()=>e.position===`top`||e.position===`bottom`?{left:`50%`,translate:`-50%`,"z-index":`${sN}`}:{top:`50%`,translate:`0 -50%`,"z-index":`${sN}`};return X(_z,{get when(){return t()},get children(){var t=VG();return $(t,()=>e.children),kR(n=>{var i=AW(`absolute whitespace-nowrap px-2 py-0.5 rounded-full text-[10px] font-sans font-medium leading-4 pointer-events-none`,`bg-[var(--rg-panel-bg)] text-[var(--rg-text-primary)] [box-shadow:var(--rg-shadow)]`,e.position===`top`&&`bottom-full mb-2.5`,e.position===`bottom`&&`top-full mt-2.5`,e.position===`left`&&`right-full mr-2.5`,e.position===`right`&&`left-full ml-2.5`,r()&&`animate-tooltip-fade-in`),a=o();return i!==n.e&&Ez(t,n.e=i),n.t=kz(t,a,n.t),n},{e:void 0,t:void 0}),t}})},GG=Z(`<div><button data-react-grab-ignore-events type=button>`),KG=e=>(()=>{var t=GG(),n=t.firstChild;Dz(n,`mouseleave`,e.onMouseLeave),Dz(n,`mouseenter`,e.onMouseEnter),Dz(n,`contextmenu`,t=>e.onContextMenu?.(t)),Dz(n,`click`,e.onClick,!0);var r=e.ref;return typeof r==`function`?Mz(r,n):e.ref=n,$(n,()=>e.icon),$(t,X(_z,{get when(){return e.tooltip},get children(){return X(WG,{get visible(){return!!e.tooltipVisible},get position(){return e.tooltipPosition??`top`},get children(){return e.tooltip}})}}),null),kR(r=>{var i=e.wrapperClass,a=e.isToggle?``:void 0,o=e.actionId,s=e.label,c=!!e.isActive,l=e.class;return i!==r.e&&Ez(t,r.e=i),a!==r.t&&Q(n,`data-react-grab-toolbar-toggle`,r.t=a),o!==r.a&&Q(n,`data-react-grab-toolbar-action`,r.a=o),s!==r.o&&Q(n,`aria-label`,r.o=s),c!==r.i&&Q(n,`aria-pressed`,r.i=c),l!==r.n&&Ez(n,r.n=l),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})(),Cz([`click`]),qG=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M9.29289 16.7071C8.90237 16.3166 8.90237 15.6834 9.29289 15.2929L12.5858 12L9.29289 8.70711C8.90237 8.31658 8.90237 7.68342 9.29289 7.29289C9.68342 6.90237 10.3166 6.90237 10.7071 7.29289L14.7071 11.2929C14.8946 11.4804 15 11.7348 15 12C15 12.2652 14.8946 12.5196 14.7071 12.7071L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071Z">`),JG=e=>{let t=()=>e.size??14;return(()=>{var n=qG();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},YG=Z(`<button data-react-grab-ignore-events data-react-grab-toolbar-collapse type=button class="group contain-layout shrink-0 flex items-center justify-center cursor-pointer interactive-scale a11y-hitbox">`),XG=Z(`<div data-react-grab-toolbar-panel><div><div><div>`),ZG=e=>{let t=()=>e.snapEdge??`bottom`,n=()=>t()===`left`||t()===`right`,r=()=>e.isCollapsed?`duration-140`:`duration-220`,i=()=>n()?`transition-[grid-template-rows] ${r()} ease-drawer`:`transition-[grid-template-columns] ${r()} ease-drawer`,a=()=>n()?`min-h-0`:`min-w-0`,o=()=>e.isCollapsed?`${{top:`rounded-t-none rounded-b-[10px]`,bottom:`rounded-b-none rounded-t-[10px]`,left:`rounded-l-none rounded-r-[10px]`,right:`rounded-r-none rounded-l-[10px]`}[t()]} ${n()?`px-0.25 py-2`:`px-2 py-0.25`}`:``,s=()=>{let n=e.isCollapsed;switch(t()){case`top`:return n?`rotate-90`:`-rotate-90`;case`bottom`:return n?`-rotate-90`:`rotate-90`;case`left`:return n?`rotate-0`:`rotate-180`;case`right`:return n?`rotate-180`:`rotate-0`;default:return`-rotate-90`}},c=()=>{if(e.isChevronPressed)return n()?`scale(0.97, 1)`:`scale(1, 0.97)`},l=()=>(()=>{var t=YG();return Dz(t,`pointercancel`,e.onCollapsePointerLeave),Dz(t,`pointerleave`,e.onCollapsePointerLeave),Dz(t,`pointerup`,e.onCollapsePointerUp,!0),Dz(t,`pointerdown`,e.onCollapsePointerDown),Dz(t,`click`,e.onCollapseClick,!0),$(t,X(JG,{size:18,get class(){return AW(`text-[var(--rg-text-secondary)] group-hover:text-[var(--rg-text-primary)] transition-[transform,color] duration-150 ease-drawer -m-0.5`,s())}})),kR(n=>{var r=e.isCollapsed?`Expand toolbar`:`Collapse toolbar`,i=!e.isCollapsed;return r!==n.e&&Q(t,`aria-label`,n.e=r),i!==n.t&&Q(t,`aria-expanded`,n.t=i),n},{e:void 0,t:void 0}),t})(),u=()=>e.isChevronPressed?`transition-[padding,border-radius,transform] duration-60 ease-[cubic-bezier(0,0,0.2,1)]`:`transition-[padding,border-radius,transform] ${r()} ease-drawer`;return(()=>{var t=XG(),r=t.firstChild,s=r.firstChild,d=s.firstChild;return Dz(t,`click`,e.onPanelClick,!0),Dz(t,`animationend`,e.onAnimationEnd),$(d,()=>e.actionButtons),$(t,l,null),kR(l=>{var f=AW(`flex items-center justify-center rounded-[13px] antialiased relative overflow-visible [font-synthesis:none]`,u(),n()&&`flex-col`,`bg-[var(--rg-panel-bg)] [box-shadow:var(--rg-shadow)]`,!e.isCollapsed&&(n()?`px-1.5 gap-0 py-2`:`py-1.5 gap-0 px-2`),o(),e.isShaking&&(n()?`animate-shake-vertical`:`animate-shake`)),p=e.transformOrigin,m=c(),h=AW(`grid relative overflow-visible`,i(),e.isCollapsed?n()?`grid-rows-[0fr] pointer-events-none`:`grid-cols-[0fr] pointer-events-none`:n()?`grid-rows-[1fr]`:`grid-cols-[1fr]`),g=AW(`flex`,n()?`flex-col items-center min-h-0`:`items-center min-w-0`,e.isCollapsed?`opacity-0`:`opacity-100`,e.isCollapsed?`transition-opacity duration-100 ease-drawer`:`transition-opacity duration-180 ease-drawer delay-[80ms]`),_=AW(`relative overflow-visible flex`,n()?`flex-col items-center`:`items-center`,a());return f!==l.e&&Ez(t,l.e=f),p!==l.t&&Az(t,`transform-origin`,l.t=p),m!==l.a&&Az(t,`transform`,l.a=m),h!==l.o&&Ez(r,l.o=h),g!==l.i&&Ez(s,l.i=g),_!==l.n&&Ez(d,l.n=_),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()},Cz([`click`,`pointerup`]),QG=e=>e===`top`||e===`bottom`,$G=e=>{let t=QG(e);return{width:t?30:16,height:t?16:30}},eK=(e,t,n,r)=>{let i=OW(),a=i.width,o=i.height,s=i.offsetLeft+16,c=Math.max(s,i.offsetLeft+a-n-16),l=i.offsetTop+16,u=Math.max(l,i.offsetTop+o-r-16);if(e===`top`||e===`bottom`){let r=Math.max(0,a-n-32);return{x:Math.min(c,Math.max(s,i.offsetLeft+16+r*t)),y:e===`top`?l:u}}let d=Math.max(0,o-r-32),f=Math.min(u,Math.max(l,i.offsetTop+16+d*t));return{x:e===`left`?s:c,y:f}},tK=(e,t,n,r,i)=>{let a=OW(),o=a.width,s=a.height;if(e===`top`||e===`bottom`){let e=o-r-32;return e<=0?DN:Math.max(0,Math.min(1,(t-a.offsetLeft-16)/e))}let c=s-i-32;return c<=0?DN:Math.max(0,Math.min(1,(n-a.offsetTop-16)/c))},nK=(e,t,n,r,i)=>{let a=OW(),o=a.width,s=a.height,{width:c,height:l}=n,u;if(t===`top`||t===`bottom`){let n=(c-r)/2;u={x:UB(e.x-n,a.offsetLeft+16,a.offsetLeft+o-c-16),y:t===`top`?a.offsetTop+16:a.offsetTop+s-l-16}}else{let n=(l-i)/2,r=UB(e.y-n,a.offsetTop+16,a.offsetTop+s-l-16);u={x:t===`left`?a.offsetLeft+16:a.offsetLeft+o-c-16,y:r}}let d=tK(t,u.x,u.y,c,l);return{position:u,ratio:d}},rK=(e,t,n,r)=>{let i=OW(),{width:a,height:o}=n,{width:s,height:c}=r;switch(e){case`top`:case`bottom`:{let n=(a-s)/2;return{x:UB(t.x+n,i.offsetLeft,i.offsetLeft+i.width-s),y:e===`top`?i.offsetTop:i.offsetTop+i.height-c}}case`left`:case`right`:{let n=(o-c)/2,r=UB(t.y+n,i.offsetTop,i.offsetTop+i.height-c);return{x:e===`left`?i.offsetLeft:i.offsetLeft+i.width-s,y:r}}}},iK=(e,t,n,r,i,a)=>{let o=OW(),s=o.width,c=o.height,l=e+i*150,u=t+a*150,d=u-o.offsetTop+r/2,f=o.offsetTop+c-u-r/2,p=l-o.offsetLeft+n/2,m=o.offsetLeft+s-l-n/2,h=Math.min(d,f,p,m),g=e=>UB(e,o.offsetLeft+16,o.offsetLeft+s-n-16),_=e=>UB(e,o.offsetTop+16,o.offsetTop+c-r-16);return h===d?{edge:`top`,x:g(l),y:o.offsetTop+16}:h===p?{edge:`left`,x:o.offsetLeft+16,y:_(u)}:h===m?{edge:`right`,x:o.offsetLeft+s-n-16,y:_(u)}:{edge:`bottom`,x:g(l),y:o.offsetTop+c-r-16}},aK=e=>{let[t,n]=J(!1),[r,i]=J(!1),[a,o]=J(!1),[s,c]=J({x:0,y:0}),l={x:0,y:0},u={x:0,y:0,time:0},d={x:0,y:0},f=!1,p,m=null,h=()=>{m?.abort(),m=null},g=t=>{if(!a()){if(Math.hypot(t.clientX-d.x,t.clientY-d.y)<=5)return;o(!0),e.onDragStart()}let n=performance.now(),r=n-u.time;r>0&&c({x:(t.clientX-u.x)/r,y:(t.clientY-u.y)/r}),u={x:t.clientX,y:t.clientY,time:n};let i=t.clientX-l.x,s=t.clientY-l.y;e.onPositionUpdate({x:i,y:s})},_=()=>{h();let t=a();if(n(!1),!t)return;f=!0;let r=e.getContainerRef(),o=r?.getBoundingClientRect();if(!o)return;let c=s(),l=iK(o.left,o.top,o.width,o.height,c.x,c.y),u=tK(l.edge,l.x,l.y,o.width,o.height);e.onSnapEdgeChange(l.edge,u),i(!0),pI(()=>{let t=r?.getBoundingClientRect(),n=t?{width:t.width,height:t.height}:e.getExpandedDimensions();pI(()=>{let t=eK(l.edge,u,n.width,n.height);e.onSnapComplete({edge:l.edge,ratio:u,position:t,expandedDimensions:n}),p=setTimeout(()=>{i(!1),e.onSnapAnimationEnd?.()},300)})})},v=XM(t=>{if(t.button!==0||e.isCollapsed())return;let r=e.getContainerRef()?.getBoundingClientRect();if(!r)return;d={x:t.clientX,y:t.clientY},l={x:t.clientX-r.left,y:t.clientY-r.top},n(!0),o(!1),c({x:0,y:0}),u={x:t.clientX,y:t.clientY,time:performance.now()},h(),m=new AbortController;let{signal:i}=m;window.addEventListener(`pointermove`,g,{signal:i}),window.addEventListener(`pointerup`,_,{signal:i}),window.addEventListener(`pointercancel`,_,{signal:i})});return LR(()=>{h(),clearTimeout(p)}),{isDragging:t,isSnapping:r,handlePointerDown:v,createDragAwareHandler:e=>t=>{if(t.stopImmediatePropagation(),f){f=!1;return}e()}}},oK=(e,t)=>{let n=t-e;return e+(n-Math.round(n/360)*360)},sK=Z(`<div data-react-grab-ignore-events data-react-grab-toolbar>`),cK=e=>{let t,n,r=null,i=XV(),[a,o]=J(!1),[s,c]=J(!1),[l,u]=J(!1),[d,f]=J(i?.edge??`bottom`),[p,m]=J(i?.ratio??.5),[h,g]=J({x:0,y:0}),[_,v]=J(!1),[y,b]=J(!1),[x,S]=J(!1),[C,w]=J(!1),[T,E]=J(0),[D,O]=J(null),k=()=>{r?.(),r=null,e.isActive||qL()},ee=aK({getContainerRef:()=>t,isCollapsed:s,getExpandedDimensions:()=>ce,onDragStart:()=>{O(null),r&&k()},onPositionUpdate:e=>g(e),onSnapEdgeChange:(e,t)=>{de(d(),e),f(e),m(t)},onSnapComplete:e=>{ce=e.expandedDimensions,g(e.position),Ae({edge:e.edge,ratio:e.ratio,collapsed:s(),enabled:!s()})}}),te=()=>d()===`left`||d()===`right`,A=()=>te()?`mb-1.5`:`mr-1.5`,ne=t=>e.activeActionId===t,re=()=>!!e.isActive&&(e.activeActionId??`copy`)===`copy`,ie=t=>D()===t&&!e.isActive&&!s()&&!ee.isDragging()&&!ee.isSnapping()&&!e.isContextMenuOpen,ae=()=>{switch(d()){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;default:return`top`}},oe=e=>{e.stopImmediatePropagation()},se=(t,n)=>({onMouseEnter:e=>{ee.isDragging()||(O(t),n?.shouldFreezeInteractions!==!1&&!r&&(r=CR(),KL(e.clientX,e.clientY)),n?.onHoverChange?.(!0))},onMouseLeave:()=>{O(e=>e===t?null:e),n?.shouldFreezeInteractions!==!1&&!e.isActive&&!e.isContextMenuOpen&&k(),n?.onHoverChange?.(!1)}});AR(FR(()=>e.shakeCount,t=>{t&&!e.enabled&&v(!0)})),AR(FR(()=>[e.isActive,e.isContextMenuOpen],([e,t])=>{!e&&!t&&r&&(r(),r=null)})),AR(FR(()=>re(),e=>{if(!e){E(e=>oK(e,0));return}let t=XM(e=>{if(!n)return;let t=n.getBoundingClientRect(),r=t.left+t.width/2,i=t.top+t.height/2,a=e.clientX-r,o=e.clientY-i;if(Math.hypot(a,o)<4)return;let s=Math.atan2(o,a)*180/Math.PI- -45;E(e=>oK(e,s))});window.addEventListener(`pointermove`,t,{passive:!0}),LR(()=>{window.removeEventListener(`pointermove`,t)})}));let ce={width:78,height:28},[le,ue]=J($G(d())),de=(e,t)=>{QG(e)!==QG(t)&&ue($G(t))},fe=(e,n)=>{let r=t?.getBoundingClientRect(),i=$G(n);return nK(e,n,ce,r?.width??i.width,r?.height??i.height)},pe=()=>{g(eK(d(),p(),ce.width,ce.height))},me=ee.createDragAwareHandler(()=>e.onToggle?.()),he=ee.createDragAwareHandler(()=>e.onActivateAction?.(kN)),ge=ee.createDragAwareHandler(()=>e.onActivateAction?.(AN)),_e=`group contain-layout flex items-center justify-center cursor-pointer interactive-scale a11y-hitbox`,ve=()=>AW(`relative contain-layout flex items-center justify-center`,A()),ye=e=>e?`text-[var(--rg-text-primary)]`:`text-[var(--rg-text-secondary)] group-hover:text-[var(--rg-text-primary)]`,be=ee.createDragAwareHandler(()=>{let e=t?.getBoundingClientRect(),n=s(),r=p();if(n){let{position:e,ratio:t}=fe(je(),d());r=t,g(e),m(r)}else e&&(ce={width:e.width,height:e.height});b(!0),c(e=>!e),Ae({edge:d(),ratio:r,collapsed:!n,enabled:n}),Ce&&clearTimeout(Ce),Ce=setTimeout(()=>{b(!1),Te()},260)}),xe=()=>rK(d(),h(),ce,le()),Se,Ce,we=null,Te=()=>{let e=t?.getBoundingClientRect();!e||e.width===0||e.height===0||(s()?ue({width:e.width,height:e.height}):(ce={width:e.width,height:e.height},we={width:e.width,height:e.height}))},Ee=(e,t)=>{if(!(e===0||t===0)&&!(ee.isDragging()||ee.isSnapping())&&!y()){if(s()){let n=le();if(n.width===e&&n.height===t)return;ue({width:e,height:t});return}we&&we.width===e&&we.height===t||(we={width:e,height:t},ce={width:e,height:t},g(eK(d(),p(),e,t)))}},De=null,Oe=()=>{ee.isDragging()||ee.isSnapping()||De===null&&(De=pI(()=>{De=null,pe()}))},ke=()=>{ee.isDragging()||(u(!0),pe(),Se&&clearTimeout(Se),Se=setTimeout(()=>{u(!1);let e=tK(d(),h().x,h().y,ce.width,ce.height);m(e),Ae({edge:d(),ratio:e,collapsed:s(),enabled:!s()})},500))},Ae=t=>{ZV(t),e.onStateChange?.(t)};IR(()=>{t&&e.onContainerRef?.(t);let n=t?.getBoundingClientRect(),r=OW(),a=!!(n&&n.width>0&&n.height>0);i?(a&&n&&(ce={width:n.width,height:n.height}),c(i.collapsed),g(eK(i.edge,i.ratio,ce.width,ce.height))):a&&n?(ce={width:n.width,height:n.height},g({x:r.offsetLeft+(r.width-n.width)/2,y:r.offsetTop+r.height-n.height-16}),m(DN)):(g(eK(`bottom`,DN,ce.width,ce.height)),m(DN)),e.onSubscribeToStateChanges&&LR(e.onSubscribeToStateChanges(e=>{if(y()||!t?.getBoundingClientRect())return;let n=s()!==e.collapsed;if(de(d(),e.edge),f(e.edge),n&&!e.collapsed){let t=je();b(!0),c(e.collapsed);let{position:n,ratio:r}=fe(t,e.edge);g(n),m(r),clearTimeout(Ce),Ce=setTimeout(()=>{b(!1),Te()},260)}else n&&(b(!0),clearTimeout(Ce),Ce=setTimeout(()=>{b(!1),Te()},260)),c(e.collapsed),g(eK(e.edge,e.ratio,ce.width,ce.height)),m(e.ratio)})),window.addEventListener(`resize`,ke),window.visualViewport?.addEventListener(`resize`,ke),window.visualViewport?.addEventListener(`scroll`,ke);let l=JM();if(l&&(window.addEventListener(`scroll`,Oe,{passive:!0,capture:!0}),typeof ResizeObserver<`u`)){let e=new ResizeObserver(Oe);e.observe(l),LR(()=>e.disconnect())}if(typeof ResizeObserver<`u`&&t){let e=new ResizeObserver(e=>{let n=e[0];if(!n)return;let r=n.borderBoxSize?.[0],i,a;if(r)i=r.inlineSize,a=r.blockSize;else{let e=t?.getBoundingClientRect();if(!e)return;i=e.width,a=e.height}Ee(i,a)});e.observe(t),LR(()=>e.disconnect())}let u=setTimeout(()=>{o(!0)},500);LR(()=>{clearTimeout(u)})}),LR(()=>{window.removeEventListener(`resize`,ke),window.visualViewport?.removeEventListener(`resize`,ke),window.visualViewport?.removeEventListener(`scroll`,ke),window.removeEventListener(`scroll`,Oe,{capture:!0}),De!==null&&mI(De),clearTimeout(Se),clearTimeout(Ce),r&&k()});let je=()=>s()?xe():h(),Me=()=>s()?`cursor-pointer`:ee.isDragging()?`cursor-grabbing`:`cursor-grab`,Ne=()=>C()||!!e.isContextMenuOpen||ee.isDragging()||ee.isSnapping()||y()||x(),Pe=()=>!!e.isActive&&!Ne(),Fe=()=>l()||ee.isDragging()?``:ee.isSnapping()?`transition-[transform,opacity] duration-300 ease-out`:y()?`transition-[transform,opacity] ${s()?`duration-140`:`duration-220`} ease-drawer`:`transition-[transform,opacity] duration-400 ease-drawer`,Ie=()=>{switch(d()){case`top`:return`center top`;case`bottom`:return`center bottom`;case`left`:return`left center`;case`right`:return`right center`;default:return`center center`}};return(()=>{var r=sK();r.addEventListener(`mouseleave`,()=>{w(!1),e.onSelectHoverChange?.(!1)}),r.addEventListener(`mouseenter`,()=>{w(!0),s()||e.onSelectHoverChange?.(!0)}),Dz(r,`mousedown`,oe),Dz(r,`pointerdown`,e=>{oe(e),ee.handlePointerDown(e)});var i=t;return typeof i==`function`?Mz(i,r):t=r,$(r,X(ZG,{get isCollapsed(){return s()},get snapEdge(){return d()},get isShaking(){return _()},get isChevronPressed(){return x()},get transformOrigin(){return Ie()},onAnimationEnd:()=>v(!1),onCollapseClick:be,onCollapsePointerDown:()=>S(!0),onCollapsePointerUp:()=>S(!1),onCollapsePointerLeave:()=>S(!1),onPanelClick:e=>{if(s()){e.stopPropagation();let{position:t,ratio:n}=fe(je(),d());g(t),m(n),b(!0),c(!1),Ae({edge:d(),ratio:n,collapsed:!1,enabled:!0}),Ce&&clearTimeout(Ce),Ce=setTimeout(()=>{b(!1),Te()},260)}},get actionButtons(){return[X(KG,pz({actionId:ON,isToggle:!0,ref:e=>n=e,get label(){return re()?`Stop selecting element`:`Copy element`},get isActive(){return re()},class:_e,get wrapperClass(){return ve()},onClick:me,onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),O(null),e.onToggleToolbarMenu?.()}},()=>se(ON),{get icon(){return X(IG,{size:14,get rotationDeg(){return T()},get class(){return ye(re())}})},get tooltipVisible(){return ie(ON)},get tooltipPosition(){return ae()},tooltip:`Copy`})),X(KG,pz({actionId:kN,label:`Comment on element`,get isActive(){return ne(kN)},class:_e,get wrapperClass(){return ve()},onClick:he},()=>se(kN),{get icon(){return X(RG,{size:14,get class(){return ye(ne(kN))}})},get tooltipVisible(){return ie(kN)},get tooltipPosition(){return ae()},tooltip:`Comment`})),X(KG,pz({actionId:AN,label:`Style element`,get isActive(){return ne(AN)},class:_e,get wrapperClass(){return ve()},onClick:ge},()=>se(AN),{get icon(){return X(BG,{size:14,get class(){return ye(ne(AN))}})},get tooltipVisible(){return ie(AN)},get tooltipPosition(){return ae()},tooltip:`Style`}))]}})),kR(e=>{var t=AW(`fixed left-0 top-0 font-sans text-[13px] antialiased select-none`,Me(),Fe(),a()?`pointer-events-auto`:`pointer-events-none`),n=String(sN),i=`translate(${je().x}px, ${je().y}px) scale(${Pe()?.97:1})`,o=Ie(),s=a()?Pe()?.55:1:0;return t!==e.e&&Ez(r,e.e=t),n!==e.t&&Az(r,`z-index`,e.t=n),i!==e.a&&Az(r,`transform`,e.a=i),o!==e.o&&Az(r,`transform-origin`,e.o=o),s!==e.i&&Az(r,`opacity`,e.i=s),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r})()},lK=BR(),uK=()=>{let e=VR(lK);if(!e)throw Error(`Menu subcomponents must be rendered inside <Menu.Provider>`);return e},dK=e=>X(lK.Provider,{get value(){return e.store},get children(){return e.children}}),fK=e=>X(YW,{get class(){return AW(`flex flex-col w-fit h-fit`,e.class)},get style(){return e.style},get children(){return e.children}}),pK=Z(`<div role=menu aria-orientation=vertical><div aria-hidden=true class="pointer-events-none absolute opacity-0 transition-[top,left,width,height,opacity,border-radius] duration-75 ease-out bg-[var(--rg-surface-hover)]">`),mK=e=>{let t=uK();return(()=>{var n=pK(),r=n.firstChild;n.$$pointermove=()=>t.notePointerMove(),Mz(n=>{t.setHighlightContainer(n),e.ref?.(n)},n);var i=t.setHighlightRail;return typeof i==`function`?Mz(i,r):t.setHighlightRail=r,$(n,()=>e.children,null),kR(r=>{var i=e.label,a=t.keyboardNavigation?t.activeDescendantId():void 0,o=t.keyboardNavigation?-1:void 0,s=AW(`relative flex flex-col`,e.class);return i!==r.e&&Q(n,`aria-label`,r.e=i),a!==r.t&&Q(n,`aria-activedescendant`,r.t=a),o!==r.a&&Q(n,`tabindex`,r.a=o),s!==r.o&&Ez(n,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()},Cz([`pointermove`]),hK=Z(`<button data-react-grab-ignore-events type=button>`),gK=e=>{let t=uK(),n=t.createItemId(),r=e.value,i=()=>e.role??`menuitem`,a=()=>!e.disabled,o=()=>t.activeValue()===r,s;return IR(()=>{s&&(t.registerItem({value:r,domId:n,element:s,isEnabled:a,onSelect:()=>e.onSelect?.()}),LR(()=>t.unregisterItem(r)))}),(()=>{var c=hK();c.$$click=t=>{t.stopPropagation(),a()&&e.onSelect?.()},c.addEventListener(`pointerleave`,()=>{t.clearActiveOnPointerLeave&&t.setActiveItem(null)}),c.addEventListener(`pointerenter`,()=>{a()&&t.canActivateOnHover()&&t.setActiveItem(r)}),c.$$pointerdown=e=>e.stopPropagation();var l=s;return typeof l==`function`?Mz(l,c):s=c,Q(c,`id`,n),$(c,()=>e.children),kR(n=>{var a=e.dataId??r,s=i(),l=i()===`menuitemradio`?!!e.checked:void 0,u=!!e.disabled,d=t.keyboardNavigation?o()?0:-1:void 0,f=e.disabled,p=AW(`relative z-1 contain-layout flex items-center justify-between w-full px-2 py-1 cursor-pointer text-left border-none bg-transparent disabled:opacity-40 disabled:cursor-default`,e.class);return a!==n.e&&Q(c,`data-react-grab-menu-item`,n.e=a),s!==n.t&&Q(c,`role`,n.t=s),l!==n.a&&Q(c,`aria-checked`,n.a=l),u!==n.o&&Q(c,`aria-disabled`,n.o=u),d!==n.i&&Q(c,`tabindex`,n.i=d),f!==n.n&&(c.disabled=n.n=f),p!==n.s&&Ez(c,n.s=p),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),c})()},Cz([`pointerdown`,`click`]),_K=Z(`<span>`),vK=e=>(()=>{var t=_K();return $(t,()=>e.children),kR(()=>Ez(t,AW(`text-[13px] leading-4 font-sans font-medium`,e.class))),t})(),yK=Z(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M6.5 5C5.67157 5 5 5.67157 5 6.5C5 7.32843 5.67157 8 6.5 8H8V6.5C8 5.67157 7.32843 5 6.5 5ZM10 8V6.5C10 4.567 8.433 3 6.5 3C4.567 3 3 4.567 3 6.5C3 8.433 4.567 10 6.5 10H8V14H6.5C4.567 14 3 15.567 3 17.5C3 19.433 4.567 21 6.5 21C8.433 21 10 19.433 10 17.5V16H14V17.5C14 19.433 15.567 21 17.5 21C19.433 21 21 19.433 21 17.5C21 15.567 19.433 14 17.5 14H16V10H17.5C19.433 10 21 8.433 21 6.5C21 4.567 19.433 3 17.5 3C15.567 3 14 4.567 14 6.5V8H10ZM10 10V14H14V10H10ZM16 8H17.5C18.3284 8 19 7.32843 19 6.5C19 5.67157 18.3284 5 17.5 5C16.6716 5 16 5.67157 16 6.5V8ZM16 16V17.5C16 18.3284 16.6716 19 17.5 19C18.3284 19 19 18.3284 19 17.5C19 16.6716 18.3284 16 17.5 16H16ZM8 16H6.5C5.67157 16 5 16.6716 5 17.5C5 18.3284 5.67157 19 6.5 19C7.32843 19 8 18.3284 8 17.5V16Z">`),bK=e=>{let t=()=>e.size??11;return(()=>{var n=yK();return kR(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&Q(n,`width`,r.e=i),a!==r.t&&Q(n,`height`,r.t=a),o!==r.a&&Q(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()},xK=Z(`<span>`),SK=Z(`<span style=display:inline-flex;align-items:center;gap:2px>`),CK=Z(`<span>Ctrl+`),wK=e=>{let t=()=>e.shortcut===`Enter`,n=()=>e.modifier!==!1,r=KB();return(()=>{var i=SK();return $(i,X(_z,{get when(){return t()},get children(){return X(eG,{size:8})}}),null),$(i,X(_z,{get when(){return!t()},get children(){return X(_z,{get when(){return n()},get fallback(){return(()=>{var t=xK();return $(t,()=>e.shortcut),t})()},get children(){return X(_z,{when:r,get fallback(){return(()=>{var t=CK();return t.firstChild,$(t,()=>e.shortcut,null),t})()},get children(){return[X(bK,{size:9}),(()=>{var t=xK();return $(t,()=>e.shortcut),t})()]}})}})}}),null),kR(()=>Ez(i,e.class)),i})()},TK=e=>X(wK,{get shortcut(){return e.shortcut},get modifier(){return e.modifier},get class(){return AW(`text-[11px] font-sans text-[var(--rg-text-secondary)] ml-4`,e.class)}}),EK=({hiddenOpacity:e=`0`,visibleOpacity:t=`1`}={})=>{let n,r,i,a=e=>{r&&(r.style.opacity=t,r.style.top=`${e.offsetTop}px`,r.style.left=`${e.offsetLeft}px`,r.style.width=`${e.offsetWidth}px`,r.style.height=`${e.offsetHeight}px`)},o=typeof ResizeObserver>`u`?void 0:new ResizeObserver(()=>{i&&a(i)});LR(()=>o?.disconnect());let s=()=>{i=void 0,o?.disconnect(),r&&(r.style.opacity=e)};return{containerRef:e=>{n=e},followerRef:e=>{r=e},followElement:e=>{if(!(!r||!n)){if(!e){s();return}i=e,a(e),o?.disconnect(),o?.observe(e),o?.observe(n)}},hideFollower:s}},DK=(e,t)=>e!==t&&e instanceof HTMLElement,OK=(e,t)=>{let n=[];for(let r of Array.from(e.children))DK(r,t)&&n.push(r);return n},kK=(e={})=>{let{topCornerRadiusPx:t,bottomCornerRadiusPx:n,cornerShape:r}=e,i=t!==void 0||n!==void 0,a,o=!1,s=e=>{if(!a||!i)return;let s=e.parentElement;if(!s)return;let c=OK(s,a),l=c[0]===e,u=c[c.length-1]===e,d=l&&t!==void 0?`${t}px`:`0px`,f=u&&n!==void 0?`${n}px`:`0px`;a.style.borderTopLeftRadius=d,a.style.borderTopRightRadius=d,a.style.borderBottomLeftRadius=f,a.style.borderBottomRightRadius=f,r&&!o&&(a.style.setProperty(`corner-shape`,r),o=!0)},{containerRef:c,followerRef:l,followElement:u,hideFollower:d}=EK();return{containerRef:c,highlightRef:e=>{a=e,o=!1,l(e)},updateHighlight:e=>{u(e),e&&s(e)},clearHighlight:d}},AK=(e={})=>{let t=new Map,n=[],r=`react-grab-menu-${Math.random().toString(36).slice(2,8)}`,i=0,a=!1,o=e.value!==void 0,[s,c]=J(null),[l,u]=J(0),d=Y(()=>o?e.value?.()??null:s()),f=t=>{if(o){e.onValueChange?.(t);return}c(t)},p=kK(e.highlight??{});AR(FR([d,l],([e])=>{if(e===null){p.clearHighlight();return}let n=t.get(e);n?p.updateHighlight(n.element):p.clearHighlight()}));let m=()=>n.filter(e=>t.get(e)?.isEnabled()),h=()=>{let e=m();e.length>0&&f(e[0])},g=()=>{let e=m();e.length>0&&f(e[e.length-1])},_=()=>{let e=m();if(e.length===0)return;let t=e.indexOf(d()??``);f(e[t===-1?0:(t+1)%e.length])},v=()=>{let e=m();if(e.length===0)return;let t=e.indexOf(d()??``);f(e[t===-1?e.length-1:(t-1+e.length)%e.length])},y=Y(()=>{l();let e=d();if(e!==null)return t.get(e)?.domId});return{keyboardNavigation:e.keyboardNavigation??!1,clearActiveOnPointerLeave:e.clearActiveOnPointerLeave??!1,activeValue:d,activeDescendantId:y,setActiveItem:f,createItemId:()=>`${r}-item-${i++}`,canActivateOnHover:()=>!(e.requirePointerMove??!1)||a,notePointerMove:()=>{a=!0},resetPointerMove:()=>{a=!1},registerItem:e=>{t.set(e.value,e),n.includes(e.value)||n.push(e.value),u(e=>e+1)},unregisterItem:e=>{t.delete(e);let r=n.indexOf(e);r!==-1&&n.splice(r,1),o||c(t=>t===e?null:t),u(e=>e+1)},getActiveItem:()=>{let e=d();return e===null?void 0:t.get(e)},selectFirst:h,selectLast:g,selectNext:_,selectPrevious:v,setHighlightContainer:p.containerRef,setHighlightRail:p.highlightRef}},jK={Provider:dK,Panel:fK,List:mK,Item:gK,Label:vK,Shortcut:TK},MK=e=>e??!0,NK=(e,t)=>typeof e.enabled==`function`?t?e.enabled(t):!1:MK(e.enabled),PK=e=>{e.type===`contextmenu`&&e.preventDefault(),e.stopImmediatePropagation()},FK=e=>{let t=XM(t=>{e.isOpen()&&(e.shouldIgnoreKeyboardEvent?.(t)||e.shouldIgnoreInputEvents&&xB(t)||t.code===`Escape`&&(t.preventDefault(),t.stopImmediatePropagation(),e.onDismiss(`keyboard`)))}),n=XM(t=>{e.isOpen()&&(qB(t,`data-react-grab-ignore-events`)||e.shouldIgnoreRightClick&&t instanceof MouseEvent&&t.button===2||e.onDismiss(`pointer`))}),r=pI(()=>{window.addEventListener(`mousedown`,n,{capture:!0}),window.addEventListener(`touchstart`,n,{capture:!0})});return window.addEventListener(`keydown`,t,{capture:!0}),()=>{mI(r),window.removeEventListener(`keydown`,t,{capture:!0}),window.removeEventListener(`mousedown`,n,{capture:!0}),window.removeEventListener(`touchstart`,n,{capture:!0})}},IK=Z(`<div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2">`),LK=Z(`<div data-react-grab-ignore-events data-react-grab-context-menu class="fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none"style=pointer-events:auto>`),RK=e=>{let t,n,r=null,i=AK({keyboardNavigation:!0,highlight:{bottomCornerRadiusPx:14,cornerShape:jN}}),[a,o]=J(0),[s,c]=J(0),l=Y(()=>e.position!==null),u=Y(()=>jW({tagName:e.tagName,componentName:e.componentName})),d=()=>{if(t){let e=t.getBoundingClientRect();o(e.width),c(e.height)}};AR(()=>{l()&&pI(d)});let f=Y(()=>{let t=e.selectionBounds,n=e.position,r=a(),i=s();if(r===0||i===0||!t||!n)return{left:PN.left,top:PN.top,arrowLeft:0,arrowPosition:`bottom`};let o=n.x??t.x+t.width/2,c=Math.max(4,Math.min(o-r/2,window.innerWidth-r-4)),l=Math.max(8,Math.min(o-c,r-8)),u=t.y+t.height+8+4,d=t.y-i-8-4,f=u+i>window.innerHeight,p=d>=0,m=f&&p,h=m?d:u,g=m?`top`:`bottom`;if(f&&!p){let e=n.y??t.y+t.height/2;h=Math.max(4,Math.min(e+4,window.innerHeight-i-4)),g=`top`}return{left:c,top:h,arrowLeft:l,arrowPosition:g}}),p=Y(()=>{let t=e.actions??[],n=e.actionContext;return t.map(e=>({id:e.id,label:e.label,action:()=>{n&&e.onAction(n)},enabled:NK(e,n),shortcut:e.shortcut,shortcutModifier:e.shortcutModifier}))});AR(FR(l,e=>{if(e){let e=t?.getRootNode(),i=e instanceof ShadowRoot?e.activeElement:null,a=document.activeElement;r=a instanceof HTMLElement&&i===null&&!(t instanceof Element&&t.contains(a))?a:null,n?.focus({preventScroll:!0});return}i.setActiveItem(null);let a=r;r=null,!(!(a instanceof HTMLElement)||!document.contains(a))&&pI(()=>{let e=document.activeElement;(e===null||e===document.body)&&a.focus({preventScroll:!0})})})),IR(()=>{d();let t=t=>{if(!l())return;let n=t.key===`ArrowDown`,r=t.key===`ArrowUp`,a=t.key===`Home`,o=t.key===`End`,s=t.key===`Tab`;if(n||r||a||o||s){t.preventDefault(),t.stopPropagation();let e=n||s&&!t.shiftKey;a?i.selectFirst():o?i.selectLast():e?i.selectNext():i.selectPrevious();return}let c=e.actions??[],u=e.actionContext,d=n=>{u&&NK(n,u)&&(t.preventDefault(),t.stopPropagation(),n.onAction(u),e.onHide())};if(t.key===`Enter`){let e=i.getActiveItem();if(e){t.preventDefault(),t.stopPropagation(),e.isEnabled()&&e.onSelect();return}}let f=tH(c,t,{includeModifierShortcuts:!0});f&&d(f)},n=FK({isOpen:l,onDismiss:e.onDismiss,shouldIgnoreRightClick:!0}),r=XM(t);window.addEventListener(`keydown`,r,{capture:!0}),LR(()=>{n(),window.removeEventListener(`keydown`,r,{capture:!0})})});let m=Y(()=>{let{tagName:e,componentName:t}=u();return`Actions for ${t?`${t}.${e}`:e}`});return X(_z,{get when(){return l()},get children(){var r=LK();Dz(r,`contextmenu`,PK,!0),Dz(r,`click`,PK,!0),Dz(r,`mousedown`,PK,!0),Dz(r,`pointerdown`,PK,!0);var a=t;return typeof a==`function`?Mz(a,r):t=r,Az(r,`z-index`,`${sN}`),$(r,X(LW,{get position(){return f().arrowPosition},leftPercent:0,get leftOffsetPx(){return f().arrowLeft}}),null),$(r,X(jK.Panel,{class:`justify-center items-start min-w-[100px]`,get children(){return[(()=>{var t=IK();return $(t,X(UW,{get tagName(){return u().tagName},get componentName(){return u().componentName},get isClickable(){return e.hasFilePath},onClick:t=>{t.stopPropagation(),e.hasFilePath&&e.actionContext&&(e.actions?.find(e=>e.id===`open`))?.onAction(e.actionContext)},shrink:!0})),t})(),X(GW,{get children(){return X(jK.Provider,{store:i,get children(){return X(jK.List,{ref:e=>n=e,get label(){return m()},class:`w-[calc(100%+16px)] -mx-2 -my-1.5 outline-none`,get children(){return X(hz,{get each(){return p()},children:t=>X(jK.Item,{get value(){return t.id},get dataId(){return t.label.toLowerCase()},get disabled(){return!t.enabled},onSelect:()=>{t.action(),e.onHide()},get children(){return[X(jK.Label,{class:`text-[var(--rg-text-primary)]`,get children(){return t.label}}),X(_z,{get when(){return t.shortcut},children:e=>X(jK.Shortcut,{get shortcut(){return e()},get modifier(){return t.shortcutModifier}})})]}})})}})}})}})]}}),null),kR(e=>{var t=`${f().top}px`,n=`${f().left}px`;return t!==e.e&&Az(r,`top`,e.e=t),n!==e.t&&Az(r,`left`,e.t=n),e},{e:void 0,t:void 0}),r}})},Cz([`pointerdown`,`mousedown`,`click`,`contextmenu`]),zK=(e,t,n,r)=>Math.max(r,Math.min(e,n-t-r)),BK=({anchor:e,measuredWidth:t,measuredHeight:n,viewportLeft:r=0,viewportTop:i=0,viewportWidth:a,viewportHeight:o,anchorGapPx:s,viewportPaddingPx:c,offscreenPosition:l})=>{if(!e||t===0||n===0)return l;let u,d;return e.edge===`left`||e.edge===`right`?(u=e.edge===`left`?e.x+s:e.x-t-s,d=e.y-n/2):(u=e.x-t/2,d=e.edge===`top`?e.y+s:e.y-n-s),{left:r+zK(u-r,t,a,c),top:i+zK(d-i,n,o,c)}},VK=(e,t)=>{let[n,r]=J(0),[i,a]=J(0),[o,s]=J(!1),[c,l]=J(!1),[u,d]=J(0),[f,p]=J(`bottom`),m,h,g=()=>{clearTimeout(m),h!==void 0&&(mI(h),h=void 0)},_=()=>{let t=e();t&&(r(t.offsetWidth),a(t.offsetHeight))},v=()=>{NR(()=>{d(e=>e+1),_()})},y=Y(()=>t()!==null);return AR(()=>{let n=t();n?(p(n.edge),clearTimeout(m),s(!0),h!==void 0&&mI(h),h=pI(()=>{_(),e()?.offsetHeight,l(!0)})):(h!==void 0&&mI(h),l(!1),m=setTimeout(()=>{s(!1)},120)),LR(g)}),AR(()=>{if(!y())return;window.addEventListener(`resize`,v),window.visualViewport?.addEventListener(`resize`,v),window.visualViewport?.addEventListener(`scroll`,v);let e=JM(),t;e&&typeof ResizeObserver<`u`&&(t=new ResizeObserver(v),t.observe(e)),LR(()=>{window.removeEventListener(`resize`,v),window.visualViewport?.removeEventListener(`resize`,v),window.visualViewport?.removeEventListener(`scroll`,v),t?.disconnect()})}),{shouldMount:o,isAnimatedIn:c,lastAnchorEdge:f,displayPosition:Y(e=>{u();let r=OW(),a=BK({anchor:t(),measuredWidth:n(),measuredHeight:i(),viewportLeft:r.offsetLeft,viewportTop:r.offsetTop,viewportWidth:r.width,viewportHeight:r.height,anchorGapPx:8,viewportPaddingPx:8,offscreenPosition:PN});return a.left===PN.left?e:a},PN),measure:_,clearAnimationHandles:g}},HK={padding:{prefix:`p`,scale:`spacing`},"padding-top,padding-bottom":{prefix:`py`,scale:`spacing`},"padding-left,padding-right":{prefix:`px`,scale:`spacing`},"padding-top":{prefix:`pt`,scale:`spacing`},"padding-right":{prefix:`pr`,scale:`spacing`},"padding-bottom":{prefix:`pb`,scale:`spacing`},"padding-left":{prefix:`pl`,scale:`spacing`},margin:{prefix:`m`,scale:`spacing`},"margin-top,margin-bottom":{prefix:`my`,scale:`spacing`},"margin-left,margin-right":{prefix:`mx`,scale:`spacing`},"margin-top":{prefix:`mt`,scale:`spacing`},"margin-right":{prefix:`mr`,scale:`spacing`},"margin-bottom":{prefix:`mb`,scale:`spacing`},"margin-left":{prefix:`ml`,scale:`spacing`},gap:{prefix:`gap`,scale:`spacing`},"column-gap":{prefix:`gap-x`,scale:`spacing`},"row-gap":{prefix:`gap-y`,scale:`spacing`},"width,height":{prefix:`size`,scale:`spacing`},width:{prefix:`w`,scale:`spacing`},height:{prefix:`h`,scale:`spacing`},"min-width":{prefix:`min-w`,scale:`spacing`},"max-width":{prefix:`max-w`,scale:`spacing`},"min-height":{prefix:`min-h`,scale:`spacing`},"max-height":{prefix:`max-h`,scale:`spacing`},"top,right,bottom,left":{prefix:`inset`,scale:`spacing`},"top,bottom":{prefix:`inset-y`,scale:`spacing`},"left,right":{prefix:`inset-x`,scale:`spacing`},top:{prefix:`top`,scale:`spacing`},right:{prefix:`right`,scale:`spacing`},bottom:{prefix:`bottom`,scale:`spacing`},left:{prefix:`left`,scale:`spacing`},"border-width":{prefix:`border`,scale:`border-width`},"border-top-width":{prefix:`border-t`,scale:`border-width`},"border-right-width":{prefix:`border-r`,scale:`border-width`},"border-bottom-width":{prefix:`border-b`,scale:`border-width`},"border-left-width":{prefix:`border-l`,scale:`border-width`},"z-index":{prefix:`z`,scale:`z-index`},opacity:{prefix:`opacity`,scale:`opacity`}},UK=(e,t)=>{let n=HK[e];if(!n)return null;let{prefix:r,scale:i}=n;if(i===`spacing`){if(t<0)return null;let e=t/4;return!Number.isInteger(e)||e>96?null:`${r}-${e}`}return i===`border-width`?!Number.isInteger(t)||t<0||t>8?null:t===1?r:`${r}-${t}`:i===`z-index`?!Number.isInteger(t)||t<0||t>50?null:`${r}-${t}`:!Number.isFinite(t)||t<0||t>100||t%5!=0?null:`${r}-${t}`},WK=e=>{let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement:e.ownerDocument?.activeElement??document.activeElement},GK=e=>e.toLowerCase()===`#00000000`?RN:e.toUpperCase(),KK=Z(`<input data-react-grab-ignore-events data-react-grab-input type=text autocapitalize=none autocorrect=off autocomplete=off>`),qK=e=>{let[t,n]=mz(e,[`class`,`ref`,`autoFocusSelect`]);return(()=>{var e=KK();return Mz(e=>{t.autoFocusSelect&&queueMicrotask(()=>{e.focus(),e.select()}),t.ref?.(e)},e),Q(e,`spellcheck`,!1),jz(e,pz({get class(){return AW(`bg-transparent border-none outline-none text-[var(--rg-text-primary)] p-0 m-0`,t.class)}},n),!1,!1),e})()},JK=`text-[13px] leading-4 font-medium`,YK={position:`absolute`,opacity:0,"pointer-events":`none`,width:`0`,height:`0`,margin:`0`,padding:`0`,overflow:`hidden`},XK=Z(`<div class="flex items-center gap-2 w-full px-2 h-[20px]"><div class="flex items-center gap-1 ml-auto shrink-0"><button type=button data-react-grab-ignore-events aria-label="Pick color"class="size-[16px] rounded-[4px] border-[var(--rg-border-button)] [border-width:0.5px] border-solid p-0 m-0 cursor-pointer shrink-0"></button><input data-react-grab-ignore-events type=color aria-hidden=true tabindex=-1 class="absolute opacity-0 pointer-events-none size-0">`),ZK=Z(`<span>`),QK=Z(`<span class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)] cursor-text">`),$K=e=>e.length===9?e.slice(0,7):e,eq=e=>{let[t,n]=J(null),r=()=>t()!==null,i=()=>GK(e.value),a,o=!0;LR(()=>{o=!1}),IR(()=>{let t=e.onRegisterTrigger?.(()=>a?.click());LR(()=>t?.())});let s=()=>{let r=t();if(r===null)return;n(null);let i=HB(r);i?i.toLowerCase()!==e.value.toLowerCase()&&e.onCommit(i,`keyboard`):e.onInvalidCommit?.(),e.onEditComplete?.()},c=()=>{r()&&(n(null),e.onEditComplete?.())},l=e=>{if(!(e.isComposing||e.keyCode===229)){if(e.stopImmediatePropagation(),e.key===`Enter`){e.preventDefault(),s();return}e.key===`Escape`&&(e.preventDefault(),c())}},u=t=>{t.preventDefault(),t.stopPropagation(),e.onInteract?.(),a?.click()};return(()=>{var c=XK(),d=c.firstChild,f=d.firstChild,p=f.nextSibling;$(c,X(_z,{get when(){return e.label},children:e=>(()=>{var t=ZK();return Ez(t,`${JK} text-[var(--rg-text-primary)] truncate min-w-0`),$(t,e),t})()}),d),$(d,X(_z,{get when(){return r()},get fallback(){return(()=>{var e=QK();return e.$$click=e=>{e.preventDefault(),e.stopPropagation(),n(i())},e.$$pointerdown=e=>e.stopPropagation(),$(e,i),kR(()=>Q(e,`data-react-grab-value`,i())),e})()},get children(){return X(qK,{autoFocusSelect:!0,inputmode:`text`,"aria-label":`Style color hex`,class:`text-[12px] leading-4 font-medium tabular-nums text-right`,get style(){return{"field-sizing":`content`,"min-width":`32px`,"max-width":e.emphasized?`100px`:`72px`}},get value(){return t()??``},onInput:e=>n(e.currentTarget.value),onKeyDown:l,onBlur:s,onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})}}),f),f.$$click=u,f.$$mousedown=e=>e.preventDefault(),f.$$pointerdown=e=>e.stopPropagation(),p.$$input=t=>{if(!o)return;let n=t.currentTarget.value,r=e.value.length===9?e.value.slice(7):``,i=n+(r.toLowerCase()===`00`?``:r);e.onInteract?.(),i&&i.toLowerCase()!==e.value.toLowerCase()&&e.onCommit(i,`pointer`)};var m=a;return typeof m==`function`?Mz(m,p):a=p,kR(t=>Az(f,`background-color`,e.value)),kR(()=>p.value=$K(e.value)),c})()},Cz([`pointerdown`,`mousedown`,`click`,`input`]),tq=Z(`<svg width=1em height=1em viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true style=width:16px;height:16px;flex-shrink:0;cursor:pointer><path fill-rule=evenodd clip-rule=evenodd>`),nq=e=>{let t=()=>e.active?`var(--rg-text-primary)`:`var(--rg-text-secondary)`,n=()=>e.active?e.direction===`left`?-2:2:0,r=()=>e.active?1.12:1,i=()=>e.direction===`left`?`M2.54282 10.5427C1.76177 11.3238 1.76177 12.5901 2.54282 13.3712L9.70183 20.5302C11.1193 21.9476 13.5428 20.9437 13.5428 18.9392V16.9573H21.0428C22.1474 16.9573 23.0428 16.0619 23.0428 14.9573V8.95733C23.0428 7.85276 22.1474 6.95733 21.0428 6.95733L13.5428 6.95733V4.97473C13.5428 2.9702 11.1193 1.96631 9.70183 3.38373L2.54282 10.5427Z`:`M14.2983 20.5302L21.4573 13.3712C22.2383 12.5901 22.2383 11.3238 21.4573 10.5427L14.2983 3.38374C12.8808 1.96631 10.4573 2.97019 10.4573 4.97473V6.95659L3.95728 6.95659C2.85271 6.95659 1.95728 7.85202 1.95728 8.95659V14.9566C1.95728 16.0612 2.85271 16.9566 3.95727 16.9566H10.4573V18.9392C10.4573 20.9437 12.8808 21.9476 14.2983 20.5302Z`;return(()=>{var a=tq(),o=a.firstChild;return Dz(a,`pointerdown`,e.onPointerDown,!0),kR(s=>{var c=`translateX(${n()}px) scale(${r()})`,l=e.active?`transform 30ms cubic-bezier(0, 0, 0.2, 1)`:`transform 450ms cubic-bezier(0.34, 1.8, 0.64, 1)`,u=i(),d=t(),f=e.active?`fill 50ms ease`:`fill 300ms ease`;return c!==s.e&&Az(a,`transform`,s.e=c),l!==s.t&&Az(a,`transition`,s.t=l),u!==s.a&&Q(o,`d`,s.a=u),d!==s.o&&Q(o,`fill`,s.o=d),f!==s.i&&Az(o,`transition`,s.i=f),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},Cz([`pointerdown`]),rq=Z(`<span>`),iq=Z(`<div class="flex items-center gap-2 w-full px-2 h-[20px]"><div class="ml-auto shrink-0 flex items-center gap-1"><span data-react-grab-ignore-events role=button tabindex=-1 class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)] cursor-pointer select-none min-w-[36px] text-center">`),aq=e=>{let t=()=>e.options.find(t=>t.value===e.value)?.label??e.value;return(()=>{var n=iq(),r=n.firstChild,i=r.firstChild;return $(n,X(_z,{get when(){return e.label},get children(){var t=rq();return Ez(t,`${JK} text-[var(--rg-text-primary)] truncate min-w-0`),$(t,()=>e.label),t}}),r),$(r,X(nq,{direction:`left`,get active(){return e.activeKey===`left`},onPointerDown:()=>e.onStep(-1)}),i),i.$$contextmenu=t=>{t.preventDefault(),t.stopPropagation(),e.onStep(-1)},i.$$click=t=>{t.preventDefault(),t.stopPropagation(),e.onStep(1)},i.$$mousedown=e=>e.preventDefault(),i.$$pointerdown=e=>e.stopPropagation(),$(i,t),$(r,X(nq,{direction:`right`,get active(){return e.activeKey===`right`},onPointerDown:()=>e.onStep(1)}),null),kR(t=>{var n=`Cycle ${e.label??`value`}`,r=`Click to cycle (${e.options.length} options)`;return n!==t.e&&Q(i,`aria-label`,t.e=n),r!==t.t&&Q(i,`title`,t.t=r),t},{e:void 0,t:void 0}),n})()},Cz([`pointerdown`,`mousedown`,`click`,`contextmenu`]),oq=e=>e.kind===`numeric`?e:null,sq=e=>e.kind===`color`?e:null,cq=e=>e.kind===`enum`?e:null,lq=/^[0-9]$/,uq=e=>{let t=Array.from(e),n=t.findIndex(e=>lq.test(e));if(n<0)return{prefixLiterals:t,rightAlignedSegments:[]};let r=t.slice(0,n),i=[],a=0;for(let e=t.length-1;e>=n;e--){let n=t[e],r=lq.test(n)?`digit`:`literal`;i.push({kind:r,value:n,digitDistanceFromRight:a}),r===`digit`&&(a+=1)}return{prefixLiterals:r,rightAlignedSegments:i}},dq=Z(`<span class=rg-slot-column aria-hidden=true><span class=rg-slot-sizer>0</span><span class=rg-slot-cell>`),fq=Z(`<span class="rg-slot-cell rg-slot-exit">`),pq=Z(`<span><span class=inline-flex style=flex-direction:row-reverse>`),mq=Z(`<span class="inline-block whitespace-pre"aria-hidden=true>`),hq=e=>typeof e==`number`?e:Number.parseFloat(String(e).replace(/[^0-9.-]/g,``))||0,gq=e=>{let t,[n,r]=J(null),i=null;AR(FR(()=>e.digit,(n,a)=>{a===void 0||n===a||(t&&(t.classList.remove(`rg-slot-enter`),t.offsetWidth,t.classList.add(`rg-slot-enter`)),r({digit:a,direction:e.direction}),i!==null&&clearTimeout(i),i=setTimeout(()=>r(null),350))},{defer:!0})),LR(()=>{i!==null&&clearTimeout(i)});let a=()=>({"animation-delay":`${e.delayMs}ms`});return(()=>{var r=dq(),i=r.firstChild.nextSibling,o=t;return typeof o==`function`?Mz(o,i):t=i,$(i,()=>e.digit),$(r,X(_z,{get when(){return n()},keyed:!0,children:e=>(()=>{var t=fq();return $(t,()=>e.digit),kR(n=>{var r=String(e.direction),i=a();return r!==n.e&&Q(t,`data-dir`,n.e=r),n.t=kz(t,i,n.t),n},{e:void 0,t:void 0}),t})()}),null),kR(t=>{var n=String(e.direction),r=a();return n!==t.e&&Q(i,`data-dir`,t.e=n),t.t=kz(i,r,t.t),t},{e:void 0,t:void 0}),r})()},_q=e=>{let t=Y(()=>String(e.children??``)),n=Y(()=>uq(t())),r=Y(FR(()=>hq(e.children),(e,t)=>t===void 0||e===t?0:e>t?1:-1)),i=Y(()=>e.direction??r());return(()=>{var r=pq(),a=r.firstChild;return $(r,X(gz,{get each(){return n().prefixLiterals},children:e=>(()=>{var t=mq();return $(t,e),t})()}),a),$(a,X(gz,{get each(){return n().rightAlignedSegments},children:e=>X(_z,{get when(){return e().kind===`digit`},get fallback(){return(()=>{var t=mq();return $(t,()=>e().value),t})()},get children(){return X(gq,{get digit(){return Number(e().value)},get direction(){return i()},get delayMs(){return e().digitDistanceFromRight*18}})}})})),kR(n=>{var i=t(),a=`inline-flex ${e.class??``}`,o={...e.style,"--rg-slot-dur":`350ms`};return i!==n.e&&Q(r,`aria-label`,n.e=i),a!==n.t&&Ez(r,n.t=a),n.a=kz(r,o,n.a),n},{e:void 0,t:void 0,a:void 0}),r})()},vq=Z(`<div data-react-grab-slider-base aria-hidden=true class="absolute inset-y-0 left-0 right-0 rounded-[6px] bg-[var(--rg-surface-active)] pointer-events-none">`),yq=Z(`<div class="flex items-center gap-1 w-full px-1"><div role=slider aria-keyshortcuts="ArrowLeft ArrowRight"tabindex=-1 class="relative flex-1 h-[20px] flex items-center overflow-hidden rounded-[6px]"><div data-react-grab-slider-fill aria-hidden=true class="absolute inset-y-0 left-0 bg-[var(--rg-surface-active)] pointer-events-none"></div><div aria-hidden=true class="absolute inset-0 pointer-events-none"></div><div data-react-grab-slider-handle aria-hidden=true class="absolute top-[2px] bottom-[2px] w-[2px] rounded-[1px] bg-[var(--rg-text-primary)] pointer-events-none"style="transition:opacity 120ms ease"></div><div class="relative z-10 flex items-center justify-between w-full px-2 pointer-events-none">`),bq=Z(`<div data-react-grab-slider-hash-mark class="absolute top-1/2 w-px h-[8px] rounded-[1px] bg-[var(--rg-text-secondary)]"style="transform:translate(-50%, -50%);transition:opacity 200ms ease">`),xq=Z(`<span>`),Sq=Z(`<span class="ml-auto flex items-center gap-1 pointer-events-auto"><span data-react-grab-value-text class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)]"><span class="text-[9px] text-[var(--rg-text-secondary)] ml-px">`),Cq=Z(`<span data-react-grab-tailwind-label aria-hidden=true class="text-[10px] leading-4 text-[var(--rg-text-secondary)] tabular-nums">`),wq=Array.from({length:9},(e,t)=>(t+1)*100/10),Tq=/^(-?(?:\d+\.?\d*|\.\d+))\s*([a-zA-Z%]*)$/,Eq=e=>{let[t,n]=J(null),[r,i]=J(0),[a,o]=J(!1),[s,c]=J(!1),l=()=>t()!==null,u,d=null,f=()=>{let t=e.max-e.min;return t<=0?0:(Math.max(e.min,Math.min(e.max,e.value))-e.min)/t*100},p=()=>{e.onCommitValue&&n(_V(e.value))},m=()=>!!e.onCommitValue,h=(t,n)=>{if(n.width<=0)return e.value;let r=Math.max(0,Math.min(1,(t-n.left)/n.width));return e.min+r*(e.max-e.min)},g=(t,n)=>{e.onCommitValue?.(h(t,n),`pointer`)},_=(e,t)=>{let n=Math.max(0,e-t.right)-Math.max(0,t.left-e),r=Math.max(0,Math.abs(n)-32),i=Math.sqrt(Math.min(r/200,1));return Math.sign(n)*8*i},v=t=>{if(!m()||l())return;t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture(t.pointerId);let n=u,r=n!==void 0&&t.target instanceof Node&&n.contains(t.target);d={startX:t.clientX,isDragging:!1,startedOnValueText:r,trackRect:t.currentTarget.getBoundingClientRect()},o(!0),e.onInteract?.()},y=t=>{if(!d)return;let n=t.clientX-d.startX;!d.isDragging&&Math.abs(n)<3||(d.isDragging=!0,e.onInteract?.(),g(t.clientX,d.trackRect),i(_(t.clientX,d.trackRect)))},b=e=>{let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),d&&(d.isDragging||(d.startedOnValueText?p():g(d.startX,d.trackRect)),d=null,o(!1),i(0))},x=e=>{let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),d&&(d=null,o(!1),i(0))};IR(()=>{let e=()=>{d=null,o(!1),c(!1),i(0)};window.addEventListener(`blur`,e),LR(()=>window.removeEventListener(`blur`,e))});let S=()=>!!e.activeKey||a()||s(),C=()=>{let r=t();if(r===null)return;n(null);let i=r.trim().replace(/(\d),(\d)/g,`$1.$2`).match(Tq);if(!i){e.onInvalidCommit?.(),e.onEditComplete?.();return}let a=i[2].toLowerCase();if(a&&a!==e.unit){e.onInvalidCommit?.(),e.onEditComplete?.();return}let o=Number.parseFloat(i[1]);Number.isFinite(o)?e.onCommitValue?.(o,`keyboard`):e.onInvalidCommit?.(),e.onEditComplete?.()},w=()=>{l()&&(n(null),e.onEditComplete?.())},T=e=>{if(!(e.isComposing||e.keyCode===229)){if(e.stopImmediatePropagation(),e.key===`Enter`){e.preventDefault(),C();return}e.key===`Escape`&&(e.preventDefault(),w())}},E=()=>{let t=r();return{cursor:m()&&!l()?`ew-resize`:`default`,"touch-action":m()?`none`:`auto`,"user-select":`none`,"-webkit-user-select":`none`,"min-width":e.emphasized?`96px`:void 0,transform:t===0?`translateX(0)`:`translateX(${t}px)`,transition:a()?`none`:`transform 350ms ${BN}`}};return(()=>{var r=yq(),i=r.firstChild,o=i.firstChild,d=o.nextSibling,p=d.nextSibling,m=p.nextSibling;return i.addEventListener(`lostpointercapture`,x),i.addEventListener(`pointercancel`,x),i.$$pointerup=b,i.addEventListener(`pointerleave`,()=>c(!1)),i.addEventListener(`pointerenter`,()=>c(!0)),i.$$pointermove=y,i.$$pointerdown=v,$(i,X(_z,{get when(){return e.emphasized},get children(){var e=vq();return kR(t=>Az(e,`opacity`,l()?0:.55)),e}}),o),$(d,X(gz,{each:wq,children:e=>(()=>{var t=bq();return kR(n=>{var r=`${e()}%`,i=S()?.4:0;return r!==n.e&&Az(t,`left`,n.e=r),i!==n.t&&Az(t,`opacity`,n.t=i),n},{e:void 0,t:void 0}),t})()})),$(m,X(_z,{get when(){return e.label},children:e=>(()=>{var t=xq();return Ez(t,`${JK} text-[var(--rg-text-primary)] truncate min-w-0`),$(t,e),t})()}),null),$(m,X(_z,{get when(){return l()},get fallback(){return(()=>{var t=Sq(),n=t.firstChild,r=n.firstChild,i=u;return typeof i==`function`?Mz(i,t):u=t,$(t,X(_z,{get when(){return e.tailwindLabel},children:e=>(()=>{var t=Cq();return $(t,e),t})()}),n),$(n,X(_q,{get children(){return _V(e.value)}}),r),$(r,()=>e.unit),kR(n=>{var r=`${_V(e.value)}${e.unit}`,i=e.onCommitValue?`text`:`default`;return r!==n.e&&Q(t,`data-react-grab-value`,n.e=r),i!==n.t&&Az(t,`cursor`,n.t=i),n},{e:void 0,t:void 0}),t})()},get children(){return X(qK,{autoFocusSelect:!0,inputmode:`decimal`,"aria-label":`Style value`,class:`text-[12px] leading-4 font-medium tabular-nums text-right pointer-events-auto ml-auto`,get style(){return{"field-sizing":`content`,"min-width":`16px`,"max-width":e.emphasized?`120px`:`60px`}},get value(){return t()??``},onInput:e=>n(e.currentTarget.value),onKeyDown:T,onBlur:C,onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})}}),null),$(r,X(_z,{get when(){return e.emphasized},get children(){return[X(nq,{direction:`left`,get active(){return e.activeKey===`left`},onPointerDown:()=>e.onStep(-1)}),X(nq,{direction:`right`,get active(){return e.activeKey===`right`},onPointerDown:()=>e.onStep(1)})]}}),null),kR(t=>{var n=e.label??`Value`,r=e.min,c=e.max,u=e.value,d=`${_V(e.value)}${e.unit}`,m=E(),h=`${f()}%`,g=+!l(),_=`calc(${f()}% - 1px)`,v=e.activeKey?.9:a()||s()?.35:0;return n!==t.e&&Q(i,`aria-label`,t.e=n),r!==t.t&&Q(i,`aria-valuemin`,t.t=r),c!==t.a&&Q(i,`aria-valuemax`,t.a=c),u!==t.o&&Q(i,`aria-valuenow`,t.o=u),d!==t.i&&Q(i,`aria-valuetext`,t.i=d),t.n=kz(i,m,t.n),h!==t.s&&Az(o,`width`,t.s=h),g!==t.h&&Az(o,`opacity`,t.h=g),_!==t.r&&Az(p,`left`,t.r=_),v!==t.d&&Az(p,`opacity`,t.d=v),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),r})()},Cz([`pointerdown`,`pointermove`,`pointerup`]),Dq=e=>X(vz,{get children(){return[X(yz,{get when(){return oq(e.property)},children:t=>X(Eq,{get label(){return gB(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get min(){return t().min},get max(){return t().max},get unit(){return t().unit},get activeKey(){return e.activeKey},get onStep(){return e.onStep},get onCommitValue(){return e.onCommit},get onEditComplete(){return e.onEditComplete},get onInvalidCommit(){return e.onInvalidCommit},get onInteract(){return e.onInteract},get tailwindLabel(){return e.tailwindLabel},get emphasized(){return e.emphasized}})}),X(yz,{get when(){return sq(e.property)},children:t=>X(eq,{get label(){return gB(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get onCommit(){return e.onCommit},get onEditComplete(){return e.onEditComplete},get onInvalidCommit(){return e.onInvalidCommit},get onRegisterTrigger(){return e.onColorPickerRegister},get onInteract(){return e.onInteract},get emphasized(){return e.emphasized}})}),X(yz,{get when(){return cq(e.property)},children:t=>X(aq,{get label(){return gB(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get options(){return t().options},get activeKey(){return e.activeKey},get onStep(){return e.onStep}})})]}}),Oq=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Copy`),kq=e=>X(rG,{"data-react-grab-ignore-events":!0,"data-react-grab-copy-button":!0,onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onCopy()},get children(){return Oq()}}),Aq=()=>{let[e,t]=J(!1),n,r=()=>{clearTimeout(n),t(!1)},i=()=>{t(!0),clearTimeout(n),n=setTimeout(()=>{t(!1)},zN)},a=()=>{clearTimeout(n)};return LR(a),{isPending:e,show:i,hide:r,cleanup:a}},jq=Z(`<div role=menu aria-orientation=vertical aria-label="Editable properties"class="relative flex flex-col w-full max-h-[var(--rg-edit-list-max-h)] overflow-y-auto outline-none no-scrollbar"><div aria-hidden=true class="pointer-events-none absolute opacity-0 transition-[top,left,width,height,opacity,border-radius] duration-75 ease-out bg-[var(--rg-surface-hover)]">`),Mq=Z(`<div class="flex items-center w-full h-[24px]">`),Nq=Z(`<button data-react-grab-ignore-events type=button role=menuitem tabindex=-1 class="relative z-1 contain-layout block w-full h-[24px] px-0 py-0 cursor-pointer text-left border-none bg-transparent">`),Pq=Z(`<div class="flex items-center justify-between w-full h-[24px] px-2 gap-2"><span class="text-[13px] leading-4 font-sans font-medium text-[var(--rg-text-primary)] truncate min-w-0">`),Fq=Z(`<span class="font-sans text-[var(--rg-text-secondary)] tabular-nums shrink-0"><span class=text-[11px]></span><span class="text-[9px] ml-px">`),Iq=Z(`<span aria-hidden=true class="size-[12px] rounded-[3px] border-[var(--rg-border-button)] [border-width:0.5px] border-solid shrink-0">`),Lq=Z(`<span class="text-[11px] font-sans text-[var(--rg-text-secondary)] shrink-0">`),Rq=e=>{let t=cq(e);return t?t.options.find(e=>e.value===t.value)?.label??t.value:``},zq=e=>{let t=[],n,r=!1,i=null,a=()=>{if(!n)return!1;let e=WK(n);return e instanceof HTMLElement&&e.matches(`input[data-react-grab-input]`)},o=(t,n)=>{n===`move`&&(r=!0);let o=a();if(r&&!o){if(e.isAdjusting()){i=t;return}i=null,t!==e.activeIndex&&e.onHoverIndex(t)}};AR(()=>{if(e.isAdjusting())return;let n=i;if(n===null)return;i=null;let o=t[n],s=a();r&&(s||o?.matches(`:hover`)&&n!==e.activeIndex&&e.onHoverIndex(n))});let{containerRef:s,highlightRef:c,updateHighlight:l,clearHighlight:u}=kK({});AR(()=>{t.length=e.properties.length});let d;return AR(()=>{let r=e.activeIndex,i=t[r];if(!i||r<0){u();return}if(l(i),d!==void 0&&cancelAnimationFrame(d),d=requestAnimationFrame(()=>{d=void 0;let e=t[r];e&&l(e)}),!n)return;let a=n.getBoundingClientRect(),o=i.getBoundingClientRect();(o.top<a.top||o.bottom>a.bottom)&&i.scrollIntoView({block:`nearest`})}),LR(()=>{d!==void 0&&cancelAnimationFrame(d)}),(()=>{var a=jq(),l=a.firstChild;return a.$$pointermove=()=>{r=!0},Mz(e=>{n=e,s(e)},a),Mz(c,l),$(a,X(gz,{get each(){return e.properties},children:(r,a)=>{let s=()=>a===e.activeIndex;return(()=>{var c=Nq();return c.$$click=t=>{t.stopPropagation(),e.onSelect(a)},c.$$mousedown=e=>{let t=n?WK(n):null;t instanceof HTMLElement&&t.matches(`input[data-react-grab-input]`)&&t.blur(),e.preventDefault()},c.addEventListener(`pointerleave`,()=>{i===a&&(i=null)}),c.$$pointermove=()=>{o(a,`move`)},c.addEventListener(`pointerenter`,()=>{o(a,`enter`)}),Mz(e=>{t[a]=e,LR(()=>{t[a]===e&&(t[a]=void 0)})},c),$(c,X(_z,{get when(){return s()},get fallback(){return(()=>{var e=Pq(),t=e.firstChild;return $(t,()=>r().label),$(e,X(vz,{get children(){return[X(yz,{get when(){return oq(r())},children:e=>(()=>{var t=Fq(),n=t.firstChild,r=n.nextSibling;return $(n,()=>_V(e().value)),$(r,()=>e().unit),t})()}),X(yz,{get when(){return sq(r())},children:e=>(()=>{var t=Iq();return kR(n=>Az(t,`background-color`,e().value)),t})()}),X(yz,{get when(){return cq(r())},children:e=>(()=>{var t=Lq();return $(t,()=>Rq(e())),t})()})]}}),null),e})()},get children(){var t=Mq();return $(t,X(Dq,{get property(){return r()},get activeKey(){return e.activeKey},get onStep(){return e.onStep},get onCommit(){return e.onCommit},get onEditComplete(){return e.onEditComplete},get onInvalidCommit(){return e.onInvalidCommit},get onInteract(){return e.onInteract},get onColorPickerRegister(){return e.onColorPickerRegister},showLabel:!0,get tailwindLabel(){return e.activeTailwindLabel}})),t}})),kR(e=>{var t=r().key,n=s()?`true`:void 0;return t!==e.e&&Q(c,`data-react-grab-edit-property`,e.e=t),n!==e.t&&Q(c,`aria-current`,e.t=n),e},{e:void 0,t:void 0}),c})()}}),null),a})()},Cz([`pointermove`,`mousedown`,`click`]),Bq=(e,t,n)=>e.kind===`color`&&typeof t==`string`&&typeof n==`string`?t.toLowerCase()===n.toLowerCase():t===n,Vq=e=>e===`ArrowLeft`?-1:1,Hq=e=>{let[t,n]=J(0),r=null,i=null,a=null,o=()=>{i!==null&&clearTimeout(i),a!==null&&clearInterval(a),i=null,a=null,r=null},s=()=>{o(),n(0)},c=t=>{o(),r=t;let n=Vq(t);i=setTimeout(()=>{a=setInterval(()=>{e.step(n,e.isShiftHeld(),e.isAltHeld(),!0)},60)},280)};return IR(()=>{window.addEventListener(`blur`,s),LR(()=>window.removeEventListener(`blur`,s))}),LR(s),{heldDirection:t,pressArrow:(t,r,i,a)=>{if(r)return;let o=Vq(t);c(t),n(o),e.step(o,i,a,!1)},releaseKey:e=>{e===r&&s()},cancelRepeat:s}},Uq=(e,t,n)=>{if(e.length===0)return null;let r=e.findIndex(e=>e.value===t),i=e[((r===-1?0:r)+n+e.length)%e.length];return!i||i.value===t?null:i},Wq=(e,t,n,r,i)=>{if(e.kind===`enum`)return Uq(e.options,e.value,t)?.value??null;if(e.kind!==`numeric`)return null;let a=Math.min(e.min,e.value),o=Math.max(e.max,e.value);if(!n&&!r&&e.unit===`px`&&i?.hasTokens){let n=i.stepLength(e.value,t,e.cssProperties[0]);if(n!==null){let t=vV(UB(n,a,o));if(t!==e.value)return t}}let s=n?10:1,c=vV(UB(e.value+t*s,a,o));return c===e.value?null:c},Gq=/^-?\d*\.?\d+$/,Kq=e=>Gq.test(e),qq=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,``),Jq=e=>{if(e.kind!==`enum`)return[];let t=[];for(let n of e.options){let e=qq(n.value),r=qq(n.label);e&&t.push(e),r&&r!==e&&t.push(r)}return t},Yq=e=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(let e of r.tailwindAliases){let i=qq(e);i&&t.push({property:r,originalIndex:n,kind:`alias`,term:i})}for(let e of Jq(r))t.push({property:r,originalIndex:n,kind:`enum-option`,term:e});let i=qq(r.label);i&&t.push({property:r,originalIndex:n,kind:`name`,term:i});let a=qq(r.key);a&&a!==i&&t.push({property:r,originalIndex:n,kind:`name`,term:a});let o=qq(`${r.label} ${r.key}`);o&&t.push({property:r,originalIndex:n,kind:`label`,term:o})}return t},Xq=(e,t)=>{if(t.kind===`alias`||t.kind===`enum-option`||t.kind===`name`)return e===t.term?UN+t.term.length:t.term.startsWith(e)||e.startsWith(t.term)?WN+Math.min(e.length,t.term.length):null;let n=t.term.indexOf(e);return n===-1?null:n===0?GN-t.term.length*1:KN-n*100-t.term.length*1},Zq=(e,t,n,r)=>{let i=e.get(t.key);i&&i.score>=r||e.set(t.key,{property:t,score:r,originalIndex:n})},Qq=e=>{let t=Yq(e),n=new Map;for(let t=0;t<e.length;t++)n.set(e[t].key,t);let r=(t,r,i)=>{for(let a=0;a<r.length;a++){let o=r[a],s=n.get(o);if(s===void 0)continue;let c=e[s];Zq(t,c,s,i-a)}};return{search:n=>{let i=qq(n);if(!i||Kq(i))return e;let a=new Map;r(a,UV(n),VN),r(a,WV(n),HN);for(let e of t){let t=Xq(i,e);t!==null&&Zq(a,e.property,e.originalIndex,t)}return Array.from(a.values()).sort((e,t)=>t.score===e.score?e.originalIndex-t.originalIndex:t.score-e.score).map(e=>e.property)}}},$q=(e,t)=>e.kind===t.kind&&!Bq(e,t.value,e.original),eJ=e=>{let{initialProperties:t,searchQuery:n}=e,[r,i]=J({}),a=Qq(t),o=Y(()=>{let e=n(),i=r(),o=e?t:t.filter(e=>e.isPrioritized||e.isCanonical&&!e.isDefault||i[e.key]!==void 0);return e?a.search(e):o.slice(0,40)}),s=new Map(t.map(e=>[e.key,e])),c=Y(()=>{let e=r(),t=Object.keys(e);if(t.length===0)return o();let n=new Map;for(let r of t){let t=e[r];if(t.kind!==`numeric`)continue;let i=s.get(r);if(i)for(let e of i.cssProperties)n.set(e,t.value)}return o().map(t=>{let r=e[t.key];if(r!==void 0)return l(t,r);if(t.kind!==`numeric`)return t;let i=n.get(t.cssProperties[0]);return i===void 0?t:t.cssProperties.every(e=>n.get(e)===i)?{...t,value:i}:t})}),l=(e,t)=>e.kind===`numeric`&&t.kind===`numeric`||e.kind===`color`&&t.kind===`color`||e.kind===`enum`&&t.kind===`enum`?{...e,value:t.value}:e;return{filteredProperties:c,applyStyle:(e,t)=>{let n;if(e.kind===`numeric`&&typeof t==`number`)n={kind:`numeric`,value:t};else if(e.kind===`color`&&typeof t==`string`)n={kind:`color`,value:t};else if(e.kind===`enum`&&typeof t==`string`)n={kind:`enum`,value:t};else return;i(t=>{let r=Object.keys(t);if(r[r.length-1]===e.key)return{...t,[e.key]:n};let i={};for(let n of r){if(n===e.key)continue;let r=s.get(n);r!==void 0&&r.cssProperties.every(t=>e.cssProperties.includes(t))||(i[n]=t[n])}return i[e.key]=n,i})},buildPendingEdits:()=>{let e=r(),t=[],n=new Set;for(let r of Object.keys(e)){let i=e[r],a=s.get(r);if(!a||a.kind!==i.kind)continue;let o=$q(a,i),c=!o&&a.cssProperties.some(e=>n.has(e));if(!(!o&&!c)){if(o)for(let e of a.cssProperties)n.add(e);a.kind===`numeric`&&i.kind===`numeric`?t.push({kind:`numeric`,key:a.key,cssProperties:a.cssProperties,value:i.value,unit:a.unit}):a.kind===`color`&&i.kind===`color`?t.push({kind:`color`,key:a.key,cssProperties:a.cssProperties,value:i.value}):a.kind===`enum`&&i.kind===`enum`&&t.push({kind:`enum`,key:a.key,cssProperties:a.cssProperties,value:i.value})}}return t},hasPendingStyles:()=>{let e=r();for(let n of t){let t=e[n.key];if(t&&$q(n,t))return!0}return!1},hasChangedStyleFor:e=>{let t=r()[e],n=s.get(e);return!!(t&&n&&$q(n,t))}}},tJ=new Map;for(let e of sV)for(let t of e)tJ.set(t.key,t.longhands);nJ=e=>{if(e.includes(`,`))return e.split(`,`);let t=tJ.get(e);return t?[...t]:[e]},rJ=/^-?(?:\d+\.?|\d*\.\d*)?$/,iJ=e=>rJ.test(e),aJ=e=>{let t=e.startsWith(`-`);return{isNegative:t,base:t?e.slice(1):e}},oJ=/^([a-z-]+)-(-?\d+(?:\.\d+)?)$/,sJ=/^(.+?)-\[(.+)]$/,cJ=/^(-?\d*\.?\d+)\s*([a-zA-Z%]*)$/,lJ=/^(-?\d*\.?\d+)(px|rem)?$/i,uJ=/^(?:length|size):/i,dJ=new Set([`opacity`,`border-width`,`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`,`z-index`,`font-weight`]),fJ=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`numeric`)return n;return null},pJ=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`enum`)return n;return null},mJ=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`color`)return n;return null},hJ=e=>{let t=e.replace(/^(?:color|length|size):/i,``).trim();return/(?:var|url)\(/i.test(t)?t:t.replace(/_/g,` `)},gJ=e=>{let t=e.lastIndexOf(`:`),n=t>=0?e.slice(t+1):e;return(n.startsWith(`!`)?n.slice(1):n).toLowerCase()},_J=(e,t)=>{let n=e.match(lJ);if(!n)return null;let r=n[2]?.toLowerCase();if(!r&&!t)return null;let i=Number.parseFloat(n[1]);return Number.isFinite(i)?r===`rem`?i*16:i:null},vJ=(e,t)=>{let n=nJ(t),r=new Map;for(let t of n)for(let n of e)n.kind===`numeric`&&n.cssProperties.includes(t)&&r.set(n.key,n);return Array.from(r.values())},yJ=(e,t)=>vV(UB(t,e.min,e.max)),bJ=e=>{let{initialProperties:t,searchQuery:n,isCompact:r,activeProperty:i,commit:a,setIsCompact:o}=e,s=e=>{for(let n of t)if(n.key===e&&(n.kind===`numeric`||n.kind===`enum`))return!0;return vJ(t,e).length>0},c=e=>{let t=e.trim().replace(/(\d),(\d)/g,`$1.$2`).match(cJ);if(!t)return null;let n=Number.parseFloat(t[1]);return Number.isFinite(n)?{value:n,unit:t[2].toLowerCase()}:null},l=(e,t)=>!e||t.toLowerCase().startsWith(e),u=e=>{if(!r())return!1;let t=i();if(t?.kind!==`numeric`)return!1;let n=c(e);return n?l(n.unit,t.unit):iJ(e)},d=Y(()=>u(n())),f=e=>{if(!r())return!1;let t=i();if(t?.kind!==`numeric`)return!1;let n=c(e);if(!n)return!1;let o=t.unit.toLowerCase();if(n.unit!==``&&n.unit!==o)return l(n.unit,t.unit);let s=yJ(t,n.value);return s!==t.value&&a(t,s),!0},p=(e,n)=>{let r=fJ(t,e);if(r)return r.unit===`px`?(o(!0),a(r,yJ(r,n),{shouldCompact:!0}),!0):!1;let i=vJ(t,e);return i.length===0?!1:(o(!0),NR(()=>{for(let e of i)a(e,yJ(e,n),{shouldCompact:!0})}),!0)},m=(e,n)=>{let r=LV(e);if(!r)return!1;let i=mJ(t,r);if(!i)return!1;let s=n===null?zV(e):HB(n);return s?(o(!0),a(i,s,{shouldCompact:!0}),!0):!1},h=e=>{let t=e.trim(),n=t.match(sJ);if(!n)return!1;let r=n[2],i=hJ(r);if(m(t,i))return!0;let a=_J(i,uJ.test(r.trim()));if(a===null)return!1;let{isNegative:o,base:s}=aJ(n[1]),c=qV(gJ(s));return c?p(c,o?-a:a):!1},g=e=>{if(h(e))return;let n=PV(e),{isNegative:r,base:i}=aJ(n),c=i.replace(/-\d*$/,``).replace(/-$/,``),l=c?qV(c):null;if(l&&s(l)&&o(!0),!r){if(m(n,null))return;let e=JV(n);if(e){let n=pJ(t,e.property);if(!n)return;let r=n.options.find(t=>t.value===e.value);r&&(o(!0),a(n,r.value,{shouldCompact:!0}));return}}let u=i.match(oJ);if(!u)return;let d=qV(u[1]);if(!d)return;let f=Number.parseFloat(u[2]);if(!Number.isFinite(f))return;let p=r?-f:f,g=dJ.has(d)?p:p*4,_=fJ(t,d);if(_){a(_,yJ(_,g),{shouldCompact:!0});return}if(!r){let e=pJ(t,d);if(e){let t=String(f),n=e.options.find(e=>e.value===t);if(n){a(e,n.value,{shouldCompact:!0});return}}}let v=vJ(t,d);v.length!==0&&NR(()=>{for(let e of v)a(e,yJ(e,g),{shouldCompact:!0})})},_=e=>{if(JV(e))return!0;let{base:n}=aJ(e),r=n.match(oJ);if(!r)return!1;let i=qV(r[1]);return i?s(i)?!0:pJ(t,i)!==null:!1};return{isInlineNumericEdit:d,isInlineNumericDraft:u,tryApplyNumericValue:f,applyTailwindClass:e=>{let t=e.trim().replace(/^class\s*=\s*["']/,``).replace(/["']\s*$/,``).replace(/\s+\[/g,`-[`),n=PV(t),r=t.split(/\s+/).filter(Boolean);if(r.length>1&&!_(n)){for(let e of r)g(e);return}g(t)}}},xJ=Z(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">No`),SJ=Z(`<span class="text-[var(--rg-error-text)] text-[13px] leading-3.5 font-sans font-medium">Yes`),CJ=Z(`<div role=alertdialog aria-modal=true aria-labelledby=rg-discard-prompt-title class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-2 w-full self-stretch"><span id=rg-discard-prompt-title class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium">Discard edits?</span><div class="flex items-center gap-[5px]">`),wJ=Z(`<div><textarea data-react-grab-ignore-events data-react-grab-input aria-label="Search properties"aria-keyshortcuts="Enter Escape ArrowUp ArrowDown ArrowLeft ArrowRight Tab"autocapitalize=none autocorrect=off autocomplete=off class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-medium bg-transparent border-none resize-none w-full p-0 m-0 outline-none"rows=1 style=caret-color:var(--rg-text-primary);field-sizing:content;min-height:16px;max-height:16px;scrollbar-width:none>`),TJ=Z(`<div>`),EJ=Z(`<div role=dialog aria-modal=true aria-label="Style element"data-react-grab-ignore-events data-react-grab-edit-panel>`),DJ=Z(`<div class="flex items-center justify-center w-full px-3 py-1.5 min-h-[28px]">`),OJ=e=>X(_z,{get when(){return e.state},children:t=>X(_z,{keyed:!0,get when(){return t().element},children:n=>X(kJ,{get state(){return t()},position:()=>e.position,get onDismiss(){return e.onDismiss},get onSubmit(){return e.onSubmit},get onPendingEditsChange(){return e.onPendingEditsChange},get onInteractingChange(){return e.onInteractingChange}})})}),kJ=e=>{let t=e.state.properties,n,r=e.state.preview,[i,a]=J(e.state.initialSearchQuery??``),[o,s]=J(null),[c,l]=J(null),u=eJ({initialProperties:t,searchQuery:()=>o()??i()}),d=()=>{let e=u.filteredProperties().findIndex(e=>e.kind===`numeric`);return e>0?e:0},[f,p]=J(d()),m=Y(()=>u.hasPendingStyles()),h=Y(()=>m()||!!e.state.hasSessionEdits),[g,_]=J(!1),v,y,b,x=!1,[S,C]=J(!1),w=Y(()=>S()||m()),[T,E]=J(!1),D=nH(),O=Y(()=>jW({tagName:e.state.tagName,componentName:e.state.componentName})),k=Y(()=>{let e=u.filteredProperties();return e.length===0?null:e[Math.min(Math.max(0,f()),e.length-1)]}),ee,te=VK(()=>ee,e.position),A=e=>{l(e),clearTimeout(v),v=setTimeout(()=>{l(t=>t===e?null:t)},100)},ne=Y(()=>w()&&!T());AR(()=>{let t=ne();e.onInteractingChange?.(t)});let re=()=>{C(!0),clearTimeout(y),y=setTimeout(()=>{C(!1)},150)},ie=()=>{queueMicrotask(()=>{n&&WK(n)!==n&&EW(n,{preventScroll:!0})})},ae=()=>{o()===null&&s(i())},oe=()=>{x=!1,clearTimeout(b)},se=()=>{x=!1,clearTimeout(b),b=setTimeout(()=>{x=!0},500)},ce=e=>{let t=e.trim(),n=t.replace(/^-/,``).replace(`.`,``);/[a-z%]+$/i.test(t)||n.length>1?se():oe()},le=e=>{if(!x)return e;let t=i();if(!t||!e.startsWith(t))return oe(),e;let n=e.slice(t.length);return/^[-.\d]/.test(n)?(oe(),n):e},ue=e=>{if(!x||e.metaKey||e.ctrlKey||e.altKey||!/^[-.\d]$/.test(e.key))return!1;e.preventDefault(),e.stopImmediatePropagation(),oe();let t=e.key;return n&&(n.value=t),xe.tryApplyNumericValue(t)?(ae(),a(t),ce(t),ie(),!0):(a(t),ie(),!0)},de=()=>{oe(),s(null),_(!1)},fe=(t,n,i={})=>{u.applyStyle(t,n),r.apply(t.cssProperties,yV(t,n)),e.onPendingEditsChange?.(u.buildPendingEdits()),re(),i.isFromKeyRepeat||we.hide(),i.flashDirection&&A(i.flashDirection===1?`right`:`left`),i.shouldFocus&&ie(),i.shouldCompact&&_(!0),i.source===`keyboard`&&D.arm()},pe=QV(e=>e.shiftKey),me=QV(e=>e.altKey),he=(t,n,r,i,a)=>{let o=k();if(!o)return null;let s=Wq(o,t,n,r,e.state.designTokens);return s===null?(A(t===1?`right`:`left`),null):(fe(o,s,{flashDirection:t,shouldFocus:!0,isFromKeyRepeat:i,source:a}),o)},ge=(e,t,n,r)=>{he(e,t,n,r,`keyboard`)&&_(!0)},_e=e=>{he(e,!1,!1,!1,`pointer`)},ve=Hq({step:ge,isShiftHeld:pe,isAltHeld:me}),ye=(e,t)=>{let n=k();if(n){if(n.kind===`numeric`&&typeof e==`number`){let r=vV(UB(e,n.min,n.max));r!==n.value&&fe(n,r,{source:t});return}typeof e==`string`&&(Bq(n,e,n.value)||fe(n,e,{source:t}))}},be=Y(()=>{if(!pe())return null;let e=k();return!e||e.kind!==`numeric`?null:UK(e.key,e.value)}),xe=bJ({initialProperties:t,searchQuery:i,isCompact:g,activeProperty:k,commit:(e,t,n)=>{fe(e,t,{...n,source:`keyboard`})},setIsCompact:_}),Se=Y(()=>g()&&i()!==``&&xe.isInlineNumericEdit()),Ce=()=>{we.hide(),D.clear(),e.onSubmit(u.buildPendingEdits())},we=Aq(),Te,Ee=()=>{Te&&(Te.classList.remove(`animate-shake`),Te.offsetWidth,Te.classList.add(`animate-shake`))},De=t=>{we.hide(),t===`discard`&&r.restore(),e.onDismiss()},Oe=e=>{if(ve.cancelRepeat(),e===`pointer`&&D.clear(),we.isPending()){De(`discard`);return}if(!h()){De(r.hasAppliedStyles()?`discard`:`preserve`);return}let t=g();de(),!(e===`keyboard`&&t)&&(we.show(),Ee())},ke=e=>{let t=u.filteredProperties();t.length!==0&&(p(n=>(n+e+t.length)%t.length),de())},Ae=()=>{D.clear(),we.hide()},je=[],Me=e=>(je.push(e),()=>{je=je.filter(t=>t!==e)}),Ne=()=>je[je.length-1]??null,Pe=(e,t)=>{if(k()?.kind===`color`){t.repeat||Ne()?.();return}ve.pressArrow(e,t.repeat,t.shiftKey,t.altKey)},Fe={ArrowUp:()=>ke(-1),ArrowDown:()=>ke(1),ArrowLeft:e=>Pe(`ArrowLeft`,e),ArrowRight:e=>Pe(`ArrowRight`,e),Tab:e=>ke(e.shiftKey?-1:1),Enter:()=>{if(we.isPending())return;let e=k(),t=Ne();if(e?.kind===`color`&&!u.hasChangedStyleFor(e.key)&&t&&!h()){t();return}Ce()},Escape:()=>Oe(`keyboard`)},Ie=e=>{if(e.isComposing||e.keyCode===229)return;if(we.isPending()){let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.closest(`[data-react-grab-discard-button]`)!==null&&(e.key===`Tab`||e.key===`Enter`))return;if(e.key===`Tab`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault(),e.stopImmediatePropagation();return}}let t=Fe[e.key];t&&(e.preventDefault(),e.stopImmediatePropagation(),t(e))};IR(()=>{queueMicrotask(()=>{if(EW(n,{preventScroll:!0}),n){let e=n.value.length;n.setSelectionRange(e,e)}}),te.measure();let e=i();e&&xe.applyTailwindClass(e);let t=FK({isOpen:()=>!0,onDismiss:Oe,shouldIgnoreKeyboardEvent:e=>{let t=e.composedPath()[0];return we.isPending()&&t instanceof HTMLElement&&t.closest(`[data-react-grab-discard-button]`)!==null},shouldIgnoreRightClick:!0,shouldIgnoreInputEvents:!0}),r=XM(e=>{qB(e,`data-react-grab-input`)||ue(e)||Ie(e)}),a=XM(e=>{ve.releaseKey(e.key)}),o=XM(e=>{e.pointerType===`mouse`&&(we.isPending()||D.consume()&&h()&&Oe(`pointer`))});window.addEventListener(`keydown`,r,{capture:!0}),window.addEventListener(`keyup`,a,{capture:!0}),window.addEventListener(`pointermove`,o,{capture:!0}),LR(()=>{t(),window.removeEventListener(`keydown`,r,{capture:!0}),window.removeEventListener(`keyup`,a,{capture:!0}),window.removeEventListener(`pointermove`,o,{capture:!0}),clearTimeout(v),clearTimeout(y),clearTimeout(b),we.cleanup(),te.clearAnimationHandles(),C(!1)})});let j=e=>{p(e),ie()};return X(_z,{get when(){return te.shouldMount()},get children(){var e=EJ();Dz(e,`contextmenu`,PK,!0),Dz(e,`click`,PK,!0),Dz(e,`mousedown`,PK,!0),Dz(e,`pointerdown`,PK,!0);var t=ee;return typeof t==`function`?Mz(t,e):ee=e,Az(e,`z-index`,`${sN}`),Az(e,`--rg-edit-list-max-h`,`280px`),$(e,X(YW,{ref:e=>Te=e,class:`flex flex-col justify-center items-start overflow-hidden w-fit h-fit`,get style(){return{"min-width":g()?void 0:`200px`,"max-width":`320px`,transform:`translateX(${ve.heldDirection()*2}px)`,transition:`transform 280ms ${BN}`}},get children(){return[X(_z,{get when(){return we.isPending()},get fallback(){return X(_z,{get when(){return!g()},get children(){var e=TJ();return e.addEventListener(`mouseleave`,()=>E(!1)),e.addEventListener(`mouseenter`,()=>E(!0)),$(e,X(UW,{get tagName(){return O().tagName},get componentName(){return O().componentName},isClickable:!1,onClick:()=>{},shrink:!0}),null),$(e,X(_z,{get when(){return h()},get children(){return X(kq,{onCopy:Ce})}}),null),kR(()=>Ez(e,AW(`contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 h-fit px-2`,h()?`w-full self-stretch justify-between`:`w-fit`))),e}})},get children(){var e=CJ(),t=e.firstChild.nextSibling;return $(t,X(rG,{"data-react-grab-ignore-events":!0,"data-react-grab-discard-button":`cancel`,onClick:e=>{e.preventDefault(),e.stopPropagation(),Ae()},get children(){return xJ()}}),null),$(t,X(rG,{variant:`destructive`,"data-react-grab-ignore-events":!0,"data-react-grab-discard-button":`confirm`,onClick:e=>{e.preventDefault(),e.stopPropagation(),De(`discard`)},get children(){return SJ()}}),null),e}}),(()=>{var e=wJ(),t=e.firstChild;return t.$$keydown=Ie,t.$$input=e=>{let t=le(e.currentTarget.value);if(t!==e.currentTarget.value&&(e.currentTarget.value=t),xe.tryApplyNumericValue(t)){ae(),a(t),ce(t),ie();return}if(oe(),xe.isInlineNumericDraft(t)){ae(),a(t),ie();return}a(t),s(null),p(t.trim()===``?d():0),de(),xe.applyTailwindClass(t)},Mz(e=>{n=e},t),Q(t,`spellcheck`,!1),kR(n=>{var r=Se()?``:`[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-1.5 w-full self-stretch [border-top-width:0.5px] border-t-solid border-t-[var(--rg-border-subtle)] antialiased`,i=Se()?YK:void 0,a=Se()?-1:0,o=g()?k()?.label??`Search property`:`Search property`;return r!==n.e&&Ez(e,n.e=r),n.t=kz(e,i,n.t),a!==n.a&&Q(t,`tabindex`,n.a=a),o!==n.o&&Q(t,`placeholder`,n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),kR(()=>t.value=i()),e})(),X(_z,{get when(){return u.filteredProperties().length>0},get children(){var e=TJ();return $(e,X(zq,{get properties(){return u.filteredProperties()},get activeIndex(){return f()},get activeKey(){return c()},onHoverIndex:p,onSelect:j,onStep:_e,onCommit:ye,onColorPickerRegister:Me,onEditComplete:ie,onInvalidCommit:Ee,onInteract:re,isAdjusting:S,get activeTailwindLabel(){return be()}})),kR(t=>{var n=g()?``:`[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start w-full self-stretch antialiased`,r=g()?YK:void 0;return n!==t.e&&Ez(e,t.e=n),t.t=kz(e,r,t.t),t},{e:void 0,t:void 0}),e}}),X(_z,{get when(){return gB(()=>!!g())()&&k()},children:e=>(()=>{var t=DJ();return t.$$mousedown=e=>e.preventDefault(),$(t,X(Dq,{get property(){return e()},get activeKey(){return c()},onStep:_e,onCommit:ye,onEditComplete:ie,onInvalidCommit:Ee,onInteract:re,onColorPickerRegister:Me,showLabel:!1,get tailwindLabel(){return be()},emphasized:!0})),t})()})]}})),kR(t=>{var n=g()?`true`:`false`,r=AW(`fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none`,te.isAnimatedIn()?`transition-[opacity,transform] duration-220 ease-spring`:`transition-[opacity,transform] duration-120 ease-drawer`),i=`${te.displayPosition().top}px`,a=`${te.displayPosition().left}px`,o=te.isAnimatedIn()?`auto`:`none`,s=FN[te.lastAnchorEdge()],c=te.isAnimatedIn()?`1`:`0`,l=te.isAnimatedIn()?`scale(1)`:`scale(0.92)`;return n!==t.e&&Q(e,`data-rg-compact`,t.e=n),r!==t.t&&Ez(e,t.t=r),i!==t.a&&Az(e,`top`,t.a=i),a!==t.o&&Az(e,`left`,t.o=a),o!==t.i&&Az(e,`pointer-events`,t.i=o),s!==t.n&&Az(e,`transform-origin`,t.n=s),c!==t.s&&Az(e,`opacity`,t.s=c),l!==t.h&&Az(e,`transform`,t.h=l),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),e}})},Cz([`pointerdown`,`mousedown`,`click`,`contextmenu`,`input`,`keydown`]),AJ=Z(`<div data-react-grab-ignore-events>`),jJ=e=>{let t,n=()=>e.interactive!==!1,r=VK(()=>t,()=>e.position);return IR(()=>{r.measure();let t=e.onDismiss?FK({isOpen:()=>!!e.position,onDismiss:e.onDismiss}):void 0;LR(()=>{r.clearAnimationHandles(),t?.()})}),X(_z,{get when(){return r.shouldMount()},get children(){var i=AJ(),a=t;return typeof a==`function`?Mz(a,i):t=i,jz(i,pz(()=>({[e.dataAttribute]:``}),{get class(){return AW(`fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none will-change-[opacity,transform]`,r.isAnimatedIn()?`transition-[opacity,transform] duration-220 ease-spring`:`transition-[opacity,transform] duration-120 ease-drawer`)},get style(){return{top:`${r.displayPosition().top}px`,left:`${r.displayPosition().left}px`,"z-index":`${sN}`,"pointer-events":n()&&r.isAnimatedIn()?`auto`:`none`,"transform-origin":FN[r.lastAnchorEdge()],opacity:r.isAnimatedIn()?`1`:`0`,transform:r.isAnimatedIn()?`scale(1)`:`scale(0.92)`}},onPointerDown:PK,onMouseDown:PK,onClick:PK,onContextMenu:PK}),!1,!0),$(i,()=>e.children),i}})},MJ=e=>{let t=AK({clearActiveOnPointerLeave:!0,highlight:{topCornerRadiusPx:14,bottomCornerRadiusPx:14,cornerShape:jN}});return X(jJ,{get position(){return e.position},dataAttribute:`data-react-grab-toolbar-menu`,get onDismiss(){return e.onDismiss},get children(){return X(jK.Panel,{class:`overflow-hidden`,style:{"min-width":`100px`},get children(){return X(jK.Provider,{store:t,get children(){return X(jK.List,{label:`Default action`,get children(){return X(hz,{get each(){return e.actions},children:t=>{let n=()=>t.id===e.defaultActionId;return X(jK.Item,{get value(){return t.id},role:`menuitemradio`,get checked(){return n()},onSelect:()=>{e.onSetDefaultAction(t.id),e.onDismiss()},get children(){return[X(jK.Label,{get class(){return n()?`text-[var(--rg-text-primary)]`:`text-[var(--rg-text-secondary)]`},get children(){return t.label}}),X(_z,{get when(){return t.shortcut},children:e=>X(jK.Shortcut,{get shortcut(){return e()},get modifier(){return t.shortcutModifier}})})]}})}})}})}})}})}})},NJ=Z(`<span aria-hidden=true class="shrink-0 font-mono text-[11px] leading-4 text-[var(--rg-text-secondary)] opacity-60 mr-1">`),PJ=Z(`<span class=text-[var(--rg-text-secondary)]>.`),FJ=Z(`<span class="flex items-center min-w-0 w-full"><span class="text-[13px] leading-4 h-fit font-medium overflow-hidden text-ellipsis whitespace-nowrap min-w-0 transition-colors">`),IJ=e=>{let t=()=>e.state?.activeIndex??0,n=AK({value:()=>String(t()),highlight:{topCornerRadiusPx:14,bottomCornerRadiusPx:14,cornerShape:jN}});return X(jJ,{get position(){return e.position},dataAttribute:`data-react-grab-hierarchy-menu`,interactive:!1,get children(){return X(jK.Panel,{class:`overflow-hidden`,style:{"min-width":`160px`},get children(){return X(jK.Provider,{store:n,get children(){return X(jK.List,{label:`Navigate element hierarchy`,get children(){return X(hz,{get each(){return e.state?.items??[]},children:(e,n)=>X(jK.Item,{get value(){return String(n())},role:`menuitemradio`,get checked(){return n()===t()},get children(){var r=FJ(),i=r.firstChild;return $(r,X(_z,{get when(){return e.depth>0},get children(){var t=NJ();return $(t,()=>e.isLast?`└─`:`├─`),kR(n=>Az(t,`padding-left`,`${(e.depth-1)*12}px`)),t}}),i),$(i,X(_z,{get when(){return e.componentName},get children(){return[gB(()=>e.componentName),PJ()]}}),null),$(i,()=>e.tagName,null),kR(e=>{var r=n()===t(),a=n()!==t();return r!==e.e&&i.classList.toggle(`text-[var(--rg-text-primary)]`,e.e=r),a!==e.t&&i.classList.toggle(`text-[var(--rg-text-secondary)]`,e.t=a),e},{e:void 0,t:void 0}),r}})})}})}})}})}})},LJ=e=>[X(SW,{get selectionVisible(){return e.selectionVisible},get selectionBounds(){return e.selectionBounds},get selectionBoundsMultiple(){return e.selectionBoundsMultiple},get selectionShouldSnap(){return e.selectionShouldSnap},get dragVisible(){return e.dragVisible},get dragBounds(){return e.dragBounds},get grabbedBoxes(){return e.grabbedBoxes},get labelInstances(){return e.labelInstances}}),X(wW,{get visible(){return e.isFrozen??!1}}),X(_z,{get when(){return gB(()=>!!e.selectionLabelVisible)()&&(e.frozenLabelEntries?.length??0)>0},get children(){return X(gz,{get each(){return e.frozenLabelEntries??[]},children:(t,n)=>X(PG,{get tagName(){return t().tagName},get componentName(){return t().componentName},get selectionBounds(){return t().bounds},get mouseX(){return t().mouseX},visible:!0,shouldToggleExpandOnClick:n===0,get onToggleExpand(){return n===0?e.onToggleExpand:void 0}})})}}),X(_z,{get when(){return gB(()=>!!e.selectionLabelVisible)()&&e.pendingShiftPreviewEntry},children:e=>X(PG,{get tagName(){return e().tagName},get componentName(){return e().componentName},get selectionBounds(){return e().bounds},get mouseX(){return e().mouseX},visible:!0})}),X(_z,{get when(){return gB(()=>!!(e.selectionLabelVisible&&e.selectionBounds))()&&(e.frozenLabelEntries?.length??0)===0},get children(){return X(PG,{get tagName(){return e.selectionTagName},get componentName(){return e.selectionComponentName},get elementsCount(){return e.selectionElementsCount},get selectionBounds(){return e.selectionBounds},get mouseX(){return e.mouseX},get visible(){return e.selectionLabelVisible},get isPromptMode(){return e.isPromptMode},get inputValue(){return e.inputValue},get status(){return e.selectionLabelStatus},get filePath(){return e.selectionFilePath},get onInputChange(){return e.onInputChange},get onSubmit(){return e.onInputSubmit},get onToggleExpand(){return e.onToggleExpand},get selectionLabelShakeCount(){return e.selectionLabelShakeCount},get onConfirmDismiss(){return e.onConfirmDismiss},get discardPrompt(){return e.discardPrompt},onOpen:()=>{e.selectionFilePath&&qI(e.selectionFilePath,e.selectionLineNumber)},get isContextMenuOpen(){return e.contextMenuPosition!==null}})}}),X(gz,{get each(){return e.labelInstances??[]},children:t=>X(PG,{get tagName(){return t().tagName},get componentName(){return t().componentName},get elementsCount(){return t().elementsCount},get selectionBounds(){return t().bounds},get mouseX(){return t().mouseX},visible:!0,get status(){return t().status},get statusText(){return t().statusText},get isPromptMode(){return t().isPromptMode},get inputValue(){return t().inputValue},get error(){return t().errorMessage},get hideArrow(){return t().hideArrow},get onShowContextMenu(){let n=t();if(!(!(n.status===`copied`||n.status===`fading`)||!vB(n.element)))return()=>e.onShowContextMenuInstance?.(n.id)},onHoverChange:n=>e.onLabelInstanceHoverChange?.(t().id,n)})}),X(_z,{get when(){return e.toolbarVisible!==!1},get children(){return X(cK,{get isActive(){return e.isActive},get isContextMenuOpen(){return e.contextMenuPosition!==null},get onToggle(){return e.onToggleActive},get onActivateAction(){return e.onActivateAction},get activeActionId(){return e.activeActionId},get enabled(){return e.enabled},get shakeCount(){return e.shakeCount},get onStateChange(){return e.onToolbarStateChange},get onSubscribeToStateChanges(){return e.onSubscribeToToolbarStateChanges},get onSelectHoverChange(){return e.onToolbarSelectHoverChange},get onContainerRef(){return e.onToolbarRef},get onToggleToolbarMenu(){return e.onToggleToolbarMenu}})}}),X(RK,{get position(){return e.contextMenuPosition??null},get selectionBounds(){return e.contextMenuBounds??null},get tagName(){return e.contextMenuTagName},get componentName(){return e.contextMenuComponentName},get hasFilePath(){return e.contextMenuHasFilePath??!1},get actions(){return e.actions},get actionContext(){return e.actionContext},get onDismiss(){return e.onContextMenuDismiss??(()=>{})},get onHide(){return e.onContextMenuHide??(()=>{})}}),X(MJ,{get position(){return e.toolbarMenuPosition??null},get actions(){return e.toolbarMenuActions??[]},get defaultActionId(){return e.defaultActionId??`copy`},get onSetDefaultAction(){return e.onSetDefaultAction??(()=>{})},get onDismiss(){return e.onToolbarMenuDismiss??(()=>{})}}),X(IJ,{get position(){return e.hierarchyMenuPosition??null},get state(){return e.hierarchyState}}),X(OJ,{get state(){return e.editPanelState??null},get position(){return e.editPanelPosition??null},get onDismiss(){return e.onEditPanelDismiss??(()=>{})},get onSubmit(){return e.onEditPanelSubmit??(()=>{})},get onPendingEditsChange(){return e.onEditPanelPendingEditsChange},get onInteractingChange(){return e.onEditPanelInteractingChange}})]}));function zJ(e){let t=e[Gz];if(!t&&(Object.defineProperty(e,Gz,{value:t=new Proxy(e,iY)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){let a=n[i];r[a].get&&Object.defineProperty(e,a,{enumerable:r[a].enumerable,get:r[a].get.bind(t)})}}return t}function BJ(e){let t;return typeof e==`object`&&!!e&&(e[Gz]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function VJ(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[eY])return n;if(!BJ(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=VJ(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=VJ(i,t))!==i&&(e[a]=r))}return e}function HJ(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function UJ(e,t,n){if(e[t])return e[t];let[r,i]=J(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function WJ(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Gz||t===tY?n:(delete n.value,delete n.writable,n.get=()=>e[Gz][t],n)}function GJ(e){RR()&&UJ(HJ(e,tY),rY)()}function KJ(e){return GJ(e),Reflect.ownKeys(e)}function qJ(e,t,n,r=!1){if(!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[nY]&&e[nY][t]&&i!==void 0&&e[nY][t].$()):(e[t]=n,e[nY]&&e[nY][t]&&i===void 0&&e[nY][t].$());let o=HJ(e,tY),s;if((s=UJ(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=UJ(o,`length`,a))&&s.$(e.length)}(s=o[rY])&&s.$()}function JJ(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];qJ(e,i,t[i])}}function YJ(e,t){if(typeof t==`function`&&(t=t(e)),t=VJ(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&qJ(e,n,r)}qJ(e,`length`,r)}else JJ(e,t)}function XJ(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(Array.isArray(r)){for(let i=0;i<r.length;i++)XJ(e,[r[i]].concat(t),n);return}else if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&XJ(e,[i].concat(t),n);return}else if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)XJ(e,[r].concat(t),n);return}else if(t.length>1){XJ(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=VJ(a),r===void 0||BJ(i)&&BJ(a)&&!Array.isArray(a)?JJ(i,a):qJ(e,r,a))}function ZJ(...[e,t]){let n=VJ(e||{}),r=Array.isArray(n),i=zJ(n);function a(...e){NR(()=>{r&&e.length===1?YJ(n,e[0]):XJ(n,e)})}return[i,a]}function QJ(e){return t=>{if(BJ(t)){let n;(n=aY.get(t))||aY.set(t,n=new Proxy(t,oY)),e(n)}return t}}var $J,eY,tY,nY,rY,iY,aY,oY,sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY,UY,WY,GY,KY,qY,JY,YY,XY,ZY,QY,$Y,eX,tX,nX,rX,iX,aX,oX,sX,cX,lX,uX,dX,fX,pX,mX,hX,gX,_X,vX,yX,bX,xX,SX,CX,wX,TX,EX,DX,OX,kX,AX,jX,MX,NX,PX,FX,IX,LX,RX,zX,BX,VX,HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ,jZ,MZ,NZ,PZ,FZ,IZ,LZ,RZ,zZ,BZ=t((()=>{rH(),wR(),hW(),$J=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
269
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:"Geist", ui-sans-serif, system-ui, sans-serif;--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--spacing:4px;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--radius-sm:4px;--ease-out:cubic-bezier(0, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--ease-drawer:cubic-bezier(.32, .72, 0, 1);--ease-spring:cubic-bezier(.34, 1.56, .64, 1)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.a11y-hitbox{position:relative}.a11y-hitbox:before{content:"";pointer-events:auto;width:100%;min-width:24px;height:100%;min-height:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1\\/2{top:50%}.top-\\[2px\\]{top:2px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-full{right:100%}.bottom-\\[2px\\]{bottom:2px}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-full{left:100%}.z-1{z-index:1}.z-10{z-index:10}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.-m-0\\.5{margin:calc(var(--spacing) * -.5)}.-m-4{margin:calc(var(--spacing) * -4)}.m-0{margin:calc(var(--spacing) * 0)}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-my-1\\.5{margin-block:calc(var(--spacing) * -1.5)}.-mt-\\[8px\\]{margin-top:-8px}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-1\\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2\\.5{margin-right:calc(var(--spacing) * 2.5)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2\\.5{margin-left:calc(var(--spacing) * 2.5)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.ml-px{margin-left:1px}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{width:0;height:0;display:none}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.list-item{display:list-item}.size-0{width:calc(var(--spacing) * 0);height:calc(var(--spacing) * 0)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-\\[12px\\]{width:12px;height:12px}.size-\\[16px\\]{width:16px;height:16px}.h-\\[8px\\]{height:8px}.h-\\[17px\\]{height:17px}.h-\\[20px\\]{height:20px}.h-\\[24px\\]{height:24px}.h-fit{height:fit-content}.max-h-\\[var\\(--rg-edit-list-max-h\\)\\]{max-height:var(--rg-edit-list-max-h)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[28px\\]{min-height:28px}.w-\\[2px\\]{width:2px}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\\[36px\\]{min-width:36px}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.-rotate-90{rotate:-90deg}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.96)}.press-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}.press-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.97)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.grid-rows-\\[0fr\\]{grid-template-rows:0fr}.grid-rows-\\[1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:4px}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[6px\\]{border-radius:6px}.rounded-\\[13px\\]{border-radius:13px}.rounded-\\[14px\\]{border-radius:14px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l{border-top-left-radius:4px;border-bottom-left-radius:4px}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tl{border-top-left-radius:4px}.rounded-r{border-top-right-radius:4px;border-bottom-right-radius:4px}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-tr{border-top-right-radius:4px}.rounded-b{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-br{border-bottom-right-radius:4px}.rounded-bl{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[var\\(--rg-border-button\\)\\]{border-color:var(--rg-border-button)}.border-t-\\[var\\(--rg-border-subtle\\)\\]{border-top-color:var(--rg-border-subtle)}.bg-\\[\\#f00\\]{background-color:red}.bg-\\[var\\(--rg-error-bg\\)\\]{background-color:var(--rg-error-bg)}.bg-\\[var\\(--rg-panel-bg\\)\\]{background-color:var(--rg-panel-bg)}.bg-\\[var\\(--rg-submit-bg\\)\\]{background-color:var(--rg-submit-bg)}.bg-\\[var\\(--rg-surface-active\\)\\]{background-color:var(--rg-surface-active)}.bg-\\[var\\(--rg-surface-hover\\)\\]{background-color:var(--rg-surface-hover)}.bg-\\[var\\(--rg-text-primary\\)\\]{background-color:var(--rg-text-primary)}.bg-\\[var\\(--rg-text-secondary\\)\\]{background-color:var(--rg-text-secondary)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.25{padding-inline:calc(var(--spacing) * .25)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-0\\.25{padding-block:calc(var(--spacing) * .25)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-px{padding-block:1px}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.text-center{text-align:center}.text-justify{text-align:justify}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-3\\.5{--tw-leading:calc(var(--spacing) * 3.5);line-height:calc(var(--spacing) * 3.5)}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-extralight{--tw-font-weight:var(--font-weight-extralight);font-weight:var(--font-weight-extralight)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.font-thin{--tw-font-weight:var(--font-weight-thin);font-weight:var(--font-weight-thin)}.break-normal{overflow-wrap:normal;word-break:normal}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.break-keep{word-break:keep-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-break-spaces{white-space:break-spaces}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--rg-error-text\\)\\]{color:var(--rg-error-text)}.text-\\[var\\(--rg-submit-fg\\)\\]{color:var(--rg-submit-fg)}.text-\\[var\\(--rg-text-primary\\)\\]{color:var(--rg-text-primary)}.text-\\[var\\(--rg-text-primary-85\\)\\]{color:var(--rg-text-primary-85)}.text-\\[var\\(--rg-text-secondary\\)\\]{color:var(--rg-text-secondary)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[box-shadow\\:var\\(--rg-shadow\\)\\]{box-shadow:var(--rg-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\\[filter\\:var\\(--rg-drop-shadow\\)\\]{filter:var(--rg-drop-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-columns\\]{transition-property:grid-template-columns;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[padding\\,border-radius\\,transform\\]{transition-property:padding,border-radius,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[top\\,left\\,width\\,height\\,opacity\\,border-radius\\]{transition-property:top,left,width,height,opacity,border-radius;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,color\\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.delay-\\[80ms\\]{transition-delay:80ms}.duration-60{--tw-duration:60ms;transition-duration:60ms}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-140{--tw-duration:.14s;transition-duration:.14s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-180{--tw-duration:.18s;transition-duration:.18s}.duration-220{--tw-duration:.22s;transition-duration:.22s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.ease-\\[cubic-bezier\\(0\\,0\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-drawer{--tw-ease:var(--ease-drawer);transition-timing-function:var(--ease-drawer)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.ease-spring{--tw-ease:var(--ease-spring);transition-timing-function:var(--ease-spring)}.will-change-\\[opacity\\,transform\\]{will-change:opacity,transform}.will-change-transform{will-change:transform}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.group-hover\\:text-\\[var\\(--rg-text-primary\\)\\]:is(:where(.group):hover *){color:var(--rg-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:bg-\\[var\\(--rg-error-bg-hover\\)\\]:hover{background-color:var(--rg-error-bg-hover)}.hover\\:bg-\\[var\\(--rg-surface-active\\)\\]:hover{background-color:var(--rg-surface-active)}.hover\\:bg-\\[var\\(--rg-surface-hover\\)\\]:hover{background-color:var(--rg-surface-hover)}.hover\\:text-\\[var\\(--rg-text-primary\\)\\]:hover{color:var(--rg-text-primary)}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}}:host{all:initial;direction:ltr}:host,[data-rg-theme=dark]{--rg-panel-bg:#161616;--rg-text-primary:#fff;--rg-text-secondary:#a7a7a7;--rg-surface-hover:#ffffff1a;--rg-surface-active:#ffffff26;--rg-border-subtle:#ffffff1a;--rg-border-button:#fff3;--rg-submit-bg:#fff;--rg-submit-fg:#161616;--rg-error-text:#f87171;--rg-error-bg:#3d1515;--rg-error-bg-hover:#4d1f1f;--rg-shadow:0 2px 8px #00000014;--rg-drop-shadow:drop-shadow(0px 2px 8px #00000014);--rg-shimmer-from:#a1a1aa;--rg-shimmer-to:#d4d4d8;--rg-text-primary-85:#ffffffd9}@media (prefers-color-scheme:dark){:host:not([data-rg-theme]){--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}}:host([data-rg-theme=light]),[data-rg-theme=light]{--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}@keyframes rg-slot-enter-up{0%{filter:blur(2px);opacity:0;transform:translateY(.5em)scale(.5)}to{filter:blur();opacity:1;transform:translateY(0)scale(1)}}@keyframes rg-slot-exit-up{0%{filter:blur();opacity:1;transform:translateY(0)scale(1)}to{filter:blur(2px);opacity:0;transform:translateY(-.5em)scale(.5)}}@keyframes rg-slot-enter-down{0%{filter:blur(2px);opacity:0;transform:translateY(-.5em)scale(.5)}to{filter:blur();opacity:1;transform:translateY(0)scale(1)}}@keyframes rg-slot-exit-down{0%{filter:blur();opacity:1;transform:translateY(0)scale(1)}to{filter:blur(2px);opacity:0;transform:translateY(.5em)scale(.5)}}@keyframes rg-slot-enter-fade{0%{filter:blur(2px);opacity:0;transform:scale(.5)}to{filter:blur();opacity:1;transform:scale(1)}}@keyframes rg-slot-exit-fade{0%{filter:blur();opacity:1;transform:scale(1)}to{filter:blur(2px);opacity:0;transform:scale(.5)}}.rg-slot-column{vertical-align:top;display:inline-block;position:relative}.rg-slot-sizer{visibility:hidden;white-space:pre;display:inline-block}.rg-slot-cell{white-space:pre;will-change:transform, filter, opacity;animation-duration:var(--rg-slot-dur,.35s);animation-timing-function:var(--rg-slot-ease,cubic-bezier(.34, 1.56, .64, 1));animation-fill-mode:both;display:inline-block;position:absolute;top:0;left:0}.rg-slot-cell.rg-slot-enter[data-dir="1"]{animation-name:rg-slot-enter-up}.rg-slot-cell.rg-slot-enter[data-dir="-1"]{animation-name:rg-slot-enter-down}.rg-slot-cell.rg-slot-enter[data-dir="0"]{animation-name:rg-slot-enter-fade}.rg-slot-cell.rg-slot-exit[data-dir="1"]{animation-name:rg-slot-exit-up}.rg-slot-cell.rg-slot-exit[data-dir="-1"]{animation-name:rg-slot-exit-down}.rg-slot-cell.rg-slot-exit[data-dir="0"]{animation-name:rg-slot-exit-fade}@media (prefers-reduced-motion:reduce){:host,:host *,:host :before,:host :after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}:host :focus,:host :focus-visible{box-shadow:none!important;outline:none!important}@keyframes shake{0%,to{translate:0}15%,45%{translate:calc(-3px * var(--rg-shake-x,1)) calc(-3px * var(--rg-shake-y,0))}30%,60%{translate:calc(3px * var(--rg-shake-x,1)) calc(3px * var(--rg-shake-y,0))}75%{translate:calc(-2px * var(--rg-shake-x,1)) calc(-2px * var(--rg-shake-y,0))}90%{translate:calc(2px * var(--rg-shake-x,1)) calc(2px * var(--rg-shake-y,0))}}@keyframes icon-loader-spin{0%{opacity:1}50%{opacity:.5}to{opacity:.2}}.icon-loader-bar{animation:.5s linear infinite icon-loader-spin}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-text{background:linear-gradient(90deg, var(--rg-shimmer-from) 0%, var(--rg-shimmer-to) 25%, var(--rg-shimmer-from) 50%, var(--rg-shimmer-to) 75%, var(--rg-shimmer-from) 100%);color:#0000;background-size:200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake,.animate-shake-vertical{will-change:translate;animation:.3s ease-out shake}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.animate-tooltip-fade-in{will-change:transform, opacity;animation:.1s ease-out tooltip-fade-in}.animate-shake-vertical{--rg-shake-x:0;--rg-shake-y:1}@supports (-webkit-touch-callout:none){textarea[data-react-grab-input]{font-size:16px}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}`,eY=Symbol(`store-raw`),tY=Symbol(`store-node`),nY=Symbol(`store-has`),rY=Symbol(`store-self`),iY={get(e,t,n){if(t===eY)return e;if(t===Gz)return n;if(t===qz)return GJ(e),n;let r=HJ(e,tY),i=r[t],a=i?i():e[t];if(t===tY||t===nY||t===`__proto__`)return a;if(!i){let n=Object.getOwnPropertyDescriptor(e,t);RR()&&(typeof a!=`function`||e.hasOwnProperty(t))&&!(n&&n.get)&&(a=UJ(r,t,a)())}return BJ(a)?zJ(a):a},has(e,t){return t===eY||t===Gz||t===qz||t===tY||t===nY||t===`__proto__`?!0:(RR()&&UJ(HJ(e,nY),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:KJ,getOwnPropertyDescriptor:WJ},aY=new WeakMap,oY={get(e,t){if(t===eY)return e;let n=e[t],r;return BJ(n)?aY.get(n)||(aY.set(n,r=new Proxy(n,oY)),r):n},set(e,t,n){return qJ(e,t,VJ(n)),!0},deleteProperty(e,t){return qJ(e,t,void 0,!0),!0}},sY=new WeakMap,cY=new WeakMap,lY=()=>{sY=new WeakMap,cY=new WeakMap},uY=(e,t,n)=>{let r=cY.get(e);if(r&&n-r.timestamp<200)return r.borderRadius;let i=(t??window.getComputedStyle(e)).borderRadius||`0px`;return cY.set(e,{borderRadius:i,timestamp:n}),i},dY=e=>{let t=performance.now(),n=sY.get(e);if(n&&t-n.timestamp<16)return n.bounds;let r=e.getBoundingClientRect(),i={borderRadius:uY(e,null,t),height:r.height,width:r.width,x:r.left,y:r.top};return sY.set(e,{bounds:i,timestamp:t}),i},fY=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),pY=e=>({selectionInteractionLockDepth:0,wasActivatedByToggle:!1,pendingCommentMode:!1,keyHoldDuration:e.keyHoldDuration,dragStart:{x:eN,y:eN},copyStart:{x:eN,y:eN},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],frozenDragRect:null,lastGrabbedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:``,grabbedBoxes:[],labelInstances:[],isTouchMode:!1,activationTimestamp:null,previouslyFocusedElement:null,contextMenuPosition:null,contextMenuElement:null,contextMenuClickOffset:null}),mY=e=>{let[t,n]=ZJ(pY(e)),[r,i]=J({x:eN,y:eN}),[a,o]=J(0),[s,c]=J({state:`idle`}),l=e=>{n(QJ(t=>{e(t),t.frozenElement=t.frozenElements.length>0?t.frozenElements[0]:null,t.frozenDragRect=null}))},u=()=>{l(e=>{e.frozenElements=[]})},d=e=>{c(t=>t.state===`active`?{...t,phase:e}:t)},f={startHold:e=>{e!==void 0&&n(`keyHoldDuration`,e),c({state:`holding`,startedAt:Date.now()})},releaseHold:()=>{s().state===`holding`&&c({state:`idle`})},activate:()=>{NR(()=>{c({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1}),n(`activationTimestamp`,Date.now()),n(`previouslyFocusedElement`,document.activeElement)})},deactivate:()=>{NR(()=>{c({state:`idle`}),n(QJ(e=>{e.wasActivatedByToggle=!1,e.pendingCommentMode=!1,e.inputText=``,e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null,e.activationTimestamp=null,e.previouslyFocusedElement=null,e.contextMenuPosition=null,e.contextMenuElement=null,e.contextMenuClickOffset=null,e.isTouchMode&&(e.detectedElement=null)}))})},toggle:()=>{t.activationTimestamp===null?(n(`wasActivatedByToggle`,!0),f.activate()):f.deactivate()},freeze:()=>{if(s().state===`active`){let e=t.frozenElement??t.detectedElement;e&&n(`frozenElement`,e),d(`frozen`)}},unfreeze:()=>{s().state===`active`&&NR(()=>{n(QJ(e=>{e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null})),d(`hovering`)})},startDrag:(e,t)=>{s().state===`active`&&NR(()=>{t||u(),n(`dragStart`,{x:e.x+window.scrollX,y:e.y+window.scrollY}),d(`dragging-select`)})},startDragReposition:()=>{let e=s();e.state===`active`&&e.phase===`dragging-select`&&d(`dragging-reposition`)},stopDragReposition:()=>{let e=s();e.state===`active`&&e.phase===`dragging-reposition`&&d(`dragging-select`)},shiftDragStart:e=>{let t=s();t.state===`active`&&t.phase===`dragging-reposition`&&n(`dragStart`,t=>({x:t.x+e.x,y:t.y+e.y}))},endDrag:()=>{let e=s();e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)&&NR(()=>{n(`dragStart`,{x:-1e3,y:-1e3}),d(`justDragged`)})},cancelDrag:()=>{let e=s();e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)&&NR(()=>{n(`dragStart`,{x:-1e3,y:-1e3}),d(`hovering`)})},finishJustDragged:()=>{let e=s();e.state===`active`&&e.phase===`justDragged`&&d(`hovering`)},startCopy:()=>{let e=s().state===`active`;c({state:`copying`,startedAt:Date.now(),wasActive:e})},completeCopy:()=>{let e=s(),t=e.state===`copying`&&e.wasActive;c({state:`justCopied`,copiedAt:Date.now(),wasActive:t})},finishJustCopied:()=>{let e=s();e.state===`justCopied`&&(e.wasActive&&!t.wasActivatedByToggle?NR(()=>{u(),c({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1})}):f.deactivate())},enterPromptMode:(e,t)=>{let{x:r}=fY(dY(t));NR(()=>{n(`copyStart`,e),n(`copyOffsetFromCenterX`,e.x-r),i(e),n(`frozenElement`,t),n(`wasActivatedByToggle`,!0),s().state===`active`?c(e=>e.state===`active`?{...e,isPromptMode:!0,phase:`frozen`}:e):(c({state:`active`,phase:`frozen`,isPromptMode:!0,isPendingDismiss:!1}),n(`activationTimestamp`,Date.now()),n(`previouslyFocusedElement`,document.activeElement))})},exitPromptMode:()=>{c(e=>e.state===`active`?{...e,isPromptMode:!1,isPendingDismiss:!1}:e)},setInputText:e=>{n(`inputText`,e)},clearInputText:()=>{n(`inputText`,``)},setPendingDismiss:e=>{c(t=>t.state===`active`?{...t,isPendingDismiss:e}:t)},setPointer:e=>{i(t=>t.x===e.x&&t.y===e.y?t:e)},setDetectedElement:e=>{n(`detectedElement`,e)},setFrozenElement:e=>{l(t=>{t.frozenElements=[e]})},setFrozenElements:e=>{l(t=>{t.frozenElements=e})},toggleFrozenElement:e=>{l(t=>{let n=t.frozenElements.indexOf(e);n>=0?t.frozenElements.splice(n,1):t.frozenElements.push(e)})},addFrozenElements:e=>{l(t=>{for(let n of e)t.frozenElements.includes(n)||t.frozenElements.push(n)})},setFrozenDragRect:e=>{n(`frozenDragRect`,e)},setCopyStart:(e,t)=>{let{x:r}=fY(dY(t));n(`copyStart`,e),n(`copyOffsetFromCenterX`,e.x-r)},setLastGrabbed:e=>{n(`lastGrabbedElement`,e)},setWasActivatedByToggle:e=>{n(`wasActivatedByToggle`,e)},setPendingCommentMode:e=>{n(`pendingCommentMode`,e)},setTouchMode:e=>{n(`isTouchMode`,e)},incrementSelectionInteractionLockDepth:()=>{n(`selectionInteractionLockDepth`,e=>e+1)},decrementSelectionInteractionLockDepth:()=>{n(`selectionInteractionLockDepth`,e=>Math.max(0,e-1))},setSelectionSource:(e,t)=>{NR(()=>{n(`selectionFilePath`,e),n(`selectionLineNumber`,t)})},incrementViewportVersion:()=>{o(e=>e+1)},addGrabbedBox:e=>{n(`grabbedBoxes`,t=>[...t,e])},removeGrabbedBox:e=>{n(`grabbedBoxes`,t=>t.filter(t=>t.id!==e))},clearGrabbedBoxes:()=>{n(`grabbedBoxes`,[])},addLabelInstance:e=>{n(`labelInstances`,t=>[...t,e])},updateLabelInstance:(e,r,i)=>{let a=t.labelInstances.findIndex(t=>t.id===e);a!==-1&&NR(()=>{n(`labelInstances`,a,`status`,r),i!==void 0&&n(`labelInstances`,a,`errorMessage`,i)})},removeLabelInstance:e=>{n(`labelInstances`,t=>t.filter(t=>t.id!==e))},clearLabelInstances:()=>{n(`labelInstances`,[])},showContextMenu:(e,t)=>{let{x:r,y:i}=fY(dY(t));NR(()=>{n(`contextMenuPosition`,e),n(`contextMenuElement`,t),n(`contextMenuClickOffset`,{x:e.x-r,y:e.y-i})})},hideContextMenu:()=>{NR(()=>{n(`contextMenuPosition`,null),n(`contextMenuElement`,null),n(`contextMenuClickOffset`,null)})},updateContextMenuPosition:()=>{let e=t.contextMenuElement,r=t.contextMenuClickOffset;if(!e||!r||!vB(e))return;let{x:i,y:a}=fY(dY(e));n(`contextMenuPosition`,{x:i+r.x,y:a+r.y})}};return{store:t,actions:f,pointer:r,viewportVersion:a,current:s}},hY=e=>{if(!document.body)return;let t=document.querySelectorAll(`[${ZM}]`);for(let n of t)n!==e&&n.parentNode!==e&&(n.shadowRoot||n.remove());document.body.appendChild(e)},gY=e=>{if(document.body){hY(e);return}let t=()=>{document.removeEventListener(`DOMContentLoaded`,t),hY(e)};document.addEventListener(`DOMContentLoaded`,t,{once:!0})},_Y=e=>{let t=document.querySelectorAll(`[${ZM}]`);for(let e of t){let t=e.shadowRoot?.querySelector(`[${ZM}]`);if(t instanceof HTMLDivElement)return{root:t,host:e};e.remove()}let n=document.createElement(`div`);n.setAttribute(ZM,`true`),$N(n),n.style.zIndex=String(sN),n.style.position=`fixed`,n.style.inset=`0`,n.style.pointerEvents=`none`,n.style.contain=`strict`;let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`),a=ZN();a&&(i.nonce=a),i.textContent=`@import url("https://fonts.googleapis.com/css2?family=Geist:wght@500&display=swap");\n${e??``}`,r.appendChild(i);let o=document.createElement(`div`);return o.setAttribute(ZM,`true`),r.appendChild(o),gY(n),setTimeout(()=>{hY(n)},NN),{root:o,host:n}},vY=e=>{let[t,n]=J(void 0),r=0;return AR(FR(e,e=>{let t=++r;if(!e){n(void 0);return}let i=QU(e)??void 0;n(i),WU(e).then(e=>{r===t&&n(e??i)}).catch(()=>{r===t&&n(i)})})),[t,n]},yY=[`data-theme`,`data-mode`,`data-color-scheme`,`data-bs-theme`,`data-mui-color-scheme`,`data-mantine-color-scheme`],bY=[{attribute:`data-dark`,theme:`dark`},{attribute:`data-light`,theme:`light`}],xY=(e,t,n)=>{let[r,i,a]=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a},SY=(e,t=0)=>{let n=HB(e),r=n?DB(n):null;return!r||r.alpha<=t?null:xY(r.red,r.green,r.blue)},CY=e=>{let t=SY(e);return t===null?null:t<.18?`dark`:`light`},wY=e=>CY(getComputedStyle(e).backgroundColor),TY=()=>{let e=SY(getComputedStyle(document.documentElement).color,TN);return e===null?null:e>.6?`dark`:null},EY=()=>{let e=document.createElement(`div`);e.style.cssText=`position:fixed;width:0;height:0;background-color:Canvas!important`,document.documentElement.appendChild(e);let t=CY(getComputedStyle(e).backgroundColor);return e.remove(),t},DY=e=>{let t=e.toLowerCase();return t===`dark`?`dark`:t===`light`?`light`:null},OY=e=>{let t=e.style.colorScheme||getComputedStyle(e).colorScheme;return t?t.trim().toLowerCase().split(/\s+/):[]},kY=e=>{let t=OY(e),n=t.includes(`dark`);return n===t.includes(`light`)?null:n?`dark`:`light`},AY=e=>{if(e.classList.contains(`dark`))return`dark`;if(e.classList.contains(`light`))return`light`;for(let t of yY){let n=e.getAttribute(t);if(!n)continue;let r=DY(n);if(r)return r}for(let{attribute:t,theme:n}of bY)if(e.hasAttribute(t))return n;return null},jY=(e,t)=>{for(let n of e){if(!n)continue;let e=t(n);if(e)return e}return null},MY=()=>{let e=[document.documentElement,document.body],t=[document.body,document.documentElement];return jY(e,AY)??jY(e,kY)??jY(t,wY)??TY()??EY()??`light`},NY=e=>e===`dark`?`light`:`dark`,PY=()=>{let e=[];for(let t of[document.documentElement,document.body]){if(!t)continue;e.push(t.className);for(let n of yY)e.push(t.getAttribute(n)??``);for(let{attribute:n}of bY)e.push(t.hasAttribute(n)?`1`:``);let n=t.style;e.push(n.colorScheme,n.backgroundColor,n.color);for(let t=0;t<n.length;t++){let r=n[t];r.startsWith(`--`)&&e.push(`${r}:${n.getPropertyValue(r)}`)}}return e.join(`|`)},FY={attributes:!0,attributeFilter:[`class`,`style`,...yY,...bY.map(({attribute:e})=>e)]},IY=(e,t)=>{let n=null,r=null,i=null,a=()=>{let i=PY();if(i===r&&n!==null)return getComputedStyle(document.body??document.documentElement).backgroundColor,n;r=i;let a=NY(MY());return a!==n&&(n=a,e.setAttribute(`data-rg-theme`,a),t?.(a)),a},o=()=>{i===null&&(i=pI(()=>{i=null,a()}))},s=a(),c=new MutationObserver(o);c.observe(document.documentElement,FY);let l=null;document.body?c.observe(document.body,FY):(l=new MutationObserver(()=>{document.body&&(l.disconnect(),l=null,c.observe(document.body,FY),a())}),l.observe(document.documentElement,{childList:!0}));let u=()=>{r=null,o()},d=window.matchMedia(`(prefers-color-scheme: dark)`);return d.addEventListener(`change`,u),{theme:s,cleanup:()=>{l?.disconnect(),c.disconnect(),d.removeEventListener(`change`,u),i!==null&&mI(i)}}},LY=()=>{},RY=()=>({activate:LY,deactivate:LY,toggle:LY,comment:LY,isActive:()=>!1,isEnabled:()=>!1,setEnabled:LY,getToolbarState:()=>null,setToolbarState:LY,onToolbarStateChange:()=>LY,reset:LY,dispose:LY,copyElement:()=>Promise.resolve(!1),getSource:()=>Promise.resolve(null),getStackContext:()=>Promise.resolve(``),getState:()=>({isActive:!1,isDragging:!1,isCopying:!1,isPromptMode:!1,isSelectionBoxVisible:!1,isDragBoxVisible:!1,targetElement:null,dragBounds:null,grabbedBoxes:[],labelInstances:[],selectionFilePath:null,toolbarState:null}),setOptions:LY,registerPlugin:LY,unregisterPlugin:LY,getPlugins:()=>[],getDisplayName:()=>null}),zY=()=>{let e=new AbortController;return{signal:e.signal,abort:()=>e.abort(),addWindowListener:(t,n,r={})=>{window.addEventListener(t,n,{...r,signal:e.signal})},addDocumentListener:(t,n,r={})=>{document.addEventListener(t,n,{...r,signal:e.signal})}}},BY=(e,t=`Unknown error`)=>e instanceof Error&&e.message?e.message:t,VY=e=>e instanceof Error?e:Error(String(e)),HY=e=>({functionName:e.functionName,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,isServer:e.isServer,isSymbolicated:e.isSymbolicated}),UY=async(e,t)=>{let n={maxLines:t},[r,i,a,o]=await Promise.all([dW(e,n),lW(e,n),ZU(e),UU(e)]);return{tagName:YN(e),componentName:a?.componentName??void 0,content:`[${r}]`,source:a,stackContext:i,frames:(o??[]).map(HY)}},WY=async(e,t)=>{let n=await Promise.all(e.map(e=>UY(e,t))),r=new Map;for(let e of n)r.has(e.content)||r.set(e.content,e);let i=[...r.values()];return i.length>0?{content:i.map(e=>e.content).join(`
270
+ `),entries:i}:null},GY=(e,t,n)=>{if(e?.entries)return t===e.content?e.entries:e.entries.length===1?[{...e.entries[0],content:t,commentText:n}]:e.entries.map(e=>({...e,commentText:n}))},KY=async(e,t,n,r)=>{await t.onBeforeCopy(n);let i=!1,a=``;try{let o=e.getContent?{content:await e.getContent(n)}:await WY(n,e.maxContextLines),s=o?.content;if(s?.trim()){let c=await t.transformCopyContent(s,n);a=r?`${r}\n${c}`:c,i=mW(a,{componentName:e.componentName,entries:GY(o,a,r)})}}catch(e){t.onCopyError(VY(e))}return i&&t.onCopySuccess(n,a),t.onAfterCopy(n,i),i},qY=(e,t)=>{let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return Math.max(0,i-n)*Math.max(0,a-r)},JY=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top,YY=e=>e.sort((e,t)=>{if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}),XY=e=>{if(e.width<=0||e.height<=0)return[];let t=window.innerWidth,n=window.innerHeight,r=e.x,i=e.y,a=e.x+e.width,o=e.y+e.height,s=r+e.width/2,c=i+e.height/2,l=UB(Math.ceil(e.width/32),3,20),u=UB(Math.ceil(e.height/32),3,20),d=l*u,f=d>100?Math.sqrt(100/d):1,p=UB(Math.floor(l*f),3,20),m=UB(Math.floor(u*f),3,20),h=new Set,g=[],_=(e,r)=>{let i=UB(Math.round(e),0,t-1),a=UB(Math.round(r),0,n-1),o=`${i}:${a}`;h.has(o)||(h.add(o),g.push({x:i,y:a}))};_(r+1,i+1),_(a-1,i+1),_(r+1,o-1),_(a-1,o-1),_(s,i+1),_(s,o-1),_(r+1,c),_(a-1,c),_(s,c);for(let t=0;t<p;t+=1){let n=r+(t+.5)/p*e.width;for(let t=0;t<m;t+=1)_(n,i+(t+.5)/m*e.height)}return g},ZY=(e,t,n)=>{let r={left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height},i=new Set,a=XY(e);PI();try{for(let e of a){let t=document.elementsFromPoint(e.x,e.y);for(let e of t)i.add(e)}}finally{FI()}let o=[];for(let e of i)!n&&_I(e)||YM(e)&&t(e)&&o.push(e);let s=new Map;for(let e of o)s.set(e,e.getBoundingClientRect());let c=[];for(let e of o){let t=s.get(e);if(t.width<=0||t.height<=0)continue;let i={left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height};if(n){let n=qY(r,i),a=t.width*t.height;a>0&&n/a>=.75&&c.push(e)}else JY(i,r)&&c.push(e)}return YY(c)},QY=e=>{let t=new Set(e);return e.filter(e=>{for(let n=e.parentElement;n;n=n.parentElement)if(t.has(n))return!1;return!0})},$Y=(e,t,n=!0)=>QY(ZY(e,t,n)),eX=(e,t)=>e.width<=0?0:UB((t.x-e.x)/e.width,0,1),tX=()=>{lY(),GI(),EI()},nX=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.pageX-window.scrollX,y:e.pageY-window.scrollY}),rX=e=>({pageX:e.x+window.scrollX,pageY:e.y+window.scrollY,width:e.width,height:e.height}),iX=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.x,y:e.y}),aX=(e,t,n)=>{let r=(e,t,n,r)=>{let i=[],a=e,o=0;for(;a&&i.length<n&&o<100;)r(a)&&i.push(a),a=t(a),o+=1;return i},i=r(e.parentElement,e=>e.parentElement,6,t);i.reverse();let a=i.map((e,t)=>({element:e,depth:t,isLast:!0})),o=i.length,s=r(e.previousElementSibling,e=>e.previousElementSibling,7,n),c=r(e.nextElementSibling,e=>e.nextElementSibling,7,n),l=Math.min(s.length,Math.max(3,7-c.length)),u=Math.min(c.length,7-l),d=[...s.slice(0,l).reverse(),e,...c.slice(0,u)],f=r(e.firstElementChild,e=>e.nextElementSibling,6,t),p=d.length-1,m=f.length-1;return d.forEach((t,n)=>{a.push({element:t,depth:o,isLast:n===p}),t===e&&f.forEach((e,t)=>{a.push({element:e,depth:o+1,isLast:t===m})})}),a},oX=e=>e instanceof SVGElement&&!(e instanceof SVGSVGElement),sX=e=>{let t=e.getBoundingClientRect();return t.width>=16||t.height>=16},cX=(e,t)=>t(e)&&!oX(e)&&sX(e),lX=new Set([`c`,`C`,`с`,`С`,`ȼ`,`Ȼ`,`ↄ`,`Ↄ`,`ᴄ`,`ᶜ`,`ⱼ`,`ⅽ`,`Ⅽ`,`ç`,`Ç`,`ć`,`Ć`,`č`,`Č`,`ĉ`,`Ĉ`,`ċ`,`Ċ`]),uX=(e,t)=>t===`KeyC`?!0:!e||e.length!==1?!1:lX.has(e),dX=(e,t)=>{if(!e||!t)return!1;let n=e.toLowerCase();return t===`Space`?n===`space`||n===` `:t.startsWith(`Key`)?t.slice(3).toLowerCase()===n:t.startsWith(`Digit`)?t.slice(5)===n:!1},fX={meta:`metaKey`,cmd:`metaKey`,command:`metaKey`,win:`metaKey`,windows:`metaKey`,ctrl:`ctrlKey`,control:`ctrlKey`,shift:`shiftKey`,alt:`altKey`,option:`altKey`,opt:`altKey`},pX=e=>{let t=e.split(`+`).map(e=>e.trim().toLowerCase()),n={metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1,key:null};for(let e of t){let t=fX[e];t?n[t]=!0:n.key=e}return n},mX=e=>{if(typeof e==`function`)return e;let t=pX(e),n=t.key;return e=>{if(n===null){let n=!t.metaKey||e.metaKey||e.key===`Meta`,r=!t.ctrlKey||e.ctrlKey||e.key===`Control`,i=!t.shiftKey||e.shiftKey||e.key===`Shift`,a=!t.altKey||e.altKey||e.key===`Alt`,o=n&&r&&i&&a,s=[t.metaKey,t.ctrlKey,t.shiftKey,t.altKey].filter(Boolean).length,c=[e.metaKey||e.key===`Meta`,e.ctrlKey||e.key===`Control`,e.shiftKey||e.key===`Shift`,e.altKey||e.key===`Alt`].filter(Boolean).length;return o&&c>=s}let r=e.key?.toLowerCase()===n||dX(n,e.code),i=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?(!t.metaKey||e.metaKey)&&(!t.ctrlKey||e.ctrlKey)&&(!t.shiftKey||e.shiftKey)&&(!t.altKey||e.altKey):!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;return r&&i}},hX=e=>!e||typeof e==`function`?{metaKey:KB(),ctrlKey:!KB(),shiftKey:!1,altKey:!1,key:null}:pX(e),gX=(e,t)=>{if(t.activationKey)return mX(t.activationKey)(e);let n=(KB()?e.metaKey:e.ctrlKey)&&!e.shiftKey&&!e.altKey;return!!(e.key&&n&&uX(e.key,e.code))},_X=e=>{if(e.length===0)return{x:0,y:0,width:0,height:0};if(e.length===1)return e[0];let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),i=Math.max(i,a.y+a.height);return{x:t,y:n,width:r-t,height:i-n}},vX=e=>{let t=getComputedStyle(e),n={};for(let e of JB)n[e]=t.getPropertyValue(e);return n},yX=e=>{let t={};for(let n of mV)t[n]=e.getPropertyValue(n);return t},bX=e=>{try{let t=e.parentElement;if(!t)return null;let n=e.namespaceURI,r=e.tagName.toLowerCase(),i=n&&n!==`http://www.w3.org/1999/xhtml`?e.ownerDocument.createElementNS(n,r):e.ownerDocument.createElement(r),a=`style`in i?i.style:null;a instanceof CSSStyleDeclaration&&a.setProperty(`display`,`none`,`important`),t.appendChild(i);try{return yX(getComputedStyle(i))}finally{i.remove()}}catch{return null}},xX=new Set([`display`,`width`,`height`]),SX=(e,t,n)=>e.kind===`color`?!1:e.cssProperties.some(e=>xX.has(e))?CX(e):e.cssProperties.every(e=>{let r=t[e],i=n[e];return r===void 0||i===void 0?!1:r===i}),CX=e=>{if(e.kind===`color`)return!1;if(e.kind===`enum`)return e.key===`font-weight`?e.original===`400`:e.options[0]?.value===e.original;let{key:t,original:n}=e;return t.startsWith(`padding`)||t.startsWith(`margin`)||t.includes(`gap`)||t===`border-width`||t.endsWith(`-radius`)||t===`border-radius`?n===0:t===`opacity`?n===100:t===`letter-spacing`||t===`z-index`?n===0:!oV.has(t)&&!!(t===`width`||t===`height`||t===`width,height`||t.startsWith(`max-`)||t.startsWith(`min-`)||t===`line-height`)},wX=e=>{let t=e.trim();if(!t||t===`auto`||t===`normal`||t===`none`)return null;let n=Number.parseFloat(t);return Number.isFinite(n)?t.endsWith(`%`)?{value:n,unit:`%`}:t.endsWith(`rem`)||t.endsWith(`em`)?{value:n*16,unit:`px`}:t.endsWith(`px`)?{value:n,unit:`px`}:{value:n,unit:``}:null},TX=(e,t)=>{let n=wX(e[t]);if(n)return n;if(t===`line-height`){let t=wX(e[`font-size`]);return t?{value:vV(t.value*qN),unit:t.unit||`px`}:null}return $B.has(t)?{value:0,unit:`px`}:null},EX=(e,t)=>{let n=TX(e,t[0]);if(!n)return null;for(let r=1;r<t.length;r++){let i=TX(e,t[r]);if(!i||i.unit!==n.unit||Math.abs(i.value-n.value)>=.5)return null}return n},DX=(e,t)=>e===`opacity`?{value:Math.round(t.value*100),unit:`%`}:eV.has(e)?{value:vV(t.value),unit:``}:{value:vV(t.value),unit:t.unit||`px`},OX=e=>e!==null,kX=(e,t)=>{let n=t.map(t=>{let n=t.longhands.length===1?TX(e,t.longhands[0]):EX(e,t.longhands);return n?{definition:t,value:n}:null}).filter(OX),r=new Map;for(let e of n)for(let t of e.definition.longhands){let n=r.get(t);(!n||e.definition.longhands.length>n.definition.longhands.length)&&r.set(t,e)}let i=new Set(r.values());return n.map(e=>({...e,isCanonical:i.has(e)}))},AX=(e,t,n)=>e===`opacity`?{min:0,max:100}:e===`z-index`?{min:ZB,max:QB}:e===`letter-spacing`?{min:-10,max:20}:e===`font-size`?{min:8,max:96}:e===`line-height`?{min:0,max:120}:e.includes(`radius`)?{min:0,max:96}:e===`width`||e===`height`||e===`width,height`||e.startsWith(`min-`)||e.startsWith(`max-`)?{min:0,max:Math.max(512,Math.ceil(t*2))}:oV.has(e)?{min:XB,max:512}:n===`%`?{min:0,max:100}:{min:e.startsWith(`margin`)?YB:0,max:384},jX=(e,t,n)=>{let r=DX(e.key,t),i=r.unit===`px`&&Math.abs(r.value)>1e7,a=AX(e.key,i?0:r.value,r.unit),o=r.value<0?a.min:a.max,s=i?o:r.value;return{kind:`numeric`,key:e.key,label:e.label,cssProperties:e.longhands,min:a.min,max:a.max,value:s,original:s,unit:r.unit,tailwindAliases:KV(e.key),isPrioritized:!1,isDefault:!1,isCanonical:n}},MX=(e,t,n,r=!1)=>{let i=HB(n),a=i?DB(i):null,o=a!==null&&a.alpha!==0;if(!o&&!r)return null;let s=o&&i?i:LN;return{kind:`color`,key:e,label:t,cssProperties:[e],value:s,original:s,tailwindAliases:KV(e),isPrioritized:r,isDefault:!1,isCanonical:!0}},NX=(e,t,n)=>{let r=t.trim(),i=n??e.options;return!i||!i.some(e=>e.value===r)?null:{kind:`enum`,key:e.key,label:e.label,cssProperties:[e.key],value:r,original:r,options:i,tailwindAliases:KV(e.key),isPrioritized:!1,isDefault:!1,isCanonical:!0}},PX=new Map(`background-color.color.padding.padding-left,padding-right.padding-top,padding-bottom.padding-top.padding-right.padding-bottom.padding-left.margin.margin-left,margin-right.margin-top,margin-bottom.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-transform.text-align.text-decoration-line.white-space.word-break.overflow-wrap.font-variant-numeric.border-radius.border-top-left-radius,border-top-right-radius.border-bottom-left-radius,border-bottom-right-radius.border-top-left-radius,border-bottom-left-radius.border-top-right-radius,border-bottom-right-radius.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.width,height.width.height.max-width.max-height.min-width.min-height.opacity.gap.row-gap.column-gap.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.border-color.align-items.justify-content.top,right,bottom,left.left,right.top,bottom.top.right.bottom.left.z-index`.split(`.`).map((e,t)=>[e,t])),FX=e=>PX.get(e.key)??1/0,IX=e=>e.map((e,t)=>({property:e,index:t})).sort((e,t)=>{let n=FX(e.property)-FX(t.property);return n===0?e.index-t.index:n}).map(e=>e.property),LX=e=>{let t=vX(e),n=getComputedStyle(e),r=yX(n),i=bX(e),a=[],o=new Set,s=e=>{o.has(e.key)||(a.push(e),o.add(e.key))};for(let e of sV)for(let n of kX(t,e))s(jX(n.definition,n.value,n.isCanonical));for(let e of cV){let n=TX(t,e.key);n&&s(jX({key:e.key,label:e.label,longhands:[e.key]},n,!0))}for(let{key:e,label:t,alwaysShow:r}of lV){let i=n.getPropertyValue(e);if(!r&&(!i||kB(i)))continue;let a=MX(e,t,i,r);a&&s(a)}let c=n.getPropertyValue(fV.key);if(c){let e=NX(fV,c,dV(c));e&&s(e)}for(let e of pV){let t=n.getPropertyValue(e.key);if(!t)continue;let r=NX(e,t);r&&s(r)}return RX(a,GV(e),r,i)},RX=(e,t,n,r)=>{let i=[],a=[];for(let o of e)if(o.isPrioritized||t.has(o.key))i.push({...o,isPrioritized:!0,isDefault:!1});else{let e=r?SX(o,n,r):CX(o);a.push({...o,isDefault:e})}return[...IX(i),...IX(a)]},zX=[{keyword:`letter`,family:`letter-spacing`},{keyword:`tracking`,family:`letter-spacing`},{keyword:`leading`,family:`line-height`},{keyword:`line-height`,family:`line-height`},{keyword:`lineheight`,family:`line-height`},{keyword:`radius`,family:`radius`},{keyword:`rounded`,family:`radius`},{keyword:`corner`,family:`radius`},{keyword:`font-size`,family:`font-size`},{keyword:`fontsize`,family:`font-size`},{keyword:`text`,family:`font-size`},{keyword:`stroke`,family:`border-width`},{keyword:`border-width`,family:`border-width`},{keyword:`borderwidth`,family:`border-width`},{keyword:`space`,family:`spacing`},{keyword:`gap`,family:`spacing`},{keyword:`gutter`,family:`spacing`},{keyword:`inset`,family:`spacing`},{keyword:`padding`,family:`spacing`},{keyword:`margin`,family:`spacing`},{keyword:`size`,family:`size`},{keyword:`width`,family:`size`},{keyword:`height`,family:`size`}],BX=e=>{let t=e.toLowerCase();for(let{keyword:e,family:n}of zX)if(t.includes(e))return n;return null},VX=e=>e.includes(`radius`)?`radius`:e.endsWith(`-width`)&&e.includes(`border`)?`border-width`:e===`font-size`?`font-size`:e===`line-height`?`line-height`:e===`letter-spacing`?`letter-spacing`:e.startsWith(`padding`)||e.startsWith(`margin`)||e.endsWith(`gap`)||e===`top`||e===`right`||e===`bottom`||e===`left`||e.startsWith(`inset`)?`spacing`:e===`width`||e===`height`||e.startsWith(`min-`)||e.startsWith(`max-`)?`size`:null,HX=e=>{let t=wX(e);return!t||t.unit!==`px`?null:vV(t.value)},UX=(e,t)=>t===null?!0:e.length===t.length?e<t:e.length<t.length,WX=(e,t,n)=>{if(n===1){for(let n of e)if(n>t)return n;return null}for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null},GX=(e,t,n)=>{let r=(t===1?Math.floor(e/n)+1:Math.ceil(e/n)-1)*n;return r<0?null:r},KX=null,qX=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),JX=()=>{let e=Array.from(document.adoptedStyleSheets??[]),t=document.styleSheets.length;if(KX&&KX.documentSheetCount===t&&qX(KX.adoptedSheets,e))return KX.names;let n=new Set;for(let t of[...document.styleSheets,...e]){let e;try{e=t.cssRules}catch{continue}YX(e,n)}return KX={documentSheetCount:t,adoptedSheets:e,names:n},n},YX=(e,t)=>{for(let n of Array.from(e))if(n instanceof CSSStyleRule){let e=n.style;for(let n=0;n<e.length;n++){let r=e.item(n);r.startsWith(`--`)&&t.add(r)}}else n instanceof CSSGroupingRule&&YX(n.cssRules,t)},XX={hasTokens:!1,matchColor:()=>null,matchLength:()=>null,stepLength:()=>null},ZX=e=>{if(typeof document>`u`)return XX;let t=JX();if(t.size===0)return XX;let n=getComputedStyle(e),r=new Map,i=new Map,a=new Map,o=null;for(let e of t){let t=n.getPropertyValue(e).trim();if(!t)continue;let s=HX(t);if(s!==null){e===`--spacing`&&s>0&&(o=s);let t=BX(e);if(t!==null){let n=i.get(s);n?n.push({name:e,family:t}):i.set(s,[{name:e,family:t}]);let r=a.get(t);r?r.add(s):a.set(t,new Set([s]))}continue}let c=HB(t);if(c){let t=c.toLowerCase();UX(e,r.get(t)??null)&&r.set(t,e)}}if(r.size===0&&i.size===0)return XX;let s=new Map;for(let[e,t]of a)s.set(e,Array.from(t).sort((e,t)=>e-t));return{hasTokens:!0,matchColor:e=>{let t=HB(e)?.toLowerCase();return t?r.get(t)??null:null},matchLength:(e,t)=>{let n=VX(t);if(n===null)return null;let r=i.get(Math.round(e));if(!r)return null;let a=null;for(let e of r)e.family===n&&UX(e.name,a)&&(a=e.name);return a},stepLength:(e,t,n)=>{let r=VX(n);if(r===null)return null;let i=Math.round(e),a=s.get(r);return a&&a.length>=2?WX(a,i,t):(r===`spacing`||r===`size`)&&o?GX(i,t,o):a?WX(a,i,t):null}}},QX=e=>e.kind===`color`||e.kind===`enum`?e.value:e.key===`opacity`&&e.unit===`%`?_V(e.value/100):`${_V(e.value)}${e.unit}`,$X=(e,t,n)=>{if(!n?.hasTokens)return null;let{edit:r}=t;return r.kind===`color`?n.matchColor(r.value):r.kind===`numeric`&&r.unit===`px`?n.matchLength(r.value,e):null},eZ=e=>{let t=new Map;for(let n of e.edits){let e=QX(n);for(let r of n.cssProperties)t.set(r,{edit:n,cssValue:e})}let n=!1;return{lines:Array.from(t,([t,r])=>{let i=$X(t,r,e.designTokens);i&&(n=!0);let a=i?` /* var(${i}) */`:``;return`${t}: ${r.cssValue};${a}`}),usesToken:n}},tZ=e=>e.filePath?`${e.filePath}:${e.lineNumber}`:``,nZ=e=>["```css",...e,"```"].join(`
271
+ `),rZ=e=>{if(e.length===0)return``;let t=e.map(e=>{let{lines:t,usesToken:n}=eZ(e);return{header:tZ(e),cssLines:t,usesToken:n}}),n=[`Apply these style changes canonically (CSS = visual intent; choose the source change that best expresses the underlying layout intent):`];if(t.some(e=>e.usesToken)&&n.push("Prefer the design token shown in each `/* var(--token) */` comment over the raw value when it matches the project's intent."),t.length===1){let[e]=t;return e.header&&n.push(`\n${e.header}`),n.push(nZ(e.cssLines)),n.join(`
272
+ `)}for(let e of t)n.push(e.header?`\n${e.header}`:``),n.push(nZ(e.cssLines));return n.join(`
273
+ `)},iZ=e=>`style`in e&&e.style instanceof CSSStyleDeclaration,aZ=e=>{let t=new Map,n=iZ(e)?e:null;return{apply:(e,r)=>{if(n)for(let i of e)t.has(i)||t.set(i,{value:n.style.getPropertyValue(i),priority:n.style.getPropertyPriority(i)}),n.style.setProperty(i,r)},restore:()=>{if(!n){t.clear();return}for(let[e,{value:r,priority:i}]of t)r?n.style.setProperty(e,r,i):n.style.removeProperty(e);t.clear()},hasAppliedStyles:()=>t.size>0}},oZ=(e,t)=>{for(let n of t){let t=e.edits.findIndex(e=>e.key===n.key);t>=0?e.edits[t]=n:e.edits.push(n)}},sZ=(e,t)=>({element:e.element,preview:e.preview,filePath:e.filePath??``,lineNumber:e.lineNumber??0,edits:t,designTokens:e.designTokens}),cZ=e=>{let[t,n]=J(null),[r,i]=J(!1),a=[],o=[],s=e=>{o=e},c=()=>{let r=t()!==null;n(null),i(!1),a=[],o=[],r&&e.onClose?.()},l=()=>{t()?.preview.restore();for(let e=a.length-1;e>=0;e--)a[e].preview.restore();c()},u=e=>{WU(e).then(t=>{t&&n(n=>!n||n.element!==e||n.componentName?n:{...n,componentName:t})})},d=(r,i,a={})=>{if(t()!==null)return!1;let o=LX(r);if(o.length===0)return!1;let s=a.filePath??e.store.selectionFilePath??void 0,c=a.lineNumber??e.store.selectionLineNumber??void 0;return n({element:r,position:i,selectionBounds:dY(r),properties:o,preview:aZ(r),filePath:s,lineNumber:c,componentName:a.componentName,tagName:a.tagName??YN(r),initialSearchQuery:a.initialSearchQuery,designTokens:ZX(r)}),u(r),e.isActivated()||e.activateRenderer(),e.actions.setPointer(i),e.actions.setFrozenElement(r),e.actions.freeze(),e.onOpen?.(),!0},f=(r,i)=>{let s=t();if(!s||s.element===r)return!1;let c=LX(r);return c.length===0?!1:((o.length>0||s.preview.hasAppliedStyles())&&a.push(sZ(s,o)),o=[],n({element:r,position:i,selectionBounds:dY(r),properties:c,preview:aZ(r),tagName:YN(r),hasSessionEdits:a.some(e=>e.edits.length>0),designTokens:ZX(r)}),ZU(r).then(e=>{if(e){for(let t of a)t.element===r&&!t.filePath&&(t.filePath=e.filePath,t.lineNumber=e.lineNumber??0);n(t=>!t||t.element!==r||t.filePath?t:{...t,filePath:e.filePath,lineNumber:e.lineNumber??void 0})}}).catch(()=>void 0),u(r),e.actions.setPointer(i),e.actions.setFrozenElement(r),!0)},p=(e,t)=>[...a,sZ(e,t)],m=e=>{let t=new Map;for(let n of e){if(n.edits.length===0)continue;let e=t.get(n.element);if(e){!e.filePath&&n.filePath&&(e.filePath=n.filePath,e.lineNumber=n.lineNumber),oZ(e,n.edits);continue}t.set(n.element,{filePath:n.filePath,lineNumber:n.lineNumber,edits:[...n.edits],designTokens:n.designTokens})}return Array.from(t.values())},h=e=>{let t=new Set;for(let n of e)n.edits.length>0&&t.add(n.element);for(let n=e.length-1;n>=0;n--){let r=e[n];r.edits.length===0&&!t.has(r.element)&&r.preview.restore()}};return{state:t,trigger:d,switchToElement:f,setPendingEdits:s,dismiss:()=>{t()!==null&&(l(),e.store.wasActivatedByToggle?e.deactivateRenderer():e.actions.unfreeze())},closePreservingRenderer:()=>{t()!==null&&(l(),e.actions.unfreeze())},submit:n=>{let r=t();if(!r)return;let i=r.element,a=p(r,n),o=rZ(m(a));h(a),c(),e.store.wasActivatedByToggle||e.actions.unfreeze(),e.performCopyWithLabel({element:i,cursorX:r.position.x,extraPrompt:o||void 0,shouldDeactivateAfter:e.store.wasActivatedByToggle})},resetWithDiscard:l,isOpen:()=>t()!==null,isInteracting:r,setInteracting:i}},lZ={enabled:!0,hue:0,selectionBox:{enabled:!0},dragBox:{enabled:!0},grabbedBoxes:{enabled:!0},elementLabel:{enabled:!0},toolbar:{enabled:!0}},uZ=(e,t)=>({enabled:t.enabled??e.enabled,hue:t.hue??e.hue,selectionBox:{enabled:t.selectionBox?.enabled??e.selectionBox.enabled},dragBox:{enabled:t.dragBox?.enabled??e.dragBox.enabled},grabbedBoxes:{enabled:t.grabbedBoxes?.enabled??e.grabbedBoxes.enabled},elementLabel:{enabled:t.elementLabel?.enabled??e.elementLabel.enabled},toolbar:{enabled:t.toolbar?.enabled??e.toolbar.enabled}}),dZ={activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,activationKey:void 0,getContent:void 0,maxContextLines:3,freezeReactUpdates:!0},fZ=(e={})=>{let t=new Map,n={},[r,i]=ZJ({theme:lZ,options:{...dZ,...e},actions:[]}),a=()=>{let r=lZ,a={...dZ,...e},o=[];for(let{config:e}of t.values())if(e.theme&&(r=uZ(r,e.theme)),e.options&&(a={...a,...e.options}),e.actions)for(let t of e.actions)o.push(t);a={...a,...n},i(`theme`,r),i(`options`,a),i(`actions`,o)},o=(e,t)=>{n[e]=t,i(`options`,e,t)},s=[`activationMode`,`keyHoldDuration`,`allowActivationInsideInput`,`activationKey`,`getContent`,`maxContextLines`,`freezeReactUpdates`],c=e=>{for(let t of s)e[t]!==void 0&&o(t,e[t])},l=(e,n)=>{t.has(e.name)&&u(e.name);let r=e.setup?.(n,_)??{};e.theme&&(r.theme=r.theme?uZ(uZ(lZ,e.theme),r.theme):e.theme),e.actions&&(r.actions=[...e.actions,...r.actions??[]]),e.hooks&&(r.hooks=r.hooks?{...e.hooks,...r.hooks}:e.hooks),e.options&&(r.options=r.options?{...e.options,...r.options}:e.options),t.set(e.name,{plugin:e,config:r}),a()},u=e=>{let n=t.get(e);n&&(n.config.cleanup&&n.config.cleanup(),t.delete(e),a())},d=()=>Array.from(t.keys()),f=(e,...n)=>{for(let{config:r}of t.values()){let t=r.hooks?.[e];t&&t(...n)}},p=(e,...n)=>{let r=!1;for(let{config:i}of t.values()){let t=i.hooks?.[e];t&&t(...n)===!0&&(r=!0)}return r},m=async(e,...n)=>{for(let{config:r}of t.values()){let t=r.hooks?.[e];t&&await t(...n)}},h=async(e,n,...r)=>{let i=n;for(let{config:n}of t.values()){let t=n.hooks?.[e];t&&(i=await t(i,...r))}return i},g=(e,n,...r)=>{let i=n;for(let{config:n}of t.values()){let t=n.hooks?.[e];t&&(i=t(i,...r))}return i},_={onActivate:()=>f(`onActivate`),onDeactivate:()=>f(`onDeactivate`),onElementHover:e=>f(`onElementHover`,e),onElementSelect:e=>{let n=!1,r;for(let{config:i}of t.values()){let t=i.hooks?.onElementSelect;if(t){let i=t(e);i===!0?n=!0:i instanceof Promise&&(n=!0,r=i)}}return{wasIntercepted:n,pendingResult:r}},onDragStart:(e,t)=>f(`onDragStart`,e,t),onDragEnd:(e,t)=>f(`onDragEnd`,e,t),onBeforeCopy:async e=>m(`onBeforeCopy`,e),transformCopyContent:async(e,t)=>h(`transformCopyContent`,e,t),onAfterCopy:(e,t)=>f(`onAfterCopy`,e,t),onCopySuccess:(e,t)=>f(`onCopySuccess`,e,t),onCopyError:e=>f(`onCopyError`,e),onStateChange:e=>f(`onStateChange`,e),onPromptModeChange:(e,t)=>f(`onPromptModeChange`,e,t),onSelectionBox:(e,t,n)=>f(`onSelectionBox`,e,t,n),onDragBox:(e,t)=>f(`onDragBox`,e,t),onGrabbedBox:(e,t)=>f(`onGrabbedBox`,e,t),onElementLabel:(e,t,n)=>f(`onElementLabel`,e,t,n),onContextMenu:(e,t)=>f(`onContextMenu`,e,t),onOpenFile:(e,t)=>p(`onOpenFile`,e,t),transformHtmlContent:async(e,t)=>h(`transformHtmlContent`,e,t),transformAgentContext:async(e,t)=>h(`transformAgentContext`,e,t),transformActionContext:e=>g(`transformActionContext`,e),transformOpenFileUrl:(e,t,n)=>g(`transformOpenFileUrl`,e,t,n)};return{register:l,unregister:u,getPluginNames:d,setOptions:c,store:r,hooks:_}},pZ=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,mZ=e=>{let t=e.bounds.x+e.bounds.width/2,n=e.bounds.width/2,r=e.mouseX===void 0?void 0:e.mouseX-t;return{id:pZ(`label`),bounds:e.bounds,boundsMultiple:e.boundsMultiple,tagName:e.tagName,componentName:e.componentName,status:e.status,createdAt:Date.now(),element:e.element,elements:e.elements,mouseX:e.mouseX,mouseXOffsetFromCenter:r,mouseXOffsetRatio:r!==void 0&&n>0?r/n:void 0,hideArrow:e.hideArrow}},hZ=(e,t)=>{let n=new Map,r=e=>{let t=n.get(e);t!==void 0&&(window.clearTimeout(t),n.delete(e))},i=()=>{for(let e of n.values())window.clearTimeout(e);n.clear()},a=()=>{i(),e.clearLabelInstances()},o=t=>{r(t);let i=window.setTimeout(()=>{e.updateLabelInstance(t,`fading`);let r=window.setTimeout(()=>{n.delete(t),e.removeLabelInstance(t)},125);n.set(t,r)},nN);n.set(t,i)};return{createInstance:(t,n,r,i,o)=>{a();let s=mZ({bounds:t,tagName:n,componentName:r,status:i,element:o?.element,mouseX:o?.mouseX,elements:o?.elements,boundsMultiple:o?.boundsMultiple,hideArrow:o?.hideArrow});return e.addLabelInstance(s),s.id},createPerElementInstances:(t,n)=>{a();let r=[];for(let i of t){let t=mZ({bounds:dY(i.element),tagName:i.tagName,componentName:i.componentName,status:n,element:i.element,mouseX:i.mouseX});e.addLabelInstance(t),r.push(t.id)}return r},updateAfterCopy:(t,n,r)=>{n?e.updateLabelInstance(t,`copied`):e.updateLabelInstance(t,`error`,r||`Unknown error`),o(t)},cancelAllFades:i,clearAll:a,handleHoverChange:(e,n)=>{if(n){r(e);return}let i=t().find(t=>t.id===e);i&&(i.status===`copied`||i.status===`error`||i.status===`fading`)&&o(e)}}},gZ=e=>{let t=window.innerWidth,n=window.innerHeight,r=Math.max(0,e.x),i=Math.min(t,e.x+e.width),a=Math.max(0,e.y),o=Math.min(n,e.y+e.height);return{x:(r+i)/2,y:(a+o)/2}},_Z=(e,t,n)=>{let r=[],i=(t,r)=>{let i=gZ(n(t)),a=UI(i.x,i.y).filter(e),o=a.indexOf(t);return o===-1?null:a[o+r]??null},a=e=>{let t=i(e,1);return t&&(r.push(e),r.length>50&&(r=r.slice(-50))),t},o=e=>{if(r.length>0){let e=r.pop();if(vB(e))return e}return i(e,-1)},s=(e,n)=>{let i=e=>n?e.nextElementSibling:e.previousElementSibling,a=i(e);for(;a;){if(t(a))return r=[],a;a=i(a)}return null};return{findNext:(e,t)=>{switch(e){case`ArrowUp`:return a(t);case`ArrowDown`:return o(t);case`ArrowRight`:return s(t,!0);case`ArrowLeft`:return s(t,!1);default:return null}},clearHistory:()=>{r=[]}}},vZ=e=>{let{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}=hX(e.activationKey);return{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}},yZ=()=>{let e=new WeakSet,t=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,`key`),n=!1;if(t?.get&&!t.get.__reactGrabPatched){n=!0;let r=t.get,i=function(){return e.has(this)?``:r.call(this)};i.__reactGrabPatched=!0,Object.defineProperty(KeyboardEvent.prototype,"key",{get:i,configurable:!0})}return{claimedEvents:e,originalKeyDescriptor:t,restore:()=>{n&&t&&Object.defineProperty(KeyboardEvent.prototype,"key",t)}}},bZ=(e,t)=>({top:t<25,bottom:t>window.innerHeight-25,left:e<25,right:e>window.innerWidth-25}),xZ=(e,t,n)=>{let r=null,i=()=>{if(!t()){a();return}let o=e(),s=bZ(o.x,o.y),c=0,l=0;if(s.top&&(l-=10),s.bottom&&(l+=10),s.left&&(c-=10),s.right&&(c+=10),c!==0||l!==0){let e=window.scrollX,t=window.scrollY;window.scrollBy(c,l);let r=window.scrollX-e,i=window.scrollY-t;(r!==0||i!==0)&&n?.({x:r,y:i})}r=s.top||s.bottom||s.left||s.right?pI(i):null},a=()=>{r!==null&&(mI(r),r=null)};return{start:i,stop:a,isActive:()=>r!==null}},SZ=()=>{let e=globalThis;return!!(e.chrome?.runtime?.id||e.browser?.runtime?.id)},CZ=e=>{try{let t=`0.1.48`,n=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 294 294"><path fill="#ff40e0" d="M145 47c25-20 50-27 67-17 16 9 23 30 20 60 0 2-1 5-1 7l-2 13h-1l-12-4c-8-3-17-5-25-6l-17-3c-10-1-20-1-29-1-10 0-20 0-29 1-6 8-11 16-16 24-5 9-9 17-13 26 4 9 8 18 13 26s10 16 16 24l11 14c5 7 11 13 18 19l10 8s-1 0 0 0l-11 9c-17 14-35 22-49 22-6 0-13-2-18-5-16-9-23-30-20-59 1-3 1-5 1-8-30-12-48-29-48-50 0-18 14-35 41-47 2-1 5-2 7-3 0-2 0-5-1-7-3-30 4-51 20-60 18-10 42-3 68 17M71 201c-1 2-1 4-1 5-2 24 3 41 13 47h1c11 7 30 1 51-15-10-9-18-18-26-29-13-1-26-4-38-8m9-38c-3 9-5 17-7 26 8 2 17 4 25 6-3-5-6-10-9-16-3-5-6-10-9-16m-19-53c-2 1-3 1-5 2-21 10-34 23-34 35 0 13 14 27 39 37 3-12 7-25 12-37-5-12-9-24-12-37m37-10c-8 1-17 3-25 6 2 8 4 16 7 25 3-5 6-11 9-16zm-3-61c-4-1-8 0-12 2-10 7-15 24-13 47 0 2 0 3 1 5 12-4 25-6 38-8 8-10 16-20 26-29-15-11-29-17-40-17m111 2c-4-2-8-3-12-2-11 0-25 5-40 17 10 9 19 19 26 29 13 2 26 4 39 8v-5c3-23-2-40-13-47m-61 23c-7 6-13 13-19 19h37c-6-6-12-13-18-19"/><mask id="a"><path fill="#fff" d="m235 85-133 27 28 133 133-27Z"/></mask><path fill="#ff40e0" d="m137 130 76 11c8 1 9 11 3 15l-28 16-4 32c-1 8-10 10-14 4l-41-66c-3-6 1-13 8-12" mask="url(#a)"/></svg>`)}`;console.log(`%cReact Grab${` v${t}`}%c\nhttps://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${n}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,``),e&&navigator.onLine&&!SZ()&&fetch(`https://www.react-grab.com/api/version?source=browser&v=${t}&t=${Date.now()}`,{referrerPolicy:`origin`,keepalive:!0,priority:`low`,cache:`no-store`}).then(e=>e.text()).then(e=>{e&&e!==t&&console.warn(`[React Grab] v${t} is outdated (latest: v${e}). Run \`npx grab@latest upgrade\` to upgrade.`)}).catch(()=>null)}catch{}},wZ=e=>typeof e==`object`&&!!e,TZ=e=>{if(!wZ(e))return null;let t={};return typeof e.enabled==`boolean`&&(t.enabled=e.enabled),(e.activationMode===`toggle`||e.activationMode===`hold`)&&(t.activationMode=e.activationMode),typeof e.keyHoldDuration==`number`&&Number.isFinite(e.keyHoldDuration)&&(t.keyHoldDuration=e.keyHoldDuration),typeof e.allowActivationInsideInput==`boolean`&&(t.allowActivationInsideInput=e.allowActivationInsideInput),typeof e.activationKey==`string`&&(t.activationKey=e.activationKey),typeof e.maxContextLines==`number`&&Number.isFinite(e.maxContextLines)&&(t.maxContextLines=e.maxContextLines),typeof e.freezeReactUpdates==`boolean`&&(t.freezeReactUpdates=e.freezeReactUpdates),typeof e.telemetry==`boolean`&&(t.telemetry=e.telemetry),Object.keys(t).length===0?null:t},EZ=()=>{if(typeof window>`u`)return null;try{let e=(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)?.getAttribute(`data-options`);return e?TZ(JSON.parse(e)):null}catch{return null}},DZ=e=>e===`Enter`||e===`NumpadEnter`,OZ=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,kZ=(e=>({name:e.name,setup:(t,n)=>({actions:[typeof e.contextMenuAction==`function`?e.contextMenuAction(t,n):e.contextMenuAction],cleanup:e.cleanup})}))({name:`copy`,contextMenuAction:{id:`copy`,label:`Copy`,shortcut:`C`,showInToolbarMenu:!0,onAction:e=>{e.copy?.()}}}),AZ={name:`comment`,setup:()=>({actions:[{id:`comment`,label:`Comment`,shortcut:`Enter`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterPromptMode?.()}}]})},jZ={name:`edit`,setup:()=>({actions:[{id:`edit`,label:`Style`,shortcut:`S`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterEditMode?.()}}]})},MZ={name:`open`,actions:[{id:`open`,label:`Open`,shortcut:`O`,enabled:e=>!!e.filePath,onAction:e=>{e.filePath&&(e.hooks.onOpenFile(e.filePath,e.lineNumber)||qI(e.filePath,e.lineNumber,e.hooks.transformOpenFileUrl),e.hideContextMenu(),e.cleanup())}}]},NZ=e=>{let t=e.left+e.width/2,n=e.top+e.height/2,r=n,i=window.innerHeight-n,a=t,o=window.innerWidth-t,s=Math.min(r,i,a,o);return s===r?`top`:s===a?`left`:s===o?`right`:`bottom`},PZ=()=>{let[e,t]=J(!1),[n,r]=J(null),i=nH(),a=()=>{let e=n();return vB(e)?e:null},o=()=>{r(null),i.clear(),t(!1)};return{selectedElement:a,isPendingDismiss:e,select:(e,n)=>{r(e),t(!1),n?.shouldPromptBeforeMouseHandoff?i.arm():i.clear()},clear:o,consumeMouseHandoff:()=>i.consume()&&a()!==null,showDismissPrompt:()=>a()?e()?!1:(t(!0),!0):(o(),!1),takeSelection:e=>{let t=a()??(vB(e)?e:null);return o(),t}}},FZ=async(e,t={})=>(await Promise.allSettled(e.map(e=>fW(e,t)))).map(e=>e.status===`fulfilled`?e.value:``),IZ=[kZ,jZ,AZ,MZ],LZ=!1,RZ=new Set,zZ=e=>{if(typeof window>`u`)return RY();let t={enabled:!0,activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,...EZ(),...e};if(t.enabled===!1||LZ)return RY();LZ=!0,qM(t.container??null),CZ(t.telemetry!==!1);let{enabled:n,telemetry:r,container:i,...a}=t;return DR(e=>{let t=!1,n,r=fZ(a),{store:i,actions:o,pointer:s,viewportVersion:c,current:l}=mY({keyHoldDuration:r.store.options.keyHoldDuration??100}),u=Y(()=>l().state===`holding`),d=Y(()=>l().state===`active`),f=Y(()=>{let e=l();return e.state===`active`&&e.phase===`frozen`}),p=Y(()=>{let e=l();return e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)}),m=Y(()=>{if(!p())return!1;let e=Math.abs(s().x+window.scrollX-i.dragStart.x),t=Math.abs(s().y+window.scrollY-i.dragStart.y);return e>2||t>2}),h=Y(()=>{let e=l();return e.state===`active`&&e.phase===`dragging-reposition`}),g=Y(()=>{let e=l();return e.state===`active`&&e.phase===`justDragged`}),_=Y(()=>l().state===`copying`),v=Y(()=>i.selectionInteractionLockDepth>0),y=Y(()=>l().state===`justCopied`),b=Y(()=>{let e=l();return e.state===`active`&&!!e.isPromptMode}),x=Y(()=>i.pendingCommentMode||b()),S=Y(()=>{let e=l();return e.state===`active`&&!!e.isPromptMode&&!!e.isPendingDismiss}),C=(e,t)=>{document.body.style[e]=t};AR(FR(d,(e,t)=>{e&&!t?(KL(s().x,s().y),C(`touchAction`,`none`)):!e&&t&&(qL(),C(`touchAction`,``))}));let w=XV(),[T,E]=J(!w||!w.collapsed),[D,O]=J(0),[k,ee]=J(0),[te,A]=J(w),[ne,re]=J(!1),ie=QV(e=>e.shiftKey),[ae,oe]=J(null),[se,ce]=J(null),[le,ue]=J(null),de=cZ({store:i,actions:o,isActivated:d,activateRenderer:()=>Gt(),deactivateRenderer:()=>Kt(),performCopyWithLabel:e=>dt(e),onOpen:()=>{kr(),ge?.(),ge=Or(Dr,ce)},onClose:()=>{ge?.(),ge=null,ce(null)}}),fe=Y(()=>i.contextMenuPosition!==null||de.isOpen()),pe=Y(()=>fe()||ae()!==null),me,he=null,ge=null,_e=!1,ve=new WeakMap,ye=PZ(),be=()=>!T()||b()||v()||fe()||ye.isPendingDismiss(),xe=()=>{ve=new WeakMap},Se=()=>{Le(!1),xe()},Ce=e=>{let t=te()??XV(),n={edge:t?.edge??`bottom`,ratio:t?.ratio??.5,collapsed:t?.collapsed??!1,enabled:t?.enabled??!0,defaultAction:t?.defaultAction??`copy`,...e};ZV(n),A(n);for(let e of RZ)e(n)},we=()=>{Fe.timerId!==null&&(clearTimeout(Fe.timerId),Fe.timerId=null)},Te=()=>{Fe.copyWaiting=!1,Fe.holdTimerFired=!1,Fe.startTimestamp=null};AR(()=>{if(l().state!==`holding`){we();return}Fe.startTimestamp=Date.now(),Fe.timerId=window.setTimeout(()=>{if(Fe.timerId=null,Fe.copyWaiting){Fe.holdTimerFired=!0;return}o.activate()},i.keyHoldDuration),LR(we)}),AR(()=>{let e=l();if(e.state!==`active`||e.phase!==`justDragged`)return;let t=setTimeout(()=>{o.finishJustDragged()},nN);LR(()=>clearTimeout(t))}),AR(()=>{if(l().state!==`justCopied`)return;let e=setTimeout(()=>{o.finishJustCopied()},nN);LR(()=>clearTimeout(e))}),AR(FR(u,(e,t=!1)=>{!t||e||!d()||(r.store.options.activationMode!==`hold`&&o.setWasActivatedByToggle(!0),r.hooks.onActivate())}));let Ee=(e,t,n)=>{Oe(e,t,n),o.clearInputText()},De=()=>{let e=i.frozenElement||pt();e&&o.enterPromptMode({x:s().x,y:s().y},e)},Oe=(e,t,n)=>{o.setCopyStart({x:t,y:n},e)},ke={lastDetectionTimestamp:0,pendingDetectionScheduledAt:0,latestPointerX:0,latestPointerY:0},Ae=null,[je,Me]=J(null),Ne=(e,t)=>{Ae!==null&&clearTimeout(Ae),Me(null),Ae=window.setTimeout(()=>{Me({x:e,y:t}),Ae=null},32)},Pe=null,Fe={timerId:null,startTimestamp:null,copyWaiting:!1,holdTimerFired:!1},Ie=null,[j,Le]=J(!1),Re=0,ze=!1,Be=null,Ve=()=>{ze=!0,Be!==null&&window.clearTimeout(Be),Be=window.setTimeout(()=>{ze=!1,Be=null},nN)},He=()=>{Be!==null&&(window.clearTimeout(Be),Be=null),ze=!1},Ue=0,We=null,Ge=null,[M,Ke]=J(!1),[qe,Je]=J(null),[Ye,Xe]=J(null),[Ze,Qe]=vY(Ye),$e=Y(()=>de.isOpen()?AN:x()?kN:M()?qe():d()?ON:null),et=e=>cX(e,DI),tt=_Z(DI,et,dY),nt=xZ(s,()=>p(),e=>{if(h()){if(o.shiftDragStart(e),Ie){Ie={x:Ie.x+e.x,y:Ie.y+e.y};return}let{pageX:t,pageY:n}=Et(s().x,s().y);Ie={x:t,y:n}}}),N=Y(()=>d()&&!_()),rt=new Map,it=(e,t)=>{let n=pZ(`grabbed`),i={id:n,bounds:e,createdAt:Date.now(),element:t};o.addGrabbedBox(i),r.hooks.onGrabbedBox(e,t);let a=window.setTimeout(()=>{rt.delete(n),o.removeGrabbedBox(n)},nN+125);rt.set(n,a)},at=async e=>{let t=await Promise.all(e.map(async e=>{let t=await ZU(e),n=t?.componentName??null,r=t?.filePath,i=t?.lineNumber??void 0,a=t?.columnNumber??void 0;n||=QU(e);let o=e instanceof HTMLElement?e.innerText?.slice(0,100):void 0;return{tagName:YN(e),id:e.id||void 0,className:e.getAttribute(`class`)||void 0,textContent:o,componentName:n??void 0,filePath:r,lineNumber:i,columnNumber:a}}));window.dispatchEvent(new CustomEvent(`react-grab:element-selected`,{detail:{elements:t}}))},ot=hZ(o,()=>i.labelInstances),st=async(e,t,n)=>{He(),l().state!==`copying`&&o.startCopy();let r=!1,i;try{r=await e(),r||(i=`Failed to copy`)}catch(e){i=BY(e,`Action failed`)}if(t)for(let e of t)ot.updateAfterCopy(e,r,i);l().state===`copying`&&(r&&o.completeCopy(),n?Kt():r?(o.activate(),Ve()):o.unfreeze())},ct=(e,t,n)=>{let i=e[0],a=n??(i?QU(i):null),o=i?YN(i):null,s=a??o??void 0;return KY({getContent:r.store.options.getContent,componentName:s,maxContextLines:r.store.options.maxContextLines},r.hooks,e,t)},lt=async(e,t,n)=>{if(e.length===0)return!1;let i=[],a=[];for(let t of e){let{wasIntercepted:e,pendingResult:n}=r.hooks.onElementSelect(t);e||i.push(t),n&&a.push(n),r.store.theme.grabbedBoxes.enabled&&it(dY(t),t)}await hI();let o=!0;if(i.length>0&&(o=await ct(i,t,n)),a.length>0&&!(await Promise.all(a)).every(Boolean))throw new cH;return at(e),o},ut=e=>{WU(e.primaryElement).then(async t=>{await st(()=>lt(e.targetElements,e.extraPrompt,t??void 0),e.labelInstanceIds.length>0?e.labelInstanceIds:null,e.shouldDeactivateAfter),e.onComplete?.()}).catch(t=>{let n=BY(t,`Action failed`);for(let t of e.labelInstanceIds)ot.updateAfterCopy(t,!1,n);l().state===`copying`&&o.unfreeze()})},dt=e=>{let{element:t,cursorX:n,selectedElements:r,extraPrompt:a,shouldDeactivateAfter:s,onComplete:c,dragRect:l}=e,u=r??[t],d=l??i.frozenDragRect,f=u.length>1,p=!f&&t===yt()?Tt():void 0,m=d&&f?nX(d):p??dY(t),h=f?m.x+m.width/2:n,g=YN(t);He(),o.startCopy();let _=g?ot.createInstance(m,g,void 0,`copying`,{element:t,mouseX:h,elements:r}):null;ut({primaryElement:t,targetElements:u,labelInstanceIds:_?[_]:[],extraPrompt:a,shouldDeactivateAfter:s,onComplete:c})},ft=e=>{let{elements:t,labelEntries:n,shouldDeactivateAfter:r,onComplete:i}=e,a=t[0];He(),o.startCopy(),ut({primaryElement:a,targetElements:t,labelInstanceIds:ot.createPerElementInstances(n,`copying`),shouldDeactivateAfter:r,onComplete:i})},pt=Y(()=>{if(c(),!N()||m()||v()||ye.isPendingDismiss())return null;let e=i.detectedElement;return vB(e)?e:null}),P=Y(()=>i.frozenElement||(f()?null:pt())),mt=Y(()=>!d()||b()||j()||_()||pe()||ye.isPendingDismiss()?null:ie()?f()?P():pt()??i.frozenElement:ye.selectedElement()),ht=Y(()=>{let e=mt();return e?aX(e,DI,et):[]}),gt=Y(()=>{let e=mt();return e?Math.max(0,ht().findIndex(t=>t.element===e)):0}),_t=Y(()=>mt()!==null);AR(()=>{let e=i.detectedElement;if(!e)return;let t=setInterval(()=>{vB(e)||o.setDetectedElement(null)},100);LR(()=>clearInterval(t))}),AR(FR(P,e=>{if(We!==null&&(clearTimeout(We),We=null),!e){Xe(null);return}We=window.setTimeout(()=>{We=null,Xe(e)},100)})),LR(()=>{We!==null&&(clearTimeout(We),We=null)}),AR(()=>{let e=i.frozenElements;LR(TL(e))}),AR(FR(d,e=>{e&&r.store.options.freezeReactUpdates&&LR(CR())}));let vt=()=>{if(i.isTouchMode&&p()){let e=i.detectedElement;return!e||_I(e)?void 0:e}let e=P();if(!(!e||_I(e)))return e},yt=Y(()=>vt()),bt=()=>yt()?i.isTouchMode&&p()?N():N()&&!m():!1,xt=cz(()=>i.frozenElements,e=>Y(()=>(c(),dY(e)))),St=Y(()=>{let e=i.frozenElements;if(e.length===0)return[];let t=i.frozenDragRect;return t&&e.length>1?[nX(t)]:xt().map(e=>e())}),Ct=Y(()=>{if(!j()||i.pendingCommentMode||M())return null;let e=i.detectedElement;return!vB(e)||_I(e)||i.frozenElements.includes(e)?null:e}),wt=Y(()=>{c();let e=Ct();if(e)return dY(e)}),Tt=Y(()=>{c();let e=i.frozenElements;if(e.length>0){let t=St();if(e.length===1){let e=t[0];if(e)return e}let n=i.frozenDragRect;return n?t[0]??nX(n):iX(_X(t))}let t=yt();if(t)return dY(t)}),Et=(e,t)=>({pageX:e+window.scrollX,pageY:t+window.scrollY}),Dt=(e,t)=>{let{pageX:n,pageY:r}=Et(e,t);return{x:Math.abs(n-i.dragStart.x),y:Math.abs(r-i.dragStart.y)}},Ot=Y(()=>{if(!p())return!1;let e=Dt(s().x,s().y);return e.x>2||e.y>2}),kt=(e,t)=>{let{pageX:n,pageY:r}=Et(e,t),a=Math.min(i.dragStart.x,n),o=Math.min(i.dragStart.y,r),s=Math.abs(n-i.dragStart.x),c=Math.abs(r-i.dragStart.y);return{x:a-window.scrollX,y:o-window.scrollY,width:s,height:c}},At=e=>e.code===`Space`||e.key===` `,jt=()=>{if(!p())return;o.startDragReposition();let{pageX:e,pageY:t}=Et(s().x,s().y);Ie={x:e,y:t}},Mt=()=>{o.stopDragReposition(),Ie=null},Nt=Y(()=>{if(c(),Ot())return iX(kt(s().x,s().y))}),Pt=Y(()=>{if(c(),!Ot())return[];let e=je();if(!e)return[];let t=kt(e.x,e.y),n=$Y(t,DI);return(n.length>0?n:$Y(t,DI,!1)).map(e=>dY(e))}),Ft=Y(()=>{let e=Pt();if(e.length>0)return e;let t=wt();return t?[...St(),t]:St()}),It=cz(()=>i.frozenElements,e=>{let t=YN(e)||`element`,n=QU(e)??void 0;return Y(()=>{if(c(),!vB(e))return null;let r=dY(e),i=ve.get(e);return{tagName:t,componentName:n,bounds:r,mouseX:i===void 0?void 0:r.x+r.width*i}})}),Lt=Y(()=>{if(b()||i.frozenElements.length<2)return[];let e=[];for(let t of It()){let n=t();n!==null&&e.push(n)}return e}),Rt=Y(()=>{if(b())return null;let e=Ct();return e?(c(),{tagName:YN(e)||`element`,componentName:QU(e)??void 0,bounds:dY(e),mouseX:s().x}):null}),zt=Y(()=>{if(_()||b()){c();let e=i.frozenElement||pt();return e?{x:fY(dY(e)).x+i.copyOffsetFromCenterX,y:i.copyStart.y}:{x:i.copyStart.x,y:i.copyStart.y}}return{x:s().x,y:s().y}}),Bt=Y(()=>{if(!j()||i.frozenElements.length!==1)return;c();let e=i.frozenElements[0];if(!vB(e))return;let t=ve.get(e);if(t===void 0)return;let n=dY(e);return n.x+n.width*t});AR(FR(()=>[pt(),i.lastGrabbedElement],([e,t])=>{t&&e&&t!==e&&o.setLastGrabbed(null),e&&r.hooks.onElementHover(e)})),AR(FR(()=>pt(),e=>{let t=++Ue,n=()=>{Ue===t&&o.setSelectionSource(null,null)};if(!e){n();return}ZU(e).then(e=>{if(Ue===t){if(!e){n();return}o.setSelectionSource(e.filePath,e.lineNumber)}}).catch(()=>{Ue===t&&o.setSelectionSource(null,null)})}));let Vt=Y(()=>i.grabbedBoxes.map(e=>({id:e.id,bounds:e.bounds,createdAt:e.createdAt}))),Ht=Y(()=>i.labelInstances.map(e=>({id:e.id,status:e.status,tagName:e.tagName,componentName:e.componentName,createdAt:e.createdAt})));AR(FR(Y(()=>{let e=d(),t=p(),n=_(),a=b(),o=pt(),s=Nt(),c=r.store.theme.enabled,l=r.store.theme.selectionBox.enabled,u=r.store.theme.dragBox.enabled,f=Ot(),m=P(),h=y();return{isActive:e,isDragging:t,isCopying:n,isPromptMode:a,isSelectionBoxVisible:!!(c&&l&&e&&!n&&!h&&!t&&m!=null),isDragBoxVisible:!!(c&&u&&e&&!n&&f),targetElement:o,dragBounds:s?{x:s.x,y:s.y,width:s.width,height:s.height}:null,grabbedBoxes:[...Vt()],labelInstances:[...Ht()],selectionFilePath:i.selectionFilePath,toolbarState:te()}}),e=>{r.hooks.onStateChange(e)})),AR(FR(()=>{let e=b();return{inputMode:e,position:e?s():PR(s),target:e?pt():PR(pt)}},({inputMode:e,position:t,target:n})=>{r.hooks.onPromptModeChange(e,{x:t.x,y:t.y,targetElement:n})})),AR(FR(()=>[ar(),Tt(),pt()],([e,t,n])=>{r.hooks.onSelectionBox(!!e,t??null,n)})),AR(FR(()=>[fr(),Nt()],([e,t])=>{r.hooks.onDragBox(!!e,t??null)})),AR(FR(()=>{let e=mr();return[e,pr(),e?zt():PR(zt),e?pt():PR(pt),i.selectionFilePath,i.selectionLineNumber]},([e,t,n,i,a,o])=>{r.hooks.onElementLabel(e,t,{x:n.x,y:n.y,content:``,element:i??void 0,tagName:i&&YN(i)||void 0,filePath:a??void 0,lineNumber:o??void 0})}));let Ut=null,Wt=e=>{if(e){if(!Ut){Ut=document.createElement(`style`),Ut.setAttribute(`data-react-grab-cursor`,``);let e=ZN();e&&(Ut.nonce=e),$N(Ut),document.head.appendChild(Ut)}Ut.textContent=`* { cursor: ${e} !important; }`}else Ut&&=(Ut.remove(),null)};AR(FR(()=>[d(),_(),b()],([e,t,n])=>{Wt(t?`progress`:e&&!n?`crosshair`:null)}));let Gt=()=>{let e=u();o.activate(),e||r.hooks.onActivate()},Kt=()=>{let e=p(),t=i.previouslyFocusedElement;Mt(),o.deactivate(),de.resetWithDiscard(),kr(),Se(),wn(),ye.clear(),Ke(!1),Je(null),e&&C(`userSelect`,``),Pe&&window.clearTimeout(Pe),nt.stop(),t instanceof HTMLElement&&t!==document.body&&t!==document.activeElement&&vB(t)&&t.focus({preventScroll:!0}),r.hooks.onDeactivate()},qt=()=>{u()&&o.releaseHold(),d()&&Kt(),He()},Jt=()=>{o.setWasActivatedByToggle(!0),Gt()},Yt=()=>{let e=[...i.frozenElements],t=i.frozenElement||pt(),n=b()?i.inputText.trim():``;if(!t){Kt();return}let r=e.length>0?e:[t],a=r.map(e=>dY(e))[0],{x:s,y:c}=fY(a),l=s+i.copyOffsetFromCenterX;o.setPointer({x:s,y:c}),o.exitPromptMode(),o.clearInputText(),dt({element:t,cursorX:l,selectedElements:r,extraPrompt:n||void 0,shouldDeactivateAfter:!0})},Xt=()=>{if(b()){if(S()){o.clearInputText(),Kt();return}o.setPendingDismiss(!0),ee(e=>e+1)}},Zt=()=>{if(ye.isPendingDismiss()){Dn();return}o.clearInputText(),Kt()},Qt=()=>{o.setPendingDismiss(!1)},$t=()=>{if(de.isOpen()){de.dismiss();return}let e=i.frozenElement||pt();e&&en(e,{x:s().x,y:s().y})},en=(e,t,n={})=>de.trigger(e,t,n),tn=(e,t)=>{if(!de.isOpen()||i.contextMenuPosition!==null)return!1;let n=UI(e,t).find(DI);if(!n)return!1;let r=de.switchToElement(n,{x:e,y:t});return r&&CL([n]),r},nn=e=>({filePath:i.selectionFilePath??void 0,lineNumber:i.selectionLineNumber??void 0,componentName:Ze(),tagName:YN(e)||void 0}),rn=()=>{Ge=null,Ke(!1),o.setPendingCommentMode(!1),Je(null)},an=e=>{let t=i.frozenElement||pt();if(!t)return!1;let n={x:s().x,y:s().y},a=r.store.actions.find(t=>t.id===e);return a?e===`edit`?en(t,n,nn(t))?(o.clearInputText(),o.exitPromptMode(),rn(),!0):!0:(o.clearInputText(),o.exitPromptMode(),rn(),a.onAction(Nn(t,n)),!0):(o.clearInputText(),o.exitPromptMode(),rn(),Mr(ON),ln(t,n),!0)},on=e=>{if(d()){if($e()!==e&&b()&&an(e))return;if($e()!==e&&i.pendingCommentMode){o.setPendingCommentMode(!1),Ge=e,Je(e),Ke(!0);return}if($e()!==e&&M()){Ge=e,Je(e);return}Kt();return}T()&&(Ge=e,Je(e),Ke(!0),Jt())},sn=()=>{on(te()?.defaultAction??`copy`)},cn=(e,t,n)=>{rn(),o.clearInputText(),o.enterPromptMode({x:t,y:n},e)},ln=(e,t)=>{Se(),Ar(),o.showContextMenu(t,e),wn(),r.hooks.onContextMenu(e,t)},un=(e,t)=>{let n=Ge;if(Ge=null,Je(null),!n)return;if(n===`edit`){en(e,t,nn(e));return}let i=r.store.actions.find(e=>e.id===n);if(!i){Mr(ON),ln(e,t);return}i.onAction(Nn(e,t))},dn=()=>{if(T()){if(d()&&x()){Kt();return}o.setPendingCommentMode(!0),d()||Jt()}},fn=(e,t,n)=>{let r=n&&j()&&!p()&&!i.pendingCommentMode&&!M();if(be()||f()&&!r)return;if(o.setPointer({x:e,y:t}),ke.latestPointerX=e,ke.latestPointerY=t,r){let n=WI(e,t);n!==i.detectedElement&&o.setDetectedElement(n);return}let a=performance.now(),s=ke.pendingDetectionScheduledAt>0&&a-ke.pendingDetectionScheduledAt<200;if(a-ke.lastDetectionTimestamp>=32&&!s&&(ke.lastDetectionTimestamp=a,ke.pendingDetectionScheduledAt=a,setTimeout(()=>{if(be()){ke.pendingDetectionScheduledAt=0;return}let e=WI(ke.latestPointerX,ke.latestPointerY);e!==i.detectedElement&&o.setDetectedElement(e),ke.pendingDetectionScheduledAt=0})),p()){if(h()){let{pageX:n,pageY:r}=Et(e,t);Ie&&o.shiftDragStart({x:n-Ie.x,y:r-Ie.y}),Ie={x:n,y:r}}Ne(e,t);let n=bZ(e,t),r=n.top||n.bottom||n.left||n.right;r&&!nt.isActive()?nt.start():!r&&nt.isActive()&&nt.stop()}},pn=(e,t,n)=>{if(!N()||v())return!1;!n&&j()&&Se();let i=ye.selectedElement()!==null;return o.startDrag({x:e,y:t},n||i),o.setPointer({x:e,y:t}),C(`userSelect`,`none`),Ne(e,t),r.hooks.onDragStart(e+window.scrollX,t+window.scrollY),!0},mn=(e,t)=>{let n=i.frozenElements.includes(e),r=i.frozenElements.length===0;if(!n){let n=eX(dY(e),t);ve.set(e,n),r&&Qe(QU(e)??void 0)}o.toggleFrozenElement(e),GI();let a=i.frozenElements.includes(e);if(a||ve.delete(e),i.frozenElements.length===0){Se(),o.unfreeze();return}CL(i.frozenElements),Le(!0),o.setPointer(t),o.setLastGrabbed(a?e:i.frozenElements[i.frozenElements.length-1]),o.freeze(),wn()},hn=()=>{let e=i.frozenElements.filter(vB),t=e.map(e=>{let t=YN(e)||`element`,n=QU(e)??void 0,r=ve.get(e),i=dY(e);return{element:e,tagName:t,componentName:n,mouseX:r===void 0?i.x+i.width/2:i.x+i.width*r}});if(Se(),e.length===0){o.unfreeze();return}if(e.length===1){dt({element:e[0],cursorX:t[0].mouseX,selectedElements:e,shouldDeactivateAfter:i.wasActivatedByToggle});return}ft({elements:e,labelEntries:t,shouldDeactivateAfter:i.wasActivatedByToggle})},gn=(e,t,n)=>{let a=$Y(e,DI),s=a.length>0?a:$Y(e,DI,!1);if(s.length===0)return;let c=n&&!i.pendingCommentMode&&!M();if(c&&o.addFrozenElements(s),CL(c?i.frozenElements:s),r.hooks.onDragEnd(s,e),c){let e=s[s.length-1];Le(!0),GI(),o.setPointer(fY(dY(e))),o.setLastGrabbed(e),o.freeze(),wn();return}let l=s[0],u=fY(dY(l));o.setPointer(u),o.setFrozenElements(s);let d=rX(e);if(o.setFrozenDragRect(d),o.freeze(),o.setLastGrabbed(l),i.pendingCommentMode){cn(l,u.x,u.y);return}if(M()){Ke(!1),Ge?un(l,u):ln(l,u);return}let f=i.wasActivatedByToggle&&!t;dt({element:l,cursorX:u.x,selectedElements:s,shouldDeactivateAfter:f,dragRect:d})},_n=e=>{for(let t of i.frozenElements)if(vB(t)&&OZ(e,dY(t)))return t;return null},vn=(e,t,n,a)=>{let c=vB(i.frozenElement)?i.frozenElement:null,l=ye.selectedElement(),u=()=>UI(e,t).find(DI)??null;if(a&&!i.pendingCommentMode&&!M()){let n=u();n!==null&&mn(n,{x:e,y:t});return}let d=u()??(vB(i.detectedElement)?i.detectedElement:null),f=l??d??c;if(!f)return;let p,m,h=d===null&&c===f,g=l===f;if(h)p=s().x,m=s().y;else if(g){let e=fY(dY(f));p=e.x,m=e.y}else p=e,m=t;if(i.pendingCommentMode){cn(f,p,m),ye.clear();return}if(M()){Ke(!1);let{wasIntercepted:e}=r.hooks.onElementSelect(f);if(e)return;ye.clear(),CL([f]),o.setFrozenElement(f);let t={x:p,y:m};o.setPointer(t),o.freeze(),Ge?un(f,t):ln(f,t);return}let _=i.wasActivatedByToggle&&!n;o.setLastGrabbed(f),dt({element:f,cursorX:p,shouldDeactivateAfter:_}),ye.clear()},yn=()=>{p()&&(Mt(),o.cancelDrag(),nt.stop(),C(`userSelect`,``))},bn=(e,t,n,r)=>{if(!p())return;Ae!==null&&(clearTimeout(Ae),Ae=null),Me(null);let i=Dt(e,t),a=i.x>2||i.y>2,s=a?kt(e,t):null;a?o.endDrag():o.cancelDrag(),Mt(),nt.stop(),C(`userSelect`,``),s?gn(s,n,r):vn(e,t,n,r)},xn=zY(),Sn=yZ(),Cn=e=>{let t;try{t=Sn.originalKeyDescriptor?.get?Sn.originalKeyDescriptor.get.call(e):e.key}catch{return!1}let n=t===`Enter`||DZ(e.code),r=d()||u();return n&&r&&!b()&&!ye.isPendingDismiss()&&!i.wasActivatedByToggle?qB(e,`data-react-grab-input`)?!1:(Sn.claimedEvents.add(e),e.preventDefault(),e.stopImmediatePropagation(),!0):!1};xn.addDocumentListener(`keydown`,XM(Cn),{capture:!0}),xn.addDocumentListener(`keyup`,XM(Cn),{capture:!0}),xn.addDocumentListener(`keypress`,XM(Cn),{capture:!0});let wn=()=>{tt.clearHistory(),ye.clear()},Tn=(e,t=!1)=>{o.setFrozenElement(e),o.freeze(),ye.select(e,{shouldPromptBeforeMouseHandoff:t});let n=fY(dY(e));o.setPointer(n),i.contextMenuPosition!==null&&o.showContextMenu(n,e)},En=()=>{ye.showDismissPrompt()&&ee(e=>e+1)},Dn=()=>{ye.clear(),o.unfreeze(),wn()},On=()=>{let e=ye.takeSelection(i.frozenElement);if(!e){Dn();return}let t=fY(dY(e));wn(),o.setLastGrabbed(e),dt({element:e,cursorX:t.x,shouldDeactivateAfter:i.wasActivatedByToggle})},kn=e=>CN.has(e.key)?e.key:e.key===`Tab`?e.shiftKey?`ArrowLeft`:`ArrowRight`:null,An=(e,t={})=>{if(!d()||b()||j()||ye.isPendingDismiss()&&!t.allowPendingKeyboardSelection)return!1;let n=kn(e);if(!n||pe())return!1;let r=P(),i=!r;if(!r){let e=JM()?.getBoundingClientRect();r=e?WI(e.left+e.width/2,e.top+e.height/2):WI(window.innerWidth/2,window.innerHeight/2)}if(!r)return!1;let a=n===`ArrowUp`||n===`ArrowDown`,o=tt.findNext(n,r);if(!o&&!a&&!i)return!1;let s=o??r;return e.preventDefault(),e.stopPropagation(),Tn(s,!0),!0},jn=e=>e.metaKey||e.ctrlKey||e.altKey||e.repeat||xB(e)||!d()||_()||v()||pe()?null:i.frozenElement||pt(),Mn=e=>{let t=jn(e);if(!t)return null;let n=tH(r.store.actions,e);return n?{element:t,action:n}:null},Nn=(e,t)=>{let n=dY(e);return Cr({element:e,filePath:i.selectionFilePath??void 0,lineNumber:i.selectionLineNumber??void 0,tagName:YN(e)||void 0,componentName:Ze(),position:t,shouldDeferHideContextMenu:!1,performWithFeedbackOptions:{fallbackBounds:n,fallbackSelectionBounds:[n],position:t}})},Pn=/^[a-zA-Z0-9-]$/,Fn=e=>{if(!e.key||e.key.length!==1||!Pn.test(e.key))return!1;let t=jn(e);return!t||!de.trigger(t,{x:s().x,y:s().y},{initialSearchQuery:e.key})?!1:(rn(),e.preventDefault(),e.stopImmediatePropagation(),!0)},In=e=>{let t=Mn(e);if(!t)return!1;let{element:n,action:r}=t;if(b())return an(r.id)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1;let i={x:s().x,y:s().y};return r.onAction(Nn(n,i)),e.preventDefault(),e.stopImmediatePropagation(),!0},Ln=e=>{if(e.key?.toLowerCase()!==`o`||!d()||!(e.metaKey||e.ctrlKey))return!1;let t=i.selectionFilePath,n=i.selectionLineNumber;return t?(e.preventDefault(),e.stopPropagation(),r.hooks.onOpenFile(t,n??void 0)||qI(t,n??void 0,r.hooks.transformOpenFileUrl),!0):!1},Rn=e=>{if(!d()||_()||i.contextMenuPosition!==null||de.isOpen())return!1;let t=e.key===`F10`&&e.shiftKey,n=e.key===`ContextMenu`;if(!t&&!n)return!1;let r=i.frozenElements,a=r.length>1,s=(a?r[0]:null)||i.frozenElement||pt();if(!s)return!1;e.preventDefault(),e.stopPropagation();let c=fY(dY(s));return a?CL(r):(CL([s]),o.setFrozenElement(s)),o.setPointer(c),o.freeze(),ln(s,c),!0},zn=Y(()=>ht().map(e=>({tagName:YN(e.element)||`element`,componentName:QU(e.element)??void 0,depth:e.depth,isLast:e.isLast}))),Bn=Y(()=>({items:zn(),activeIndex:gt()})),Vn=e=>{if(!(!r.store.options.allowActivationInsideInput&&xB(e))&&!(!gX(e,r.store.options)&&((e.metaKey||e.ctrlKey)&&!SN.includes(e.key)&&!DZ(e.code)&&(d()&&!i.wasActivatedByToggle?Kt():u()&&(we(),Te(),o.releaseHold())),!DZ(e.code)||!u()))){if((d()||u())&&!b()&&(e.preventDefault(),DZ(e.code)&&e.stopImmediatePropagation()),d()){if(i.wasActivatedByToggle&&r.store.options.activationMode!==`hold`||e.repeat)return;Pe!==null&&window.clearTimeout(Pe),Pe=window.setTimeout(()=>{Kt()},200);return}if(u()&&e.repeat){if(Fe.copyWaiting){let e=Fe.holdTimerFired;Te(),e&&o.activate()}return}if(!(_()||y())&&!u()){let t=r.store.options.keyHoldDuration??100;xB(e)?SB(e)?t+=600:t+=400:CB()&&(t+=600),Te(),o.startHold(t)}}},Hn=e=>{if(!ye.isPendingDismiss())return!1;if(DZ(e.code))return!0;let t=CN.has(e.key),n=Mn(e)!==null;return!t&&!n?!1:t?An(e,{allowPendingKeyboardSelection:!0}):In(e)?(wn(),!0):!1};xn.addWindowListener(`keydown`,XM(e=>{if(kn(e)&&xB(e)||Hn(e))return;if(Cn(e),!T()){gX(e,r.store.options)&&!e.repeat&&O(e=>e+1);return}let t=DZ(e.code)&&u()&&!b(),n=qB(e,EN);if(b()&&gX(e,r.store.options)&&!e.repeat&&!n){e.preventDefault(),e.stopPropagation(),Xt();return}if(e.key===`Escape`&&pe()){ae()!==null&&kr();return}let a=qB(e,`data-react-grab-ignore-events`)&&!t;if(b()||a)return b()&&!n&&In(e)||(e.key===`Escape`&&(b()?Xt():i.wasActivatedByToggle&&Kt()),a&&CN.has(e.key)&&An(e)),void 0;if(p()&&At(e)){e.repeat||jt(),e.preventDefault(),e.stopPropagation();return}if(e.key===`Escape`&&(u()||i.wasActivatedByToggle)){Kt();return}d()&&!SN.includes(e.key)&&e.preventDefault();let o=Date.now()-Re<200;An(e)||Ln(e)||Rn(e)||In(e)||Fn(e)||o||Vn(e)}),{capture:!0}),xn.addWindowListener(`keyup`,XM(e=>{if(Cn(e))return;if(At(e)&&h()&&(Mt(),e.preventDefault(),e.stopPropagation()),e.key===`Shift`&&j()){p()&&yn(),hn();return}if(qB(e,`data-react-grab-ignore-events`))return;let t=vZ(r.store.options),n=t.metaKey||t.ctrlKey?KB()?!e.metaKey:!e.ctrlKey:t.shiftKey&&!e.shiftKey||t.altKey&&!e.altKey,a=r.store.options.activationKey?typeof r.store.options.activationKey==`function`?r.store.options.activationKey(e):mX(r.store.options.activationKey)(e):uX(e.key,e.code);if(y()||ze){(a||n)&&(He(),Kt());return}if(!u()&&!d()||b())return;let s=!!r.store.options.activationKey,c=r.store.options.activationMode===`hold`,l=p();if(d()){let e=fe();if(n){if(i.wasActivatedByToggle&&r.store.options.activationMode!==`hold`||e)return;Kt()}else if(c&&a){if(Pe!==null&&(window.clearTimeout(Pe),Pe=null),e||l)return;Kt()}else!s&&a&&Pe!==null&&(window.clearTimeout(Pe),Pe=null);return}if(a||n){if(i.wasActivatedByToggle&&r.store.options.activationMode!==`hold`)return;if(u()||Fe.holdTimerFired&&n){we();let t=(Fe.startTimestamp?Date.now()-Fe.startTimestamp:0)>=200,n=Fe.holdTimerFired&&t&&(r.store.options.allowActivationInsideInput||!xB(e));Te(),n?o.activate():o.releaseHold()}else Kt()}}),{capture:!0}),xn.addDocumentListener(`copy`,()=>{u()&&(Fe.copyWaiting=!0)}),xn.addWindowListener(`keypress`,XM(Cn),{capture:!0}),xn.addWindowListener(`pointermove`,XM(e=>{if(!e.isPrimary)return;let t=e.pointerType===`touch`;if(o.setTouchMode(t),!qB(e,`data-react-grab-ignore-events`)&&!be()&&!(t&&!u()&&!d())){if((t?u():d())&&!b()&&f()&&!e.shiftKey&&!j()){if(ye.consumeMouseHandoff()){En();return}o.unfreeze(),wn()}fn(e.clientX,e.clientY,e.shiftKey)}}),{passive:!0}),xn.addWindowListener(`pointerdown`,XM(e=>{if(e.button===0&&e.isPrimary&&(o.setTouchMode(e.pointerType===`touch`),_e=!1,!qB(e,`data-react-grab-ignore-events`))){if(fe()){tn(e.clientX,e.clientY)&&(_e=!0,e.preventDefault(),e.stopImmediatePropagation());return}if(b()){let t=Tt();t&&e.clientX>=t.x&&e.clientX<=t.x+t.width&&e.clientY>=t.y&&e.clientY<=t.y+t.height?Yt():Xt();return}if(ye.isPendingDismiss()){e.preventDefault(),e.stopImmediatePropagation();return}if(v()){e.preventDefault(),e.stopImmediatePropagation();return}pn(e.clientX,e.clientY,e.shiftKey)&&(e.pointerId!==void 0&&document.documentElement.setPointerCapture(e.pointerId),e.preventDefault(),e.stopImmediatePropagation())}}),{capture:!0}),xn.addWindowListener(`pointerup`,XM(e=>{if(e.button!==0||!e.isPrimary||qB(e,`data-react-grab-ignore-events`)||fe())return;let t=N()||v()||p(),n=e.metaKey||e.ctrlKey;bn(e.clientX,e.clientY,n,e.shiftKey),t&&(e.preventDefault(),e.stopImmediatePropagation())}),{capture:!0}),xn.addWindowListener(`contextmenu`,XM(e=>{if(!N()||_()||b()||de.isOpen())return;let t=qB(e,`data-react-grab-ignore-events`),n={x:e.clientX,y:e.clientY},r=t&&i.frozenElements.length>1?_n(n):null,a=ye.isPendingDismiss();if(t&&!r&&!a&&!_t())return;if(fe()){e.preventDefault();return}e.preventDefault(),e.stopPropagation();let s=r??WI(e.clientX,e.clientY);if(!s)return;let c=i.frozenElements;c.length>1&&c.includes(s)?CL(c):(CL([s]),o.setFrozenElement(s)),o.setPointer(n),o.freeze(),ln(s,n)}),{capture:!0}),xn.addWindowListener(`pointercancel`,XM(e=>{e.isPrimary&&yn()})),xn.addWindowListener(`click`,XM(e=>{if(!qB(e,`data-react-grab-ignore-events`)){if(_e){_e=!1,e.preventDefault(),e.stopImmediatePropagation();return}fe()||(N()||g())&&(e.preventDefault(),e.stopImmediatePropagation(),i.wasActivatedByToggle&&!b()&&!e.shiftKey&&(u()?o.setWasActivatedByToggle(!1):Kt()))}}),{capture:!0}),xn.addDocumentListener(`visibilitychange`,()=>{if(document.hidden){o.clearGrabbedBoxes();let e=i.activationTimestamp;d()&&!b()&&e!==null&&Date.now()-e>500&&Kt()}}),xn.addWindowListener(`blur`,()=>{yn(),u()&&(we(),o.releaseHold(),Te()),Se()}),xn.addWindowListener(`focus`,()=>{Re=Date.now()}),xn.addWindowListener(`focusin`,e=>{qB(e,ZM)&&e.stopPropagation()},{capture:!0});let Un=()=>{if(!(i.isTouchMode&&!u()&&!d())&&!be()&&!f()&&!p()&&i.frozenElements.length===0){let e=WI(s().x,s().y);o.setDetectedElement(e)}},Wn=null,Gn=null,Kn=()=>{tX(),Un(),o.incrementViewportVersion(),o.updateContextMenuPosition()};xn.addWindowListener(`scroll`,Kn,{capture:!0});let qn=window.innerWidth,Jn=window.innerHeight;xn.addWindowListener(`resize`,()=>{let e=window.innerWidth,t=window.innerHeight;if(qn>0&&Jn>0){let n=e/qn,r=t/Jn,i=Math.abs(n-r)<MN,a=Math.abs(n-1)>MN;i&&a&&o.setPointer({x:s().x*n,y:s().y*r})}qn=e,Jn=t,Kn()});let Yn=window.visualViewport;if(Yn){let{signal:e}=xn;Yn.addEventListener(`resize`,Kn,{signal:e}),Yn.addEventListener(`scroll`,Kn,{signal:e})}let Xn=()=>{Gn===null&&(Gn=pI(()=>{Gn=null,o.incrementViewportVersion()}))};AR(()=>{if(r.store.theme.enabled&&(d()||_()||i.labelInstances.length>0||i.grabbedBoxes.length>0)){if(Wn!==null)return;Wn=window.setInterval(()=>{Xn()},100);return}Wn!==null&&(window.clearInterval(Wn),Wn=null),Gn!==null&&(mI(Gn),Gn=null)}),LR(()=>{Wn!==null&&window.clearInterval(Wn),Gn!==null&&mI(Gn)}),xn.addDocumentListener(`copy`,XM(e=>{b()||qB(e,`data-react-grab-ignore-events`)||N()&&e.preventDefault()}),{capture:!0}),LR(()=>{xn.abort(),Ae!==null&&window.clearTimeout(Ae),Pe&&window.clearTimeout(Pe),He(),he?.(),he=null,ge?.(),ge=null,rt.forEach(e=>window.clearTimeout(e)),rt.clear(),ot.cancelAllFades(),nt.stop(),C(`userSelect`,``),C(`touchAction`,``),Wt(null),Sn.restore(),qM(null)});let{root:Zn,host:Qn}=_Y($J);LR(IY(Qn).cleanup);let $n=Y(()=>r.store.theme.enabled),er=Y(()=>r.store.theme.selectionBox.enabled),tr=Y(()=>r.store.theme.elementLabel.enabled),nr=Y(()=>r.store.theme.dragBox.enabled),rr=Y(()=>y()||ne()&&!f()||de.isInteracting()),ir=Y(()=>Pt().length>0),ar=Y(()=>!$n()||!er()||rr()?!1:ir()?!0:bt()),or=Y(()=>{let e=yt();if(e)return YN(e)||void 0}),sr=Y(()=>!$n()||fe()||!tr()||rr()?!1:bt()),cr=new Map,lr=e=>{let t=e.elements?.filter(vB)??[],n=e.element,r=null;t.length>0?r=t.map(dY):n&&vB(n)&&(r=[dY(n)]);let i=e.bounds,a=e.boundsMultiple;r&&(i=r.length>1?iX(_X(r)):r[0],e.boundsMultiple!==void 0&&(a=e.boundsMultiple.length>1&&e.boundsMultiple.length===e.elements?.length?r:[i]));let o=cr.get(e.id),s=o?.boundsMultiple,c=s===a||s!==void 0&&a!==void 0&&s.length===a.length&&s.every((e,t)=>e.x===a[t].x&&e.y===a[t].y&&e.width===a[t].width&&e.height===a[t].height);if(o&&o.status===e.status&&o.errorMessage===e.errorMessage&&o.bounds.x===i.x&&o.bounds.y===i.y&&o.bounds.width===i.width&&o.bounds.height===i.height&&c)return o;let l=i.x+i.width/2,u=i.width/2,d;d=e.mouseXOffsetRatio!==void 0&&u>0?l+e.mouseXOffsetRatio*u:e.mouseXOffsetFromCenter===void 0?e.mouseX??l:l+e.mouseXOffsetFromCenter;let f={...e,bounds:i,boundsMultiple:a,mouseX:d};return cr.set(e.id,f),f},ur=Y(()=>{if(!$n()||!r.store.theme.grabbedBoxes.enabled)return[];c();let e=new Set(i.labelInstances.map(e=>e.id));for(let t of cr.keys())e.has(t)||cr.delete(t);return i.labelInstances.map(lr)}),dr=Y(()=>!$n()||!r.store.theme.grabbedBoxes.enabled?[]:(c(),i.grabbedBoxes.map(e=>!e.element||!document.body.contains(e.element)?e:{...e,bounds:dY(e.element)}))),fr=Y(()=>$n()&&nr()&&N()&&Ot()),pr=Y(()=>_()?`processing`:`hover`),mr=Y(()=>{if(!$n())return!1;let e=tr(),t=b(),n=_(),r=N(),i=p(),a=!!P(),o=ne(),s=f();return!e||t||o&&!s?!1:n?!0:r&&!i&&a}),hr=Y(()=>{c();let e=i.contextMenuElement;return e?dY(e):null}),gr=Y(()=>(c(),i.contextMenuPosition)),_r=Y(()=>{let e=i.contextMenuElement;if(!e)return;let t=i.frozenElements.length;return t>1?`${t} elements`:YN(e)||void 0}),[vr]=vY(()=>i.frozenElements.length>1?null:i.contextMenuElement),[yr]=MR(()=>i.contextMenuElement,async e=>e?ZU(e):null),br=async e=>{o.incrementSelectionInteractionLockDepth();try{return await e()}finally{o.decrementSelectionInteractionLockDepth()}},xr=(e,t,n,r,a)=>async c=>{await br(async()=>{let l=a?.fallbackBounds??null,u=a?.fallbackSelectionBounds??[],d=a?.position??i.contextMenuPosition??s(),f=St(),p=hr()??l,m=t.length>1,h=m?iX(_X(f)):p,g=i.wasActivatedByToggle,_;if(_=m?f:p?[p]:u,o.hideContextMenu(),h){let i=m?h.x+h.width/2:d.x,a=ot.createInstance(h,n||`element`,r,`copying`,{element:e,mouseX:i,elements:m?t:void 0,boundsMultiple:_}),o=!1,s;try{o=await c(),o||(s=`Failed to copy`)}catch(e){s=BY(e,`Action failed`)}ot.updateAfterCopy(a,o,s)}else try{await c()}catch{}g?Kt():o.unfreeze()})},Sr=()=>{setTimeout(()=>{o.hideContextMenu()},0)},Cr=e=>{let{element:t,filePath:n,lineNumber:a,tagName:s,componentName:c,position:l,performWithFeedbackOptions:u,shouldDeferHideContextMenu:f,onBeforeCopy:p,onBeforePrompt:m,customEnterPromptMode:h}=e,g=i.frozenElements.length>0?i.frozenElements:[t],_=f?Sr:o.hideContextMenu,v={element:t,elements:g,filePath:n,lineNumber:a,componentName:c,tagName:s,enterPromptMode:h??(()=>{ot.clearAll(),rn(),m?.(),Ee(t,l.x,l.y),o.setPointer({x:l.x,y:l.y}),o.setFrozenElement(t),De(),d()||Gt(),_()}),enterEditMode:()=>{en(t,l,{filePath:n,lineNumber:a,componentName:c,tagName:s})&&rn(),_()},copy:()=>{rn(),p?.(),dt({element:t,cursorX:l.x,selectedElements:g.length>1?g:void 0,shouldDeactivateAfter:i.wasActivatedByToggle}),_()},hooks:{transformHtmlContent:r.hooks.transformHtmlContent,onOpenFile:r.hooks.onOpenFile,transformOpenFileUrl:r.hooks.transformOpenFileUrl},performWithFeedback:xr(t,g,s,c,u),hideContextMenu:_,cleanup:()=>{i.wasActivatedByToggle?Kt():o.unfreeze()}},y=r.hooks.transformActionContext(v);return{...v,...y}},wr=Y(()=>{let e=i.contextMenuElement;if(!e)return;let t=yr(),n=i.contextMenuPosition??s();return Cr({element:e,filePath:t?.filePath,lineNumber:t?.lineNumber??void 0,tagName:_r(),componentName:vr(),position:n,shouldDeferHideContextMenu:!0,onBeforeCopy:()=>{ye.clear()},customEnterPromptMode:()=>{ot.clearAll(),rn(),o.clearInputText(),o.enterPromptMode(n,e),Sr()}})}),Tr=()=>{setTimeout(()=>{o.hideContextMenu(),Kt()},0)},Er=()=>{if(!me)return null;let e=me.getBoundingClientRect(),t=NZ(e);return t===`left`||t===`right`?{x:t===`left`?e.right:e.left,y:e.top+e.height/2,edge:t}:{x:e.left+e.width/2,y:t===`top`?e.bottom:e.top,edge:t}},Dr=()=>{let e=Er();if(e)return e;let t=de.state();return t?{x:t.position.x,y:t.position.y,edge:`bottom`}:null},Or=(e,t)=>{let n=null,r=()=>{let i=e();i&&t(i),n=pI(r)};return r(),()=>{n!==null&&(mI(n),n=null)}};AR(()=>{if(!_t())return;let e=Or(Er,ue);LR(()=>{e(),ue(null)})});let kr=()=>{he?.(),he=null,oe(null)},Ar=()=>{o.hideContextMenu(),kr(),de.dismiss()},jr=()=>{ae()===null?(o.hideContextMenu(),de.isOpen()&&de.closePreservingRenderer(),he?.(),he=Or(Er,oe)):kr()},Mr=e=>{Ce({defaultAction:e})},Nr=e=>{let t=i.labelInstances.find(t=>t.id===e);if(!t?.element||!vB(t.element))return;let n=t.element,r=fY(dY(n)),a={x:t.mouseX??r.x,y:r.y},s=t.elements&&t.elements.length>0?t.elements.filter(e=>vB(e)):[n];setTimeout(()=>{kr(),de.isOpen()&&de.closePreservingRenderer(),d()||(o.setWasActivatedByToggle(!0),Gt()),o.setPointer(a),o.setFrozenElements(s),s.length>1&&t.bounds&&o.setFrozenDragRect(rX(t.bounds)),o.freeze(),o.showContextMenu(a,n)},0)};AR(()=>{let e=r.store.theme.hue;e===0?Zn.style.filter=``:Zn.style.filter=`hue-rotate(${e}deg)`}),r.store.theme.enabled&&Promise.resolve().then(()=>(RJ(),gW)).then(({ReactGrabRenderer:e})=>{t||(n=Sz(()=>X(e,{get selectionVisible(){return ar()},get selectionBounds(){return Tt()},get selectionBoundsMultiple(){return Ft()},get selectionShouldSnap(){return i.frozenElements.length>0||Pt().length>0},get selectionElementsCount(){return i.frozenElements.length},get frozenLabelEntries(){return Lt()},get pendingShiftPreviewEntry(){return Rt()??void 0},get selectionFilePath(){return i.selectionFilePath??void 0},get selectionLineNumber(){return i.selectionLineNumber??void 0},get selectionTagName(){return or()},get selectionComponentName(){return Ze()},get selectionLabelVisible(){return sr()},selectionLabelStatus:`idle`,get hierarchyState(){return Bn()},get hierarchyMenuPosition(){return le()},get labelInstances(){return ur()},get dragVisible(){return fr()},get dragBounds(){return Nt()},get grabbedBoxes(){return dr()},get mouseX(){return gB(()=>i.frozenElements.length>1)()?void 0:Bt()??zt().x},get isFrozen(){return f()||d()||ne()},get inputValue(){return i.inputText},get isPromptMode(){return b()},onShowContextMenuInstance:Nr,get onLabelInstanceHoverChange(){return ot.handleHoverChange},get onInputChange(){return o.setInputText},onInputSubmit:()=>void Yt(),onToggleExpand:$t,get selectionLabelShakeCount(){return k()},onConfirmDismiss:Zt,get discardPrompt(){return gB(()=>!!ye.isPendingDismiss())()?{isKeyboardSelection:!0,onConfirm:Zt,onCopy:On}:S()?{onConfirm:Zt,onCancel:Qt}:void 0},get toolbarVisible(){return r.store.theme.toolbar.enabled},get isActive(){return d()},onToggleActive:sn,onActivateAction:on,get activeActionId(){return $e()},get enabled(){return T()},get shakeCount(){return D()},onToolbarStateChange:e=>{A(e),e.enabled!==T()&&(E(e.enabled),e.enabled||(qt(),Ar())),RZ.forEach(t=>t(e))},onSubscribeToToolbarStateChanges:e=>(RZ.add(e),()=>{RZ.delete(e)}),onToolbarSelectHoverChange:re,onToolbarRef:e=>{me=e},get contextMenuPosition(){return gr()},get contextMenuBounds(){return hr()},get contextMenuTagName(){return _r()},get contextMenuComponentName(){return vr()},get contextMenuHasFilePath(){return!!yr()?.filePath},get actions(){return r.store.actions},get actionContext(){return wr()},onContextMenuDismiss:Tr,onContextMenuHide:Sr,get toolbarMenuPosition(){return ae()},get toolbarMenuActions(){return r.store.actions.filter(e=>e.showInToolbarMenu===!0)},get defaultActionId(){return te()?.defaultAction??`copy`},onSetDefaultAction:Mr,onToggleToolbarMenu:jr,onToolbarMenuDismiss:kr,get editPanelState(){return de.state()},get editPanelPosition(){return se()},get onEditPanelDismiss(){return de.dismiss},get onEditPanelSubmit(){return de.submit},get onEditPanelPendingEditsChange(){return de.setPendingEdits},get onEditPanelInteractingChange(){return de.setInteracting}}),Zn))}).catch(e=>{console.warn(`[react-grab] Failed to load renderer:`,e)});let Pr={activate:()=>{o.setPendingCommentMode(!1),!d()&&T()&&Jt()},deactivate:()=>{(d()||_())&&Kt()},toggle:()=>{d()?Kt():T()&&Jt()},comment:dn,isActive:()=>d(),isEnabled:()=>T(),setEnabled:e=>{e!==T()&&(E(e),Ce({enabled:e,collapsed:!e}),e||(qt(),Ar()))},getToolbarState:()=>te()??XV(),setToolbarState:e=>{let t=te()??XV(),n=e.collapsed??t?.collapsed??!1,r={edge:e.edge??t?.edge??`bottom`,ratio:e.ratio??t?.ratio??.5,collapsed:n,enabled:e.enabled??!n,defaultAction:e.defaultAction??t?.defaultAction??`copy`};ZV(r),A(r),r.enabled!==T()&&(E(r.enabled),r.enabled||(qt(),Ar())),RZ.forEach(e=>e(r))},onToolbarStateChange:e=>(RZ.add(e),()=>{RZ.delete(e)}),reset:()=>{qt(),Ar(),o.clearGrabbedBoxes(),o.clearLabelInstances(),o.setSelectionSource(null,null)},dispose:()=>{t=!0,LZ=!1,n?.(),he?.(),he=null,ge?.(),ge=null,RZ.clear(),e()},copyElement:async e=>{let t=Array.isArray(e)?e:[e];return t.length!==0&&await ct(t)},getSource:async e=>{let t=await ZU(e);return t?{filePath:t.filePath,lineNumber:t.lineNumber,componentName:t.componentName}:null},getStackContext:e=>lW(e,{maxLines:r.store.options.maxContextLines}),getState:()=>({isActive:d(),isDragging:p(),isCopying:_(),isPromptMode:b(),isSelectionBoxVisible:!!ar(),isDragBoxVisible:!!fr(),targetElement:pt(),dragBounds:Nt()??null,grabbedBoxes:[...Vt()],labelInstances:[...Ht()],selectionFilePath:i.selectionFilePath,toolbarState:te()}),setOptions:e=>{r.setOptions(e)},registerPlugin:e=>{r.register(e,Pr)},unregisterPlugin:e=>{r.unregister(e)},getPlugins:()=>r.getPluginNames(),getDisplayName:QU};for(let e of IZ)r.register(e,Pr);return setTimeout(()=>{sI(!0)},IN),Pr})}})),VZ=r({DEFAULT_THEME:()=>lZ,commentPlugin:()=>AZ,formatElementInfo:()=>fW,generateSnippet:()=>FZ,getGlobalApi:()=>UZ,getStack:()=>UU,init:()=>zZ,isInstrumentationActive:()=>SP,openPlugin:()=>MZ,registerPlugin:()=>qZ,setGlobalApi:()=>WZ,unregisterPlugin:()=>JZ}),HZ,UZ,WZ,GZ,KZ,qZ,JZ,YZ=t((()=>{BZ(),wR(),hW(),HZ=null,UZ=()=>typeof window>`u`?HZ:window.__REACT_GRAB__??HZ??null,WZ=e=>{HZ=e,typeof window<`u`&&(e?window.__REACT_GRAB__=e:delete window.__REACT_GRAB__)},GZ=[],KZ=e=>{for(;GZ.length>0;){let t=GZ.shift();t&&e.registerPlugin(t)}},qZ=e=>{let t=UZ();if(t){t.registerPlugin(e);return}GZ.push(e)},JZ=e=>{let t=UZ();if(t){t.unregisterPlugin(e);return}let n=GZ.findIndex(t=>t.name===e);n!==-1&&GZ.splice(n,1)},typeof window<`u`&&!window.__REACT_GRAB_DISABLED__&&(window.__REACT_GRAB__?HZ=window.__REACT_GRAB__:(HZ=zZ(),window.__REACT_GRAB__=HZ),KZ(HZ),window.dispatchEvent(new CustomEvent(`react-grab:init`,{detail:HZ})))}));Sr(),Br(),bD();var XZ=`linear-grab:context-copied`,ZZ=`linear-grab:picker-activated`,QZ=`linear-grab:picker-finished`,$Z=0,eQ=null;function tQ(e){!e||e.grabbedAt===$Z||Tr().then(t=>{if(t.workflowMode!==`local`||e.grabbedAt===$Z)return;let n=()=>{$Z=e.grabbedAt,navigator.clipboard.writeText(hD(e,t)).then(()=>window.dispatchEvent(new CustomEvent(XZ))).catch(()=>{$Z=0})};e.source?.filePath?(eQ&&clearTimeout(eQ),eQ=null,n()):(eQ&&clearTimeout(eQ),eQ=setTimeout(n,900))})}function nQ(e,t=Date.now()){return{tagName:e.tagName||void 0,componentName:e.componentName||void 0,content:e.textContent?e.textContent.slice(0,500):``,source:e.filePath?{filePath:e.filePath,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null,componentName:e.componentName??null}:null,stackContext:void 0,pageUrl:location.href,grabbedAt:t}}function rQ(e,t){let n=null,r=0;return{plugin:{name:`linear-grab`,hooks:{onElementSelect:i=>{r=Date.now(),n=Tr().then(e=>e.captureShots?ej(i):null);let a=t?.(),o={tagName:i.tagName?.toLowerCase()||void 0,componentName:a?.getDisplayName?.(i)||void 0,content:(i.textContent??``).slice(0,500),source:null,stackContext:void 0,pageUrl:location.href,grabbedAt:r};e([o]);try{a?.getSource?.(i)?.then(t=>{t?.filePath&&e([{...o,source:{filePath:t.filePath,lineNumber:t.lineNumber??null,columnNumber:t.columnNumber??null,componentName:t.componentName??o.componentName??null}}])})}catch{}}}},handleSelection(t){let i=r&&Date.now()-r<4e3?r:Date.now(),a=t.map((e,t)=>nQ(e,i+t));if(!a.length)return;e(a);let o=n;n=null,o&&o.then(t=>{t&&e([{...a[0],screenshotDataUrl:t},...a.slice(1)])})}}}var iQ=!1;async function aQ(){if(xr||iQ)return;iQ=!0;let e=await Promise.resolve().then(()=>(YZ(),VZ));try{e.init()}catch{iQ=!1;return}let t=rQ(e=>{kr(e),tQ(e[0])},()=>e.getGlobalApi());e.registerPlugin(t.plugin),ZA(),window.addEventListener(`react-grab:element-selected`,e=>{t.handleSelection(e.detail.elements??[])})}async function oQ(){if(xr){let e=await chrome.runtime.sendMessage({type:`grab/activate`});if(e&&e.ok===!1)throw Error(e.error??`Cannot activate the picker on this page.`);return}await aQ();let e=await Promise.resolve().then(()=>(YZ(),VZ));window.dispatchEvent(new CustomEvent(ZZ));let t=e.getGlobalApi();if(t?.activate?.(),typeof t?.isActive==`function`){let e=!1,n=0,r=setInterval(()=>{n+=1;let i=!1;try{i=t.isActive()}catch{}if(i){e=!0;return}(e||n>=8)&&(clearInterval(r),window.dispatchEvent(new CustomEvent(QZ)))},250);setTimeout(()=>clearInterval(r),3e5)}}function sQ(e){if(!xr)return()=>{};let t=t=>{t?.type===`grab/updated`&&e()};return chrome.runtime.onMessage.addListener(t),()=>chrome.runtime.onMessage.removeListener(t)}var cQ=2500;function lQ(e){let t=e.x+e.w/2,n=e.y+e.h/2,r=document.elementFromPoint(t,n)??document.body,i=t=>{let n=t.getBoundingClientRect();return n.left<=e.x&&n.top<=e.y&&n.right>=e.x+e.w&&n.bottom>=e.y+e.h};for(;r!==document.body&&!i(r);)r=r.parentElement??document.body;return r}async function uQ(e){let t=null,n=document.createElement(`video`);try{t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:`browser`},audio:!1,preferCurrentTab:!0,selfBrowserSurface:`include`}),n.srcObject=t,n.muted=!0,n.playsInline=!0,await n.play(),await new Promise(e=>setTimeout(e,250));let r=n.videoWidth/window.innerWidth,i=n.videoHeight/window.innerHeight;if(!n.videoWidth||r<=0||i<=0)return null;let a=document.createElement(`canvas`);a.width=Math.max(1,Math.round(e.w*r)),a.height=Math.max(1,Math.round(e.h*i));let o=a.getContext(`2d`);return o?(o.drawImage(n,e.x*r,e.y*i,e.w*r,e.h*i,0,0,a.width,a.height),a.toDataURL(`image/png`)):null}catch(e){return console.warn(`[linear-grab] tab-frame region capture failed:`,e),null}finally{n.srcObject=null,t?.getTracks().forEach(e=>e.stop())}}function dQ(){return new Promise(e=>{let t=document.createElement(`div`);t.setAttribute(`data-linear-grab`,`true`),t.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:crosshair;user-select:none;`;let n=document.createElement(`div`);n.style.cssText=`position:fixed;display:none;border:2px solid #5e6ad2;border-radius:4px;box-shadow:0 0 0 100000px rgba(0,0,0,0.35);pointer-events:none;`,t.appendChild(n),document.body.appendChild(t);let r=0,i=0,a=!1,o=e=>({x:Math.min(r,e.clientX),y:Math.min(i,e.clientY),w:Math.abs(e.clientX-r),h:Math.abs(e.clientY-i)}),s=()=>{t.remove(),window.removeEventListener(`keydown`,l,!0)},c=()=>{s(),e(null)},l=e=>{e.key===`Escape`&&(e.stopPropagation(),c())};window.addEventListener(`keydown`,l,!0),t.addEventListener(`pointerdown`,e=>{a=!0,r=e.clientX,i=e.clientY,t.setPointerCapture(e.pointerId)}),t.addEventListener(`pointermove`,e=>{if(!a)return;let t=o(e);n.style.display=`block`,n.style.left=`${t.x}px`,n.style.top=`${t.y}px`,n.style.width=`${t.w}px`,n.style.height=`${t.h}px`}),t.addEventListener(`pointerup`,t=>{let n=o(t);if(s(),n.w<8||n.h<8)return e(null);(lQ(n).querySelectorAll(`*`).length>cQ?uQ(n):Promise.race([tj(n),new Promise(e=>setTimeout(()=>{console.warn(`[linear-grab] region capture timed out after 4s — trying a tab frame`),e(null)},4e3))]).then(e=>e??uQ(n))).then(t=>{if(!t)return e(null);e({tagName:`region`,componentName:void 0,content:`Region capture ${Math.round(n.w)}×${Math.round(n.h)}`,source:null,stackContext:void 0,screenshotDataUrl:t,pageUrl:location.href,grabbedAt:Date.now()})})})})}Br(),Sr(),bD();var fQ=N(`<span class="text-text-faint ml-auto text-[10.5px] font-normal normal-case tabular-nums">`),pQ=N(`<details open class=group><summary class="text-text-dim hover:text-text flex cursor-pointer items-center gap-1.5 text-[11px] font-semibold tracking-wide uppercase select-none"><span aria-hidden class="text-text-faint inline-block w-3 text-center transition-transform group-open:rotate-90">›</span></summary><div class="flex flex-col gap-2 pt-2 pl-4">`),mQ=N(`<p class="text-warn text-[10.5px] leading-snug">Several captures resolve to the same source — this page region likely renders inside an iframe/canvas the picker can't see into. Use <b>Capture region</b> for visual pointers there.`),hQ=N(`<span class="inline-block min-w-[8ch] text-center">`),gQ=N(`<div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5"><span class="text-text-faint text-[10.5px] leading-snug">All elements post into ONE issue. Shift+click / drag selects several at once.</span><div class="flex items-center justify-end gap-1.5">`),_Q=N(`<div class="flex flex-col gap-1.5"><div class="flex gap-1.5">`),vQ=N(`<span class=text-danger>●`),yQ=N(`<div class="flex flex-col gap-1.5"><span class="text-text-faint text-[10.5px] leading-snug">Captures your screen as a looping GIF (max 30s) the coding agent can watch. Pick this tab in the share dialog, then reproduce the issue.`),bQ=N(`<span class="inline-block min-w-[4ch] text-center">Stop`),xQ=N(`<div class="bg-surface border-border flex items-center gap-2 rounded-lg border p-2.5"><span aria-hidden class="bg-danger size-2 shrink-0 animate-pulse rounded-full"></span><span class="text-text min-w-[5ch] text-[12px] tabular-nums"></span><span class="text-text-faint text-[10.5px]">max 0:30`),SQ=N(`<div class="bg-surface border-border flex items-center gap-2 rounded-lg border p-2.5"><span class="text-text-dim text-[12px]">Encoding GIF…`),CQ=N(`<div class="flex h-full flex-col gap-4 overflow-y-auto pt-3 pb-4 pl-3 pr-4">`),wQ=N(`<span class="text-success text-[12px] leading-none">✓`),TQ=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M4 4l8 8M12 4l-8 8">`),EQ=N(`<span class="font-mono text-text-dim break-all text-[11px] leading-snug">`),DQ=N(`<img alt="Element location screenshot"class="border-border bg-bg max-h-32 w-full rounded-md border object-contain">`),OQ=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex items-center justify-between gap-2"><span class="font-mono text-accent min-w-0 truncate text-[12px]"></span><div class="flex shrink-0 items-center gap-1">`),kQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),AQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><rect x=2 y=2.5 width=12 height=11 rx=1.5></rect><path d="m2 10.5 3.5-3 3 2.5 3-2 2.5 2"></path><circle cx=6 cy=6 r=1 fill=currentColor stroke=none>`),jQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 2.5v8M4.5 7.5 8 11l3.5-3.5M2.5 13.5h11">`),MQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M2.5 4h11M6.5 4V2.5h3V4M4 4l.7 9a1.5 1.5 0 0 0 1.5 1.4h3.6A1.5 1.5 0 0 0 11.3 13l.7-9M6.5 7v4.5M9.5 7v4.5">`),NQ=N(`<div class="bg-surface border-border flex flex-col gap-2 rounded-lg border p-2.5"><img alt="Screen recording preview"class="border-border bg-bg max-h-44 w-full rounded-md border object-contain"><span class="text-text-faint text-[10.5px] tabular-nums"> KB · <!>s · <!>×</span><label class="flex cursor-pointer items-center gap-2 select-none"><input type=checkbox class="accent-accent rounded"><span class="text-text text-[12px]">Attach to issue on create</span></label><div class="flex items-center gap-1">`),PQ=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M6.5 9.5 9.5 6.5M7.5 4.5 9 3a2.5 2.5 0 0 1 3.5 3.5L11 8M8.5 11.5 7 13a2.5 2.5 0 0 1-3.5-3.5L5 8">`);function FQ(e){return(()=>{var t=pQ(),n=t.firstChild;n.firstChild;var r=n.nextSibling;return P(n,()=>e.title,null),P(n,j(M,{get when(){return e.badge},get children(){var t=fQ();return P(t,()=>e.badge),t}}),null),P(r,()=>e.children),t})()}function IQ(){let e=sr(),t=_r(()=>({queryKey:[`grab`],queryFn:Dr})),n=_r(()=>({queryKey:[`settings`],queryFn:Tr})),r=()=>t.data??[],i=()=>!!(n.data?.linearApiKey||n.data?.linearAccessToken),[a,o]=T(null),s=()=>{o(null),oQ().catch(e=>{o(e instanceof Error&&e.message?e.message:`Cannot activate the picker — open your dev app in the active tab first.`)})},c=async()=>{await jr(),e.invalidateQueries({queryKey:[`grab`]})},[l,u]=T(!1),d=async()=>{let e=(r()??[]).map(e=>`- <${e.componentName??e.tagName??`element`}>${e.source?.filePath?` — ${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}`:``}${e.screenshotDataUrl?` (screenshot captured — use Copy PNG to paste it)`:``}`),t=`Captured on ${r()?.[0]?.pageUrl??location.href}:\n${e.join(`
274
+ `)}`;try{await navigator.clipboard.writeText(t),u(!0),setTimeout(()=>u(!1),1800)}catch{}},[f,p]=T(null),m=async(e,t)=>{try{await navigator.clipboard.write([new ClipboardItem({"image/png":sj(t)})]),p(e),setTimeout(()=>p(null),1800)}catch{}},[h,g]=T(null),_=async e=>{try{await navigator.clipboard.writeText(hD(e,n.data??{})),g(e.grabbedAt),setTimeout(()=>g(null),1800)}catch{o(`Clipboard was blocked — click the button again.`)}},v=async t=>{await Ar(t),e.invalidateQueries({queryKey:[`grab`]})},[y,b]=T(!1),x=async()=>{o(null),b(!0),window.dispatchEvent(new CustomEvent(ZZ));try{let e=await dQ();e?await kr([e]):o(`Region capture failed or was cancelled. On heavy pages a "share this tab" prompt appears — pick THIS tab to capture. Details in the console ([linear-grab]).`)}finally{b(!1),window.dispatchEvent(new CustomEvent(`linear-grab:picker-finished`))}},[S,C]=T(KD());ae(qD(C));let[w,E]=T(0);O(()=>{if(S().phase!==`recording`)return;let e=setInterval(()=>E(Date.now()-(KD().startedAt??Date.now())),250);ae(()=>clearInterval(e))});let k=e=>{let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},[ee,te]=T(`idle`),[A,ne]=T(null),re=async()=>{let e=KD().result;if(!e)throw Error(`No recording available.`);if(e.assetUrl)return e.assetUrl;let t=await Promise.race([jO(e.blob,`recording-${Date.now()}.gif`),new Promise((e,t)=>setTimeout(()=>t(Error(`upload timed out`)),6e4))]);return sO(t),t},ie=async()=>{ne(null),te(`busy`);try{let e=re().then(e=>new Blob([`![Screen recording](${e})`],{type:`text/plain`}));try{await navigator.clipboard.write([new ClipboardItem({"text/plain":e})])}catch{let t=await e;await navigator.clipboard.writeText(await t.text())}te(`copied`),setTimeout(()=>te(`idle`),2e3)}catch{te(`idle`),await le(),ne(`Direct upload is blocked in this browser — copied the GIF instead. Paste it into a Linear comment and Linear uploads it.`)}},oe=()=>{let e=S().result;if(!e)return;let t=document.createElement(`a`);t.href=e.url,t.download=`linear-grab-recording.gif`,t.click()},[se,ce]=T(`idle`),le=async()=>{let e=S().result;if(e){ne(null),ce(`busy`);try{try{await navigator.clipboard.write([new ClipboardItem({"image/gif":e.blob})])}catch{let t=await createImageBitmap(e.blob),n=document.createElement(`canvas`);n.width=t.width,n.height=t.height,n.getContext(`2d`).drawImage(t,0,0);let r=await new Promise((e,t)=>n.toBlob(n=>n?e(n):t(Error(`PNG encode failed`)),`image/png`));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]),ne(`Browser blocks GIF clipboard — copied the first frame as PNG. Use Download for the animation.`)}ce(`copied`),setTimeout(()=>ce(`idle`),2e3)}catch(e){ce(`idle`),ne(e instanceof Error?e.message:`Copy failed.`)}}};return(()=>{var e=CQ();return P(e,j(FQ,{title:`Captured elements`,get badge(){return $e(()=>!!r().length)()?`${r().length}/8`:void 0},get children(){return[j(M,{get when(){return r().length>0},get fallback(){return j(Kj,{title:`No elements captured`,children:`Click "Pick element" below, then use the react-grab overlay on your dev app. Every pick ADDS to this list — Shift+click or drag in the overlay selects several at once. Source info needs a dev build.`})},get children(){var e=gQ(),t=e.firstChild,n=t.firstChild.nextSibling;return P(e,j(We,{get each(){return r()},children:e=>(()=>{var t=OQ(),n=t.firstChild.firstChild,r=n.nextSibling;return P(n,(()=>{var t=$e(()=>!!e.componentName);return()=>t()?`<${e.componentName}>`:$e(()=>!!e.tagName)()?`<${e.tagName}>`:`Element`})()),P(r,j(q,{class:`size-7 px-0`,variant:`ghost`,title:`Copy context for a local agent (Claude Code / Cursor) — includes skills & memory paths`,"aria-label":`Copy context`,onClick:()=>void _(e),get children(){return j(M,{get when(){return h()===e.grabbedAt},get fallback(){return kQ()},get children(){return wQ()}})}}),null),P(r,j(M,{get when(){return e.screenshotDataUrl},get children(){return j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return f()===e.grabbedAt?`Copied!`:`Copy PNG — paste into Claude Code, Linear, Slack…`},"aria-label":`Copy capture as PNG`,onClick:()=>void m(e.grabbedAt,e.screenshotDataUrl),get children(){return j(M,{get when(){return f()===e.grabbedAt},get fallback(){return AQ()},get children(){return wQ()}})}})}}),null),P(r,j(q,{class:`size-7 px-0`,variant:`ghost`,title:`Remove this element`,"aria-label":`Remove element`,onClick:()=>void v(e.grabbedAt),get children(){return TQ()}}),null),P(t,j(M,{get when(){return e.source?.filePath},get children(){var t=EQ();return P(t,()=>e.source.filePath,null),P(t,(()=>{var t=$e(()=>e.source?.lineNumber!=null);return()=>t()?`:${e.source.lineNumber}`:``})(),null),t}}),null),P(t,j(M,{get when(){return e.screenshotDataUrl},get children(){var t=DQ();return D(()=>it(t,`src`,e.screenshotDataUrl)),t}}),null),t})()}),t),P(e,j(M,{get when(){return new Set(r().filter(e=>e.source?.filePath).map(e=>`${e.source.filePath}:${e.source.lineNumber??``}`)).size<r().filter(e=>e.source?.filePath).length},get children(){return mQ()}}),t),P(n,j(q,{class:`h-6 shrink-0 px-2 text-[11px]`,variant:`ghost`,title:`Copy all captures as plain text — paste into a Claude Code session`,onClick:()=>void d(),get children(){var e=hQ();return P(e,()=>l()?`Copied ✓`:`Copy all`),e}}),null),P(n,j(q,{class:`h-6 shrink-0 px-2 text-[11px]`,variant:`ghost`,onClick:c,children:`Clear all`}),null),e}}),(()=>{var e=_Q(),t=e.firstChild;return P(t,j(q,{variant:`primary`,class:`min-w-0 flex-1`,onClick:s,children:`Pick element`}),null),P(t,j(M,{when:!xr,get children(){return j(q,{variant:`ghost`,class:`min-w-0 flex-1`,get loading(){return y()},title:`Drag a rectangle over any part of the page — the shot attaches to the issue`,onClick:()=>void x(),children:`Capture region`})}}),null),P(e,j(M,{get when(){return a()},get children(){return j(qj,{get message(){return a()}})}}),null),e})()]}}),null),P(e,j(FQ,{title:`Recording`,get badge(){return $e(()=>!!S().result)()?`${(S().result.durationMs/1e3).toFixed(1)}s`:void 0},get children(){return[j(M,{get when(){return S().phase===`idle`||S().phase===`error`},get children(){var e=yQ(),t=e.firstChild;return P(e,j(q,{variant:`ghost`,onClick:()=>void rO(),get children(){return[vQ(),` Record interaction`]}}),t),P(e,j(M,{get when(){return $e(()=>S().phase===`error`)()&&S().error},get children(){return j(qj,{get message(){return S().error}})}}),null),e}}),j(M,{get when(){return S().phase===`recording`},get children(){var e=xQ(),t=e.firstChild.nextSibling;return t.nextSibling,P(t,()=>k(w())),P(e,j(q,{variant:`primary`,class:`ml-auto`,onClick:()=>void iO(),get children(){return bQ()}}),null),e}}),j(M,{get when(){return S().phase===`processing`},get children(){var e=SQ(),t=e.firstChild;return P(e,j(Fj,{}),t),e}}),j(M,{get when(){return $e(()=>S().phase===`ready`)()&&S().result},children:e=>(()=>{var t=NQ(),n=t.firstChild,r=n.nextSibling,a=r.firstChild,o=a.nextSibling,s=o.nextSibling.nextSibling;s.nextSibling;var c=r.nextSibling,l=c.firstChild,u=c.nextSibling;return P(r,()=>(e().blob.size/1024).toFixed(0),a),P(r,()=>(e().durationMs/1e3).toFixed(1),o),P(r,()=>e().width,s),P(r,()=>e().height,null),l.addEventListener(`change`,e=>oO(e.currentTarget.checked)),P(u,j(q,{variant:`ghost`,class:`size-7 px-0`,get loading(){return ee()===`busy`},get disabled(){return!i()},get title(){return i()?`Copy markdown — uploads to Linear, copies embeddable link`:`Connect Linear in Settings first`},"aria-label":`Copy markdown`,onClick:()=>void ie(),get children(){return j(M,{get when(){return ee()===`copied`},get fallback(){return PQ()},get children(){return wQ()}})}}),null),P(u,j(q,{variant:`ghost`,class:`size-7 px-0`,get loading(){return se()===`busy`},title:`Copy GIF — paste into a Linear comment and Linear uploads it`,"aria-label":`Copy GIF`,onClick:()=>void le(),get children(){return j(M,{get when(){return se()===`copied`},get fallback(){return kQ()},get children(){return wQ()}})}}),null),P(u,j(q,{variant:`ghost`,class:`size-7 px-0`,title:`Download GIF`,"aria-label":`Download GIF`,onClick:oe,get children(){return jQ()}}),null),P(u,j(q,{variant:`danger`,class:`ml-auto size-7 px-0`,title:`Discard recording`,"aria-label":`Discard recording`,onClick:aO,get children(){return MQ()}}),null),P(t,j(M,{get when(){return A()},get children(){return j(qj,{get message(){return A()}})}}),null),D(()=>it(n,`src`,e().url)),D(()=>l.checked=S().attachOnCreate),t})()})]}}),null),e})()}function LQ(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function RQ(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function zQ(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var BQ=(e,t)=>Math.abs(e-t)<1.01,VQ=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},HQ,UQ=()=>{if(HQ!==void 0)return HQ;if(typeof navigator>`u`)return HQ=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return HQ=!0;let e=navigator.maxTouchPoints;return HQ=navigator.platform===`MacIntel`&&e!==void 0&&e>0},WQ=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},GQ=e=>e,KQ=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},qQ=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(WQ(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(WQ(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},JQ={passive:!0},YQ=typeof window>`u`||`onscrollend`in window,XQ=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&YQ,o=0,s=a?null:VQ(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,JQ),a&&r.addEventListener(`scrollend`,u,JQ),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},ZQ=(e,t)=>XQ(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),QQ=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},$Q=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},e$=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:GQ,rangeExtractor:KQ,onChange:()=>{},measureElement:QQ,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=RQ(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!UQ()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,JQ),e.addEventListener(`touchend`,n,JQ),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(UQ()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=RQ(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=RQ(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=LQ(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=RQ(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=r$(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=RQ(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=RQ(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return zQ(t[t$(0,t.length-1,r?e=>n[e*2]:e=>zQ(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(UQ()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&BQ(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},t$=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function n$(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function r$(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=n$(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=t$(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}function i$(e){let t=Ve(e),n=new e$(t),[r,i]=tr(n.getVirtualItems()),[a,o]=T(n.getTotalSize()),s=new Proxy(n,{get(e,t){switch(t){case`getVirtualItems`:return()=>r;case`getTotalSize`:return()=>a();default:return Reflect.get(e,t)}}});return s.setOptions(t),ie(()=>{let e=s._didMount();s._willUpdate(),ae(e)}),E(()=>{s.setOptions(Ve(t,e,{onChange:(t,n)=>{var r;t._willUpdate(),i(ar(t.getVirtualItems(),{key:`index`})),o(t.getTotalSize()),(r=e.onChange)==null||r.call(e,t,n)}})),s._willUpdate(),i(ar(n.getVirtualItems(),{key:`index`})),o(n.getTotalSize())}),s}function a$(e){return i$(Ve({observeElementRect:qQ,observeElementOffset:ZQ,scrollToFn:$Q},e))}Br();var o$=3e4,s$=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i,c$={running:[],review:[]},l$=null,u$=new Set;function d$(e){return u$.add(e),l$||(l$=setInterval(()=>void m$(),o$),m$()),()=>{u$.delete(e),!u$.size&&l$&&(clearInterval(l$),l$=null)}}function f$(){m$()}function p$(e){return{id:e.id,identifier:e.identifier,title:e.title,stateName:e.state.name,stateColor:e.state.color,delegateName:e.delegate?.displayName??`Agent`,updatedAt:e.updatedAt,prUrl:e.attachments?.find(e=>s$.test(e.url))?.url}}async function m$(){try{let e=await Tr();if(!e.linearApiKey&&!e.linearAccessToken)return;let t=(await gO()).filter(e=>!!e.delegate&&e.state.type===`started`).map(p$);c$={running:t.filter(e=>!e.prUrl),review:t.filter(e=>!!e.prUrl)};for(let e of u$)e(c$)}catch{}}var h$=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M2.5 8a5.5 5.5 0 1 1 1.6 3.9"></path><path d="M2.5 12.5V8.9h3.6">`),g$=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="m2.5 4 3.5 4-3.5 4M8 12.5h5.5">`),_$=N(`<pre class="font-mono max-h-56 overflow-auto px-2.5 py-2 pr-3 text-[10px] leading-relaxed whitespace-pre-wrap"style=background:#0b0c0e;color:#8b8e98>`),v$=N(`<div class="border-border overflow-clip rounded-lg border"><div class="bg-surface-2 flex h-8 items-center gap-2 pl-2.5 pr-1.5"><span class="text-[11px] font-medium"></span><span class="text-text-faint font-mono text-[10px]"></span><span class=ml-auto>`),y$=N(`<span aria-hidden class="size-2 shrink-0 rounded-full">`),b$=N(`<p class="text-text-faint px-2.5 py-2 text-[10.5px]">No deployment URL yet — logs appear once Vercel picks up the branch.`);function x$(e){let t=sr(),n=_r(()=>({queryKey:[`stage-status`,e.url,e.base],queryFn:()=>XO(e.url,e.base),refetchInterval:e=>e.state.data?.state===`success`||e.state.data?.state===`failure`||e.state.data?.state===`error`?!1:8e3,retry:0})),r=()=>![`success`,`failure`,`error`].includes(n.data?.state??`pending`),[i,a]=T(!1),o=_r(()=>({queryKey:[`deploy-logs`,n.data?.url??e.url],queryFn:()=>ZO(n.data.url),enabled:i()&&!!n.data?.url,refetchInterval:()=>r()?1e4:!1,retry:0})),s,c=!0;O(()=>{o.data?.logs,!(!s||!c)&&requestAnimationFrame(()=>{s&&(s.scrollTop=s.scrollHeight)})});let l=vr(()=>({mutationFn:()=>QO(e.url,e.base),onSuccess:()=>void t.invalidateQueries({queryKey:[`stage-status`,e.url,e.base]})})),u=()=>{let e=n.data?.state;return e===`success`?{label:`Ready`,color:`var(--color-success)`}:e===`failure`||e===`error`?{label:`Failed`,color:`var(--color-danger)`}:e===`none`||e===`unknown`?{label:`Waiting for deploy…`,color:`var(--color-text-dim)`}:{label:`Building…`,color:`var(--color-accent)`}};return(()=>{var t=v$(),d=t.firstChild,f=d.firstChild,p=f.nextSibling;return p.nextSibling,P(d,j(M,{get when(){return r()},get fallback(){return(()=>{var e=y$();return D(t=>dt(e,`background`,u().color)),e})()},get children(){return j(Fj,{size:11})}}),f),P(f,()=>u().label),P(p,()=>e.base,null),P(p,(()=>{var e=$e(()=>!!n.data?.sha);return()=>e()?` @ ${n.data.sha}`:``})(),null),P(d,j(M,{get when(){return $e(()=>n.data?.state===`success`)()&&n.data?.url},get children(){return j(Vj,{get href(){return n.data.url},class:`shrink-0`,title:`Open the staging deployment`,children:`Open`})}}),null),P(d,j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get loading(){return l.isPending},get title(){return`Reset ${e.base} — delete + recreate from the default branch (drifted or conflicted staging)`},"aria-label":`Reset staging branch`,onClick:()=>l.mutate(),get children(){return h$()}}),null),P(d,j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return i()?`Hide build logs`:`Show build logs (vercel inspect --logs via the bridge)`},get"aria-label"(){return i()?`Hide build logs`:`Show build logs`},onClick:()=>a(e=>!e),get children(){return g$()}}),null),P(t,j(M,{get when(){return i()},get children(){return j(M,{get when(){return n.data?.url},get fallback(){return b$()},get children(){var e=_$();e.addEventListener(`scroll`,()=>{s&&(c=s.scrollTop+s.clientHeight>=s.scrollHeight-40)});var t=s;return typeof t==`function`?pt(t,e):s=e,P(e,j(M,{get when(){return o.data},get fallback(){return j(Fj,{size:12})},get children(){return o.data.logs||`No log output.`}})),e}})}}),null),D(e=>dt(f,`color`,u().color)),t})()}Br();function S$(e,t=6e3){return Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(Error(`upload timeout`)),t))])}async function C$(){let e=[],t=[];for(let n of await Dr()??[]){let r=n.source?.filePath?` — \`${n.source.filePath}${n.source.lineNumber==null?``:`:${n.source.lineNumber}`}\``:``;if(e.push(`- \`<${n.componentName??n.tagName??`element`}>\`${r}`),n.screenshotDataUrl)try{let t=await S$(jO(sj(n.screenshotDataUrl),`capture-${n.grabbedAt}.png`),15e3);e.push(` ![capture](${t})`)}catch{t.push(`element screenshot upload failed — the ref line still landed`)}}let n=KD();if(n.result)try{let t=n.result.assetUrl??await S$(jO(n.result.blob,`recording-${Date.now()}.gif`),6e4);sO(t),e.push(`![recording](${t})`)}catch(e){t.push(`recording upload failed (${e instanceof Error?e.message:`error`}) — Copy GIF from the Capture tab and paste it instead`)}return{block:e.length?`Captured context:\n${e.join(`
275
+ `)}`:null,failed:t}}function w$(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var T$=/^(https?:\/\/|mailto:)/i,E$=/\.(mp4|mov|webm|m4v)(\?|#|$)/i,D$=/\.(png|jpe?g|gif|webp|avif|svg)(\?|#|$)/i,O$=class extends HTMLElement{objectUrl=null;connectedCallback(){let e=this.getAttribute(`src`)??``,t=this.getAttribute(`alt`)??``;(async()=>{try{let n=await fetch(e);if(!n.ok)throw Error(String(n.status));let r=await n.blob();if(this.objectUrl=URL.createObjectURL(r),this.textContent=``,r.type.startsWith(`video/`)){let e=document.createElement(`video`);e.controls=!0,e.preload=`metadata`,e.src=this.objectUrl,this.appendChild(e)}else{let e=document.createElement(`img`);e.src=this.objectUrl,e.alt=t,this.appendChild(e)}}catch{this.textContent=``;let e=document.createElement(`span`);e.textContent=`🖼 ${t||`media`} — start the bridge (npx linear-grab-bridge) to view Linear-hosted media here`,e.style.cssText=`font-size:10.5px;color:var(--color-text-faint);`,this.appendChild(e)}})()}disconnectedCallback(){this.objectUrl&&URL.revokeObjectURL(this.objectUrl)}};typeof customElements<`u`&&!customElements.get(`lg-media`)&&customElements.define(`lg-media`,O$);var k$=null;function A$(e){k$=e?e.replace(/\/$/,``):null}function j$(e){try{if(k$&&new URL(e).hostname.endsWith(`uploads.linear.app`))return`${k$}/fetch?url=${encodeURIComponent(e)}`}catch{}return e}function M$(e){let t=e;return t=t.replace(/`([^`]+)`/g,(e,t)=>`<code>${t}</code>`),t=t.replace(/!\[([^\]]*)\]\((?:&lt;)?([^()\s]+?)(?:&gt;)?\)/g,(e,t,n)=>{if(!T$.test(n))return t;let r=j$(n);return E$.test(n)?`<video controls preload="metadata" src="${r}"></video>`:r!==n&&!D$.test(n)?`<lg-media src="${r}" alt="${t}"></lg-media>`:`<img src="${r}" alt="${t}" loading="lazy" />`}),t=t.replace(/\[([^\]]+)\]\((?:&lt;)?([^()\s]+?)(?:&gt;)?\)/g,(e,t,n)=>T$.test(n)?`<a href="${n}" target="_blank" rel="noopener noreferrer">${t}</a>`:t),t=t.replace(/&lt;(https?:\/\/[^\s&]+)&gt;/g,`<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>`),t=t.replace(/(^|[\s(])((?:https?:\/\/)[^\s<>()"']+)/g,(e,t,n)=>`${t}<a href="${n}" target="_blank" rel="noopener noreferrer">${n}</a>`),t=t.replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|\W)\*([^*\n]+)\*(?=\W|$)/g,`$1<em>$2</em>`),t}function N$(e){let t=w$(e.trim()).split(`
266
276
  `),n=[],r=0;for(;r<t.length;){let e=t[r];if(!e.trim()){r++;continue}if(e.startsWith("```")){let e=[];for(r++;r<t.length&&!t[r].startsWith("```");)e.push(t[r++]);r++,n.push(`<pre><code>${e.join(`
267
- `)}</code></pre>`);continue}let i=e.match(/^(#{1,6})\s+(.*)$/);if(i){n.push(`<h4>${S$(i[2])}</h4>`),r++;continue}if(/^\s*[-*]\s+/.test(e)){let e=[];for(;r<t.length&&/^\s*[-*]\s+/.test(t[r]);)e.push(`<li>${S$(t[r].replace(/^\s*[-*]\s+/,``))}</li>`),r++;n.push(`<ul>${e.join(``)}</ul>`);continue}if(/^\s*\d+[.)]\s+/.test(e)){let e=[];for(;r<t.length&&/^\s*\d+[.)]\s+/.test(t[r]);)e.push(`<li>${S$(t[r].replace(/^\s*\d+[.)]\s+/,``))}</li>`),r++;n.push(`<ol>${e.join(``)}</ol>`);continue}let a=[];for(;r<t.length&&t[r].trim()&&!/^(#{1,6}\s|```|\s*[-*]\s+|\s*\d+[.)]\s+)/.test(t[r]);)a.push(t[r]),r++;n.push(`<p>${S$(a.join(`<br />`))}</p>`)}return n.join(``)}Br();var w$=N(`<div class="lg-md text-text text-[12px] leading-relaxed break-words">`),T$=N(`<div class="flex h-full flex-col">`),E$=N(`<span class="tabular-nums text-[10.5px] text-text-faint">live · updated `),D$=N(`<svg aria-hidden width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M1 4.5A7 7 0 0 1 13.5 3"></path><path d="M15 11.5A7 7 0 0 1 2.5 13"></path><polyline points="1 1 1 5 5 5"></polyline><polyline points="15 11 15 15 11 15">`),O$=N(`<div class="flex-1 overflow-y-auto">`),k$=N(`<div class="min-h-0 flex-1 overflow-y-auto pl-2 pr-3"><div style=position:relative>`),A$=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">My issues</span><div class="flex items-center gap-2"></div></div><div class="border-border flex shrink-0 items-center gap-1 border-b px-3 py-1.5">`),j$=N(`<button>`),M$=N(`<div style=position:absolute;top:0;left:0;width:100%>`),N$=N(`<button class="w-full cursor-pointer rounded-md px-2 py-1.5 text-left hover:bg-surface-2 transition-colors"><div class="flex items-center gap-1.5 min-w-0"><span class="font-mono text-[11px] text-text-dim shrink-0"></span><span class="truncate text-[12.5px] text-text"></span></div><div class="mt-0.5 flex items-center gap-1.5"><span class="ml-auto tabular-nums text-[10.5px] text-text-faint">`),P$=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M10.5 3.5 6 8l4.5 4.5">`),F$=N(`<span class="font-mono text-[11px] text-text-dim shrink-0">`),I$=N(`<span class="truncate text-[12px] font-medium text-text">`),L$=N(`<span class="text-[11.5px] text-text-faint">Loading…`),R$=N(`<div class="flex items-center gap-2"><span class="text-[11px] text-text-dim">`),z$=N(`<div class="flex flex-col gap-2">`),B$=N(`<div class="flex flex-col gap-1"><span class="text-[10.5px] font-semibold uppercase tracking-wide text-text-dim">Attachments</span><div class="flex flex-col gap-1">`),V$=N(`<div class="flex flex-col gap-2.5"><span class="text-[10.5px] font-semibold uppercase tracking-wide text-text-dim">Comments`),H$=N(`<option value=local>Message local Claude Code session`),U$=N(`<option value=new>Start NEW agent (@<!>)`),W$=N(`<option value=comment>Comment only`),G$=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=2.2></circle><path d="M8 1v3M8 12v3M1 8h3M12 8h3">`),K$=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3 y=3 width=10 height=10 rx=1.5>`),q$=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M13 7.5 8.2 12.3a3.2 3.2 0 0 1-4.5-4.5L8.9 2.6a2.1 2.1 0 0 1 3 3L7.1 10.4a1 1 0 0 1-1.5-1.5l4.3-4.3">`),J$=N(`<span class="inline-block min-w-[4ch] text-left">Send`),Y$=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 flex-col gap-1 border-b px-3 py-2"><div class="flex items-center gap-2"></div></div><div class="min-h-0 flex-1 overflow-y-auto pl-3 pr-4 py-3 flex flex-col gap-3"></div><div class="border-border shrink-0 border-t p-2.5 flex flex-col gap-1.5"><div class="flex items-center gap-2">`),X$=N(`<option selected>`),Z$=N(`<svg width=10 height=10 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3 y=3 width=10 height=10 rx=1.5>`),Q$=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=currentColor aria-hidden><path d="M4.5 2.8a.8.8 0 0 1 1.22-.68l8 5.2a.8.8 0 0 1 0 1.36l-8 5.2a.8.8 0 0 1-1.22-.68V2.8Z">`),$$=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="m2.5 4 3.5 4-3.5 4M8 12.5h5.5">`),e1=N(`<div class="bg-surface border-border overflow-clip rounded-lg border"><div class="border-border flex h-9 min-w-0 items-center justify-between gap-2 border-b px-3"><div class="flex min-w-0 items-center gap-1.5 text-[11.5px] font-medium"><span aria-hidden class="text-text-dim inline-flex"></span><span class="text-text shrink-0">Local Claude Code</span><span class="text-text-dim shrink-0">started by you</span><span class="text-text-faint shrink-0 tabular-nums">· </span></div></div><div class="flex h-9 items-center gap-1 pr-2"><button class="hover:bg-surface-2 flex h-full min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-3 text-left transition-colors"title="Open the live thread in the Local tab"><span></span><span class="text-text-faint min-w-0 flex-1 truncate text-[11.5px]"></span><svg width=14 height=14 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class="text-text-dim shrink-0"><path d="m6 3.5 4.5 4.5L6 12.5">`),t1=N(`<option>`),n1=N(`<div class="flex flex-col gap-1.5">`),r1=N(`<span class="text-success text-[11px]">✓`),i1=N(`<span class="inline-block min-w-[6ch] text-center">Merge`),a1=N(`<div class="flex min-w-0 items-center gap-1.5"><a target=_blank rel=noreferrer class="text-accent min-w-0 truncate text-[11.5px] hover:underline">`),o1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 2 14 5.5 8 9 2 5.5 8 2Z"></path><path d="M2 10.5 8 14l6-3.5">`),s1=N(`<div class="flex flex-col gap-0.5"><div class="flex items-center gap-1.5"><span class="text-[11px] font-medium text-text-dim"></span><span class="ml-auto tabular-nums text-[10.5px] text-text-faint">`),c1=N(`<option>Steer running agent<!> · `),l1=N(`<span class="bg-danger inline-block size-2.5 rounded-full"aria-hidden>`),u1=N(`<span class="text-[11px] text-text-dim">`),d1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class=transition-transform><path d="m3.5 6.5 4.5 4 4.5-4">`),f1=N(`<p class="text-[12px] text-text leading-relaxed whitespace-pre-wrap break-words">`),p1=N(`<div class="border-border mt-0.5 flex flex-col gap-1 overflow-y-auto border-t pt-1.5 pl-0.5 pr-3">`),m1=N(`<div class="bg-surface border-border rounded-lg border p-2.5 flex flex-col gap-1.5"><div class="flex items-center gap-1.5 flex-wrap"><span class="ml-auto tabular-nums text-[10.5px] text-text-faint">`),h1=N(`<p class="font-mono text-text-faint text-[10.5px] leading-relaxed break-words">→ <!> `),g1=N(`<div>`);function _1(e){let t=k(()=>C$(e.text));return(()=>{var e=w$();return D(()=>e.innerHTML=t()),e})()}function v1(){let[e,t]=T(null);return O(()=>{let e=oj();e&&(t(e),lj())}),(()=>{var n=T$();return P(n,j(M,{get when(){return e()===null},get fallback(){return j(x1,{get issueId(){return e()},onBack:()=>t(null)})},get children(){return j(y1,{onSelect:e=>t(e)})}})),n})()}function y1(e){let t,n=_r(()=>({queryKey:[`my-issues`],queryFn:mO,refetchInterval:12e3})),r=_r(()=>({queryKey:[`bridge-tasks`],queryFn:FO,refetchInterval:1e4,retry:0})),i=e=>(r.data??[]).some(t=>t.title.startsWith(e.identifier)),a=e=>e.state.type===`started`&&e.attachments?.some(e=>/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url)),o=[{id:`all`,label:`All`},{id:`active`,label:`In Progress`},{id:`review`,label:`Review`},{id:`done`,label:`Done`},{id:`cloud`,label:`Cloud`},{id:`local`,label:`Local`}],[s,c]=br(`issues:filter`,`all`),[l,u]=br(`issues:search`,``),d=k(()=>{let e=l().trim().toLowerCase();return(n.data??[]).filter(t=>{if(e&&!`${t.identifier} ${t.title}`.toLowerCase().includes(e))return!1;switch(s()){case`active`:return t.state.type===`started`;case`review`:return!!a(t);case`done`:return t.state.type===`completed`;case`cloud`:return!!t.delegate;case`local`:return i(t);default:return!0}})}),f=YQ({get count(){return d().length},getScrollElement:()=>t,estimateSize:()=>56,overscan:5});return(()=>{var r=A$(),a=r.firstChild,p=a.firstChild.nextSibling,m=a.nextSibling;return P(p,j(M,{get when(){return n.dataUpdatedAt>0},get children(){var e=E$();return e.firstChild,P(e,()=>Gj(n.dataUpdatedAt),null),e}}),null),P(p,j(q,{class:`size-7 px-0`,get loading(){return n.isFetching},onClick:()=>void n.refetch(),title:`Refresh`,"aria-label":`Refresh issues`,get children(){return D$()}}),null),P(m,j(We,{each:o,children:e=>(()=>{var t=j$();return t.$$click=()=>c(e.id),P(t,()=>e.label),D(()=>st(t,`h-6 shrink-0 cursor-pointer rounded-md px-2 text-[11px] font-medium transition-colors ${s()===e.id?`bg-accent-soft text-accent`:`text-text-dim hover:bg-surface-2`}`)),t})()}),null),P(m,j(Mj,{class:`ml-auto h-6 w-28 text-[11px]`,placeholder:`Search…`,get value(){return l()},onInput:e=>u(e.currentTarget.value)}),null),P(r,j(M,{get when(){return n.isError},get children(){var e=O$();return P(e,j(Hj,{title:`Connect Linear in Settings`,get children(){return n.error?.message??`Unable to load issues.`}})),e}}),null),P(r,j(M,{get when(){return $e(()=>!n.isError&&!n.isPending)()&&d().length===0},get children(){var e=O$();return P(e,j(Hj,{title:`No issues found`,children:`Issues you create will appear here.`})),e}}),null),P(r,j(M,{get when(){return $e(()=>!n.isError)()&&d().length>0},get children(){var n=k$(),r=n.firstChild,a=t;return typeof a==`function`?pt(a,n):t=n,P(r,j(We,{get each(){return f.getVirtualItems()},children:t=>{let n=k(()=>d()[t.index]);return j(M,{get when(){return n()},get children(){var r=M$();return P(r,j(b1,{get issue(){return n()},get local(){return i(n())},get onSelect(){return e.onSelect}})),D(e=>dt(r,`transform`,`translateY(${t.start}px)`)),r}})}})),D(e=>dt(r,`height`,`${f.getTotalSize()}px`)),n}}),null),r})()}function b1(e){return(()=>{var t=N$(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling,o=a.firstChild;return t.$$click=()=>e.onSelect(e.issue.id),P(n,j(Vj,{get color(){return e.issue.state.color}}),r),P(r,()=>e.issue.identifier),P(i,()=>e.issue.title),P(a,j(Bj,{get children(){return e.issue.state.name}}),o),P(a,j(M,{get when(){return e.issue.delegate},get children(){return j(Bj,{class:`text-accent`,get children(){return[j(Fj,{}),` `,$e(()=>e.issue.delegate.displayName)]}})}}),o),P(a,j(M,{get when(){return e.local},get children(){return j(Bj,{class:`text-accent`,get children(){return[j(Ij,{}),` local`]}})}}),o),P(a,j(M,{get when(){return $e(()=>!!(e.issue.state.type===`started`&&e.issue.delegate))()&&e.issue.attachments?.some(e=>/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url))},get children(){return j(Bj,{color:`var(--color-warn)`,children:`needs review`})}}),o),P(o,()=>Gj(e.issue.updatedAt)),t})()}function x1(e){let t=sr(),n=_r(()=>({queryKey:[`issue`,e.issueId],queryFn:()=>hO(e.issueId),refetchInterval:8e3,enabled:!!e.issueId})),r=_r(()=>({queryKey:[`sessions`,e.issueId],queryFn:()=>_O(e.issueId),refetchInterval:8e3,enabled:!!e.issueId})),i=_r(()=>({queryKey:[`settings`],queryFn:Tr})),a=_r(()=>({queryKey:[`bridge-tasks`],queryFn:FO,refetchInterval:5e3,retry:0})),o=[{id:``,label:`Default model`},{id:`fable`,label:`Fable 5`},{id:`opus`,label:`Opus`},{id:`sonnet`,label:`Sonnet`},{id:`haiku`,label:`Haiku`}],s=vr(()=>({mutationFn:async t=>{let r=n.data?.attachments.find(e=>/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url)),i=r?se.data?.previews[r.url]:void 0,a=[...t.activities].reverse().find(e=>e.content.__typename===`AgentActivityResponseContent`)?.content.body,o=[`✅ **Closeout** (posted from the panel — one-click acceptance)`,``,`**Fix:** ${(t.summary??a??`Fix complete — see the PR.`).slice(0,600)}`,``,...r?[`**PR:** ${r.url}`]:[],...i?[`**Deploy preview:** ${i}`]:[],``,`**DEFINITION OF DONE — acceptance checklist**`,`- [x] PR opened and linked${r?` — ${r.url}`:``}`,i?`- [x] Deploy-preview URL included (above)`:`- [ ] Deploy-preview URL — none found on the PR`,`- [x] Issue moved to review state (this action)`,`- [ ] Demo media on the issue — attach from the PR/agent artifacts if recorded`];await TO(e.issueId,o.join(`
268
- `),t.comment?.id??void 0);let s=n.data?.team?.id;if(s){let t=await bO(s),n=t.find(e=>e.type===`started`&&/review/i.test(e.name))??t.filter(e=>e.type===`completed`).sort((e,t)=>e.position-t.position)[0];n&&await xO(e.issueId,n.id)}},onSuccess:()=>{t.invalidateQueries({queryKey:[`issue`,e.issueId]}),t.invalidateQueries({queryKey:[`sessions`,e.issueId]})}})),c=vr(()=>({mutationFn:e=>zO(e.id,e.model),onSuccess:e=>{t.setQueryData([`bridge-tasks`],t=>t?.map(t=>t.id===e.id?e:t))}})),l=vr(()=>({mutationFn:e=>RO(e,`Continue where you left off. If the work is already complete, finish any remaining closeout steps (PR, Linear update, announcement).`),onSuccess:()=>void t.invalidateQueries({queryKey:[`bridge-tasks`]})})),u=vr(()=>({mutationFn:e=>BO(e),onSuccess:()=>void t.invalidateQueries({queryKey:[`bridge-tasks`]})})),[d,f]=T(!1),p=async e=>{try{await navigator.clipboard.writeText(ZO(e)),f(!0),setTimeout(()=>f(!1),1800)}catch{}},m=k(()=>{let e=n.data?.identifier;return e?a.data?.find(t=>t.title.startsWith(e)):void 0}),h=e=>e.status===`running`?{word:`Working…`,cls:`text-accent`}:e.status===`done`?{word:`Finished`,cls:`text-success`}:e.status===`stopped`?{word:`Stopped`,cls:`text-warn`}:{word:`Error`,cls:`text-danger`},[g,_]=br(`activity-reply:${e.issueId}`,``),[v,y]=T(null),[b,x]=T(0),S=_r(()=>({queryKey:[`grab`],queryFn:Dr,enabled:uj()===`composer`})),[C,w]=T(!1),E=async()=>{w(!0),y(null);try{let{block:e,failed:t}=await p$();e?_(t=>`${t?`${t}\n`:``}${e}\n`):t.length||y(`Nothing captured yet — pick an element, capture a region, or record first.`),t.length&&y(t.join(` · `))}catch(e){y(e instanceof Error?e.message:`Attach failed.`)}finally{w(!1)}},ee=()=>{if(uj()===`composer`){fj(`capture`);return}x(Date.now()),fj(`composer`),XZ().catch(()=>fj(`capture`))};O(()=>{if(uj()!==`composer`)return;let e=(S.data??[]).filter(e=>e.grabbedAt>b());if(!e.length)return;let t=e.map(e=>{let t=e.source?.filePath?` — \`${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}\``:``;return`- \`<${e.componentName??e.tagName??`element`}>\`${t}`}).join(`
269
- `);_(e=>`${e?`${e}\n`:``}${t}\n`),x(Math.max(...e.map(e=>e.grabbedAt)))});let[te,A]=T(WD());ae(GD(A));let ne=!1;O(()=>{te().phase===`ready`&&ne&&(ne=!1,E())});let re=()=>{te().phase===`recording`?nO():(ne=!0,tO())},ie=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i,oe=k(()=>(n.data?.attachments??[]).map(e=>e.url).filter(e=>ie.test(e))),se=_r(()=>({queryKey:[`pr-status`,oe().sort().join(`|`)],queryFn:()=>WO(oe()),refetchInterval:3e4,retry:0,enabled:oe().length>0})),ce=e=>_e().has(e)?`MERGED`:se.data?.statuses[e],[le,ue]=T(null),de=()=>i.data?.stagingBranch?.trim()||`staging`,[fe,pe]=T(null),[me,he]=T(new Set),ge=async e=>{pe(e);try{await GO(e,de()),he(t=>new Set(t).add(e))}catch{}finally{pe(null)}},[_e,ve]=T(new Set),[ye,be]=T(null),xe=async n=>{be(null),ue(n);try{await YO(n),ve(e=>new Set(e).add(n)),t.invalidateQueries({queryKey:[`issue`,e.issueId]}),t.invalidateQueries({queryKey:[`my-issues`]}),n$()}catch(e){be(e instanceof Error?`${e.message} (bridge must be running; gh needs merge rights)`:`Merge failed.`)}finally{ue(null)}},Se=k(()=>{let e=n.data?DO(n.data.comments):[],t=new Set(e.map(e=>e.id));return[...(r.data??[]).filter(e=>e.comment?.id&&!t.has(e.comment.id)).map(e=>({id:e.comment.id,createdAt:e.updatedAt,body:``,user:{displayName:e.appUser?.displayName??`agent`,app:!0},parent:null})),...e]}),[Ce,we]=T(`comment`),Te=!1,Ee=!1;O(()=>{if(Ee||!n.data||!i.data)return;Ee=!0;let e=Se();e.length?we(`thread:${e[0].id}`):n.data.delegate&&i.data.cursorAgentId&&we(`new`)}),O(()=>{Te||m()&&(Ce()===`comment`||Ce()===`new`)&&we(`local`)}),O(()=>{if(Te)return;let e=Se();e.length&&(Ce()===`comment`||Ce()===`new`)&&we(`thread:${e[0].id}`)});let De=vr(()=>({mutationFn:async()=>{let t=g().trim();if(!t)throw Error(`Message is empty`);let n=i.data??{},r=Ce();if(r===`local`){let n=m();if(!n)throw Error(`Local session not found — is the bridge running?`);await RO(n.id,t),await TO(e.issueId,`🖥️ **→ local agent:** ${t}`).catch(()=>{})}else r.startsWith(`thread:`)?await TO(e.issueId,t,r.slice(7)):r===`new`&&n.cursorAgentId?await EO(e.issueId,t,{name:n.cursorAgentName,displayName:n.cursorAgentName??`Cursor`,url:n.cursorAgentUrl}):await TO(e.issueId,t)},onSuccess:()=>{_(``),y(null),fj(`capture`),t.invalidateQueries({queryKey:[`issue`,e.issueId]}),n$()},onError:e=>{y(e.message??`Failed to send`)}})),Oe=k(()=>n.data),ke=k(()=>r.data??[]);return(()=>{var t=Y$(),r=t.firstChild,a=r.firstChild,f=r.nextSibling,y=f.nextSibling,b=y.firstChild;return P(a,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,title:`Back to issues`,"aria-label":`Back to issues`,"data-tip-pos":`right bottom`,get onClick(){return e.onBack},get children(){return P$()}}),null),P(a,j(M,{get when(){return Oe()},get children(){return[(()=>{var e=F$();return P(e,()=>Oe().identifier),e})(),(()=>{var e=I$();return P(e,()=>Oe().title),e})()]}}),null),P(a,j(M,{get when(){return $e(()=>!!n.isPending)()&&!Oe()},get children(){return L$()}}),null),P(r,j(M,{get when(){return Oe()},get children(){var e=R$(),t=e.firstChild;return P(e,j(Vj,{get color(){return Oe().state.color}}),t),P(t,()=>Oe().state.name),P(e,j(Lj,{get href(){return Oe().url},class:`ml-auto shrink-0`,children:`Open in Linear`}),null),e}}),null),P(f,j(M,{get when(){return m()},children:e=>{let t=()=>h(e());return(()=>{var n=e1(),r=n.firstChild,i=r.firstChild.firstChild,a=i.nextSibling.nextSibling.nextSibling;a.firstChild;var s=r.nextSibling,f=s.firstChild,m=f.firstChild,h=m.nextSibling;return P(i,j(Ij,{size:12})),P(a,()=>Gj(e().startedAt),null),P(r,j(Pj,{class:`h-6 w-auto max-w-[110px] shrink-0 text-[10.5px]`,get value(){return e().pendingModel??e().model??``},onChange:t=>c.mutate({id:e().id,model:t.currentTarget.value}),title:`Model — applies from the next message`,get children(){return[j(We,{each:o,children:t=>(()=>{var n=t1();return P(n,()=>t.label),D(()=>n.selected=(e().pendingModel??e().model??``)===t.id),D(()=>n.value=t.id),n})()}),j(M,{get when(){return!o.some(t=>t.id===(e().pendingModel??e().model??``))},get children(){var t=X$();return P(t,()=>e().pendingModel??e().model),D(()=>t.value=e().pendingModel??e().model??``),t}})]}}),null),f.$$click=()=>cj(`local`),P(f,j(M,{get when(){return e().status===`running`},get children(){return j(jj,{size:12})}}),m),P(m,()=>t().word),P(h,(()=>{var t=$e(()=>e().status===`done`);return()=>t()?e().result??e().lastText:e().lastText})()),P(s,j(M,{get when(){return e().status===`running`},get children(){return j(q,{variant:`danger`,class:`size-6 shrink-0 px-0`,get loading(){return u.isPending},title:`Stop the session — resumable afterwards`,"aria-label":`Stop session`,onClick:()=>u.mutate(e().id),get children(){return Z$()}})}}),null),P(s,j(M,{get when(){return $e(()=>e().status!==`running`)()&&e().sessionId},get children(){return j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get loading(){return l.isPending},get title(){return`Run again — resumes this session${e().pendingModel?` on ${e().pendingModel}`:``}`},"aria-label":`Resume session`,onClick:()=>l.mutate(e().id),get children(){return Q$()}})}}),null),P(s,j(M,{get when(){return e().sessionId},get children(){return j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return d()?`Copied!`:`Copy terminal resume command (claude --resume …)`},"aria-label":`Copy resume command`,onClick:()=>void p(e()),get children(){return $$()}})}}),null),D(()=>st(m,`shrink-0 text-[11.5px] font-medium ${t().cls}`)),n})()}}),null),P(f,j(M,{get when(){return ke().length>0},get children(){var e=z$();return P(e,j(We,{get each(){return ke()},children:e=>(()=>{var t=n1();return P(t,j(S1,{session:e}),null),P(t,j(M,{get when(){return $e(()=>!!(/complete/i.test(e.status)&&n.data?.state.type===`started`))()&&!/review/i.test(n.data?.state.name??``)},get children(){return j(q,{variant:`primary`,class:`self-start`,get loading(){return s.isPending},title:`Post the acceptance comment (fix summary, PR, preview, checklist) in the agent thread and move the issue to review`,onClick:()=>s.mutate(e),children:`Post closeout to Linear`})}}),null),t})()})),e}}),null),P(f,j(M,{get when(){return $e(()=>!!Oe())()&&Oe().attachments.length>0},get children(){var e=B$(),t=e.firstChild.nextSibling;return P(t,j(We,{get each(){return Oe().attachments},children:e=>{let t=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url);return[(()=>{var n=a1(),r=n.firstChild;return P(r,()=>e.title),P(n,j(M,{get when(){return t&&se.data?.previews[e.url]},get children(){return j(Lj,{get href(){return se.data.previews[e.url]},class:`shrink-0`,title:`Vercel deploy preview of this PR's branch`,children:`Preview`})}}),null),P(n,j(M,{get when(){return $e(()=>!!(t&&ce(e.url)))()&&ce(e.url)!==`OPEN`},get children(){return j(Bj,{get class(){return`ml-auto shrink-0 ${ce(e.url)===`MERGED`?`text-success`:`text-text-faint`}`},get children(){return ce(e.url)===`MERGED`?`✓ merged`:`closed`}})}}),null),P(n,j(M,{get when(){return t&&(!ce(e.url)||ce(e.url)===`OPEN`)},get children(){return[j(q,{variant:`ghost`,class:`ml-auto size-6 shrink-0 px-0`,get loading(){return fe()===e.url},get disabled(){return me().has(e.url)},get title(){return $e(()=>!!me().has(e.url))()?`On ${de()} — staging preview deploying`:`Merge into ${de()} — deploys the staging preview domain`},"aria-label":`Merge to staging`,onClick:()=>void ge(e.url),get children(){return j(M,{get when(){return me().has(e.url)},get fallback(){return o1()},get children(){return r1()}})}}),j(q,{variant:`primary`,class:`h-6 shrink-0 px-2 text-[11px]`,get loading(){return le()===e.url},get title(){return se.isError?`PR state unknown — restart the bridge (npx linear-grab-bridge) for live merge status`:`Squash-merge this PR via the bridge gh — reviewed the demo? Ship it.`},onClick:()=>void xe(e.url),get children(){return i1()}})]}}),null),D(t=>{var n=e.url,i=e.title;return n!==t.e&&it(r,`href`,t.e=n),i!==t.t&&it(r,`title`,t.t=i),t},{e:void 0,t:void 0}),n})(),j(M,{get when(){return me().has(e.url)},get children(){return j(d$,{get url(){return e.url},get base(){return de()}})}})]}}),null),P(t,j(M,{get when(){return ye()},get children(){return j(Uj,{get message(){return ye()}})}}),null),e}}),null),P(f,j(M,{get when(){return $e(()=>!!Oe())()&&Oe().comments.length>0},get children(){var e=V$();return e.firstChild,P(e,j(Ge,{get each(){return Oe().comments},children:e=>{let t=e();return(()=>{var e=s1(),n=e.firstChild,r=n.firstChild,i=r.nextSibling;return P(r,()=>t.user?.displayName??t.user?.name??`Unknown`),P(n,j(M,{get when(){return t.user?.app},get children(){return j(Bj,{children:`agent`})}}),i),P(i,()=>Gj(t.createdAt)),P(e,j(_1,{get text(){return t.body}}),null),e})()}}),null),e}}),null),P(f,j(M,{get when(){return $e(()=>!!(Oe()&&Oe().comments.length===0))()&&ke().length===0},get children(){return j(Hj,{title:`No activity yet`,children:`Comments and agent sessions will appear here.`})}}),null),P(f,j(M,{get when(){return $e(()=>!!n.isError)()&&!Oe()},get children(){return j(Hj,{title:`Failed to load issue`,get children(){return n.error?.message??`Unknown error`}})}}),null),P(y,j(M,{get when(){return v()},get children(){return j(Uj,{get message(){return v()}})}}),b),P(y,j(Nj,{rows:2,placeholder:`Reply — steer the agent or add context…`,get value(){return g()},onInput:e=>_(e.target.value),get disabled(){return De.isPending}}),b),P(b,j(Pj,{class:`min-w-0 flex-1`,get value(){return Ce()},onChange:e=>{Te=!0,we(e.currentTarget.value)},get children(){return[j(M,{get when(){return m()},get children(){var e=H$();return D(()=>e.selected=Ce()===`local`),e}}),j(We,{get each(){return Se()},children:(e,t)=>(()=>{var n=c1(),r=n.firstChild.nextSibling;return r.nextSibling,P(n,(()=>{var e=$e(()=>Se().length>1);return()=>e()?` #${t()+1}`:``})(),r),P(n,()=>Gj(e.createdAt),null),D(()=>n.selected=Ce()===`thread:${e.id}`),D(()=>n.value=`thread:${e.id}`),n})()}),j(M,{get when(){return i.data?.cursorAgentId},get children(){var e=U$(),t=e.firstChild.nextSibling;return t.nextSibling,P(e,()=>i.data?.cursorAgentName??`Cursor`,t),D(()=>e.selected=Ce()===`new`),e}}),(()=>{var e=W$();return D(()=>e.selected=Ce()===`comment`),e})()]}}),null),P(b,j(q,{variant:`ghost`,get class(){return`size-7 shrink-0 px-0 ${uj()===`composer`?`text-accent`:``}`},get title(){return uj()===`composer`?`Pick mode ON — every pick appends here. Click to stop.`:`Pick elements — refs append to this reply (stays on until toggled off or sent)`},"aria-label":`Pick element for reply`,onClick:ee,get children(){return G$()}}),null),P(b,j(q,{variant:`ghost`,get class(){return`size-7 shrink-0 px-0 ${te().phase===`recording`?`text-danger`:``}`},get title(){return te().phase===`recording`?`Stop recording — the GIF auto-attaches to this reply`:`Record a GIF from this thread (auto-attaches when done)`},"aria-label":`Record GIF`,onClick:re,get children(){return j(M,{get when(){return te().phase===`recording`},get fallback(){return l1()},get children(){return K$()}})}}),null),P(b,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return C()},title:`Attach captures — element refs, screenshots, region shots, recording GIF`,"aria-label":`Attach captures`,onClick:()=>void E(),get children(){return q$()}}),null),P(b,j(q,{class:`min-w-[52px] shrink-0`,variant:`primary`,get loading(){return De.isPending},get disabled(){return g().trim().length===0},onClick:()=>De.mutate(),get children(){return J$()}}),null),t})()}function S1(e){let t=k(()=>{let t=e.session.status;return/complete|done/i.test(t)?`var(--color-success)`:/await|pending|elicit/i.test(t)?`var(--color-warn)`:`var(--color-accent)`}),n=k(()=>{let t=e.session.status;return/active/i.test(t)?`Working…`:/awaitingInput|elicit/i.test(t)?`Needs input`:/complete/i.test(t)?`Complete`:/error/i.test(t)?`Error`:/pending/i.test(t)?`Queued`:t}),r=k(()=>e.session.activities.filter(e=>e.content?.body||e.content?.action).slice(-15)),[i,a]=T(!1),o,s=!0,c=()=>{o&&(s=o.scrollTop+o.clientHeight>=o.scrollHeight-40)};return O(()=>{let e=r().length;!o||!e||!s||requestAnimationFrame(()=>{o&&(o.scrollTop=o.scrollHeight)})}),(()=>{var s=m1(),l=s.firstChild,u=l.firstChild;return P(l,j(M,{get when(){return/active|pending/i.test(e.session.status)},get children(){return j(jj,{size:12})}}),u),P(l,j(Bj,{get color(){return t()},get children(){return n()}}),u),P(l,j(M,{get when(){return e.session.appUser?.displayName},get children(){var t=u1();return P(t,()=>e.session.appUser.displayName),t}}),u),P(u,()=>Gj(e.session.updatedAt)),P(l,j(M,{get when(){return e.session.externalLinks?.[0]},children:e=>j(Lj,{get href(){return e().url},class:`shrink-0`,title:`Open this run on the agent's site`,get children(){return e().label||`Cursor`}})}),null),P(l,j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return i()?`Collapse to a window`:`Expand — show the whole session feed`},get"aria-label"(){return i()?`Collapse feed`:`Expand feed`},onClick:()=>a(e=>!e),get children(){var e=d1();return D(t=>dt(e,`transform`,i()?`rotate(180deg)`:`none`)),e}}),null),P(s,j(M,{get when(){return e.session.summary},get children(){var t=f1();return P(t,()=>e.session.summary),t}}),null),P(s,j(M,{get when(){return r().length>0},get children(){var e=p1();e.addEventListener(`scroll`,c);var t=o;return typeof t==`function`?pt(t,e):o=e,P(e,j(Ge,{get each(){return r()},children:e=>j(M,{get when(){return e().content.action},get fallback(){return(()=>{var t=g1();return P(t,j(_1,{get text(){return e().content.body??``}})),D(()=>st(t,`lg-md text-[11.5px] leading-relaxed break-words ${e().content.__typename===`AgentActivityErrorContent`?`text-danger`:`text-text`}`)),t})()},get children(){var t=h1(),n=t.firstChild.nextSibling;return n.nextSibling,P(t,()=>e().content.action,n),P(t,()=>e().content.parameter,null),t}})})),D(()=>e.classList.toggle(`max-h-64`,!i())),e}}),null),s})()}rt([`click`]);var C1=N(`<svg aria-hidden width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M1 4.5A7 7 0 0 1 13.5 3"></path><path d="M15 11.5A7 7 0 0 1 2.5 13"></path><polyline points="1 1 1 5 5 5"></polyline><polyline points="15 11 15 15 11 15">`),w1=N(`<div class="flex flex-col gap-1.5">`),T1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text inline-flex items-center gap-1.5 text-[12px] font-semibold"> Cloud agents</span><span class="text-text-faint text-[10.5px] tabular-nums"> working · updated </span></div><div class="border-border flex shrink-0 items-center gap-1 border-b px-3 py-1.5"></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),E1=N(`<button>`),D1=N(`<div class="grid place-items-center py-10">`),O1=N(`<button class="flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left"title="View the thread here"><span class="font-mono text-text-dim shrink-0 text-[11px]"></span><span class="text-text hover:text-accent min-w-0 truncate text-[12.5px] font-medium transition-colors">`),k1=N(`<p class="text-text-dim line-clamp-2 cursor-pointer text-[11.5px] leading-snug break-words">`),A1=N(`<span class="text-text-dim text-[11px]">`),j1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),M1=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><div class="flex min-w-0 items-center gap-1.5"><span class=ml-auto>`),N1=N(`<span aria-hidden class="size-2 shrink-0 rounded-full">`),P1=N(`<span class="text-text-dim text-[12.5px]">Conversation session`);function F1(){let e=_r(()=>({queryKey:[`cloud-sessions`],queryFn:vO,refetchInterval:12e3})),t=[{id:`all`,label:`All`},{id:`working`,label:`Working`},{id:`input`,label:`Needs input`},{id:`done`,label:`Done`}],[n,r]=br(`cloud:filter`,`all`),i=k(()=>(e.data??[]).filter(e=>{switch(n()){case`working`:return/active|pending/i.test(e.status);case`input`:return/awaitingInput|elicit/i.test(e.status);case`done`:return/complete/i.test(e.status);default:return!0}})),a=e=>/active/i.test(e)?{word:`Working…`,color:`var(--color-accent)`}:/awaitingInput|elicit/i.test(e)?{word:`Needs input`,color:`var(--color-warn)`}:/complete/i.test(e)?{word:`Complete`,color:`var(--color-success)`}:/error/i.test(e)?{word:`Error`,color:`var(--color-danger)`}:{word:e,color:`var(--color-text-dim)`},o=e=>{let t=[...e.activities].reverse().find(e=>e.content?.body||e.content?.action);return t?t.content.action?`→ ${t.content.action} ${t.content.parameter??``}`:t.content.body??``:e.summary??``},s=k(()=>(e.data??[]).filter(e=>/active|pending/i.test(e.status)).length),[c,l]=T(null);return j(M,{get when(){return!c()},get fallback(){return j(x1,{get issueId(){return c()},onBack:()=>l(null)})},get children(){var c=T1(),u=c.firstChild,d=u.firstChild,f=d.firstChild,p=d.nextSibling,m=p.firstChild,h=u.nextSibling,g=h.nextSibling;return P(d,j(Fj,{size:13}),f),P(p,s,m),P(p,()=>Gj(e.dataUpdatedAt||Date.now()),null),P(h,j(We,{each:t,children:e=>(()=>{var t=E1();return t.$$click=()=>r(e.id),P(t,()=>e.label),D(()=>st(t,`h-6 shrink-0 cursor-pointer rounded-md px-2 text-[11px] font-medium transition-colors ${n()===e.id?`bg-accent-soft text-accent`:`text-text-dim hover:bg-surface-2`}`)),t})()}),null),P(h,j(q,{class:`ml-auto size-6 px-0`,get loading(){return e.isFetching},title:`Refresh`,"aria-label":`Refresh sessions`,onClick:()=>void e.refetch(),get children(){return C1()}}),null),P(g,j(M,{get when(){return i().length>0},get fallback(){return j(M,{get when(){return!e.isPending},get fallback(){return(()=>{var e=D1();return P(e,j(jj,{})),e})()},get children(){return j(Hj,{title:`No cloud agent sessions`,children:`Delegate an issue to Cursor from the Draft tab and its live session appears here.`})}})},get children(){var e=w1();return P(e,j(Ge,{get each(){return i()},children:e=>(()=>{var t=M1(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,s=i.firstChild;return P(n,j(M,{get when(){return/active|pending/i.test(e().status)},get fallback(){return(()=>{var t=N1();return D(n=>dt(t,`background`,a(e().status).color)),t})()},get children(){return j(jj,{})}}),r),P(n,j(M,{get when(){return e().issue},get fallback(){return P1()},get children(){var t=O1(),n=t.firstChild,r=n.nextSibling;return t.$$click=()=>l(e().issue.id),P(n,()=>e().issue.identifier),P(r,()=>e().issue.title),t}}),r),P(r,()=>Gj(e().updatedAt)),P(t,j(M,{get when(){return o(e())},get children(){var t=k1();return t.$$click=()=>e().issue&&l(e().issue.id),P(t,()=>o(e())),t}}),i),P(i,j(Bj,{get color(){return a(e().status).color},get children(){return a(e().status).word}}),s),P(i,j(M,{get when(){return e().issue},get children(){return[j(Vj,{get color(){return e().issue.state.color}}),(()=>{var t=A1();return P(t,()=>e().issue.state.name),t})()]}}),s),P(i,j(M,{get when(){return e().issue},get children(){return[j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,title:`Open the thread — steer this agent`,"aria-label":`Open thread`,onClick:()=>l(e().issue.id),get children(){return j1()}}),j(Lj,{get href(){return e().issue.url},class:`shrink-0`,children:`Linear`})]}}),null),t})()})),e}})),c}})}rt([`click`]);var I1=N(`<div class="flex flex-col gap-1.5">`),L1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Running now</span><span class="text-text-faint text-[10.5px] tabular-nums"> agent<!> active</span></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),R1=N(`<span class="font-mono text-text-dim shrink-0 text-[11px]">`),z1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),B1=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><button class="flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left"><span class="text-text hover:text-accent min-w-0 truncate text-[12.5px] font-medium transition-colors"></span></button><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><p class="text-text-dim line-clamp-2 text-[11.5px] leading-snug break-words"></p><div class="flex min-w-0 items-center gap-1.5"><span class=ml-auto>`);function V1(){let e=_r(()=>({queryKey:[`cloud-sessions`],queryFn:vO,refetchInterval:12e3})),t=_r(()=>({queryKey:[`bridge-tasks`],queryFn:FO,refetchInterval:5e3,retry:0})),n=_r(()=>({queryKey:[`my-issues`],queryFn:mO,refetchInterval:3e4})),r=k(()=>{let r=(e.data??[]).filter(e=>/active|pending|awaitingInput|elicit/i.test(e.status)).map(e=>({kind:`cloud`,at:Date.parse(e.updatedAt),session:e})),i=(t.data??[]).filter(e=>e.status===`running`).map(e=>({kind:`local`,at:e.startedAt,task:e,issueId:(n.data??[]).find(t=>e.title.startsWith(t.identifier))?.id}));return[...r,...i].sort((e,t)=>t.at-e.at)}),[i,a]=T(null),o=e=>/awaitingInput|elicit/i.test(e)?{word:`Needs input`,color:`var(--color-warn)`}:{word:`Working…`,color:`var(--color-accent)`},s=e=>{let t=[...e.activities].reverse().find(e=>e.content?.body||e.content?.action);return t?t.content.action?`→ ${t.content.action} ${t.content.parameter??``}`:t.content.body??``:e.summary??``};return j(M,{get when(){return!i()},get fallback(){return j(x1,{get issueId(){return i()},onBack:()=>a(null)})},get children(){var e=L1(),t=e.firstChild,n=t.firstChild.nextSibling,i=n.firstChild,c=i.nextSibling;c.nextSibling;var l=t.nextSibling;return P(n,()=>r().length,i),P(n,()=>r().length===1?``:`s`,c),P(l,j(M,{get when(){return r().length>0},get fallback(){return j(Hj,{title:`Nothing running`,children:`Delegate an issue from the Draft tab — cloud (Cursor) and local (Claude Code) agents working right now appear here together.`})},get children(){var e=I1();return P(e,j(Ge,{get each(){return r()},children:e=>(()=>{var t=B1(),n=t.firstChild,r=n.firstChild,i=r.firstChild,c=r.nextSibling,l=n.nextSibling,u=l.nextSibling,d=u.firstChild;return P(n,j(jj,{size:12}),r),P(n,j(Bj,{get title(){return e().kind===`cloud`?`Cursor cloud agent`:`Local Claude Code`},get children(){return[$e(()=>$e(()=>e().kind===`cloud`)()?j(Fj,{}):j(Ij,{})),$e(()=>e().kind===`cloud`?`cloud`:`local`)]}}),r),r.$$click=()=>{let t=e();t.kind===`cloud`&&t.session.issue?a(t.session.issue.id):t.kind===`local`&&cj(`local`)},P(r,j(M,{get when(){return e().kind===`cloud`},get children(){var t=R1();return P(t,()=>e().session.issue?.identifier),t}}),i),P(i,(()=>{var t=$e(()=>e().kind===`cloud`);return()=>t()?e().session.issue?.title??`Conversation session`:e().task.title})()),P(c,()=>Gj(e().at)),P(l,(()=>{var t=$e(()=>e().kind===`cloud`);return()=>t()?s(e().session):e().task.lastText})()),P(u,j(M,{get when(){return e().kind===`cloud`},get fallback(){return j(Bj,{color:`var(--color-accent)`,children:`Working…`})},get children(){return j(Bj,{get color(){return o(e().session.status).color},get children(){return o(e().session.status).word}})}}),d),P(u,j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return e().kind===`cloud`?`Open the thread — steer this agent`:`Open the live session in the Local tab`},"aria-label":`Open thread`,onClick:()=>{let t=e();t.kind===`cloud`&&t.session.issue?a(t.session.issue.id):t.kind===`local`&&cj(`local`)},get children(){return z1()}}),null),D(()=>it(r,`title`,e().kind===`cloud`?`View the thread here`:`Open the Local tab`)),t})()})),e}})),e}})}rt([`click`]),Br();var H1=N(`<div class="border-accent/40 bg-accent-soft self-end rounded-lg border px-2.5 py-1.5"><p class="text-accent mb-0.5 text-[9.5px] font-semibold tracking-wide uppercase">You</p><div class="lg-md text-text text-[11.5px] leading-relaxed break-words">`),U1=N(`<div><p></p><div class="lg-md text-text text-[11.5px] leading-relaxed break-words">`),W1=N(`<p>`),G1=N(`<span class="text-text-faint max-w-[55%] truncate text-[10.5px] tabular-nums"> running<!> · `),K1=N(`<div class="flex flex-col gap-1.5">`),q1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Local Claude Code</span></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),J1=N(`<span class="bg-surface-2 border-border font-mono mt-2 block rounded-md border px-2 py-1.5 text-[11px] select-all">npx linear-grab-bridge`),Y1=N(`<span class="text-text-faint text-[10.5px] tabular-nums">ctx <!> · out `),X1=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-faint min-w-0 truncate text-[10.5px]">`),Z1=N(`<option selected>`),Q1=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=currentColor aria-hidden><path d="M4.5 2.8a.8.8 0 0 1 1.22-.68l8 5.2a.8.8 0 0 1 0 1.36l-8 5.2a.8.8 0 0 1-1.22-.68V2.8Z">`),$1=N(`<span class="text-success text-[12px] leading-none">✓`),e0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><path d="M14 10a2 2 0 0 1-2 2H6l-3.5 2.5V4a2 2 0 0 1 2-2H12a2 2 0 0 1 2 2v6Z">`),t0=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3 y=3 width=10 height=10 rx=1.5>`),n0=N(`<span class="font-mono text-text-faint min-w-0 truncate text-[10.5px]">`),r0=N(`<div class="border-border bg-bg flex flex-col gap-1 rounded-md border p-2"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text-dim text-[10.5px] font-semibold tracking-wide uppercase">Changes</span><span class="ml-auto shrink-0 text-[10.5px] tabular-nums"><span class=text-success>+</span> <span class=text-danger>−`),i0=N(`<div class="border-border bg-bg flex max-h-80 flex-col gap-1.5 overflow-y-auto rounded-md border py-2 pl-2 pr-3">`),a0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=2.2></circle><path d="M8 1v3M8 12v3M1 8h3M12 8h3">`),o0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M13 7.5 8.2 12.3a3.2 3.2 0 0 1-4.5-4.5L8.9 2.6a2.1 2.1 0 0 1 3 3L7.1 10.4a1 1 0 0 1-1.5-1.5l4.3-4.3">`),s0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M8 2v4M8 10v4M2 8h4M10 8h4M4.5 4.5 6 6M11.5 11.5 10 10M11.5 4.5 10 6M4.5 11.5 6 10">`),c0=N(`<span class="inline-block min-w-[4ch] text-center">Send`),l0=N(`<div class="flex flex-col gap-1.5"><div class="flex items-center gap-1"><span class="text-text-faint min-w-0 flex-1 truncate text-[10.5px]">`),u0=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text min-w-0 truncate text-[12.5px] font-medium"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><p class="text-text-dim text-[11.5px] leading-snug break-words"></p><div class="flex flex-wrap items-center gap-1.5"></div><div class="flex items-center gap-1">`),d0=N(`<span aria-hidden class="size-2 shrink-0 rounded-full">`),f0=N(`<div class="flex min-w-0 items-center gap-1.5">`),p0=N(`<option>`),m0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),h0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M2.5 3.5 6 7 2.5 10.5M7.5 12.5h6">`),g0=N(`<span class=text-success>+`),_0=N(`<span class=text-danger>−`),v0=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim min-w-0 flex-1 truncate text-[10.5px]"></span><span class="shrink-0 text-[10px] tabular-nums">`),y0=N(`<span class=text-text-faint>bin`),b0=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim min-w-0 flex-1 truncate text-[10.5px]"></span><span class="text-success shrink-0 text-[10px]">new`),x0=N(`<div class="flex min-w-0 items-center gap-1.5 pt-0.5"><a target=_blank rel=noreferrer class="text-accent min-w-0 truncate text-[11px] hover:underline">`),S0=N(`<p class="text-text-faint text-[11px]">Waiting for output…`),C0=[{id:``,label:`Default model`},{id:`fable`,label:`Fable 5`},{id:`opus`,label:`Opus`},{id:`sonnet`,label:`Sonnet`},{id:`haiku`,label:`Haiku`}];function w0(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)<(r[e]??0);return!1}var T0=e=>e==null?`–`:e>=1e3?`${(e/1e3).toFixed(e>=1e5?0:1)}k`:String(e);function E0(){let e=sr(),t=_r(()=>({queryKey:[`bridge-health`],queryFn:PO,refetchInterval:5e3,retry:0})),n=_r(()=>({queryKey:[`bridge-tasks`],queryFn:FO,refetchInterval:3e3,enabled:!!t.data?.ok})),[r,i]=T(null),a=_r(()=>({queryKey:[`my-issues`],queryFn:mO,staleTime:15e3})),o=e=>{let t=e.title.match(/^([A-Z][A-Z0-9]*-\d+)/)?.[1];return t?a.data?.find(e=>e.identifier===t):void 0},s=_r(()=>({queryKey:[`bridge-task`,r()],queryFn:()=>IO(r()),refetchInterval:1500,enabled:!!r()&&!!t.data?.ok})),c=_r(()=>({queryKey:[`bridge-diff`,r()],queryFn:()=>HO(r()),refetchInterval:6e3,enabled:!!r()&&!!t.data?.ok})),l=()=>{e.invalidateQueries({queryKey:[`bridge-tasks`]}),e.invalidateQueries({queryKey:[`bridge-task`,r()]})},u=vr(()=>({mutationFn:e=>BO(e),onSuccess:l})),[d,f]=br(`local:message`,``),[p,m]=T(!1),[h,g]=T(0),_=_r(()=>({queryKey:[`grab`],queryFn:Dr,enabled:uj()===`local`})),v=()=>{g(Date.now()),fj(`local`),XZ().catch(()=>fj(`capture`))};O(()=>{if(uj()!==`local`)return;let e=(_.data??[]).filter(e=>e.grabbedAt>=h());if(!e.length)return;let t=e.map(e=>{let t=e.source?.filePath?` — \`${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}\``:``;return`- \`<${e.componentName??e.tagName??`element`}>\`${t}`}).join(`
270
- `);f(e=>`${e?`${e}\n`:``}${t}\n`),fj(`capture`)});let y=async()=>{m(!0);try{let{block:e,failed:t}=await p$();e&&f(t=>`${t?`${t}\n`:``}${e}\n`),t.length&&f(e=>`${e}\n<!-- upload issues: ${t.join(` · `)} -->\n`)}finally{m(!1)}},b=vr(()=>({mutationFn:e=>RO(e.id,e.text),onSuccess:()=>{f(``),l()}})),x=vr(()=>({mutationFn:e=>zO(e.id,e.model),onSuccess:t=>{e.setQueryData([`bridge-tasks`],e=>e?.map(e=>e.id===t.id?t:e)),l()}})),S=vr(()=>({mutationFn:e=>VO(e),onSuccess:l})),C,w=!0,E=()=>{C&&(w=C.scrollTop+C.clientHeight>=C.scrollHeight-48)};O(()=>{let e=s.data?.tail?.length??0;r(),!(!C||!e||!w)&&requestAnimationFrame(()=>{C&&(C.scrollTop=C.scrollHeight)})});let[ee,te]=T(null),A=async e=>{try{await navigator.clipboard.writeText(ZO(e)),te(e.id),setTimeout(()=>te(null),1800)}catch{}},ne=e=>e===`running`?`var(--color-accent)`:e===`done`?`var(--color-success)`:e===`stopped`?`var(--color-warn)`:`var(--color-danger)`,re=e=>{let t=e.line.kind,n=k(()=>C$(e.line.text));return t===`user`?(()=>{var e=H1(),t=e.firstChild.nextSibling;return D(()=>t.innerHTML=n()),e})():t===`assistant`||t===`result`?(()=>{var e=U1(),r=e.firstChild,i=r.nextSibling;return st(e,`bg-surface rounded-lg border px-2.5 py-1.5 ${t===`result`?`border-success/40`:`border-border`}`),st(r,`mb-0.5 text-[9.5px] font-semibold tracking-wide uppercase ${t===`result`?`text-success`:`text-text-faint`}`),P(r,t===`result`?`Result`:`Claude`),D(()=>i.innerHTML=n()),e})():(()=>{var n=W1();return st(n,`font-mono px-1 text-[10px] leading-relaxed break-words ${t===`subagent`?`text-warn`:t===`stderr`?`text-danger`:`text-text-faint`}`),P(n,()=>e.line.text),n})()};return(()=>{var e=q1(),a=e.firstChild;a.firstChild;var l=a.nextSibling;return P(a,j(M,{get when(){return t.data?.ok},get fallback(){return j(Bj,{class:`text-danger`,children:`bridge offline`})},get children(){return[j(M,{get when(){return w0(t.data.version,`0.15.1`)},get children(){return j(Bj,{class:`text-warn`,title:`Ctrl+C the old process, then: npx linear-grab-bridge`,get children(){return[`v`,$e(()=>t.data.version),` outdated — restart`]}})}}),(()=>{var e=G1(),r=e.firstChild,i=r.nextSibling;return i.nextSibling,P(e,()=>t.data.active,r),P(e,()=>{let e=(n.data??[]).reduce((e,t)=>e+(t.usage?.costUsd??0),0);return e>0?` · Σ $${e.toFixed(2)}`:``},i),P(e,()=>t.data.cwd.split(`/`).slice(-2).join(`/`),null),D(()=>it(e,`title`,t.data?.cwd)),e})()]}}),null),P(l,j(M,{get when(){return t.data?.ok},get fallback(){return j(Hj,{title:`Bridge not running`,get children(){return[`Start it in your repo's terminal:`,J1(),`Then delegate from the Draft tab ("Local Claude Code") or watch tasks here. Sessions stay interactive — send follow-ups, switch models, interrupt, resume in your terminal. History persists across restarts.`]}})},get children(){return j(M,{get when(){return(n.data??[]).length>0},get fallback(){return j(Hj,{title:`No local tasks yet`,children:`Create an issue in Draft with "Delegate to → Local Claude Code", and it appears here with live status and a conversation view.`})},get children(){var e=K1();return P(e,j(Ge,{get each(){return n.data},children:e=>(()=>{var t=u0(),n=t.firstChild,a=n.firstChild,l=a.nextSibling,m=n.nextSibling,h=m.nextSibling,g=h.nextSibling;return P(n,j(M,{get when(){return e().status===`running`},get fallback(){return(()=>{var t=d0();return D(n=>dt(t,`background`,ne(e().status))),t})()},get children(){return j(jj,{})}}),a),P(a,()=>e().title),P(l,()=>Gj(e().startedAt)),P(m,()=>e().lastText),P(h,j(Bj,{get color(){return ne(e().status)},get children(){return e().status}}),null),P(h,j(Bj,{get children(){return e().model??`default model`}}),null),P(h,j(M,{get when(){return e().pendingModel},get children(){return j(Bj,{class:`text-warn`,get children(){return[`→ `,$e(()=>e().pendingModel),` next msg`]}})}}),null),P(h,j(M,{get when(){return e().subagents>0},get children(){return j(Bj,{class:`text-warn`,get children(){return[`⛓ `,$e(()=>e().subagents),` subagents`]}})}}),null),P(h,j(M,{get when(){return e().usage},get children(){var t=Y1(),n=t.firstChild.nextSibling;return n.nextSibling,P(t,()=>T0(e().usage.contextTokens),n),P(t,()=>T0(e().usage.outputTokens),null),P(t,(()=>{var t=$e(()=>!!e().usage.costUsd);return()=>t()?` · $${e().usage.costUsd.toFixed(2)}`:``})(),null),t}}),null),P(t,j(M,{get when(){return o(e())},children:e=>(()=>{var t=f0();return P(t,j(Bj,{get children(){return e().state.name}}),null),P(t,j(Lj,{get href(){return e().url},children:`Open in Linear`}),null),t})()}),g),P(t,j(M,{get when(){return $e(()=>!!e().worktree)()&&!e().worktree.removed},get children(){var t=X1(),n=t.firstChild;return P(t,j(Bj,{class:`text-warn`,children:`⎇ worktree`}),n),P(n,()=>e().worktree.branch),P(t,j(M,{get when(){return e().status!==`running`},get children(){return j(q,{variant:`ghost`,class:`ml-auto h-6 shrink-0 px-2 text-[11px]`,get loading(){return S.isPending},get title(){return`Remove the worktree at ${e().worktree.path} — the branch (and PR) survive`},onClick:()=>S.mutate(e().id),children:`Remove`})}}),null),D(()=>it(n,`title`,e().worktree.path)),t}}),g),P(g,j(Pj,{class:`h-7 w-auto min-w-0 flex-1 text-[11px]`,get value(){return e().pendingModel??e().model??``},onChange:t=>x.mutate({id:e().id,model:t.currentTarget.value}),title:`Model — applies from the next message`,get children(){return[j(We,{each:C0,children:t=>(()=>{var n=p0();return P(n,()=>t.label),D(()=>n.selected=(e().pendingModel??e().model??``)===t.id),D(()=>n.value=t.id),n})()}),j(M,{get when(){return!C0.some(t=>t.id===(e().pendingModel??e().model??``))},get children(){var t=Z1();return P(t,()=>e().pendingModel??e().model),D(()=>t.value=e().pendingModel??e().model??``),t}})]}}),null),P(g,j(M,{get when(){return $e(()=>e().status!==`running`)()&&e().sessionId},get children(){return j(q,{variant:`ghost`,class:`size-7 px-0`,get loading(){return b.isPending},get title(){return`Resume — continues this session${e().pendingModel?` on ${e().pendingModel}`:``}`},"aria-label":`Resume session`,onClick:()=>b.mutate({id:e().id,text:`Continue where you left off. If the work is already complete, finish any remaining closeout steps (PR, Linear update, announcement).`}),get children(){return Q1()}})}}),null),P(g,j(M,{get when(){return o(e())},children:e=>j(q,{variant:`ghost`,class:`size-7 px-0`,title:`Open the issue's Activity thread`,onClick:()=>cj(`activity`,e().id),get children(){return m0()}})}),null),P(g,j(q,{variant:`ghost`,class:`size-7 px-0`,get disabled(){return!e().sessionId},get title(){return $e(()=>!!e().sessionId)()?`Copy resume command · session ${e().sessionId.slice(0,8)}…`:`No session yet`},onClick:()=>void A(e()),get children(){return j(M,{get when(){return ee()===e().id},get fallback(){return h0()},get children(){return $1()}})}}),null),P(g,j(q,{variant:`ghost`,class:`size-7 px-0`,get title(){return r()===e().id?`Hide thread`:`Open thread — chat & changes`},onClick:()=>i(r()===e().id?null:e().id),get children(){return e0()}}),null),P(g,j(M,{get when(){return e().status===`running`},get children(){return j(q,{variant:`danger`,class:`size-7 px-0`,get loading(){return u.isPending},title:`Interrupt — the session stays resumable`,onClick:()=>u.mutate(e().id),get children(){return t0()}})}}),null),P(t,j(M,{get when(){return r()===e().id},get children(){return[j(M,{get when(){return $e(()=>!!c.data)()&&(c.data.files.length||c.data.untracked.length||c.data.prs.length)},get children(){var e=r0(),t=e.firstChild,n=t.firstChild.nextSibling,r=n.firstChild;r.firstChild;var i=r.nextSibling.nextSibling;return i.firstChild,P(t,j(M,{get when(){return c.data.branch},get children(){var e=n0();return P(e,()=>c.data.branch),e}}),n),P(r,()=>c.data.totalAdded,null),P(i,()=>c.data.totalDeleted,null),P(e,j(We,{get each(){return c.data.files},children:e=>(()=>{var t=v0(),n=t.firstChild,r=n.nextSibling;return P(n,()=>e.path),P(r,j(M,{get when(){return!e.binary},get fallback(){return y0()},get children(){return[(()=>{var t=g0();return t.firstChild,P(t,()=>e.added,null),t})(),` `,(()=>{var t=_0();return t.firstChild,P(t,()=>e.deleted,null),t})()]}})),D(()=>it(n,`title`,e.path)),t})()}),null),P(e,j(We,{get each(){return c.data.untracked},children:e=>(()=>{var t=b0(),n=t.firstChild;return it(n,`title`,e),P(n,e),t})()}),null),P(e,j(We,{get each(){return c.data.prs},children:e=>(()=>{var t=x0(),n=t.firstChild;return P(t,j(Bj,{class:`text-accent`,get children(){return[`PR · `,$e(()=>e.state.toLowerCase())]}}),n),P(n,()=>e.title),D(t=>{var r=e.url,i=e.title;return r!==t.e&&it(n,`href`,t.e=r),i!==t.t&&it(n,`title`,t.t=i),t},{e:void 0,t:void 0}),t})()}),null),e}}),(()=>{var e=i0();return e.addEventListener(`scroll`,E),pt(e=>{C=e,w=!0},e),P(e,j(M,{get when(){return(s.data?.tail??[]).length>0},get fallback(){return S0()},get children(){return j(Ge,{get each(){return s.data?.tail??[]},children:e=>j(re,{get line(){return e()}})})}})),e})(),(()=>{var t=l0(),n=t.firstChild,r=n.firstChild;return P(t,j(Nj,{rows:2,get placeholder(){return e().status===`running`?`Message the working agent — it queues into the live session…`:`Follow-up — resumes the session…`},get value(){return d()},onInput:e=>f(e.currentTarget.value)}),n),P(r,(()=>{var t=$e(()=>!!e().alive);return()=>t()?`live session`:e().sessionId?`resumes on send`:`no session`})()),P(n,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,title:`Pick elements on the page — refs drop into this message`,"aria-label":`Pick element`,onClick:v,get children(){return a0()}}),null),P(n,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return p()},title:`Attach captures — element refs, screenshots, region shots, recording GIF`,"aria-label":`Attach captures`,onClick:()=>void y(),get children(){return o0()}}),null),P(n,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get disabled(){return $e(()=>!e().alive)()&&!e().sessionId},title:`Compact the session — frees context (sends /compact)`,"aria-label":`Compact session`,onClick:()=>b.mutate({id:e().id,text:`/compact`}),get children(){return s0()}}),null),P(n,j(q,{variant:`primary`,class:`shrink-0`,get loading(){return b.isPending},get disabled(){return!d().trim()||!e().alive&&!e().sessionId},onClick:()=>b.mutate({id:e().id,text:d().trim()}),get children(){return c0()}}),null),t})()]}}),null),t})()})),e}})}})),e})()}Br();var D0=N(`<span class="text-text-faint text-[10.5px] tabular-nums">/<!> from your issues`),O0=N(`<div class="flex flex-col gap-1.5">`),k0=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Pull requests</span></div><div class="border-border flex shrink-0 items-center gap-1.5 border-b px-3 py-1.5"><div class="bg-surface-2 border-border flex shrink-0 rounded-md border p-0.5"></div></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),A0=N(`<span class="text-warn text-[10.5px]"title="Merge states come from gh via the bridge">states unknown — restart the bridge`),j0=N(`<button>`),M0=N(`<span class="text-success text-[11px]">✓`),N0=N(`<span class="text-[12px] leading-none">✓`),P0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),F0=N(`<span class="text-success text-[12px] leading-none">✓`),I0=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><a target=_blank rel=noreferrer class="text-accent truncate text-[12.5px] font-medium hover:underline"></a><div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim shrink-0 text-[11px]"></span><span class="text-text-dim truncate text-[11.5px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><div class="flex min-w-0 flex-wrap items-center gap-1.5"><div class="ml-auto flex shrink-0 items-center gap-1">`),L0=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 2 14 5.5 8 9 2 5.5 8 2Z"></path><path d="M2 10.5 8 14l6-3.5">`),R0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=4 cy=3.5 r=1.5></circle><circle cx=4 cy=12.5 r=1.5></circle><circle cx=12 cy=8 r=1.5></circle><path d="M4 5v6M4 6.5c0 2 2 3 4.5 3h2">`),z0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),B0=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i;function V0(e){let t=_r(()=>({queryKey:[`my-issues`],queryFn:mO,refetchInterval:15e3})),n=k(()=>(t.data??[]).flatMap(e=>(e.attachments??[]).filter(e=>B0.test(e.url)).map(t=>({issue:e,attachment:t})))),r=_r(()=>({queryKey:[`bridge-tasks`],queryFn:FO,refetchInterval:1e4,retry:0})),i=_r(()=>({queryKey:[`pr-status`,n().map(e=>e.attachment.url).sort().join(`|`)],queryFn:()=>WO(n().map(e=>e.attachment.url)),refetchInterval:3e4,retry:0,enabled:n().length>0})),[a,o]=T(new Set),s=e=>a().has(e.attachment.url)?`MERGED`:i.data?.statuses[e.attachment.url],c=e=>!!r.data?.some(t=>t.title.startsWith(e.issue.identifier)),[l,u]=T(`all`),[d,f]=T(``),p=k(()=>{let e=d().trim().toLowerCase();return n().filter(t=>{let n=t.issue.state.type,r=s(t);return!(l()===`review`&&(n!==`started`||r===`MERGED`||r===`CLOSED`)||l()===`open`&&(r===`MERGED`||r===`CLOSED`||!(n===`started`||n===`unstarted`||n===`backlog`))||l()===`done`&&!(n===`completed`||r===`MERGED`||r===`CLOSED`)||e&&![t.attachment.title,t.issue.title,t.issue.identifier].join(` `).toLowerCase().includes(e))})}),m=_r(()=>({queryKey:[`settings`],queryFn:Tr})),h=()=>m.data?.stagingBranch?.trim()||`staging`,[g,_]=T(null),[v,y]=T(new Set),[b,x]=T(null),S=async e=>{_(e),x(null);try{await GO(e,h()),y(t=>new Set(t).add(e))}catch(e){x(e instanceof Error?e.message:String(e))}finally{_(null)}},[C,w]=T(null),[E,O]=T(null),ee=async e=>{O(e);try{await YO(e),o(t=>new Set(t).add(e))}catch{}finally{O(null)}},te=async e=>{try{await navigator.clipboard.writeText(e.attachment.url),w(e.attachment.id),setTimeout(()=>w(null),1500)}catch{}};return(()=>{var r=k0(),o=r.firstChild;o.firstChild;var m=o.nextSibling,_=m.firstChild,y=m.nextSibling;return P(o,j(M,{get when(){return!i.isError},get fallback(){return A0()},get children(){var e=D0(),t=e.firstChild,r=t.nextSibling;return r.nextSibling,P(e,()=>p().length,t),P(e,()=>n().length,r),e}}),null),P(_,j(We,{each:[{id:`all`,label:`All`},{id:`review`,label:`Review`},{id:`open`,label:`Open`},{id:`done`,label:`Done`}],children:e=>(()=>{var t=j0();return t.$$click=()=>u(e.id),P(t,()=>e.label),D(()=>st(t,`rounded-[5px] px-2 py-0.5 text-[11px] font-medium transition-colors ${l()===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),P(m,j(Mj,{class:`h-6 min-w-0 flex-1 text-[11px]`,placeholder:`Search PRs…`,get value(){return d()},onInput:e=>f(e.currentTarget.value)}),null),P(y,j(M,{get when(){return p().length>0},get fallback(){return j(Hj,{title:`No PRs yet`,get children(){return $e(()=>!!t.isError)()?`Connect Linear in Settings.`:n().length>0?`No PRs match the current filter.`:`PRs opened by delegated agents appear here as soon as they link back to your issues.`}})},get children(){var t=O0();return P(t,j(We,{get each(){return p()},children:t=>(()=>{var n=I0(),r=n.firstChild,o=r.nextSibling,l=o.firstChild,u=l.nextSibling,d=u.nextSibling,f=o.nextSibling,p=f.firstChild;return P(r,()=>t.attachment.title||t.attachment.url),P(n,j(M,{get when(){return i.data?.previews[t.attachment.url]},get children(){return j(Lj,{get href(){return i.data.previews[t.attachment.url]},class:`shrink-0 self-start`,title:`Vercel deploy preview of this PR's branch`,children:`Preview`})}}),o),P(o,j(Vj,{get color(){return t.issue.state.color}}),l),P(l,()=>t.issue.identifier),P(u,()=>t.issue.title),P(d,()=>Gj(t.issue.updatedAt)),P(f,j(Bj,{get children(){return t.issue.state.name}}),p),P(f,j(M,{get when(){return t.issue.delegate},get children(){return j(Bj,{class:`text-accent`,get children(){return[j(Fj,{}),` `,$e(()=>t.issue.delegate.displayName)]}})}}),p),P(f,j(M,{get when(){return c(t)},get children(){return j(Bj,{class:`text-warn`,get children(){return[j(Ij,{}),` local`]}})}}),p),P(f,j(Lj,{get href(){return t.issue.url},class:`shrink-0`,title:`Open the issue in Linear`,children:`Linear`}),p),P(p,j(M,{get when(){return $e(()=>!!s(t))()&&s(t)!==`OPEN`},get children(){return j(Bj,{get class(){return s(t)===`MERGED`?`text-success`:`text-text-faint`},get children(){return s(t)===`MERGED`?`✓ merged`:`closed`}})}}),null),P(p,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return g()===t.attachment.url},get disabled(){return v().has(t.attachment.url)},get title(){return $e(()=>!!v().has(t.attachment.url))()?`On ${h()} — staging preview deploying`:`Merge into ${h()} — deploys the staging preview domain`},"aria-label":`Merge to staging`,onClick:()=>void S(t.attachment.url),get children(){return j(M,{get when(){return v().has(t.attachment.url)},get fallback(){return L0()},get children(){return M0()}})}}),null),P(p,j(q,{variant:`primary`,class:`size-7 px-0`,get classList(){return{hidden:!!s(t)&&s(t)!==`OPEN`}},get loading(){return E()===t.attachment.url},get disabled(){return a().has(t.attachment.url)},get title(){return a().has(t.attachment.url)?`Merged`:`Squash-merge this PR (bridge gh)`},"aria-label":`Merge PR`,onClick:()=>void ee(t.attachment.url),get children(){return j(M,{get when(){return a().has(t.attachment.url)},get fallback(){return R0()},get children(){return N0()}})}}),null),P(p,j(q,{variant:`ghost`,class:`size-7 px-0`,title:`Open the issue's Activity thread`,"aria-label":`Open issue activity`,onClick:()=>{cj(`activity`,t.issue.id),e.onOpenIssue()},get children(){return P0()}}),null),P(p,j(q,{variant:`ghost`,class:`size-7 px-0`,title:`Copy PR URL`,"aria-label":`Copy PR URL`,onClick:()=>void te(t),get children(){return j(M,{get when(){return C()===t.attachment.id},get fallback(){return z0()},get children(){return F0()}})}}),null),P(f,j(M,{get when(){return v().has(t.attachment.url)},get children(){return j(d$,{get url(){return t.attachment.url},get base(){return h()}})}}),null),D(e=>{var n=t.attachment.url,i=t.attachment.title;return n!==e.e&&it(r,`href`,e.e=n),i!==e.t&&it(r,`title`,e.t=i),e},{e:void 0,t:void 0}),n})()})),t}})),r})()}rt([`click`]);var H0=[`display`,`align-items`,`justify-content`,`gap`,`padding`,`margin`,`width`,`height`,`font-size`,`font-weight`,`line-height`,`letter-spacing`,`color`,`background-color`,`border-radius`,`border-width`,`border-color`,`box-shadow`,`opacity`,`transform`,`transition-property`,`transition-duration`],U0=new Set([`color`,`background-color`,`border-color`]),W0={margin:new Set([`0px`]),padding:new Set([`0px`]),gap:new Set([`normal`,`0px`]),"box-shadow":new Set([`none`]),transform:new Set([`none`]),"border-width":new Set([`0px`]),"border-radius":new Set([`0px`]),"letter-spacing":new Set([`normal`]),opacity:new Set([`1`]),"transition-property":new Set([`all`,`none`]),"transition-duration":new Set([`0s`]),width:new Set([`auto`]),height:new Set([`auto`])},G0=null;function K0(e){try{return G0||(G0=document.createElement(`span`),G0.setAttribute(`data-linear-grab`,`true`),G0.style.display=`none`,document.body.appendChild(G0)),G0.style.color=``,G0.style.color=e,G0.style.color?getComputedStyle(G0).color:null}catch{return null}}var q0=null;function J0(){if(q0)return q0;let e=new Map,t=getComputedStyle(document.documentElement),n=new Set;for(let r of Array.from(document.styleSheets)){let i;try{i=r.cssRules}catch{continue}for(let r of Array.from(i)){let i=r.style;if(i)for(let r=0;r<i.length;r++){let a=i.item(r);if(!a.startsWith(`--`)||n.has(a))continue;n.add(a);let o=t.getPropertyValue(a).trim()||i.getPropertyValue(a).trim();if(!o||o.length>80)continue;let s=K0(o);s&&!e.has(s)&&e.set(s,a)}}}return q0=e,e}function Y0(e){let t=e.getBoundingClientRect();if(t.width<2&&t.height<2)return!1;let n=getComputedStyle(e);return n.display!==`none`&&n.visibility!==`hidden`}function X0(e){let t=[],n=e.getAttribute(`role`);n&&t.push(n);for(let n of[`data-state`,`data-highlighted`,`aria-expanded`,`aria-selected`,`data-active`]){let r=e.getAttribute(n);r!=null&&t.push(`${n.replace(/^(data|aria)-/,``)}=${r||`true`}`)}return t.join(` `)}async function Z0(){try{return(await Promise.resolve().then(()=>(zZ(),jZ))).getGlobalApi()?.getDisplayName??null}catch{return null}}function Q0(e,t){let n=null;try{n=t?.(e)??null}catch{}let r=X0(e),i=n||e.tagName.toLowerCase();return r?`${i} [${r}]`:i}function $0(e,t){let n=getComputedStyle(e),r={},i={};for(let e of H0){let a=n.getPropertyValue(e).trim();if(!(!a||W0[e]?.has(a)))if(U0.has(e)){let n=K0(a);if(n===`rgba(0, 0, 0, 0)`)continue;let o=n?t.get(n):void 0;o&&(i[e]=o),r[e]=a}else r[e]=a}return{styles:r,tok:i}}var e2=40;async function t2(e){let t=J0(),n=await Z0(),r=[],i=new Map,a=e=>{if(r.length>=e2||!Y0(e))return;let o=typeof e.className==`string`?e.className:``,s=`${e.tagName}|${o}`,c=i.get(s);if(c)c.count+=1;else{let{styles:a,tok:c}=$0(e,t),l={label:Q0(e,n),count:1,classes:o,styles:a,tokens:c};i.set(s,l),r.push(l)}for(let t of Array.from(e.children))a(t)};return a(e),{title:r[0]?.label??e.tagName.toLowerCase(),pageUrl:location.href,extractedAt:Date.now(),nodes:r,states:[]}}var n2={active:!1,msLeft:0,total:0,byTrigger:{}},r2=new Set;function i2(e){n2={...n2,...e};for(let e of r2)e(n2)}function a2(e){return r2.add(e),e(n2),()=>void r2.delete(e)}var o2=null;function s2(){o2?.()}function c2(e){return e===`hover`||e===`focus`?e:`open`}async function l2(e,t,n){let r=J0(),i=await Z0(),a=[],o=new Set,s=new Map,c=e=>$0(e,r).styles,l=e=>{if(!(s.size>=120)){s.set(e,c(e));for(let t of Array.from(e.children))l(t)}};l(e);let u=(e,t)=>{let n=s.get(e);if(!n)return;let r=c(e),l={};for(let e of new Set([...Object.keys(n),...Object.keys(r)])){let t=n[e]??`(unset)`,i=r[e]??`(unset)`;t!==i&&(l[e]={from:t,to:i})}if(Object.keys(l).length===0)return;let u=Q0(e,i),d=`${t}|${u}|${Object.keys(l).join(`,`)}`;if(o.has(d))return;o.add(d),a.push({trigger:t,label:u,changed:l});let f=c2(t);i2({total:n2.total+1,byTrigger:{...n2.byTrigger,[f]:(n2.byTrigger[f]??0)+1}})},d=e=>{let t=e.target;t instanceof Element&&s.has(t)&&setTimeout(()=>u(t,`hover`),50)},f=e=>{let t=e.target;t instanceof Element&&s.has(t)&&setTimeout(()=>u(t,`focus`),50)};e.addEventListener(`pointerover`,d,!0),e.addEventListener(`focusin`,f,!0);let p=new MutationObserver(e=>{for(let t of e){if(t.type!==`attributes`||!(t.target instanceof Element))continue;let e=t.target,n=t.attributeName??``,r=e.getAttribute(n)??``;setTimeout(()=>u(e,`attr:${n}=${r||`true`}`),50)}});p.observe(e,{subtree:!0,attributes:!0,attributeFilter:[`class`,`data-state`,`data-highlighted`,`aria-expanded`,`aria-selected`,`open`]});let m=new MutationObserver(t=>{for(let n of t)for(let t of Array.from(n.addedNodes))!(t instanceof Element)||e.contains(t)||t.id===`linear-grab-root`||t.closest?.(`#linear-grab-root`)||setTimeout(()=>{if(!t.isConnected||!Y0(t))return;let{styles:e}=$0(t,r);if(Object.keys(e).length===0)return;let n=Q0(t,i),s=`appeared|${n}`;if(o.has(s))return;o.add(s);let c={};for(let[t,n]of Object.entries(e))c[t]={from:`(absent)`,to:n};a.push({trigger:`appeared (portal/open)`,label:n,changed:c}),i2({total:n2.total+1,byTrigger:{...n2.byTrigger,open:(n2.byTrigger.open??0)+1}})},50)});m.observe(document.body,{childList:!0,subtree:!1}),i2({active:!0,msLeft:t,total:0,byTrigger:{}});let h=setInterval(()=>{let e=t-(Date.now()-g);n?.(Math.max(0,e)),i2({msLeft:Math.max(0,e)})},250),g=Date.now();return await new Promise(e=>{let n=setTimeout(e,t);o2=()=>{clearTimeout(n),e()}}),o2=null,i2({active:!1,msLeft:0}),clearInterval(h),e.removeEventListener(`pointerover`,d,!0),e.removeEventListener(`focusin`,f,!0),p.disconnect(),m.disconnect(),a}function u2(e){let t=[`# Design genome: ${e.title}`,`Extracted from ${e.pageUrl}`,``,`## Structure`];for(let n of e.nodes){t.push(`### ${n.label}${n.count>1?` ×${n.count}`:``}`),n.classes&&t.push(`classes: \`${n.classes}\``);let e=Object.entries(n.styles).map(([e,t])=>{let r=n.tokens[e];return`${e}: ${t}${r?` ← var(${r})`:``}`});e.length&&t.push("```",...e,"```")}if(e.states.length){t.push(``,`## Interaction states`);for(let n of e.states)t.push(`### ${n.label} — ${n.trigger}`),t.push("```",...Object.entries(n.changed).map(([e,t])=>`${e}: ${t.from} → ${t.to}`),"```")}return t.join(`
271
- `)}function d2(){return new Promise(e=>{let t=document.createElement(`div`);t.setAttribute(`data-linear-grab`,`true`),t.style.cssText=`position:fixed;z-index:2147483647;pointer-events:none;border:1.5px solid #5e6ad2;border-radius:4px;background:rgba(94,106,210,0.08);display:none;`,document.body.appendChild(t);let n=null,r=e=>{let t=document.elementFromPoint(e.clientX,e.clientY);return!t||t.closest(`#linear-grab-root`)?null:t},i=e=>{let i=r(e);if(n=i,!i){t.style.display=`none`;return}let a=i.getBoundingClientRect();t.style.display=`block`,t.style.left=`${a.left-2}px`,t.style.top=`${a.top-2}px`,t.style.width=`${a.width+4}px`,t.style.height=`${a.height+4}px`},a=n=>{t.remove(),window.removeEventListener(`mousemove`,i,!0),window.removeEventListener(`click`,o,!0),window.removeEventListener(`keydown`,s,!0),e(n)},o=e=>{e.preventDefault(),e.stopPropagation(),a(n)},s=e=>{e.key===`Escape`&&(e.stopPropagation(),a(null))};window.addEventListener(`mousemove`,i,!0),window.addEventListener(`click`,o,!0),window.addEventListener(`keydown`,s,!0)})}function f2(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?parseFloat(t)||0:t.endsWith(`s`)?(parseFloat(t)||0)*1e3:0})}var p2=new Set(`width.height.min-width.min-height.max-width.max-height.top.left.right.bottom.inset.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.font-size.line-height.letter-spacing.box-shadow.filter.background-position.grid-template-columns.grid-template-rows.flex-basis.gap`.split(`.`));function m2(e){return e.includes(`all`)?[`all (includes layout/paint props)`]:e.filter(e=>p2.has(e))}function h2(e){let t=g2(e);if(t===`ease-in`||t===`ease-in-out`)return t;let n=t.match(/cubic-bezier\(\s*([\d.]+)\s*,\s*(-?[\d.]+)/);if(n){let e=parseFloat(n[1]),r=parseFloat(n[2]);if(e>=.4&&r<e/2)return t}return null}function g2(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===`(`)t++;else if(r===`)`)t--;else if(r===`,`&&t===0)return e.slice(0,n).trim()}return e.trim()}var _2=`[data-slot*="content"], [role="menu"], [role="dialog"], [role="listbox"]`,v2=new Set([`width`,`height`,`flex-basis`,`grid-template-columns`,`grid-template-rows`,`grid-template-areas`]);function y2(e,t){if(e instanceof SVGElement)return!0;try{if(e.closest(`svg`))return!0}catch{}try{if(e.closest(_2))return!0}catch{}try{if(e.closest(`[data-panel]`))return!t||t.length===0||t.every(e=>v2.has(e))}catch{}return!1}function b2(e){let t=e.id?`#${e.id}`:``,n=typeof e.className==`string`&&e.className?`.${e.className.split(/\s+/).filter(Boolean).slice(0,2).join(`.`)}`:``;return`${e.tagName.toLowerCase()}${t}${n}`}var x2=200;function S2(e){if(typeof e.className!=`string`)return;let t=e.className.split(/\s+/).filter(e=>/^(transition|duration-|delay-|ease-)/.test(e));return t.length?t.join(` `):void 0}function C2(e,t,n,r,i,a){let o=[];return n>0&&o.push(`remove the ${Math.round(n)}ms transition-delay`),(r?.includes(`transition-all`)||e.includes(`all`))&&o.push(`scope 'transition-all' to the intended properties (e.g. transition-colors)`),a?.length&&o.push(`JANK: transitions LAYOUT/PAINT props (${a.join(`, `)}) — reflow/repaint every frame; animate transform/opacity instead (box-shadow → animate a pseudo-element's opacity)`),i&&o.push(`easing '${i}' starts slow — §42 bans ease-in/ease-in-out on UI, use ease-out`),t>500?o.push(`${Math.round(t)}ms is over the 500ms HARD CAP for UI feedback`):t>300?o.push(`${Math.round(t)}ms is over the 300ms UI cap`):t>100&&o.push(`shorten ${Math.round(t)}ms → ≤100ms`),o.push(`make PRESS feedback instant: 'active:transition-none' (and data-[state=…]:transition-none for toggles) — animate only hover in/out`),o.join(`; `)}async function w2(){try{return(await Promise.resolve().then(()=>(zZ(),jZ))).getGlobalApi()??null}catch{return null}}async function T2(e){let t=await w2(),n=null,r=null;try{n=t?.getDisplayName?.(e)??null}catch{}try{let n=await t?.getSource?.(e);n?.filePath&&(r=`${n.filePath}${n.lineNumber==null?``:`:${n.lineNumber}`}`)}catch{}return{component:n,source:r}}var E2=[],D2=null;function O2(e){E2.push(e),D2??=setTimeout(()=>{D2=null;let e=E2.slice(0,50).map(e=>({kind:`css-slowdown`,...e}));E2=[],XO().then(t=>fetch(`${t}/scan/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({events:e}),keepalive:!0})).catch(()=>{})},1500)}var k2=[],A2=new Set;function j2(e){let t=e.mode===`live`?k2.find(t=>t.mode===`live`&&t.element===e.element&&(t.classHint??``)===(e.classHint??``)&&t.properties.join()===e.properties.join()):void 0;t?(t.count+=1,t.at=e.at,t.sinceInputMs=e.sinceInputMs,k2=[...k2]):k2=[e,...k2].slice(0,100);for(let e of A2)e(k2);O2(e)}function M2(e){return A2.add(e),e(k2),()=>void A2.delete(e)}function N2(){k2=[];for(let e of A2)e(k2)}var P2=!0;try{P2=localStorage.getItem(`linear-grab:css-watch`)!==`0`}catch{}var F2=new Set;function I2(){return P2}function L2(e){P2=e;try{localStorage.setItem(`linear-grab:css-watch`,e?`1`:`0`)}catch{}for(let t of F2)t(e)}function R2(e){return F2.add(e),e(P2),()=>void F2.delete(e)}var z2=!1;function B2(){if(z2||typeof window>`u`)return;z2=!0;let e=0,t=()=>{e=performance.now()};for(let e of[`pointerdown`,`pointerup`,`keydown`])window.addEventListener(e,t,{capture:!0,passive:!0});let n=new Map,r=new Map;window.addEventListener(`transitionrun`,t=>{if(!P2)return;let i=performance.now()-e;if(i>x2)return;let a=t.target;if(!(a instanceof Element)||a.closest(`#linear-grab-root`)||a===document.documentElement||a===document.body||t.propertyName.startsWith(`--`))return;let o=getComputedStyle(a),s=o.transitionProperty.split(`,`).map(e=>e.trim());if(y2(a,s))return;let c=f2(o.transitionDuration),l=f2(o.transitionDelay),u=Math.max(0,s.indexOf(t.propertyName)),d=c[u%c.length]??c[0]??0,f=l[u%l.length]??l[0]??0;if(d+f<=100)return;let p=r.get(a);if(p){p.props.add(t.propertyName),p.duration=Math.max(p.duration,d),p.delay=Math.max(p.delay,f);return}let m={props:new Set([t.propertyName]),duration:d,delay:f,since:i,timer:setTimeout(()=>{r.delete(a);let e=b2(a),t=Date.now();if(t-(n.get(e)??0)<5e3)return;n.set(e,t);let i=S2(a),o=[...m.props],s=a.isConnected?h2(getComputedStyle(a).transitionTimingFunction):null,c=m2(o);T2(a).then(({component:n,source:r})=>{j2({mode:`live`,page:location.pathname,element:e,component:n,source:r,properties:o,durationMs:Math.round(m.duration),delayMs:Math.round(m.delay),sinceInputMs:Math.round(m.since),count:1,classHint:i,easing:s??void 0,jankProps:c.length?c:void 0,suggestion:C2(o,m.duration,m.delay,i,s,c),at:t})})},300)};r.set(a,m)},{capture:!0,passive:!0})}var V2=`button, a, input, select, textarea, [role], [tabindex], [data-state], [aria-expanded]`;async function H2(){let e=new Map,t=Array.from(document.querySelectorAll(V2)).slice(0,3e3);for(let n of t){if(n.closest(`#linear-grab-root`))continue;let t=n.getBoundingClientRect();if(t.width<2&&t.height<2)continue;let r=getComputedStyle(n);if(r.cursor!==`pointer`&&!n.matches(`button, a, input, select, textarea`))continue;let i=r.transitionProperty.split(`,`).map(e=>e.trim());if(y2(n,i))continue;let a=f2(r.transitionDuration),o=f2(r.transitionDelay),s=Math.max(...a,0)+Math.max(...o,0);if(s<=100)continue;let c=S2(n),l=`${n.tagName}|${c??i.join()}|${Math.round(s)}`,u=e.get(l);if(u){u.finding.count+=1;continue}let d=h2(r.transitionTimingFunction),f=m2(i);e.set(l,{example:n,finding:{mode:`audit`,page:location.pathname,element:b2(n),component:null,source:null,properties:i,durationMs:Math.round(Math.max(...a,0)),delayMs:Math.round(Math.max(...o,0)),count:1,classHint:c,easing:d??void 0,jankProps:f.length?f:void 0,suggestion:C2(i,Math.max(...a,0),Math.max(...o,0),c,d,f),at:Date.now()}})}let n=[];for(let{finding:t,example:r}of e.values()){let{component:e,source:i}=await T2(r);t.component=e,t.source=i,n.push(t)}n.sort((e,t)=>t.durationMs+t.delayMs-(e.durationMs+e.delayMs)||t.count-e.count),k2=[...n,...k2.filter(e=>e.mode===`live`)].slice(0,100);for(let e of A2)e(k2);for(let e of n)O2(e);return n}function U2(e){return[`Below is a CSS-slowdown report from my running app (live-captured on real input + full-page audit).`,`Goal: ALL interaction feedback must be instant. Rules:`,``,`1. Most of these come from SHARED design-system variants — fix the VARIANT`,` DEFINITIONS, not the call sites. Grep for the exact class recipes in the`," findings' `classes:` lines (e.g. `transition-all`, `transition-colors duration-150`).","2. Press/toggle state changes get NO transition: add `active:transition-none`"," and `data-[state=on]:transition-none` / `data-[state=open]:transition-none`.",` Hover in/out may keep a transition but shorten it: duration-150 → duration-100`,` (duration-75 for small controls like tabs and icon buttons).`,"3. Replace every `transition-all` with the scoped variant (transition-colors /",` transition-transform / transition-opacity — per what actually changes).`,`3b. Findings marked ⚠ layout/paint: NEVER transition width/height/top/left/`,` margin/padding/box-shadow — they reflow or repaint every frame. Use`,` transform: translate/scale, and animate a pseudo-element's opacity for shadows.`,`3c. Findings marked ⚠ easing: never ease-in OR ease-in-out on UI (§42 bans`,` both) — replace with ease-out (house curve: cubic-bezier(.2,0,.1,1), the`,` theme default).`,`3d. Press must be instant GLOBALLY: keep the unlayered §42 rule in globals.css`," — `button:active, a:active, [role=button/tab/menuitem/option]:active"," { transition-duration: 0s }` — so pointer-down feedback snaps and only the",` release animates back. If a control still animates on press, that global`,` rule is missing or overridden.`,`4. Where a finding's source looks like a generic fallback (one file:line repeated`," for many components), locate the code by the `classes:` line instead.",`5. Do NOT touch entry/exit animations of popovers/menus or icon micro-motion`,` (chevron rotate etc.) — that is intentional; only input FEEDBACK must be instant.`,`6. PROOF REQUIRED: after the change I will re-run the audit — it must show zero`,` interactive elements ≥100ms and clicking must produce no live findings.`,` Do not claim done without stating what you changed per variant.`,``,`---`,``,W2(e)].join(`
272
- `)}function W2(e){let t=[`# CSS slowdowns on ${location.host}${location.pathname}`,`Threshold: 100ms (interaction feedback should be instant).`,``];for(let n of e)t.push(`## ${n.component??n.element}${n.count>1?` ×${n.count}`:``} — ${n.durationMs}ms${n.delayMs?` +${n.delayMs}ms delay`:``}`),n.source&&t.push(`- source: ${n.source}`),t.push(`- transitions: ${n.properties.join(`, `)}`),n.classHint&&t.push(`- classes: \`${n.classHint}\``),n.jankProps?.length&&t.push(`- ⚠ layout/paint transition (reflows every frame): ${n.jankProps.join(`, `)}`),n.easing&&t.push(`- ⚠ easing: ${n.easing} (§42 bans ease-in/ease-in-out — use ease-out)`),n.sinceInputMs!=null&&t.push(`- fired ${n.sinceInputMs}ms after user input (live capture)`),t.push(`- fix: ${n.suggestion}`,``);return t.join(`
273
- `)}function G2(e,t,n){return{ruleId:e.id,part:e.part,severity:e.severity,description:e.description,selector:b2(t),evidence:n,el:typeof WeakRef<`u`?new WeakRef(t):void 0}}function K2(e){return e.getBoundingClientRect()}function q2(e){return e.split(`/`)[0].trim().split(/\s+/).filter(Boolean).map(e=>e.endsWith(`px`)?parseFloat(e):NaN)}function J2(e){let t=e.match(/rgba?\(([^)]+)\)/);return t?t[1].split(`,`).map(e=>e.trim()).join(`,`):null}function Y2(e,t){let n=t,r=n.maskImage||n.webkitMaskImage||``;if(r&&r!==`none`)return r;let i=(e.getAttribute(`style`)??``).match(/(?:^|;|\s)(?:-webkit-)?mask-image\s*:\s*([^;]+)/i);return i&&i[1].trim()&&i[1].trim()!==`none`?i[1].trim():``}var X2=new Set([0,8,12,16]),Z2={light:J2(`rgb(240, 240, 241)`),dark:J2(`rgb(35, 35, 37)`)},Q2=new Set([`#50e3c2`,`#ee0000`,`#f5a623`]),$2=`button, a, [role="button"], [role="tab"], [role="menuitem"], [role="option"], input, textarea, select`;function e4(e){let t=[],n=e=>{for(let r of Array.from(e)){let e=r;if(e.cssRules&&e.cssRules.length){n(e.cssRules);continue}let i=r.selectorText;i&&i.includes(`:hover`)&&t.push(i.replace(/:hover/g,``))}};for(let t of Array.from(e.styleSheets))try{n(t.cssRules)}catch{}return t}function t4(e,t){for(let n of t)if(n.trim())try{if(e.matches(n))return!0}catch{}return!1}function n4(e){return!e.matches(`button, [role="button"]`)||e.querySelectorAll(`svg`).length===0?!1:(e.textContent??``).trim().length===0}function r4(e){let t=e.parentElement;for(;t;){try{let e=i4(t).overflowY;if(e===`auto`||e===`scroll`)return t}catch{}t=t.parentElement}return null}var i4=e=>getComputedStyle(e),a4={id:`radius-vocabulary`,part:`§40`,severity:`error`,description:`§40: radius vocabulary is {8, 12, 16, full} — never rounded-md/[4px]/[6px]/[10px]. Off-vocabulary radius.`,check(e){let t=[];for(let n of e.els){let r=e.css(n).borderRadius;if(!r||r===`0px`)continue;let i=q2(r);if(i.some(e=>Number.isNaN(e)))continue;let a=Math.max(...i);if(a===0)continue;let o=K2(n),s=Math.min(o.width||0,o.height||0);s>0&&a>=s/2-.5||i.every(e=>X2.has(e))||t.push(G2(this,n,`border-radius: ${r}`))}return t}},o4={id:`row-radius-token`,part:`§40`,severity:`error`,description:`§40: list rows consume --row-radius (8px) or 0 — no bespoke per-surface row radius.`,check(e){let t=[];for(let n of e.els){let r=K2(n).height;if(r<26||r>50||!r4(n))continue;let i=n.parentElement;if(!i||Array.from(i.children).filter(e=>{let t=K2(e);return Math.abs(t.height-r)<2}).length<3)continue;let a=q2(e.css(n).borderRadius);if(a.some(e=>Number.isNaN(e)))continue;let o=Math.max(0,...a);o===0||o===8||t.push(G2(this,n,`row radius ${e.css(n).borderRadius} (want 0 or var(--row-radius)=8px)`))}return t}},s4={id:`active-fill-token`,part:`§11`,severity:`error`,description:`§11: active/selected fill must be var(--selected) (theme-safe) — never bg-secondary (#F0F0F1 / #232325).`,check(e){let t=[],n=null;try{let t=e.root.documentElement??document.documentElement;t&&(n=J2(e.css(t).getPropertyValue(`--selected`).trim()))}catch{}let r=[Z2.light,Z2.dark].filter(Boolean);if(n&&r.includes(n)){let t=e.root.documentElement??document.documentElement;return[G2({id:this.id,part:this.part,severity:`warn`,description:`§11: active-fill-token unverifiable — --selected resolves EQUAL to bg-secondary this theme; cannot distinguish the token from the anti-pattern.`},t??e.els[0],`--selected == bg-secondary (${n})`)]}for(let n of e.els){if(!(n.matches(`[role="tab"], [role="button"], [aria-selected], [role="option"]`)||n.closest(`[role="tablist"], [role="menu"], [data-rail], nav`)))continue;let i=J2(e.css(n).backgroundColor);i&&r.includes(i)&&t.push(G2(this,n,`background bg-secondary (${e.css(n).backgroundColor}) — use var(--selected)`))}return t}},c4={id:`inline-style-state`,part:`§40`,severity:`error`,description:`§40: the shared row-action class owns ALL visual states; inline styles carry LAYOUT ONLY — an inline background/color kills the class state.`,check(e){let t=[];for(let n of e.els){let e=typeof n.className==`string`?n.className:``;if(!/pb-row-action|row-action/.test(e))continue;let r=n.getAttribute(`style`)??``;/(^|;|\s)(background|color)\s*:/.test(r)&&t.push(G2(this,n,`inline style="${r}" on a row-action element`))}return t}},l4={id:`icon-button-no-hover`,part:`§40`,severity:`warn`,description:`§40/Part 10: every interactive control changes color on hover — icon-only button with no :hover rule and no .pb-row-action.`,check(e){let t=[],n=e4(e.root.styleSheets?e.root:document);for(let r of e.els){if(!n4(r))continue;let i=typeof r.className==`string`?r.className:``;/pb-row-action|row-action/.test(i)||r.hasAttribute(`data-framer-appear-id`)||Array.from(r.attributes).some(e=>e.name.startsWith(`data-framer`))||e.css(r).willChange.includes(`transform`)||t4(r,n)||t.push(G2(this,r,`icon-only ${r.tagName.toLowerCase()} with no hover rule / .pb-row-action`))}return t}},u4={id:`icon-button-no-tooltip`,part:`§7`,severity:`warn`,description:`§7: every icon-only button gets the shared Tooltip — needs aria-describedby / data-slot="tooltip-trigger" (menu-row title exempt).`,check(e){let t=[];for(let n of e.els)n4(n)&&(n.hasAttribute(`aria-describedby`)||n.getAttribute(`data-slot`)===`tooltip-trigger`||n.closest(`[data-slot="tooltip-trigger"]`)||n.closest(`[role="menuitem"]`)&&n.hasAttribute(`title`)||t.push(G2(this,n,`icon-only ${n.tagName.toLowerCase()} with no tooltip trigger / aria-describedby`)));return t}},d4={id:`unvirtualized-scroller`,part:`§0`,severity:`error`,description:`§0: every dynamic-length scrolling list virtualizes — a tall scroller with 60+ direct children is unvirtualized.`,check(e){let t=[];for(let n of e.els){let r=e.css(n);if(![r.overflowY,r.overflowX,r.overflow].some(e=>e===`auto`||e===`scroll`)||n.scrollHeight<=2*n.clientHeight)continue;let i=n.children.length;i<=60||t.push(G2(this,n,`${i} direct children, scrollHeight ${n.scrollHeight} > 2×clientHeight ${n.clientHeight}`))}return t}},f4={id:`scroll-no-fade`,part:`§1`,severity:`warn`,description:`§1: a horizontal scroller needs a truthful scroll fade — no scroll-fade-x/scroll-fade-x-js class and no mask-image.`,check(e){let t=[];for(let n of e.els){let r=e.css(n).overflowX;if(r!==`auto`&&r!==`scroll`||n.clientWidth<24||n.scrollWidth<=n.clientWidth+8)continue;let i=typeof n.className==`string`?n.className:``;/scroll-fade-x(-js)?/.test(i)||Y2(n,e.css(n))||t.push(G2(this,n,`horizontal scroller (scrollWidth ${n.scrollWidth} > clientWidth ${n.clientWidth}) with no fade`))}return t}},p4={id:`phantom-fade`,part:`§1`,severity:`warn`,description:`§1: a fade must NEVER paint when nothing is hidden — mask-image present but scrollWidth ≤ clientWidth (the fade lies).`,check(e){let t=[];for(let n of e.els)Y2(n,e.css(n))&&(n.scrollWidth>n.clientWidth||t.push(G2(this,n,`mask-image fade but scrollWidth ${n.scrollWidth} ≤ clientWidth ${n.clientWidth}`)));return t}},m4={id:`scrollbar-flush`,part:`Part 5`,severity:`warn`,description:`Part 5: scrollables carry asymmetric right padding so content clears the scrollbar — padding-right < 8px while overflowing vertically with content reaching the right edge.`,check(e){let t=[];for(let n of e.els){let r=e.css(n);if(![r.overflowY,r.overflow].some(e=>e===`auto`||e===`scroll`)||n.scrollHeight<=n.clientHeight)continue;let i=parseFloat(r.paddingRight)||0;if(i>=8)continue;let a=K2(n);Array.from(n.children).some(e=>{let t=K2(e);return a.right-t.right<=4})&&t.push(G2(this,n,`padding-right ${i}px (<8px) with content flush to the scrollbar`))}return t}},h4=/^("?(Geist|Geist Mono)"?|ui-monospace|ui-sans-serif|-apple-system|system-ui)/i,g4={id:`font-family`,part:`Part 5`,severity:`warn`,description:`Part 5: Geist / Geist Mono ONLY — computed font-family does not start with the Geist / ui-monospace fallback chain.`,check(e){let t=[];for(let n of e.els){if(!k4(n))continue;let r=e.css(n).fontFamily;r&&(h4.test(r.trim())||t.push(G2(this,n,`font-family: ${r}`)))}return t}},_4={id:`uppercase-label`,part:`§25`,severity:`error`,description:`§25: group/section labels are sentence-case — never uppercase (text-transform: uppercase on small <13px text).`,check(e){let t=[];for(let n of e.els){if(!k4(n))continue;let r=e.css(n);r.textTransform===`uppercase`&&((parseFloat(r.fontSize)||0)>=13||t.push(G2(this,n,`text-transform: uppercase at ${r.fontSize}`)))}return t}},v4={id:`hardcoded-status-hex`,part:`Part 5`,severity:`warn`,description:`Part 5: raw hex only for the status trio (#50E3C2/#EE0000/#F5A623) — a saturated non-token color on small UI text.`,check(e){let t=[],n=new Set;for(let e of Q2){let t=J2(`rgb(${parseInt(e.slice(1,3),16)}, ${parseInt(e.slice(3,5),16)}, ${parseInt(e.slice(5,7),16)})`);t&&n.add(t)}try{let t=e.root,r=t.documentElement;if(r&&t.body){let i=e.css(r),a=t.createElement(`span`);a.setAttribute(`data-linear-grab`,`true`),a.style.display=`none`,t.body.appendChild(a);for(let e=0;e<i.length;e++){let t=i[e];if(!t.startsWith(`--`))continue;let r=i.getPropertyValue(t).trim();if(!r||r.length>40||(a.style.color=``,a.style.color=r,!a.style.color))continue;let o=J2(getComputedStyle(a).color);o&&n.add(o)}a.remove()}}catch{}for(let r of e.els){if(!k4(r))continue;let i=(r.getAttribute(`style`)??``).match(/#[0-9a-fA-F]{6}/g)??[],a=e.css(r);if((parseFloat(a.fontSize)||0)>=16)continue;for(let e of i)Q2.has(e.toLowerCase())||t.push(G2(this,r,`hardcoded ${e} (not the brand status trio)`));let o=J2(a.color);if(o&&i.length===0&&!n.has(o)){let[e,n,i]=o.split(`,`).map(e=>parseFloat(e));Number.isFinite(e)&&A4(e,n,i)&&t.push(G2(this,r,`saturated non-token color ${a.color} on small UI text`))}}return t}},y4={id:`editor-shadow`,part:`Part 5`,severity:`error`,description:`Part 5: editor surfaces are FLAT — box-shadow that is not a 0.5px hairline ring / approved popover/card/input token shadow.`,check(e){let t=[];if(!(e.root.querySelector?.(`[data-editor-surface]`)||typeof location<`u`&&/\/editor\//.test(location.pathname)))return t;for(let n of e.els){if(!n.closest(`[data-editor-surface]`)&&!/\/editor\//.test(typeof location<`u`?location.pathname:``))continue;let r=e.css(n).boxShadow;!r||r===`none`||M4(r)||N4(r)||t.push(G2(this,n,`box-shadow: ${r}`))}return t}},b4={id:`focusring-clip`,part:`§24`,severity:`warn`,description:`§24/Part 5: focus rings never clip — a focusable element whose nearest overflow-hidden ancestor sits <4px from its border box.`,check(e){let t=[];for(let n of e.els){if(!n.matches($2)&&n.getAttribute(`tabindex`)==null)continue;let r=n.parentElement;for(;r;){let t=e.css(r);if([t.overflow,t.overflowX,t.overflowY].some(e=>e===`hidden`))break;r=r.parentElement}if(!r)continue;let i=K2(n),a=K2(r);if(i.width===0&&i.height===0)continue;let o=Math.min(i.left-a.left,a.right-i.right,i.top-a.top,a.bottom-i.bottom);o>=4||t.push(G2(this,n,`overflow-hidden ancestor ${o.toFixed(1)}px from border box — focus ring will clip`))}return t}},x4={id:`fixed-width-in-pane`,part:`§24`,severity:`warn`,description:`§24: no fixed field widths in resizable panes — w-[Npx] (N ≥ 200) inside a [data-panel] / flex-basis sibling clips at the pane edge.`,check(e){let t=[];for(let n of e.els){if(!n.closest(`[data-panel]`))continue;let e=typeof n.className==`string`?n.className:``,r=n.getAttribute(`style`)??``,i=e.match(/w-\[(\d+)px\]/)??r.match(/(?:^|;|\s)width\s*:\s*(\d+)px/);if(!i)continue;let a=parseFloat(i[1]);a<200||t.push(G2(this,n,`fixed width ${a}px inside a resizable pane — use w-full max-w-[${a}px]`))}return t}},S4={id:`menu-icons-all-or-none`,part:`§21`,severity:`error`,description:`§21: within one menu ALL items carry a leading icon or NONE do — a mixed set reads broken.`,check(e){let t=[],n=Array.from(e.root.querySelectorAll(`[role="menu"]`));for(let e of n){let n=Array.from(e.querySelectorAll(`[role="menuitem"]`));if(n.length<2)continue;let r=n.filter(e=>e.querySelector(`svg`)).length;r===0||r===n.length||t.push(G2(this,e,`${r}/${n.length} menu items have a leading icon`))}return t}},C4={id:`menu-icon-mixed-weight`,part:`§21`,severity:`warn`,description:`§21: menu icons are ONE stroke family — some filled (fill=currentColor) and some stroke-based, or rendered sizes differing >2px, mixes two design systems.`,check(e){let t=[],n=Array.from(e.root.querySelectorAll(`[role="menu"]`));for(let e of n){let n=Array.from(e.querySelectorAll(`[role="menuitem"] svg`));if(n.length<2)continue;let r=0,i=0,a=[];for(let e of n){Array.from(e.querySelectorAll(`path, circle, rect, polygon`)).some(e=>{let t=(e.getAttribute(`fill`)??``).toLowerCase();return t===`currentcolor`||t&&t!==`none`})?r++:i++;let t=K2(e);a.push(Math.max(t.width,t.height))}let o=Math.max(...a),s=Math.min(...a),c=r>0&&i>0,l=o>0&&o-s>2;!c&&!l||t.push(G2(this,e,c?`${r} filled + ${i} stroke-based icons in one menu`:`icon sizes differ by ${(o-s).toFixed(1)}px`))}return t}},w4={id:`chrome-selectable`,part:`Part 5`,severity:`warn`,description:`Part 5: chrome (rails/pills/tabs) is select-none — a rail/pill/tab without user-select:none.`,check(e){let t=[];for(let n of e.els){if(!(n.matches(`[role="tab"]`)||n.closest(`[role="tablist"], [data-rail], nav`)||/\bpill\b/.test(typeof n.className==`string`?n.className:``)))continue;let r=e.css(n).userSelect||e.css(n).webkitUserSelect;r!==`none`&&t.push(G2(this,n,`chrome element without user-select:none (user-select: ${r||`auto`})`))}return t}},T4={id:`cursor-mismatch`,part:`Part 5`,severity:`warn`,description:`Part 5: cursor semantics — buttons get pointer, static text gets default. A button with cursor:text, or static text with cursor:pointer and no interactive ancestor.`,check(e){let t=[];for(let n of e.els){let r=e.css(n).cursor;if(n.matches(`button, [role="button"]`)&&r===`text`){t.push(G2(this,n,`interactive control with cursor:text`));continue}if(r===`pointer`&&n.matches(`p, h1, h2, h3, h4, h5, h6, span`)){if(n.closest(`button, a, [role="button"], [onclick], label`)||n.matches(`button, a, [role="button"]`))continue;t.push(G2(this,n,`static ${n.tagName.toLowerCase()} with cursor:pointer and no interactive ancestor`))}}return t}};function E4(e){let t=e.transitionProperty.split(`,`).map(e=>e.trim()).filter(Boolean);return t.length===1&&t[0]===`none`?[]:t}var D4=[a4,o4,s4,c4,l4,u4,d4,f4,p4,m4,g4,_4,v4,y4,b4,x4,S4,C4,w4,T4,{id:`transition-all`,part:`§42`,severity:`error`,description:`§42: never transition-all — scope to what changes (transition-colors / transition-[transform,...]).`,check(e){let t=[];for(let n of e.els){if(!n.matches($2))continue;let r=E4(e.css(n));r.includes(`all`)&&(y2(n,r)||t.push(G2(this,n,`transition-property: all`)))}return t}},{id:`transition-paint-prop`,part:`§42`,severity:`error`,description:`§42: never transition layout/paint props (box-shadow, width, height, top/left, margin, padding) — they reflow/repaint every frame; focus rings SNAP, shadows animate a pseudo-element opacity.`,check(e){let t=[];for(let n of e.els){let r=E4(e.css(n)),i=m2(r).filter(e=>e!==`all (includes layout/paint props)`);i.length!==0&&(y2(n,r)||t.push(G2(this,n,`transitions layout/paint props: ${i.join(`, `)}`)))}return t}},{id:`transition-too-slow`,part:`§42`,severity:`error`,description:`§42: interaction feedback is ≤100ms (duration-75 for small controls) — the 100ms theme default is fine; an explicit duration-150+ crept in.`,check(e){let t=[];for(let n of e.els){if(!n.matches($2))continue;let r=e.css(n),i=E4(r);if(i.length===0||y2(n,i))continue;let a=f2(r.transitionDuration),o=Math.max(0,...a);o<=100||t.push(G2(this,n,`transition-duration ${o}ms (>100ms) on [${i.join(`, `)}]`))}return t}},{id:`ease-in-feedback`,part:`§42`,severity:`warn`,description:`§42: house curve is cubic-bezier(.2,0,.1,1) ease-out — never ease-in / ease-in-out (or an ease-in-shaped bezier) on feedback.`,check(e){let t=[];for(let n of e.els){if(!n.matches($2))continue;let r=e.css(n),i=E4(r);if(i.length===0||y2(n,i))continue;let a=h2(r.transitionTimingFunction);a&&t.push(G2(this,n,`transition-timing-function: ${a}`))}return t}},{id:`press-instant-rule-missing`,part:`§42`,severity:`error`,description:"§42: the global press-instant rule (globals.css) must exist — `button:active{transition-duration:0s}` (or transition:none). Absent = press feedback animates instead of snapping.",check(e){let t=e.root.styleSheets?e.root:document,n=!1,r=e=>{for(let t of Array.from(e)){if(n)return;let e=t;if(e.cssRules&&e.cssRules.length){r(e.cssRules);continue}let i=t,a=i.selectorText;if(a&&/:active\b/.test(a)&&/(^|[\s,])(button|a|\[role=("|')?(button|tab|menuitem|option)("|')?\])/i.test(a))try{let e=i.style.transitionDuration,t=i.style.transition;if(e===`0s`||/(^|\s)none(\s|$)/.test(t)||/\b0s\b/.test(t)){n=!0;return}}catch{}}};try{for(let e of Array.from(t.styleSheets)){if(n)break;try{r(e.cssRules)}catch{}}}catch{}if(n)return[];let i=e.root.documentElement??e.els[0]??document.documentElement;return[G2(this,i,"no `button:active { transition-duration: 0s }` rule on this page")]}}],O4=[];function k4(e){for(let t of Array.from(e.childNodes))if(t.nodeType===3&&(t.textContent??``).trim().length>0)return!0;return!1}function A4(e,t,n){let r=Math.max(e,t,n);return r<40?!1:r-Math.min(e,t,n)>60}function j4(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t.filter(Boolean)}function M4(e){return j4(e).every(e=>{if(/\btransparent\b/.test(e)||/(?:rgba?|hsla?|oklch|oklab|lab|lch|color)\([^)]*[/,]\s*0(?:\.0+)?\s*\)/.test(e))return!0;let t=e.match(/-?\d*\.?\d+(?:px|em|rem)/g)??[];return t.length>0&&t.every(e=>parseFloat(e)===0)})}function N4(e){return!!(/\b0px\s+0px\s+0px\s+0?\.?5px\b/.test(e)||/\b0px?\s+0px?\s+0px?\s+0?\.?5px\b/.test(e))}var P4=`#linear-grab-root, [data-linear-grab], [data-react-grab], #claude-agent-glow-border, [id^="react-scan"]`;function F4(e=typeof document<`u`?document:{}){let t=new Map,n=e=>{let n=t.get(e);return n||(n=getComputedStyle(e),t.set(e,n)),n};i4=n;let r=Array.from(e.querySelectorAll(`*`)),i=[],a=e.documentElement??null,o=e.body??null,s=(a?.getBoundingClientRect().width??0)>0;for(let e of r){if(e===a||e===o||e.closest(P4))continue;let t=K2(e);if(s){if(t.width<2||t.height<2)continue}else if(t.width===0&&t.height===0&&e.children.length===0)continue;i.push(e)}let c={root:e,els:i,css:n},l=[];for(let e of[...D4,...O4])try{l.push(...e.check(c))}catch{}i4=e=>getComputedStyle(e);let u=new Map;for(let e of l){let t=`${e.ruleId}|${e.selector}|${e.evidence}`,n=u.get(t);n?n.count=(n.count??1)+1:u.set(t,e)}return[...u.values()]}function I4(e){let t=new Map;for(let n of e){let e=t.get(n.ruleId);e?e.push(n):t.set(n.ruleId,[n])}let n=Array.from(t.entries()).sort((e,t)=>{let n=e[1][0].severity===`error`?0:1,r=t[1][0].severity===`error`?0:1;return n===r?t[1].length===e[1].length?e[0].localeCompare(t[0]):t[1].length-e[1].length:n-r}),r=e.length,i=e.filter(e=>e.severity===`error`).length,a=new Set(e.map(e=>e.page).filter(Boolean)).size>1,o=[`# Slop scan — ${i} error${i===1?``:`s`}, ${r-i} warn (${r} total)`,``];for(let[e,t]of n){let n=t[0],r=t.reduce((e,t)=>e+(t.count??1),0);o.push(`## ${e} — ${n.severity} ×${r} [${n.part}]`),o.push(n.description);for(let e of t){let t=e.component||e.source?` — ${[e.component,e.source].filter(Boolean).join(` @ `)}`:``,n=(e.count??1)>1?` ×${e.count}`:``;o.push(`- ${a&&e.page?`\`${e.page}\` `:``}\`${e.selector}\`${n} — ${e.evidence}${t}`)}o.push(``)}return o.join(`
274
- `)}function L4(e){return[`Below is a design-system SLOP report from my running app — each finding is a`,"live-DOM violation of the Linear/Protocolbase primitives contract (`Linear","-primitives.md`). Every rule cites its §id. Goal: zero errors. Rules:",``,`1. Fix at the TOKEN / VARIANT level, not the call sites. Most of these come`,` from shared row/button/menu variants — change --row-radius, --selected,`,` .pb-row-action, the Button/Input variant, or the globals.css §42 rules —`,` not one component at a time.`,`2. Cite the primitives §id in your fix (each finding carries it). Radius →`,` §40 vocabulary {8,12,16,full}; active fill → §11 var(--selected); menus →`,` §21 all-or-none icons + one stroke family; uppercase labels → §25;`,` editor flatness → Part 5; scrollers → §0–1 virtualize + truthful fade.`,`3. §42 group (transition-all / paint-prop / too-slow / ease-in / press-`,` instant): scope transitions to what changes, drop box-shadow/width/height`,` from transition lists, keep feedback ≤100ms (duration-75 small controls),`,` use ease-out (cubic-bezier(.2,0,.1,1)), and keep the global`," `button:active{transition-duration:0s}` press-instant rule.",`4. Do NOT touch EXEMPT intentional motion — popover/menu/dialog entry-exit,`,` svg icon micro-motion, and panel width/height transitions are §42-blessed.`,` The scan already excludes them; do not "fix" them.`,`5. 'unverifiable' warnings mean the token collapsed to the anti-pattern this`,` theme — verify the intent in BOTH themes, do not just silence it.`,"6. Findings carry `Component @ file:line` when the fiber source resolved.",` When one file:line repeats across many components it is the nearest-`,` debug-fiber fallback — locate the real code by the selector classes.`,`7. PROOF REQUIRED: after the change I will re-run the scan — it must show 0`,` errors. State what you changed per token/variant; do not claim done blind.`,``,`---`,``,I4(e)].join(`
275
- `)}var R4=[],z4=new Set;function B4(e){return z4.add(e),e(R4),()=>void z4.delete(e)}function V4(){R4=[];for(let e of z4)e(R4)}function H4(){let e=location.pathname,t=F4(document).map(t=>({...t,page:e}));R4=[...t,...R4.filter(t=>t.page!==e)];for(let e of z4)e(R4);return U4(t).then(()=>{R4=[...R4];for(let e of z4)e(R4);W4(t)}),t}async function U4(e){let t=null;try{t=(await Promise.resolve().then(()=>(zZ(),jZ))).getGlobalApi()??null}catch{return}if(!t)return;let n=new Map;for(let t of e){let e=t.el?.deref();if(!e)continue;let r=n.get(e);r?r.push(t):n.set(e,[t])}let r=300;for(let[e,i]of n){if(r--<=0)break;let n=null,a=null;try{n=t.getDisplayName?.(e)??null}catch{}try{let n=await t.getSource?.(e);n?.filePath&&(a=`${n.filePath}${n.lineNumber==null?``:`:${n.lineNumber}`}`)}catch{}if(!(!n&&!a))for(let e of i)e.component=n,e.source=a}}function W4(e){if(e.length===0)return;let t=Date.now(),n=e.slice(0,200).map(({el:e,...n})=>({kind:`slop-scan`,at:t,...n}));XO().then(e=>fetch(`${e}/scan/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({events:n}),keepalive:!0})).catch(()=>{})}var G4=!1;try{G4=localStorage.getItem(`linear-grab:slop-live`)===`1`}catch{}var K4=new Set;function q4(){return G4}function J4(e){G4=e;try{localStorage.setItem(`linear-grab:slop-live`,e?`1`:`0`)}catch{}for(let t of K4)t(e);e&&Z4(300)}function Y4(e){return K4.add(e),e(G4),()=>void K4.delete(e)}var X4=null;function Z4(e){X4&&clearTimeout(X4),X4=setTimeout(()=>{if(X4=null,G4)try{H4()}catch{}},e)}var Q4=!1;function $4(){if(Q4||typeof window>`u`)return;Q4=!0;let e=location.pathname;setInterval(()=>{location.pathname!==e&&(e=location.pathname,G4&&Z4(1e3))},500)}var e3=N(`<span class="inline-block min-w-[7ch] text-center">Extract`),t3=N(`<div class="relative flex flex-col gap-2 pl-4"><div class="bg-border absolute top-1 bottom-1 left-[5px] w-px"aria-hidden>`),n3=N(`<span class="text-success text-[12px] leading-none">✓`),r3=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M4 4l8 8M12 4l-8 8">`),i3=N(`<div class="flex items-center justify-end gap-1 px-1">`),a3=N(`<span class="relative inline-flex items-center justify-center"><svg width=12 height=12 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3.5 y=3 width=3.2 height=10 rx=1></rect><rect x=9.3 y=3 width=3.2 height=10 rx=1></rect></svg><span class="bg-success absolute -top-0.5 -right-0.5 size-1.5 animate-pulse rounded-full"aria-hidden>`),o3=N(`<span class="inline-block min-w-[5ch] text-center">Audit`),s3=N(`<div class="flex max-h-72 flex-col gap-1.5 overflow-y-auto pr-2">`),c3=N(`<span class="text-[12px] leading-none">✓`),l3=N(`<div class="flex items-center gap-1 px-1">`),u3=N(`<span class="text-text-faint font-normal tabular-nums"> · <!> pages`),d3=N(`<span class="inline-block min-w-[4ch] text-center">Scan`),f3=N(`<div class="flex items-center gap-1 px-1"><button class="border-border cursor-pointer rounded-full border px-2 py-0.5 text-[10px] font-medium tabular-nums"> errors</button><button class="border-border cursor-pointer rounded-full border px-2 py-0.5 text-[10px] font-medium tabular-nums"> warns`),p3=N(`<div class="flex h-full flex-col gap-3 overflow-y-auto pt-3 pb-4 pr-3 pl-2"><div class="flex items-center justify-between gap-2 px-1"><div class=min-w-0><p class="text-text text-[12.5px] font-semibold">Design genomes</p><p class="text-text-faint text-[10.5px] leading-snug">Point at a component → get its structure, tokens and interaction states as a spec you can hand to an agent.</p></div></div><div class="border-border mt-1 flex flex-col gap-2 border-t pt-3"><div class="flex items-center justify-between gap-2 px-1"><div class=min-w-0><p class="text-text text-[12.5px] font-semibold">CSS slowdowns</p><p class="text-text-faint text-[10.5px] leading-snug">Transitions/delays over the 100ms house cap (§42) on interactive elements — feedback that animates instead of being instant. Live hits appear as you use the app; Audit sweeps the whole page.</p></div><div class="flex shrink-0 items-center gap-1"></div></div></div><div class="border-border mt-1 flex flex-col gap-2 border-t pt-3"><div class="flex items-center justify-between gap-2 px-1"><div class=min-w-0><p class="text-text text-[12.5px] font-semibold">Slop scan</p><p class="text-text-faint text-[10.5px] leading-snug">Design-contract drift — Linear-primitives rules checked against the live DOM. Results accumulate per page as you navigate; re-scanning a page overwrites only that page's findings.</p></div><div class="flex shrink-0 items-center gap-1">`),m3=N(`<p class="text-text mt-1 text-[11px] font-semibold">Interaction states`),h3=N(`<svg width=12 height=12 viewBox="0 0 16 16"aria-hidden><rect x=3.5 y=3.5 width=9 height=9 rx=1.5 fill=currentColor>`),g3=N(`<span class="text-warn text-[10.5px] font-medium tabular-nums">s · <!> states`),_3=N(`<div class="border-border flex flex-col gap-2 border-t px-2.5 py-2"><p class="text-text-faint truncate text-[10px]"></p><div class="flex max-h-64 flex-col gap-2 overflow-y-auto pr-2"></div><div class="flex items-center gap-1">`),v3=N(`<div class=relative><span class="border-border bg-surface absolute top-3 -left-[13.5px] size-[9px] rounded-full border"aria-hidden></span><div class="bg-surface border-border flex flex-col rounded-lg border"><button class="flex w-full cursor-pointer items-center gap-2 px-2.5 py-2 text-left"><span class="text-accent min-w-0 truncate font-mono text-[12px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"> roles<!> · </span><svg width=10 height=10 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 class="text-text-faint shrink-0 transition-transform"aria-hidden><path d="m4 6 4 4 4-4">`),y3=N(`<span class=text-text-faint> ×`),b3=N(`<div class="flex flex-col gap-0.5"><p class="text-text text-[11px] font-medium">`),x3=N(`<span class=text-accent> ← var(<!>)`),S3=N(`<p class="text-text-dim font-mono text-[10px] leading-snug break-all">: `),C3=N(`<div class="flex flex-col gap-0.5"><p class="text-warn text-[10.5px] font-medium"> — `),w3=N(`<p class="text-text-dim font-mono text-[10px] leading-snug break-all">: <!> → `),T3=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=2 fill=currentColor stroke=none>`),E3=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),D3=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=currentColor aria-hidden><path d="M4.5 2.5v11l9-5.5z">`),O3=N(`<p class="text-text-faint px-1 text-[10.5px]">Nothing caught yet — interact with the app, or run Audit.`),k3=N(`<span class="text-text-dim font-mono text-[10px] break-all">`),A3=N(`<span class="text-danger text-[10px] leading-snug">⚠ layout/paint transition: `),j3=N(`<span class="text-danger text-[10px] leading-snug">⚠ ease-in easing: `),M3=N(`<div class="bg-surface border-border flex flex-col gap-0.5 rounded-lg border p-2"><div class="flex items-center gap-2"><span class="text-warn shrink-0 text-[10px] font-semibold tracking-wide uppercase"></span><span class="text-accent min-w-0 truncate font-mono text-[11.5px]"></span><span class="text-text ml-auto shrink-0 text-[11px] font-medium tabular-nums">ms</span></div><span class="text-text-dim text-[10px] leading-snug"></span><span class="text-text-faint text-[10px] leading-snug">`),N3=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 1.5 9.6 6l4.4 1.6L9.6 9.2 8 13.7 6.4 9.2 2 7.6 6.4 6Z"></path><path d="M13 11.5l.6 1.7 1.7.6-1.7.6-.6 1.7-.6-1.7-1.7-.6 1.7-.6Z">`),P3=N(`<p class="text-text-faint px-1 text-[10.5px]">No scan yet — click Scan to audit this page against the contract.`),F3=N(`<div class="border-border flex flex-col gap-1 border-t px-2 py-1.5"><p class="text-text-dim text-[10px] leading-snug">`),I3=N(`<div class="bg-surface border-border flex flex-col rounded-lg border"><button class="flex w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left"><span class="size-1.5 shrink-0 rounded-full"aria-hidden></span><span class="text-accent min-w-0 truncate font-mono text-[11.5px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums">×</span><svg width=10 height=10 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 class="text-text-faint shrink-0 transition-transform"aria-hidden><path d="m4 6 4 4 4-4">`),L3=N(`<span class=text-accent> `),R3=N(`<span class="text-text-faint tabular-nums"> ×`),z3=N(`<button class="hover:bg-surface-2 flex w-full cursor-pointer flex-col gap-0.5 rounded px-1 py-0.5 text-left"title="Reveal on the page"><span class="text-text min-w-0 truncate font-mono text-[10.5px]"></span><span class="text-text-faint font-mono text-[10px] leading-snug break-all">`),B3=`linear-grab:genomes:v1`,V3=30;function H3(){try{return JSON.parse(localStorage.getItem(B3)??`[]`)}catch{return[]}}function U3(e){try{localStorage.setItem(B3,JSON.stringify(e.slice(0,V3)))}catch{}}var W3=new Map;function G3(e){let t=e.el?.deref();if(!(t instanceof HTMLElement)||!t.isConnected)return!1;t.scrollIntoView({block:`center`,behavior:`smooth`});let n=t.style.outline,r=t.style.outlineOffset;return t.style.outline=`2px solid #e5a13a`,t.style.outlineOffset=`2px`,setTimeout(()=>{t.style.outline=n,t.style.outlineOffset=r},1400),!0}function K3(){let[e,t]=T(H3()),[n,r]=T(null),[i,a]=T(null),[o,s]=T(null),[c,l]=T(null),[u,d]=T(null),[f,p]=T({active:!1,msLeft:0,total:0,byTrigger:{}});ae(a2(p));let[m,h]=T([]);ae(M2(h));let[g,_]=T(I2());ae(R2(_));let[v,y]=T(!1),[b,x]=T(!1),S=async()=>{y(!0);try{await H2()}finally{y(!1)}},C=async()=>{try{await navigator.clipboard.writeText(W2(m())),x(!0),setTimeout(()=>x(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},[w,E]=T(!1),O=async()=>{try{await navigator.clipboard.writeText(U2(m())),E(!0),setTimeout(()=>E(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},[k,ee]=T([]);ae(B4(ee));let[te,A]=T(q4());ae(Y4(A));let[ne,re]=T(!1),[ie,oe]=T(null),[se,ce]=T(!0),[le,ue]=T(!0),[de,fe]=T(!1),[pe,me]=T(!1),he=()=>{l(null),re(!0);try{H4(),oe(null)}catch(e){l(e instanceof Error?e.message:String(e))}finally{re(!1)}},ge=()=>{V4(),oe(null)},_e=()=>new Set(k().map(e=>e.page)).size,ve=()=>k().filter(e=>e.severity===`error`?se():le()),ye=()=>{let e=new Map;for(let t of ve()){let n=e.get(t.ruleId);n?n.push(t):e.set(t.ruleId,[t])}return[...e.values()].sort((e,t)=>Number(t[0].severity===`error`)-Number(e[0].severity===`error`)||t.length-e.length)},be=()=>k().filter(e=>e.severity===`error`).length,xe=()=>k().length-be(),Se=async()=>{try{await navigator.clipboard.writeText(I4(ve())),fe(!0),setTimeout(()=>fe(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},Ce=async()=>{try{await navigator.clipboard.writeText(L4(ve())),me(!0),setTimeout(()=>me(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},we=e=>{t(e),U3(e)},Te=async()=>{l(null),a(`extract`),window.dispatchEvent(new CustomEvent(VZ));try{let t=await d2();if(!t)return;let n=await t2(t),i=Date.now();W3.set(i,new WeakRef(t)),we([{id:i,genome:n},...e()]),r(i)}catch(e){l(e instanceof Error?e.message:String(e))}finally{a(null),cj(`design`),window.dispatchEvent(new CustomEvent(HZ))}},Ee=async t=>{l(null),a(t.id),window.dispatchEvent(new CustomEvent(VZ));try{let n=W3.get(t.id)?.deref()??null;if(!n||!n.isConnected){if(n=await d2(),!n)return;W3.set(t.id,new WeakRef(n))}let r=await l2(n,8e3,e=>s(Math.ceil(e/1e3)));r.length===0&&l(`No state changes captured — hover/open the component while the 8s window runs.`),we(e().map(e=>e.id===t.id?{...e,genome:{...e.genome,states:[...e.genome.states,...r]}}:e))}catch(e){l(e instanceof Error?e.message:String(e))}finally{a(null),s(null),cj(`design`),window.dispatchEvent(new CustomEvent(HZ))}},De=async e=>{try{await navigator.clipboard.writeText(u2(e.genome)),d(e.id),setTimeout(()=>d(null),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},Oe=t=>{W3.delete(t),we(e().filter(e=>e.id!==t))},[ke,Ae]=T(!1),je=async()=>{try{let t=e().map(e=>u2(e.genome)).join(`
277
+ `)}</code></pre>`);continue}let i=e.match(/^(#{1,6})\s+(.*)$/);if(i){n.push(`<h4>${M$(i[2])}</h4>`),r++;continue}if(/^\s*[-*]\s+/.test(e)){let e=[];for(;r<t.length&&/^\s*[-*]\s+/.test(t[r]);)e.push(`<li>${M$(t[r].replace(/^\s*[-*]\s+/,``))}</li>`),r++;n.push(`<ul>${e.join(``)}</ul>`);continue}if(/^\s*\d+[.)]\s+/.test(e)){let e=[];for(;r<t.length&&/^\s*\d+[.)]\s+/.test(t[r]);)e.push(`<li>${M$(t[r].replace(/^\s*\d+[.)]\s+/,``))}</li>`),r++;n.push(`<ol>${e.join(``)}</ol>`);continue}let a=[];for(;r<t.length&&t[r].trim()&&!/^(#{1,6}\s|```|\s*[-*]\s+|\s*\d+[.)]\s+)/.test(t[r]);)a.push(t[r]),r++;n.push(`<p>${M$(a.join(`<br />`))}</p>`)}return n.join(``)}Br();var P$=N(`<div class="lg-md text-text text-[12px] leading-relaxed break-words">`),F$=N(`<div class="flex h-full flex-col">`),I$=N(`<span class="tabular-nums text-[10.5px] text-text-faint">live · updated `),L$=N(`<svg aria-hidden width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M1 4.5A7 7 0 0 1 13.5 3"></path><path d="M15 11.5A7 7 0 0 1 2.5 13"></path><polyline points="1 1 1 5 5 5"></polyline><polyline points="15 11 15 15 11 15">`),R$=N(`<div class="flex-1 overflow-y-auto">`),z$=N(`<div class="min-h-0 flex-1 overflow-y-auto pl-2 pr-3"><div style=position:relative>`),B$=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">My issues</span><div class="flex items-center gap-2"></div></div><div class="border-border flex shrink-0 items-center gap-1 border-b px-3 py-1.5">`),V$=N(`<button>`),H$=N(`<div style=position:absolute;top:0;left:0;width:100%>`),U$=N(`<button class="w-full cursor-pointer rounded-md px-2 py-1.5 text-left hover:bg-surface-2 transition-colors"><div class="flex items-center gap-1.5 min-w-0"><span class="font-mono text-[11px] text-text-dim shrink-0"></span><span class="truncate text-[12.5px] text-text"></span></div><div class="mt-0.5 flex items-center gap-1.5"><span class="ml-auto tabular-nums text-[10.5px] text-text-faint">`),W$=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M10.5 3.5 6 8l4.5 4.5">`),G$=N(`<span class="font-mono text-[11px] text-text-dim shrink-0">`),K$=N(`<span class="truncate text-[12px] font-medium text-text">`),q$=N(`<span class="text-[11.5px] text-text-faint">Loading…`),J$=N(`<div class="flex items-center gap-2"><span class="text-[11px] text-text-dim">`),Y$=N(`<div class="flex flex-col gap-2">`),X$=N(`<div class="flex flex-col gap-1"><span class="text-[10.5px] font-semibold uppercase tracking-wide text-text-dim">Attachments</span><div class="flex flex-col gap-1">`),Z$=N(`<div class="flex flex-col gap-2.5"><span class="text-[10.5px] font-semibold uppercase tracking-wide text-text-dim">Comments`),Q$=N(`<option value=local>Message local Claude Code session`),$$=N(`<option value=new>Start NEW agent (@<!>)`),e1=N(`<option value=comment>Comment only`),t1=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=2.2></circle><path d="M8 1v3M8 12v3M1 8h3M12 8h3">`),n1=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3 y=3 width=10 height=10 rx=1.5>`),r1=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M13 7.5 8.2 12.3a3.2 3.2 0 0 1-4.5-4.5L8.9 2.6a2.1 2.1 0 0 1 3 3L7.1 10.4a1 1 0 0 1-1.5-1.5l4.3-4.3">`),i1=N(`<span class="inline-block min-w-[4ch] text-left">Send`),a1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 flex-col gap-1 border-b px-3 py-2"><div class="flex items-center gap-2"></div></div><div class="min-h-0 flex-1 overflow-y-auto pl-3 pr-4 py-3 flex flex-col gap-3"></div><div class="border-border shrink-0 border-t p-2.5 flex flex-col gap-1.5"><div class="flex items-center gap-2">`),o1=N(`<option selected>`),s1=N(`<svg width=10 height=10 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3 y=3 width=10 height=10 rx=1.5>`),c1=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=currentColor aria-hidden><path d="M4.5 2.8a.8.8 0 0 1 1.22-.68l8 5.2a.8.8 0 0 1 0 1.36l-8 5.2a.8.8 0 0 1-1.22-.68V2.8Z">`),l1=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="m2.5 4 3.5 4-3.5 4M8 12.5h5.5">`),u1=N(`<div class="bg-surface border-border overflow-clip rounded-lg border"><div class="border-border flex h-9 min-w-0 items-center justify-between gap-2 border-b px-3"><div class="flex min-w-0 items-center gap-1.5 text-[11.5px] font-medium"><span aria-hidden class="text-text-dim inline-flex"></span><span class="text-text shrink-0">Local Claude Code</span><span class="text-text-dim shrink-0">started by you</span><span class="text-text-faint shrink-0 tabular-nums">· </span></div></div><div class="flex h-9 items-center gap-1 pr-2"><button class="hover:bg-surface-2 flex h-full min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-3 text-left transition-colors"title="Open the live thread in the Local tab"><span></span><span class="text-text-faint min-w-0 flex-1 truncate text-[11.5px]"></span><svg width=14 height=14 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class="text-text-dim shrink-0"><path d="m6 3.5 4.5 4.5L6 12.5">`),d1=N(`<option>`),f1=N(`<div class="flex flex-col gap-1.5">`),p1=N(`<span class="text-success text-[11px]">✓`),m1=N(`<span class="inline-block min-w-[6ch] text-center">Merge`),h1=N(`<div class="flex min-w-0 items-center gap-1.5"><a target=_blank rel=noreferrer class="text-accent min-w-0 truncate text-[11.5px] hover:underline">`),g1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 2 14 5.5 8 9 2 5.5 8 2Z"></path><path d="M2 10.5 8 14l6-3.5">`),_1=N(`<div class="flex flex-col gap-0.5"><div class="flex items-center gap-1.5"><span class="text-[11px] font-medium text-text-dim"></span><span class="ml-auto tabular-nums text-[10.5px] text-text-faint">`),v1=N(`<option>Steer running agent<!> · `),y1=N(`<span class="bg-danger inline-block size-2.5 rounded-full"aria-hidden>`),b1=N(`<span class="text-[11px] text-text-dim">`),x1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden class=transition-transform><path d="m3.5 6.5 4.5 4 4.5-4">`),S1=N(`<p class="text-[12px] text-text leading-relaxed whitespace-pre-wrap break-words">`),C1=N(`<div class="border-border mt-0.5 flex flex-col gap-1 overflow-y-auto border-t pt-1.5 pl-0.5 pr-3">`),w1=N(`<div class="bg-surface border-border rounded-lg border p-2.5 flex flex-col gap-1.5"><div class="flex items-center gap-1.5 flex-wrap"><span class="ml-auto tabular-nums text-[10.5px] text-text-faint">`),T1=N(`<p class="font-mono text-text-faint text-[10.5px] leading-relaxed break-words">→ <!> `),E1=N(`<div>`);function D1(e){let t=k(()=>N$(e.text));return(()=>{var e=P$();return D(()=>e.innerHTML=t()),e})()}function O1(){let[e,t]=T(null);return O(()=>{let e=uj();e&&(t(e),pj())}),(()=>{var n=F$();return P(n,j(M,{get when(){return e()===null},get fallback(){return j(j1,{get issueId(){return e()},onBack:()=>t(null)})},get children(){return j(k1,{onSelect:e=>t(e)})}})),n})()}function k1(e){let t,n=_r(()=>({queryKey:[`my-issues`],queryFn:gO,refetchInterval:12e3})),r=_r(()=>({queryKey:[`bridge-tasks`],queryFn:LO,refetchInterval:1e4,retry:0})),i=e=>(r.data??[]).some(t=>t.title.startsWith(e.identifier)),a=e=>e.state.type===`started`&&e.attachments?.some(e=>/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url)),o=[{id:`all`,label:`All`},{id:`active`,label:`In Progress`},{id:`review`,label:`Review`},{id:`done`,label:`Done`},{id:`cloud`,label:`Cloud`},{id:`local`,label:`Local`}],[s,c]=br(`issues:filter`,`all`),[l,u]=br(`issues:search`,``),d=k(()=>{let e=l().trim().toLowerCase();return(n.data??[]).filter(t=>{if(e&&!`${t.identifier} ${t.title}`.toLowerCase().includes(e))return!1;switch(s()){case`active`:return t.state.type===`started`;case`review`:return!!a(t);case`done`:return t.state.type===`completed`;case`cloud`:return!!t.delegate;case`local`:return i(t);default:return!0}})}),f=a$({get count(){return d().length},getScrollElement:()=>t,estimateSize:()=>56,overscan:5});return(()=>{var r=B$(),a=r.firstChild,p=a.firstChild.nextSibling,m=a.nextSibling;return P(p,j(M,{get when(){return n.dataUpdatedAt>0},get children(){var e=I$();return e.firstChild,P(e,()=>Yj(n.dataUpdatedAt),null),e}}),null),P(p,j(q,{class:`size-7 px-0`,get loading(){return n.isFetching},onClick:()=>void n.refetch(),title:`Refresh`,"aria-label":`Refresh issues`,get children(){return L$()}}),null),P(m,j(We,{each:o,children:e=>(()=>{var t=V$();return t.$$click=()=>c(e.id),P(t,()=>e.label),D(()=>st(t,`h-6 shrink-0 cursor-pointer rounded-md px-2 text-[11px] font-medium transition-colors ${s()===e.id?`bg-accent-soft text-accent`:`text-text-dim hover:bg-surface-2`}`)),t})()}),null),P(m,j(Ij,{class:`ml-auto h-6 w-28 text-[11px]`,placeholder:`Search…`,get value(){return l()},onInput:e=>u(e.currentTarget.value)}),null),P(r,j(M,{get when(){return n.isError},get children(){var e=R$();return P(e,j(Kj,{title:`Connect Linear in Settings`,get children(){return n.error?.message??`Unable to load issues.`}})),e}}),null),P(r,j(M,{get when(){return $e(()=>!n.isError&&!n.isPending)()&&d().length===0},get children(){var e=R$();return P(e,j(Kj,{title:`No issues found`,children:`Issues you create will appear here.`})),e}}),null),P(r,j(M,{get when(){return $e(()=>!n.isError)()&&d().length>0},get children(){var n=z$(),r=n.firstChild,a=t;return typeof a==`function`?pt(a,n):t=n,P(r,j(We,{get each(){return f.getVirtualItems()},children:t=>{let n=k(()=>d()[t.index]);return j(M,{get when(){return n()},get children(){var r=H$();return P(r,j(A1,{get issue(){return n()},get local(){return i(n())},get onSelect(){return e.onSelect}})),D(e=>dt(r,`transform`,`translateY(${t.start}px)`)),r}})}})),D(e=>dt(r,`height`,`${f.getTotalSize()}px`)),n}}),null),r})()}function A1(e){return(()=>{var t=U$(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling,o=a.firstChild;return t.$$click=()=>e.onSelect(e.issue.id),P(n,j(Gj,{get color(){return e.issue.state.color}}),r),P(r,()=>e.issue.identifier),P(i,()=>e.issue.title),P(a,j(Wj,{get children(){return e.issue.state.name}}),o),P(a,j(M,{get when(){return e.issue.delegate},get children(){return j(Wj,{class:`text-accent`,get children(){return[j(zj,{}),` `,$e(()=>e.issue.delegate.displayName)]}})}}),o),P(a,j(M,{get when(){return e.local},get children(){return j(Wj,{class:`text-accent`,get children(){return[j(Bj,{}),` local`]}})}}),o),P(a,j(M,{get when(){return $e(()=>!!(e.issue.state.type===`started`&&e.issue.delegate))()&&e.issue.attachments?.some(e=>/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url))},get children(){return j(Wj,{color:`var(--color-warn)`,children:`needs review`})}}),o),P(o,()=>Yj(e.issue.updatedAt)),t})()}function j1(e){let t=sr(),n=_r(()=>({queryKey:[`issue`,e.issueId],queryFn:()=>_O(e.issueId),refetchInterval:8e3,enabled:!!e.issueId})),r=_r(()=>({queryKey:[`sessions`,e.issueId],queryFn:()=>yO(e.issueId),refetchInterval:8e3,enabled:!!e.issueId})),i=_r(()=>({queryKey:[`settings`],queryFn:Tr})),a=_r(()=>({queryKey:[`bridge-tasks`],queryFn:LO,refetchInterval:5e3,retry:0})),o=[{id:``,label:`Default model`},{id:`claude-fable-5-1`,label:`Fable 5.1`},{id:`fable`,label:`Fable 5`},{id:`opus`,label:`Opus`},{id:`sonnet`,label:`Sonnet`},{id:`haiku`,label:`Haiku`}],s=vr(()=>({mutationFn:async t=>{let r=n.data?.attachments.find(e=>/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url)),i=r?se.data?.previews[r.url]:void 0,a=[...t.activities].reverse().find(e=>e.content.__typename===`AgentActivityResponseContent`)?.content.body,o=[`✅ **Closeout** (posted from the panel — one-click acceptance)`,``,`**Fix:** ${(t.summary??a??`Fix complete — see the PR.`).slice(0,600)}`,``,...r?[`**PR:** ${r.url}`]:[],...i?[`**Deploy preview:** ${i}`]:[],``,`**DEFINITION OF DONE — acceptance checklist**`,`- [x] PR opened and linked${r?` — ${r.url}`:``}`,i?`- [x] Deploy-preview URL included (above)`:`- [ ] Deploy-preview URL — none found on the PR`,`- [x] Issue moved to review state (this action)`,`- [ ] Demo media on the issue — attach from the PR/agent artifacts if recorded`];await DO(e.issueId,o.join(`
278
+ `),t.comment?.id??void 0);let s=n.data?.team?.id;if(s){let t=await SO(s),n=t.find(e=>e.type===`started`&&/review/i.test(e.name))??t.filter(e=>e.type===`completed`).sort((e,t)=>e.position-t.position)[0];n&&await CO(e.issueId,n.id)}},onSuccess:()=>{t.invalidateQueries({queryKey:[`issue`,e.issueId]}),t.invalidateQueries({queryKey:[`sessions`,e.issueId]})}})),c=vr(()=>({mutationFn:e=>UO(e.id,e.model),onSuccess:e=>{t.setQueryData([`bridge-tasks`],t=>t?.map(t=>t.id===e.id?e:t))}})),l=vr(()=>({mutationFn:e=>HO(e,`Continue where you left off. If the work is already complete, finish any remaining closeout steps (PR, Linear update, announcement).`),onSuccess:()=>void t.invalidateQueries({queryKey:[`bridge-tasks`]})})),u=vr(()=>({mutationFn:e=>WO(e),onSuccess:()=>void t.invalidateQueries({queryKey:[`bridge-tasks`]})})),[d,f]=T(!1),p=async e=>{try{await navigator.clipboard.writeText(tk(e)),f(!0),setTimeout(()=>f(!1),1800)}catch{}},m=k(()=>{let e=n.data?.identifier;return e?a.data?.find(t=>t.title.startsWith(e)):void 0}),h=e=>e.status===`running`?{word:`Working…`,cls:`text-accent`}:e.status===`done`?{word:`Finished`,cls:`text-success`}:e.status===`stopped`?{word:`Stopped`,cls:`text-warn`}:{word:`Error`,cls:`text-danger`},[g,_]=br(`activity-reply:${e.issueId}`,``),[v,y]=T(null),[b,x]=T(0),S=_r(()=>({queryKey:[`grab`],queryFn:Dr,enabled:mj()===`composer`})),[C,w]=T(!1),E=async()=>{w(!0),y(null);try{let{block:e,failed:t}=await C$();e?_(t=>`${t?`${t}\n`:``}${e}\n`):t.length||y(`Nothing captured yet — pick an element, capture a region, or record first.`),t.length&&y(t.join(` · `))}catch(e){y(e instanceof Error?e.message:`Attach failed.`)}finally{w(!1)}},ee=()=>{if(mj()===`composer`){gj(`capture`);return}x(Date.now()),gj(`composer`),oQ().catch(()=>gj(`capture`))};O(()=>{if(mj()!==`composer`)return;let e=(S.data??[]).filter(e=>e.grabbedAt>b());if(!e.length)return;let t=e.map(e=>{let t=e.source?.filePath?` — \`${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}\``:``;return`- \`<${e.componentName??e.tagName??`element`}>\`${t}`}).join(`
279
+ `);_(e=>`${e?`${e}\n`:``}${t}\n`),x(Math.max(...e.map(e=>e.grabbedAt)))});let[te,A]=T(KD());ae(qD(A));let ne=!1;O(()=>{te().phase===`ready`&&ne&&(ne=!1,E())});let re=()=>{te().phase===`recording`?iO():(ne=!0,rO())},ie=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i,oe=k(()=>(n.data?.attachments??[]).map(e=>e.url).filter(e=>ie.test(e))),se=_r(()=>({queryKey:[`pr-status`,oe().sort().join(`|`)],queryFn:()=>JO(oe()),refetchInterval:3e4,retry:0,enabled:oe().length>0})),ce=e=>_e().has(e)?`MERGED`:se.data?.statuses[e],[le,ue]=T(null),de=()=>i.data?.stagingBranch?.trim()||`staging`,[fe,pe]=T(null),[me,he]=T(new Set),ge=async e=>{pe(e);try{await YO(e,de()),he(t=>new Set(t).add(e))}catch{}finally{pe(null)}},[_e,ve]=T(new Set),[ye,be]=T(null),xe=async n=>{be(null),ue(n);try{await $O(n),ve(e=>new Set(e).add(n)),t.invalidateQueries({queryKey:[`issue`,e.issueId]}),t.invalidateQueries({queryKey:[`my-issues`]}),f$()}catch(e){be(e instanceof Error?`${e.message} (bridge must be running; gh needs merge rights)`:`Merge failed.`)}finally{ue(null)}},Se=k(()=>{let e=n.data?kO(n.data.comments):[],t=new Set(e.map(e=>e.id));return[...(r.data??[]).filter(e=>e.comment?.id&&!t.has(e.comment.id)).map(e=>({id:e.comment.id,createdAt:e.updatedAt,body:``,user:{displayName:e.appUser?.displayName??`agent`,app:!0},parent:null})),...e]}),[Ce,we]=T(`comment`),Te=!1,Ee=!1;O(()=>{if(Ee||!n.data||!i.data)return;Ee=!0;let e=Se();e.length?we(`thread:${e[0].id}`):n.data.delegate&&i.data.cursorAgentId&&we(`new`)}),O(()=>{Te||m()&&(Ce()===`comment`||Ce()===`new`)&&we(`local`)}),O(()=>{if(Te)return;let e=Se();e.length&&(Ce()===`comment`||Ce()===`new`)&&we(`thread:${e[0].id}`)});let De=vr(()=>({mutationFn:async()=>{let t=g().trim();if(!t)throw Error(`Message is empty`);let n=i.data??{},r=Ce();if(r===`local`){let n=m();if(!n)throw Error(`Local session not found — is the bridge running?`);await HO(n.id,t),await DO(e.issueId,`🖥️ **→ local agent:** ${t}`).catch(()=>{})}else r.startsWith(`thread:`)?await DO(e.issueId,t,r.slice(7)):r===`new`&&n.cursorAgentId?await OO(e.issueId,t,{name:n.cursorAgentName,displayName:n.cursorAgentName??`Cursor`,url:n.cursorAgentUrl}):await DO(e.issueId,t)},onSuccess:()=>{_(``),y(null),gj(`capture`),t.invalidateQueries({queryKey:[`issue`,e.issueId]}),f$()},onError:e=>{y(e.message??`Failed to send`)}})),Oe=k(()=>n.data),ke=k(()=>r.data??[]);return(()=>{var t=a1(),r=t.firstChild,a=r.firstChild,f=r.nextSibling,y=f.nextSibling,b=y.firstChild;return P(a,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,title:`Back to issues`,"aria-label":`Back to issues`,"data-tip-pos":`right bottom`,get onClick(){return e.onBack},get children(){return W$()}}),null),P(a,j(M,{get when(){return Oe()},get children(){return[(()=>{var e=G$();return P(e,()=>Oe().identifier),e})(),(()=>{var e=K$();return P(e,()=>Oe().title),e})()]}}),null),P(a,j(M,{get when(){return $e(()=>!!n.isPending)()&&!Oe()},get children(){return q$()}}),null),P(r,j(M,{get when(){return Oe()},get children(){var e=J$(),t=e.firstChild;return P(e,j(Gj,{get color(){return Oe().state.color}}),t),P(t,()=>Oe().state.name),P(e,j(Vj,{get href(){return Oe().url},class:`ml-auto shrink-0`,children:`Open in Linear`}),null),e}}),null),P(f,j(M,{get when(){return m()},children:e=>{let t=()=>h(e());return(()=>{var n=u1(),r=n.firstChild,i=r.firstChild.firstChild,a=i.nextSibling.nextSibling.nextSibling;a.firstChild;var s=r.nextSibling,f=s.firstChild,m=f.firstChild,h=m.nextSibling;return P(i,j(Bj,{size:12})),P(a,()=>Yj(e().startedAt),null),P(r,j(Rj,{class:`h-6 w-auto max-w-[110px] shrink-0 text-[10.5px]`,get value(){return e().pendingModel??e().model??``},onChange:t=>c.mutate({id:e().id,model:t.currentTarget.value}),title:`Model — applies from the next message`,get children(){return[j(We,{each:o,children:t=>(()=>{var n=d1();return P(n,()=>t.label),D(()=>n.selected=(e().pendingModel??e().model??``)===t.id),D(()=>n.value=t.id),n})()}),j(M,{get when(){return!o.some(t=>t.id===(e().pendingModel??e().model??``))},get children(){var t=o1();return P(t,()=>e().pendingModel??e().model),D(()=>t.value=e().pendingModel??e().model??``),t}})]}}),null),f.$$click=()=>fj(`local`),P(f,j(M,{get when(){return e().status===`running`},get children(){return j(Fj,{size:12})}}),m),P(m,()=>t().word),P(h,(()=>{var t=$e(()=>e().status===`done`);return()=>t()?e().result??e().lastText:e().lastText})()),P(s,j(M,{get when(){return e().status===`running`},get children(){return j(q,{variant:`danger`,class:`size-6 shrink-0 px-0`,get loading(){return u.isPending},title:`Stop the session — resumable afterwards`,"aria-label":`Stop session`,onClick:()=>u.mutate(e().id),get children(){return s1()}})}}),null),P(s,j(M,{get when(){return $e(()=>e().status!==`running`)()&&e().sessionId},get children(){return j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get loading(){return l.isPending},get title(){return`Run again — resumes this session${e().pendingModel?` on ${e().pendingModel}`:``}`},"aria-label":`Resume session`,onClick:()=>l.mutate(e().id),get children(){return c1()}})}}),null),P(s,j(M,{get when(){return e().sessionId},get children(){return j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return d()?`Copied!`:`Copy terminal resume command (claude --resume …)`},"aria-label":`Copy resume command`,onClick:()=>void p(e()),get children(){return l1()}})}}),null),D(()=>st(m,`shrink-0 text-[11.5px] font-medium ${t().cls}`)),n})()}}),null),P(f,j(M,{get when(){return ke().length>0},get children(){var e=Y$();return P(e,j(We,{get each(){return ke()},children:e=>(()=>{var t=f1();return P(t,j(M1,{session:e}),null),P(t,j(M,{get when(){return $e(()=>!!(/complete/i.test(e.status)&&n.data?.state.type===`started`))()&&!/review/i.test(n.data?.state.name??``)},get children(){return j(q,{variant:`primary`,class:`self-start`,get loading(){return s.isPending},title:`Post the acceptance comment (fix summary, PR, preview, checklist) in the agent thread and move the issue to review`,onClick:()=>s.mutate(e),children:`Post closeout to Linear`})}}),null),t})()})),e}}),null),P(f,j(M,{get when(){return $e(()=>!!Oe())()&&Oe().attachments.length>0},get children(){var e=X$(),t=e.firstChild.nextSibling;return P(t,j(We,{get each(){return Oe().attachments},children:e=>{let t=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url);return[(()=>{var n=h1(),r=n.firstChild;return P(r,()=>e.title),P(n,j(M,{get when(){return t&&se.data?.previews[e.url]},get children(){return j(Vj,{get href(){return se.data.previews[e.url]},class:`shrink-0`,title:`Vercel deploy preview of this PR's branch`,children:`Preview`})}}),null),P(n,j(M,{get when(){return $e(()=>!!(t&&ce(e.url)))()&&ce(e.url)!==`OPEN`},get children(){return j(Wj,{get class(){return`ml-auto shrink-0 ${ce(e.url)===`MERGED`?`text-success`:`text-text-faint`}`},get children(){return ce(e.url)===`MERGED`?`✓ merged`:`closed`}})}}),null),P(n,j(M,{get when(){return t&&(!ce(e.url)||ce(e.url)===`OPEN`)},get children(){return[j(q,{variant:`ghost`,class:`ml-auto size-6 shrink-0 px-0`,get loading(){return fe()===e.url},get disabled(){return me().has(e.url)},get title(){return $e(()=>!!me().has(e.url))()?`On ${de()} — staging preview deploying`:`Merge into ${de()} — deploys the staging preview domain`},"aria-label":`Merge to staging`,onClick:()=>void ge(e.url),get children(){return j(M,{get when(){return me().has(e.url)},get fallback(){return g1()},get children(){return p1()}})}}),j(q,{variant:`primary`,class:`h-6 shrink-0 px-2 text-[11px]`,get loading(){return le()===e.url},get title(){return se.isError?`PR state unknown — restart the bridge (npx linear-grab-bridge) for live merge status`:`Squash-merge this PR via the bridge gh — reviewed the demo? Ship it.`},onClick:()=>void xe(e.url),get children(){return m1()}})]}}),null),D(t=>{var n=e.url,i=e.title;return n!==t.e&&it(r,`href`,t.e=n),i!==t.t&&it(r,`title`,t.t=i),t},{e:void 0,t:void 0}),n})(),j(M,{get when(){return me().has(e.url)},get children(){return j(x$,{get url(){return e.url},get base(){return de()}})}})]}}),null),P(t,j(M,{get when(){return ye()},get children(){return j(qj,{get message(){return ye()}})}}),null),e}}),null),P(f,j(M,{get when(){return $e(()=>!!Oe())()&&Oe().comments.length>0},get children(){var e=Z$();return e.firstChild,P(e,j(Ge,{get each(){return Oe().comments},children:e=>{let t=e();return(()=>{var e=_1(),n=e.firstChild,r=n.firstChild,i=r.nextSibling;return P(r,()=>t.user?.displayName??t.user?.name??`Unknown`),P(n,j(M,{get when(){return t.user?.app},get children(){return j(Wj,{children:`agent`})}}),i),P(i,()=>Yj(t.createdAt)),P(e,j(D1,{get text(){return t.body}}),null),e})()}}),null),e}}),null),P(f,j(M,{get when(){return $e(()=>!!(Oe()&&Oe().comments.length===0))()&&ke().length===0},get children(){return j(Kj,{title:`No activity yet`,children:`Comments and agent sessions will appear here.`})}}),null),P(f,j(M,{get when(){return $e(()=>!!n.isError)()&&!Oe()},get children(){return j(Kj,{title:`Failed to load issue`,get children(){return n.error?.message??`Unknown error`}})}}),null),P(y,j(M,{get when(){return v()},get children(){return j(qj,{get message(){return v()}})}}),b),P(y,j(Lj,{rows:2,placeholder:`Reply — steer the agent or add context…`,get value(){return g()},onInput:e=>_(e.target.value),get disabled(){return De.isPending}}),b),P(b,j(Rj,{class:`min-w-0 flex-1`,get value(){return Ce()},onChange:e=>{Te=!0,we(e.currentTarget.value)},get children(){return[j(M,{get when(){return m()},get children(){var e=Q$();return D(()=>e.selected=Ce()===`local`),e}}),j(We,{get each(){return Se()},children:(e,t)=>(()=>{var n=v1(),r=n.firstChild.nextSibling;return r.nextSibling,P(n,(()=>{var e=$e(()=>Se().length>1);return()=>e()?` #${t()+1}`:``})(),r),P(n,()=>Yj(e.createdAt),null),D(()=>n.selected=Ce()===`thread:${e.id}`),D(()=>n.value=`thread:${e.id}`),n})()}),j(M,{get when(){return i.data?.cursorAgentId},get children(){var e=$$(),t=e.firstChild.nextSibling;return t.nextSibling,P(e,()=>i.data?.cursorAgentName??`Cursor`,t),D(()=>e.selected=Ce()===`new`),e}}),(()=>{var e=e1();return D(()=>e.selected=Ce()===`comment`),e})()]}}),null),P(b,j(q,{variant:`ghost`,get class(){return`size-7 shrink-0 px-0 ${mj()===`composer`?`text-accent`:``}`},get title(){return mj()===`composer`?`Pick mode ON — every pick appends here. Click to stop.`:`Pick elements — refs append to this reply (stays on until toggled off or sent)`},"aria-label":`Pick element for reply`,onClick:ee,get children(){return t1()}}),null),P(b,j(q,{variant:`ghost`,get class(){return`size-7 shrink-0 px-0 ${te().phase===`recording`?`text-danger`:``}`},get title(){return te().phase===`recording`?`Stop recording — the GIF auto-attaches to this reply`:`Record a GIF from this thread (auto-attaches when done)`},"aria-label":`Record GIF`,onClick:re,get children(){return j(M,{get when(){return te().phase===`recording`},get fallback(){return y1()},get children(){return n1()}})}}),null),P(b,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return C()},title:`Attach captures — element refs, screenshots, region shots, recording GIF`,"aria-label":`Attach captures`,onClick:()=>void E(),get children(){return r1()}}),null),P(b,j(q,{class:`min-w-[52px] shrink-0`,variant:`primary`,get loading(){return De.isPending},get disabled(){return g().trim().length===0},onClick:()=>De.mutate(),get children(){return i1()}}),null),t})()}function M1(e){let t=k(()=>{let t=e.session.status;return/complete|done/i.test(t)?`var(--color-success)`:/await|pending|elicit/i.test(t)?`var(--color-warn)`:`var(--color-accent)`}),n=k(()=>{let t=e.session.status;return/active/i.test(t)?`Working…`:/awaitingInput|elicit/i.test(t)?`Needs input`:/complete/i.test(t)?`Complete`:/error/i.test(t)?`Error`:/pending/i.test(t)?`Queued`:t}),r=k(()=>e.session.activities.filter(e=>e.content?.body||e.content?.action).slice(-15)),[i,a]=T(!1),o,s=!0,c=()=>{o&&(s=o.scrollTop+o.clientHeight>=o.scrollHeight-40)};return O(()=>{let e=r().length;!o||!e||!s||requestAnimationFrame(()=>{o&&(o.scrollTop=o.scrollHeight)})}),(()=>{var s=w1(),l=s.firstChild,u=l.firstChild;return P(l,j(M,{get when(){return/active|pending/i.test(e.session.status)},get children(){return j(Fj,{size:12})}}),u),P(l,j(Wj,{get color(){return t()},get children(){return n()}}),u),P(l,j(M,{get when(){return e.session.appUser?.displayName},get children(){var t=b1();return P(t,()=>e.session.appUser.displayName),t}}),u),P(u,()=>Yj(e.session.updatedAt)),P(l,j(M,{get when(){return e.session.externalLinks?.[0]},children:e=>j(Vj,{get href(){return e().url},class:`shrink-0`,title:`Open this run on the agent's site`,get children(){return e().label||`Cursor`}})}),null),P(l,j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return i()?`Collapse to a window`:`Expand — show the whole session feed`},get"aria-label"(){return i()?`Collapse feed`:`Expand feed`},onClick:()=>a(e=>!e),get children(){var e=x1();return D(t=>dt(e,`transform`,i()?`rotate(180deg)`:`none`)),e}}),null),P(s,j(M,{get when(){return e.session.summary},get children(){var t=S1();return P(t,()=>e.session.summary),t}}),null),P(s,j(M,{get when(){return r().length>0},get children(){var e=C1();e.addEventListener(`scroll`,c);var t=o;return typeof t==`function`?pt(t,e):o=e,P(e,j(Ge,{get each(){return r()},children:e=>j(M,{get when(){return e().content.action},get fallback(){return(()=>{var t=E1();return P(t,j(D1,{get text(){return e().content.body??``}})),D(()=>st(t,`lg-md text-[11.5px] leading-relaxed break-words ${e().content.__typename===`AgentActivityErrorContent`?`text-danger`:`text-text`}`)),t})()},get children(){var t=T1(),n=t.firstChild.nextSibling;return n.nextSibling,P(t,()=>e().content.action,n),P(t,()=>e().content.parameter,null),t}})})),D(()=>e.classList.toggle(`max-h-64`,!i())),e}}),null),s})()}rt([`click`]);var N1=N(`<svg aria-hidden width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M1 4.5A7 7 0 0 1 13.5 3"></path><path d="M15 11.5A7 7 0 0 1 2.5 13"></path><polyline points="1 1 1 5 5 5"></polyline><polyline points="15 11 15 15 11 15">`),P1=N(`<div class="flex flex-col gap-1.5">`),F1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text inline-flex items-center gap-1.5 text-[12px] font-semibold"> Cloud agents</span><span class="text-text-faint text-[10.5px] tabular-nums"> working · updated </span></div><div class="border-border flex shrink-0 items-center gap-1 border-b px-3 py-1.5"></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),I1=N(`<button>`),L1=N(`<div class="grid place-items-center py-10">`),R1=N(`<button class="flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left"title="View the thread here"><span class="font-mono text-text-dim shrink-0 text-[11px]"></span><span class="text-text hover:text-accent min-w-0 truncate text-[12.5px] font-medium transition-colors">`),z1=N(`<p class="text-text-dim line-clamp-2 cursor-pointer text-[11.5px] leading-snug break-words">`),B1=N(`<span class="text-text-dim text-[11px]">`),V1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),H1=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><div class="flex min-w-0 items-center gap-1.5"><span class=ml-auto>`),U1=N(`<span aria-hidden class="size-2 shrink-0 rounded-full">`),W1=N(`<span class="text-text-dim text-[12.5px]">Conversation session`);function G1(){let e=_r(()=>({queryKey:[`cloud-sessions`],queryFn:bO,refetchInterval:12e3})),t=[{id:`all`,label:`All`},{id:`working`,label:`Working`},{id:`input`,label:`Needs input`},{id:`done`,label:`Done`}],[n,r]=br(`cloud:filter`,`all`),i=k(()=>(e.data??[]).filter(e=>{switch(n()){case`working`:return/active|pending/i.test(e.status);case`input`:return/awaitingInput|elicit/i.test(e.status);case`done`:return/complete/i.test(e.status);default:return!0}})),a=e=>/active/i.test(e)?{word:`Working…`,color:`var(--color-accent)`}:/awaitingInput|elicit/i.test(e)?{word:`Needs input`,color:`var(--color-warn)`}:/complete/i.test(e)?{word:`Complete`,color:`var(--color-success)`}:/error/i.test(e)?{word:`Error`,color:`var(--color-danger)`}:{word:e,color:`var(--color-text-dim)`},o=e=>{let t=[...e.activities].reverse().find(e=>e.content?.body||e.content?.action);return t?t.content.action?`→ ${t.content.action} ${t.content.parameter??``}`:t.content.body??``:e.summary??``},s=k(()=>(e.data??[]).filter(e=>/active|pending/i.test(e.status)).length),[c,l]=T(null);return j(M,{get when(){return!c()},get fallback(){return j(j1,{get issueId(){return c()},onBack:()=>l(null)})},get children(){var c=F1(),u=c.firstChild,d=u.firstChild,f=d.firstChild,p=d.nextSibling,m=p.firstChild,h=u.nextSibling,g=h.nextSibling;return P(d,j(zj,{size:13}),f),P(p,s,m),P(p,()=>Yj(e.dataUpdatedAt||Date.now()),null),P(h,j(We,{each:t,children:e=>(()=>{var t=I1();return t.$$click=()=>r(e.id),P(t,()=>e.label),D(()=>st(t,`h-6 shrink-0 cursor-pointer rounded-md px-2 text-[11px] font-medium transition-colors ${n()===e.id?`bg-accent-soft text-accent`:`text-text-dim hover:bg-surface-2`}`)),t})()}),null),P(h,j(q,{class:`ml-auto size-6 px-0`,get loading(){return e.isFetching},title:`Refresh`,"aria-label":`Refresh sessions`,onClick:()=>void e.refetch(),get children(){return N1()}}),null),P(g,j(M,{get when(){return i().length>0},get fallback(){return j(M,{get when(){return!e.isPending},get fallback(){return(()=>{var e=L1();return P(e,j(Fj,{})),e})()},get children(){return j(Kj,{title:`No cloud agent sessions`,children:`Delegate an issue to Cursor from the Draft tab and its live session appears here.`})}})},get children(){var e=P1();return P(e,j(Ge,{get each(){return i()},children:e=>(()=>{var t=H1(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,s=i.firstChild;return P(n,j(M,{get when(){return/active|pending/i.test(e().status)},get fallback(){return(()=>{var t=U1();return D(n=>dt(t,`background`,a(e().status).color)),t})()},get children(){return j(Fj,{})}}),r),P(n,j(M,{get when(){return e().issue},get fallback(){return W1()},get children(){var t=R1(),n=t.firstChild,r=n.nextSibling;return t.$$click=()=>l(e().issue.id),P(n,()=>e().issue.identifier),P(r,()=>e().issue.title),t}}),r),P(r,()=>Yj(e().updatedAt)),P(t,j(M,{get when(){return o(e())},get children(){var t=z1();return t.$$click=()=>e().issue&&l(e().issue.id),P(t,()=>o(e())),t}}),i),P(i,j(Wj,{get color(){return a(e().status).color},get children(){return a(e().status).word}}),s),P(i,j(M,{get when(){return e().issue},get children(){return[j(Gj,{get color(){return e().issue.state.color}}),(()=>{var t=B1();return P(t,()=>e().issue.state.name),t})()]}}),s),P(i,j(M,{get when(){return e().issue},get children(){return[j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,title:`Open the thread — steer this agent`,"aria-label":`Open thread`,onClick:()=>l(e().issue.id),get children(){return V1()}}),j(Vj,{get href(){return e().issue.url},class:`shrink-0`,children:`Linear`})]}}),null),t})()})),e}})),c}})}rt([`click`]);var K1=N(`<div class="flex flex-col gap-1.5">`),q1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Running now</span><span class="text-text-faint text-[10.5px] tabular-nums"> agent<!> active</span></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),J1=N(`<span class="font-mono text-text-dim shrink-0 text-[11px]">`),Y1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),X1=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><button class="flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left"><span class="text-text hover:text-accent min-w-0 truncate text-[12.5px] font-medium transition-colors"></span></button><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><p class="text-text-dim line-clamp-2 text-[11.5px] leading-snug break-words"></p><div class="flex min-w-0 items-center gap-1.5"><span class=ml-auto>`);function Z1(){let e=_r(()=>({queryKey:[`cloud-sessions`],queryFn:bO,refetchInterval:12e3})),t=_r(()=>({queryKey:[`bridge-tasks`],queryFn:LO,refetchInterval:5e3,retry:0})),n=_r(()=>({queryKey:[`my-issues`],queryFn:gO,refetchInterval:3e4})),r=k(()=>{let r=(e.data??[]).filter(e=>/active|pending|awaitingInput|elicit/i.test(e.status)).map(e=>({kind:`cloud`,at:Date.parse(e.updatedAt),session:e})),i=(t.data??[]).filter(e=>e.status===`running`).map(e=>({kind:`local`,at:e.startedAt,task:e,issueId:(n.data??[]).find(t=>e.title.startsWith(t.identifier))?.id}));return[...r,...i].sort((e,t)=>t.at-e.at)}),[i,a]=T(null),o=e=>/awaitingInput|elicit/i.test(e)?{word:`Needs input`,color:`var(--color-warn)`}:{word:`Working…`,color:`var(--color-accent)`},s=e=>{let t=[...e.activities].reverse().find(e=>e.content?.body||e.content?.action);return t?t.content.action?`→ ${t.content.action} ${t.content.parameter??``}`:t.content.body??``:e.summary??``};return j(M,{get when(){return!i()},get fallback(){return j(j1,{get issueId(){return i()},onBack:()=>a(null)})},get children(){var e=q1(),t=e.firstChild,n=t.firstChild.nextSibling,i=n.firstChild,c=i.nextSibling;c.nextSibling;var l=t.nextSibling;return P(n,()=>r().length,i),P(n,()=>r().length===1?``:`s`,c),P(l,j(M,{get when(){return r().length>0},get fallback(){return j(Kj,{title:`Nothing running`,children:`Delegate an issue from the Draft tab — cloud (Cursor) and local (Claude Code) agents working right now appear here together.`})},get children(){var e=K1();return P(e,j(Ge,{get each(){return r()},children:e=>(()=>{var t=X1(),n=t.firstChild,r=n.firstChild,i=r.firstChild,c=r.nextSibling,l=n.nextSibling,u=l.nextSibling,d=u.firstChild;return P(n,j(Fj,{size:12}),r),P(n,j(Wj,{get title(){return e().kind===`cloud`?`Cursor cloud agent`:`Local Claude Code`},get children(){return[$e(()=>$e(()=>e().kind===`cloud`)()?j(zj,{}):j(Bj,{})),$e(()=>e().kind===`cloud`?`cloud`:`local`)]}}),r),r.$$click=()=>{let t=e();t.kind===`cloud`&&t.session.issue?a(t.session.issue.id):t.kind===`local`&&fj(`local`)},P(r,j(M,{get when(){return e().kind===`cloud`},get children(){var t=J1();return P(t,()=>e().session.issue?.identifier),t}}),i),P(i,(()=>{var t=$e(()=>e().kind===`cloud`);return()=>t()?e().session.issue?.title??`Conversation session`:e().task.title})()),P(c,()=>Yj(e().at)),P(l,(()=>{var t=$e(()=>e().kind===`cloud`);return()=>t()?s(e().session):e().task.lastText})()),P(u,j(M,{get when(){return e().kind===`cloud`},get fallback(){return j(Wj,{color:`var(--color-accent)`,children:`Working…`})},get children(){return j(Wj,{get color(){return o(e().session.status).color},get children(){return o(e().session.status).word}})}}),d),P(u,j(q,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return e().kind===`cloud`?`Open the thread — steer this agent`:`Open the live session in the Local tab`},"aria-label":`Open thread`,onClick:()=>{let t=e();t.kind===`cloud`&&t.session.issue?a(t.session.issue.id):t.kind===`local`&&fj(`local`)},get children(){return Y1()}}),null),D(()=>it(r,`title`,e().kind===`cloud`?`View the thread here`:`Open the Local tab`)),t})()})),e}})),e}})}rt([`click`]),Br();var Q1=N(`<div class="border-accent/40 bg-accent-soft self-end rounded-lg border px-2.5 py-1.5"><p class="text-accent mb-0.5 text-[9.5px] font-semibold tracking-wide uppercase">You</p><div class="lg-md text-text text-[11.5px] leading-relaxed break-words">`),$1=N(`<div><p></p><div class="lg-md text-text text-[11.5px] leading-relaxed break-words">`),e0=N(`<p>`),t0=N(`<span class="text-text-faint max-w-[55%] truncate text-[10.5px] tabular-nums"> running<!> · `),n0=N(`<div class="flex flex-col gap-1.5">`),r0=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Local Claude Code</span></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),i0=N(`<span class="bg-surface-2 border-border font-mono mt-2 block rounded-md border px-2 py-1.5 text-[11px] select-all">npx linear-grab-bridge`),a0=N(`<span class="text-text-faint text-[10.5px] tabular-nums">ctx <!> · out `),o0=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-faint min-w-0 truncate text-[10.5px]">`),s0=N(`<option selected>`),c0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=currentColor aria-hidden><path d="M4.5 2.8a.8.8 0 0 1 1.22-.68l8 5.2a.8.8 0 0 1 0 1.36l-8 5.2a.8.8 0 0 1-1.22-.68V2.8Z">`),l0=N(`<span class="text-success text-[12px] leading-none">✓`),u0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><path d="M14 10a2 2 0 0 1-2 2H6l-3.5 2.5V4a2 2 0 0 1 2-2H12a2 2 0 0 1 2 2v6Z">`),d0=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3 y=3 width=10 height=10 rx=1.5>`),f0=N(`<span class="font-mono text-text-faint min-w-0 truncate text-[10.5px]">`),p0=N(`<div class="border-border bg-bg flex flex-col gap-1 rounded-md border p-2"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text-dim text-[10.5px] font-semibold tracking-wide uppercase">Changes</span><span class="ml-auto shrink-0 text-[10.5px] tabular-nums"><span class=text-success>+</span> <span class=text-danger>−`),m0=N(`<div class="border-border bg-bg flex max-h-80 flex-col gap-1.5 overflow-y-auto rounded-md border py-2 pl-2 pr-3">`),h0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=2.2></circle><path d="M8 1v3M8 12v3M1 8h3M12 8h3">`),g0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M13 7.5 8.2 12.3a3.2 3.2 0 0 1-4.5-4.5L8.9 2.6a2.1 2.1 0 0 1 3 3L7.1 10.4a1 1 0 0 1-1.5-1.5l4.3-4.3">`),_0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M8 2v4M8 10v4M2 8h4M10 8h4M4.5 4.5 6 6M11.5 11.5 10 10M11.5 4.5 10 6M4.5 11.5 6 10">`),v0=N(`<span class="inline-block min-w-[4ch] text-center">Send`),y0=N(`<div class="flex flex-col gap-1.5"><div class="flex items-center gap-1"><span class="text-text-faint min-w-0 flex-1 truncate text-[10.5px]">`),b0=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text min-w-0 truncate text-[12.5px] font-medium"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><p class="text-text-dim text-[11.5px] leading-snug break-words"></p><div class="flex flex-wrap items-center gap-1.5"></div><div class="flex items-center gap-1">`),x0=N(`<span aria-hidden class="size-2 shrink-0 rounded-full">`),S0=N(`<div class="flex min-w-0 items-center gap-1.5">`),C0=N(`<option>`),w0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),T0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M2.5 3.5 6 7 2.5 10.5M7.5 12.5h6">`),E0=N(`<span class=text-success>+`),D0=N(`<span class=text-danger>−`),O0=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim min-w-0 flex-1 truncate text-[10.5px]"></span><span class="shrink-0 text-[10px] tabular-nums">`),k0=N(`<span class=text-text-faint>bin`),A0=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim min-w-0 flex-1 truncate text-[10.5px]"></span><span class="text-success shrink-0 text-[10px]">new`),j0=N(`<div class="flex min-w-0 items-center gap-1.5 pt-0.5"><a target=_blank rel=noreferrer class="text-accent min-w-0 truncate text-[11px] hover:underline">`),M0=N(`<p class="text-text-faint text-[11px]">Waiting for output…`),N0=[{id:``,label:`Default model`},{id:`fable`,label:`Fable 5`},{id:`opus`,label:`Opus`},{id:`sonnet`,label:`Sonnet`},{id:`haiku`,label:`Haiku`}];function P0(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)<(r[e]??0);return!1}var F0=e=>e==null?`–`:e>=1e3?`${(e/1e3).toFixed(e>=1e5?0:1)}k`:String(e);function I0(){let e=sr(),t=_r(()=>({queryKey:[`bridge-health`],queryFn:IO,refetchInterval:5e3,retry:0})),n=_r(()=>({queryKey:[`bridge-tasks`],queryFn:LO,refetchInterval:3e3,enabled:!!t.data?.ok})),[r,i]=T(null),a=_r(()=>({queryKey:[`my-issues`],queryFn:gO,staleTime:15e3})),o=e=>{let t=e.title.match(/^([A-Z][A-Z0-9]*-\d+)/)?.[1];return t?a.data?.find(e=>e.identifier===t):void 0},s=_r(()=>({queryKey:[`bridge-task`,r()],queryFn:()=>RO(r()),refetchInterval:1500,enabled:!!r()&&!!t.data?.ok})),c=_r(()=>({queryKey:[`bridge-diff`,r()],queryFn:()=>KO(r()),refetchInterval:6e3,enabled:!!r()&&!!t.data?.ok})),l=()=>{e.invalidateQueries({queryKey:[`bridge-tasks`]}),e.invalidateQueries({queryKey:[`bridge-task`,r()]})},u=vr(()=>({mutationFn:e=>WO(e),onSuccess:l})),[d,f]=br(`local:message`,``),[p,m]=T(!1),[h,g]=T(0),_=_r(()=>({queryKey:[`grab`],queryFn:Dr,enabled:mj()===`local`})),v=()=>{g(Date.now()),gj(`local`),oQ().catch(()=>gj(`capture`))};O(()=>{if(mj()!==`local`)return;let e=(_.data??[]).filter(e=>e.grabbedAt>=h());if(!e.length)return;let t=e.map(e=>{let t=e.source?.filePath?` — \`${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}\``:``;return`- \`<${e.componentName??e.tagName??`element`}>\`${t}`}).join(`
280
+ `);f(e=>`${e?`${e}\n`:``}${t}\n`),gj(`capture`)});let y=async()=>{m(!0);try{let{block:e,failed:t}=await C$();e&&f(t=>`${t?`${t}\n`:``}${e}\n`),t.length&&f(e=>`${e}\n<!-- upload issues: ${t.join(` · `)} -->\n`)}finally{m(!1)}},b=vr(()=>({mutationFn:e=>HO(e.id,e.text),onSuccess:()=>{f(``),l()}})),x=vr(()=>({mutationFn:e=>UO(e.id,e.model),onSuccess:t=>{e.setQueryData([`bridge-tasks`],e=>e?.map(e=>e.id===t.id?t:e)),l()}})),S=vr(()=>({mutationFn:e=>GO(e),onSuccess:l})),C,w=!0,E=()=>{C&&(w=C.scrollTop+C.clientHeight>=C.scrollHeight-48)};O(()=>{let e=s.data?.tail?.length??0;r(),!(!C||!e||!w)&&requestAnimationFrame(()=>{C&&(C.scrollTop=C.scrollHeight)})});let[ee,te]=T(null),A=async e=>{try{await navigator.clipboard.writeText(tk(e)),te(e.id),setTimeout(()=>te(null),1800)}catch{}},ne=e=>e===`running`?`var(--color-accent)`:e===`done`?`var(--color-success)`:e===`stopped`?`var(--color-warn)`:`var(--color-danger)`,re=e=>{let t=e.line.kind,n=k(()=>N$(e.line.text));return t===`user`?(()=>{var e=Q1(),t=e.firstChild.nextSibling;return D(()=>t.innerHTML=n()),e})():t===`assistant`||t===`result`?(()=>{var e=$1(),r=e.firstChild,i=r.nextSibling;return st(e,`bg-surface rounded-lg border px-2.5 py-1.5 ${t===`result`?`border-success/40`:`border-border`}`),st(r,`mb-0.5 text-[9.5px] font-semibold tracking-wide uppercase ${t===`result`?`text-success`:`text-text-faint`}`),P(r,t===`result`?`Result`:`Claude`),D(()=>i.innerHTML=n()),e})():(()=>{var n=e0();return st(n,`font-mono px-1 text-[10px] leading-relaxed break-words ${t===`subagent`?`text-warn`:t===`stderr`?`text-danger`:`text-text-faint`}`),P(n,()=>e.line.text),n})()};return(()=>{var e=r0(),a=e.firstChild;a.firstChild;var l=a.nextSibling;return P(a,j(M,{get when(){return t.data?.ok},get fallback(){return j(Wj,{class:`text-danger`,children:`bridge offline`})},get children(){return[j(M,{get when(){return P0(t.data.version,`0.15.1`)},get children(){return j(Wj,{class:`text-warn`,title:`Ctrl+C the old process, then: npx linear-grab-bridge`,get children(){return[`v`,$e(()=>t.data.version),` outdated — restart`]}})}}),(()=>{var e=t0(),r=e.firstChild,i=r.nextSibling;return i.nextSibling,P(e,()=>t.data.active,r),P(e,()=>{let e=(n.data??[]).reduce((e,t)=>e+(t.usage?.costUsd??0),0);return e>0?` · Σ $${e.toFixed(2)}`:``},i),P(e,()=>t.data.cwd.split(`/`).slice(-2).join(`/`),null),D(()=>it(e,`title`,t.data?.cwd)),e})()]}}),null),P(l,j(M,{get when(){return t.data?.ok},get fallback(){return j(Kj,{title:`Bridge not running`,get children(){return[`Start it in your repo's terminal:`,i0(),`Then delegate from the Draft tab ("Local Claude Code") or watch tasks here. Sessions stay interactive — send follow-ups, switch models, interrupt, resume in your terminal. History persists across restarts.`]}})},get children(){return j(M,{get when(){return(n.data??[]).length>0},get fallback(){return j(Kj,{title:`No local tasks yet`,children:`Create an issue in Draft with "Delegate to → Local Claude Code", and it appears here with live status and a conversation view.`})},get children(){var e=n0();return P(e,j(Ge,{get each(){return n.data},children:e=>(()=>{var t=b0(),n=t.firstChild,a=n.firstChild,l=a.nextSibling,m=n.nextSibling,h=m.nextSibling,g=h.nextSibling;return P(n,j(M,{get when(){return e().status===`running`},get fallback(){return(()=>{var t=x0();return D(n=>dt(t,`background`,ne(e().status))),t})()},get children(){return j(Fj,{})}}),a),P(a,()=>e().title),P(l,()=>Yj(e().startedAt)),P(m,()=>e().lastText),P(h,j(Wj,{get color(){return ne(e().status)},get children(){return e().status}}),null),P(h,j(Wj,{get children(){return e().model??`default model`}}),null),P(h,j(M,{get when(){return e().pendingModel},get children(){return j(Wj,{class:`text-warn`,get children(){return[`→ `,$e(()=>e().pendingModel),` next msg`]}})}}),null),P(h,j(M,{get when(){return e().subagents>0},get children(){return j(Wj,{class:`text-warn`,get children(){return[`⛓ `,$e(()=>e().subagents),` subagents`]}})}}),null),P(h,j(M,{get when(){return e().usage},get children(){var t=a0(),n=t.firstChild.nextSibling;return n.nextSibling,P(t,()=>F0(e().usage.contextTokens),n),P(t,()=>F0(e().usage.outputTokens),null),P(t,(()=>{var t=$e(()=>!!e().usage.costUsd);return()=>t()?` · $${e().usage.costUsd.toFixed(2)}`:``})(),null),t}}),null),P(t,j(M,{get when(){return o(e())},children:e=>(()=>{var t=S0();return P(t,j(Wj,{get children(){return e().state.name}}),null),P(t,j(Vj,{get href(){return e().url},children:`Open in Linear`}),null),t})()}),g),P(t,j(M,{get when(){return $e(()=>!!e().worktree)()&&!e().worktree.removed},get children(){var t=o0(),n=t.firstChild;return P(t,j(Wj,{class:`text-warn`,children:`⎇ worktree`}),n),P(n,()=>e().worktree.branch),P(t,j(M,{get when(){return e().status!==`running`},get children(){return j(q,{variant:`ghost`,class:`ml-auto h-6 shrink-0 px-2 text-[11px]`,get loading(){return S.isPending},get title(){return`Remove the worktree at ${e().worktree.path} — the branch (and PR) survive`},onClick:()=>S.mutate(e().id),children:`Remove`})}}),null),D(()=>it(n,`title`,e().worktree.path)),t}}),g),P(g,j(Rj,{class:`h-7 w-auto min-w-0 flex-1 text-[11px]`,get value(){return e().pendingModel??e().model??``},onChange:t=>x.mutate({id:e().id,model:t.currentTarget.value}),title:`Model — applies from the next message`,get children(){return[j(We,{each:N0,children:t=>(()=>{var n=C0();return P(n,()=>t.label),D(()=>n.selected=(e().pendingModel??e().model??``)===t.id),D(()=>n.value=t.id),n})()}),j(M,{get when(){return!N0.some(t=>t.id===(e().pendingModel??e().model??``))},get children(){var t=s0();return P(t,()=>e().pendingModel??e().model),D(()=>t.value=e().pendingModel??e().model??``),t}})]}}),null),P(g,j(M,{get when(){return $e(()=>e().status!==`running`)()&&e().sessionId},get children(){return j(q,{variant:`ghost`,class:`size-7 px-0`,get loading(){return b.isPending},get title(){return`Resume — continues this session${e().pendingModel?` on ${e().pendingModel}`:``}`},"aria-label":`Resume session`,onClick:()=>b.mutate({id:e().id,text:`Continue where you left off. If the work is already complete, finish any remaining closeout steps (PR, Linear update, announcement).`}),get children(){return c0()}})}}),null),P(g,j(M,{get when(){return o(e())},children:e=>j(q,{variant:`ghost`,class:`size-7 px-0`,title:`Open the issue's Activity thread`,onClick:()=>fj(`activity`,e().id),get children(){return w0()}})}),null),P(g,j(q,{variant:`ghost`,class:`size-7 px-0`,get disabled(){return!e().sessionId},get title(){return $e(()=>!!e().sessionId)()?`Copy resume command · session ${e().sessionId.slice(0,8)}…`:`No session yet`},onClick:()=>void A(e()),get children(){return j(M,{get when(){return ee()===e().id},get fallback(){return T0()},get children(){return l0()}})}}),null),P(g,j(q,{variant:`ghost`,class:`size-7 px-0`,get title(){return r()===e().id?`Hide thread`:`Open thread — chat & changes`},onClick:()=>i(r()===e().id?null:e().id),get children(){return u0()}}),null),P(g,j(M,{get when(){return e().status===`running`},get children(){return j(q,{variant:`danger`,class:`size-7 px-0`,get loading(){return u.isPending},title:`Interrupt — the session stays resumable`,onClick:()=>u.mutate(e().id),get children(){return d0()}})}}),null),P(t,j(M,{get when(){return r()===e().id},get children(){return[j(M,{get when(){return $e(()=>!!c.data)()&&(c.data.files.length||c.data.untracked.length||c.data.prs.length)},get children(){var e=p0(),t=e.firstChild,n=t.firstChild.nextSibling,r=n.firstChild;r.firstChild;var i=r.nextSibling.nextSibling;return i.firstChild,P(t,j(M,{get when(){return c.data.branch},get children(){var e=f0();return P(e,()=>c.data.branch),e}}),n),P(r,()=>c.data.totalAdded,null),P(i,()=>c.data.totalDeleted,null),P(e,j(We,{get each(){return c.data.files},children:e=>(()=>{var t=O0(),n=t.firstChild,r=n.nextSibling;return P(n,()=>e.path),P(r,j(M,{get when(){return!e.binary},get fallback(){return k0()},get children(){return[(()=>{var t=E0();return t.firstChild,P(t,()=>e.added,null),t})(),` `,(()=>{var t=D0();return t.firstChild,P(t,()=>e.deleted,null),t})()]}})),D(()=>it(n,`title`,e.path)),t})()}),null),P(e,j(We,{get each(){return c.data.untracked},children:e=>(()=>{var t=A0(),n=t.firstChild;return it(n,`title`,e),P(n,e),t})()}),null),P(e,j(We,{get each(){return c.data.prs},children:e=>(()=>{var t=j0(),n=t.firstChild;return P(t,j(Wj,{class:`text-accent`,get children(){return[`PR · `,$e(()=>e.state.toLowerCase())]}}),n),P(n,()=>e.title),D(t=>{var r=e.url,i=e.title;return r!==t.e&&it(n,`href`,t.e=r),i!==t.t&&it(n,`title`,t.t=i),t},{e:void 0,t:void 0}),t})()}),null),e}}),(()=>{var e=m0();return e.addEventListener(`scroll`,E),pt(e=>{C=e,w=!0},e),P(e,j(M,{get when(){return(s.data?.tail??[]).length>0},get fallback(){return M0()},get children(){return j(Ge,{get each(){return s.data?.tail??[]},children:e=>j(re,{get line(){return e()}})})}})),e})(),(()=>{var t=y0(),n=t.firstChild,r=n.firstChild;return P(t,j(Lj,{rows:2,get placeholder(){return e().status===`running`?`Message the working agent — it queues into the live session…`:`Follow-up — resumes the session…`},get value(){return d()},onInput:e=>f(e.currentTarget.value)}),n),P(r,(()=>{var t=$e(()=>!!e().alive);return()=>t()?`live session`:e().sessionId?`resumes on send`:`no session`})()),P(n,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,title:`Pick elements on the page — refs drop into this message`,"aria-label":`Pick element`,onClick:v,get children(){return h0()}}),null),P(n,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return p()},title:`Attach captures — element refs, screenshots, region shots, recording GIF`,"aria-label":`Attach captures`,onClick:()=>void y(),get children(){return g0()}}),null),P(n,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get disabled(){return $e(()=>!e().alive)()&&!e().sessionId},title:`Compact the session — frees context (sends /compact)`,"aria-label":`Compact session`,onClick:()=>b.mutate({id:e().id,text:`/compact`}),get children(){return _0()}}),null),P(n,j(q,{variant:`primary`,class:`shrink-0`,get loading(){return b.isPending},get disabled(){return!d().trim()||!e().alive&&!e().sessionId},onClick:()=>b.mutate({id:e().id,text:d().trim()}),get children(){return v0()}}),null),t})()]}}),null),t})()})),e}})}})),e})()}Br();var L0=N(`<span class="text-text-faint text-[10.5px] tabular-nums">/<!> from your issues`),R0=N(`<div class="flex flex-col gap-1.5">`),z0=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Pull requests</span></div><div class="border-border flex shrink-0 items-center gap-1.5 border-b px-3 py-1.5"><div class="bg-surface-2 border-border flex shrink-0 rounded-md border p-0.5"></div></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),B0=N(`<span class="text-warn text-[10.5px]"title="Merge states come from gh via the bridge">states unknown — restart the bridge`),V0=N(`<button>`),H0=N(`<span class="text-success text-[11px]">✓`),U0=N(`<span class="text-[12px] leading-none">✓`),W0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),G0=N(`<span class="text-success text-[12px] leading-none">✓`),K0=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><a target=_blank rel=noreferrer class="text-accent truncate text-[12.5px] font-medium hover:underline"></a><div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim shrink-0 text-[11px]"></span><span class="text-text-dim truncate text-[11.5px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><div class="flex min-w-0 flex-wrap items-center gap-1.5"><div class="ml-auto flex shrink-0 items-center gap-1">`),q0=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 2 14 5.5 8 9 2 5.5 8 2Z"></path><path d="M2 10.5 8 14l6-3.5">`),J0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=4 cy=3.5 r=1.5></circle><circle cx=4 cy=12.5 r=1.5></circle><circle cx=12 cy=8 r=1.5></circle><path d="M4 5v6M4 6.5c0 2 2 3 4.5 3h2">`),Y0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),X0=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i;function Z0(e){let t=_r(()=>({queryKey:[`my-issues`],queryFn:gO,refetchInterval:15e3})),n=k(()=>(t.data??[]).flatMap(e=>(e.attachments??[]).filter(e=>X0.test(e.url)).map(t=>({issue:e,attachment:t})))),r=_r(()=>({queryKey:[`bridge-tasks`],queryFn:LO,refetchInterval:1e4,retry:0})),i=_r(()=>({queryKey:[`pr-status`,n().map(e=>e.attachment.url).sort().join(`|`)],queryFn:()=>JO(n().map(e=>e.attachment.url)),refetchInterval:3e4,retry:0,enabled:n().length>0})),[a,o]=T(new Set),s=e=>a().has(e.attachment.url)?`MERGED`:i.data?.statuses[e.attachment.url],c=e=>!!r.data?.some(t=>t.title.startsWith(e.issue.identifier)),[l,u]=T(`all`),[d,f]=T(``),p=k(()=>{let e=d().trim().toLowerCase();return n().filter(t=>{let n=t.issue.state.type,r=s(t);return!(l()===`review`&&(n!==`started`||r===`MERGED`||r===`CLOSED`)||l()===`open`&&(r===`MERGED`||r===`CLOSED`||!(n===`started`||n===`unstarted`||n===`backlog`))||l()===`done`&&!(n===`completed`||r===`MERGED`||r===`CLOSED`)||e&&![t.attachment.title,t.issue.title,t.issue.identifier].join(` `).toLowerCase().includes(e))})}),m=_r(()=>({queryKey:[`settings`],queryFn:Tr})),h=()=>m.data?.stagingBranch?.trim()||`staging`,[g,_]=T(null),[v,y]=T(new Set),[b,x]=T(null),S=async e=>{_(e),x(null);try{await YO(e,h()),y(t=>new Set(t).add(e))}catch(e){x(e instanceof Error?e.message:String(e))}finally{_(null)}},[C,w]=T(null),[E,O]=T(null),ee=async e=>{O(e);try{await $O(e),o(t=>new Set(t).add(e))}catch{}finally{O(null)}},te=async e=>{try{await navigator.clipboard.writeText(e.attachment.url),w(e.attachment.id),setTimeout(()=>w(null),1500)}catch{}};return(()=>{var r=z0(),o=r.firstChild;o.firstChild;var m=o.nextSibling,_=m.firstChild,y=m.nextSibling;return P(o,j(M,{get when(){return!i.isError},get fallback(){return B0()},get children(){var e=L0(),t=e.firstChild,r=t.nextSibling;return r.nextSibling,P(e,()=>p().length,t),P(e,()=>n().length,r),e}}),null),P(_,j(We,{each:[{id:`all`,label:`All`},{id:`review`,label:`Review`},{id:`open`,label:`Open`},{id:`done`,label:`Done`}],children:e=>(()=>{var t=V0();return t.$$click=()=>u(e.id),P(t,()=>e.label),D(()=>st(t,`rounded-[5px] px-2 py-0.5 text-[11px] font-medium transition-colors ${l()===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),P(m,j(Ij,{class:`h-6 min-w-0 flex-1 text-[11px]`,placeholder:`Search PRs…`,get value(){return d()},onInput:e=>f(e.currentTarget.value)}),null),P(y,j(M,{get when(){return p().length>0},get fallback(){return j(Kj,{title:`No PRs yet`,get children(){return $e(()=>!!t.isError)()?`Connect Linear in Settings.`:n().length>0?`No PRs match the current filter.`:`PRs opened by delegated agents appear here as soon as they link back to your issues.`}})},get children(){var t=R0();return P(t,j(We,{get each(){return p()},children:t=>(()=>{var n=K0(),r=n.firstChild,o=r.nextSibling,l=o.firstChild,u=l.nextSibling,d=u.nextSibling,f=o.nextSibling,p=f.firstChild;return P(r,()=>t.attachment.title||t.attachment.url),P(n,j(M,{get when(){return i.data?.previews[t.attachment.url]},get children(){return j(Vj,{get href(){return i.data.previews[t.attachment.url]},class:`shrink-0 self-start`,title:`Vercel deploy preview of this PR's branch`,children:`Preview`})}}),o),P(o,j(Gj,{get color(){return t.issue.state.color}}),l),P(l,()=>t.issue.identifier),P(u,()=>t.issue.title),P(d,()=>Yj(t.issue.updatedAt)),P(f,j(Wj,{get children(){return t.issue.state.name}}),p),P(f,j(M,{get when(){return t.issue.delegate},get children(){return j(Wj,{class:`text-accent`,get children(){return[j(zj,{}),` `,$e(()=>t.issue.delegate.displayName)]}})}}),p),P(f,j(M,{get when(){return c(t)},get children(){return j(Wj,{class:`text-warn`,get children(){return[j(Bj,{}),` local`]}})}}),p),P(f,j(Vj,{get href(){return t.issue.url},class:`shrink-0`,title:`Open the issue in Linear`,children:`Linear`}),p),P(p,j(M,{get when(){return $e(()=>!!s(t))()&&s(t)!==`OPEN`},get children(){return j(Wj,{get class(){return s(t)===`MERGED`?`text-success`:`text-text-faint`},get children(){return s(t)===`MERGED`?`✓ merged`:`closed`}})}}),null),P(p,j(q,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return g()===t.attachment.url},get disabled(){return v().has(t.attachment.url)},get title(){return $e(()=>!!v().has(t.attachment.url))()?`On ${h()} — staging preview deploying`:`Merge into ${h()} — deploys the staging preview domain`},"aria-label":`Merge to staging`,onClick:()=>void S(t.attachment.url),get children(){return j(M,{get when(){return v().has(t.attachment.url)},get fallback(){return q0()},get children(){return H0()}})}}),null),P(p,j(q,{variant:`primary`,class:`size-7 px-0`,get classList(){return{hidden:!!s(t)&&s(t)!==`OPEN`}},get loading(){return E()===t.attachment.url},get disabled(){return a().has(t.attachment.url)},get title(){return a().has(t.attachment.url)?`Merged`:`Squash-merge this PR (bridge gh)`},"aria-label":`Merge PR`,onClick:()=>void ee(t.attachment.url),get children(){return j(M,{get when(){return a().has(t.attachment.url)},get fallback(){return J0()},get children(){return U0()}})}}),null),P(p,j(q,{variant:`ghost`,class:`size-7 px-0`,title:`Open the issue's Activity thread`,"aria-label":`Open issue activity`,onClick:()=>{fj(`activity`,t.issue.id),e.onOpenIssue()},get children(){return W0()}}),null),P(p,j(q,{variant:`ghost`,class:`size-7 px-0`,title:`Copy PR URL`,"aria-label":`Copy PR URL`,onClick:()=>void te(t),get children(){return j(M,{get when(){return C()===t.attachment.id},get fallback(){return Y0()},get children(){return G0()}})}}),null),P(f,j(M,{get when(){return v().has(t.attachment.url)},get children(){return j(x$,{get url(){return t.attachment.url},get base(){return h()}})}}),null),D(e=>{var n=t.attachment.url,i=t.attachment.title;return n!==e.e&&it(r,`href`,e.e=n),i!==e.t&&it(r,`title`,e.t=i),e},{e:void 0,t:void 0}),n})()})),t}})),r})()}rt([`click`]);var Q0=[`display`,`align-items`,`justify-content`,`gap`,`padding`,`margin`,`width`,`height`,`font-size`,`font-weight`,`line-height`,`letter-spacing`,`color`,`background-color`,`border-radius`,`border-width`,`border-color`,`box-shadow`,`opacity`,`transform`,`transition-property`,`transition-duration`],$0=new Set([`color`,`background-color`,`border-color`]),e2={margin:new Set([`0px`]),padding:new Set([`0px`]),gap:new Set([`normal`,`0px`]),"box-shadow":new Set([`none`]),transform:new Set([`none`]),"border-width":new Set([`0px`]),"border-radius":new Set([`0px`]),"letter-spacing":new Set([`normal`]),opacity:new Set([`1`]),"transition-property":new Set([`all`,`none`]),"transition-duration":new Set([`0s`]),width:new Set([`auto`]),height:new Set([`auto`])},t2=null;function n2(e){try{return t2||(t2=document.createElement(`span`),t2.setAttribute(`data-linear-grab`,`true`),t2.style.display=`none`,document.body.appendChild(t2)),t2.style.color=``,t2.style.color=e,t2.style.color?getComputedStyle(t2).color:null}catch{return null}}var r2=null;function i2(){if(r2)return r2;let e=new Map,t=getComputedStyle(document.documentElement),n=new Set;for(let r of Array.from(document.styleSheets)){let i;try{i=r.cssRules}catch{continue}for(let r of Array.from(i)){let i=r.style;if(i)for(let r=0;r<i.length;r++){let a=i.item(r);if(!a.startsWith(`--`)||n.has(a))continue;n.add(a);let o=t.getPropertyValue(a).trim()||i.getPropertyValue(a).trim();if(!o||o.length>80)continue;let s=n2(o);s&&!e.has(s)&&e.set(s,a)}}}return r2=e,e}function a2(e){let t=e.getBoundingClientRect();if(t.width<2&&t.height<2)return!1;let n=getComputedStyle(e);return n.display!==`none`&&n.visibility!==`hidden`}function o2(e){let t=[],n=e.getAttribute(`role`);n&&t.push(n);for(let n of[`data-state`,`data-highlighted`,`aria-expanded`,`aria-selected`,`data-active`]){let r=e.getAttribute(n);r!=null&&t.push(`${n.replace(/^(data|aria)-/,``)}=${r||`true`}`)}return t.join(` `)}async function s2(){try{return(await Promise.resolve().then(()=>(YZ(),VZ))).getGlobalApi()?.getDisplayName??null}catch{return null}}function c2(e,t){let n=null;try{n=t?.(e)??null}catch{}let r=o2(e),i=n||e.tagName.toLowerCase();return r?`${i} [${r}]`:i}function l2(e,t){let n=getComputedStyle(e),r={},i={};for(let e of Q0){let a=n.getPropertyValue(e).trim();if(!(!a||e2[e]?.has(a)))if($0.has(e)){let n=n2(a);if(n===`rgba(0, 0, 0, 0)`)continue;let o=n?t.get(n):void 0;o&&(i[e]=o),r[e]=a}else r[e]=a}return{styles:r,tok:i}}var u2=40;async function d2(e){let t=i2(),n=await s2(),r=[],i=new Map,a=e=>{if(r.length>=u2||!a2(e))return;let o=typeof e.className==`string`?e.className:``,s=`${e.tagName}|${o}`,c=i.get(s);if(c)c.count+=1;else{let{styles:a,tok:c}=l2(e,t),l={label:c2(e,n),count:1,classes:o,styles:a,tokens:c};i.set(s,l),r.push(l)}for(let t of Array.from(e.children))a(t)};return a(e),{title:r[0]?.label??e.tagName.toLowerCase(),pageUrl:location.href,extractedAt:Date.now(),nodes:r,states:[]}}var f2={active:!1,msLeft:0,total:0,byTrigger:{}},p2=new Set;function m2(e){f2={...f2,...e};for(let e of p2)e(f2)}function h2(e){return p2.add(e),e(f2),()=>void p2.delete(e)}var g2=null;function _2(){g2?.()}function v2(e){return e===`hover`||e===`focus`?e:`open`}async function y2(e,t,n){let r=i2(),i=await s2(),a=[],o=new Set,s=new Map,c=e=>l2(e,r).styles,l=e=>{if(!(s.size>=120)){s.set(e,c(e));for(let t of Array.from(e.children))l(t)}};l(e);let u=(e,t)=>{let n=s.get(e);if(!n)return;let r=c(e),l={};for(let e of new Set([...Object.keys(n),...Object.keys(r)])){let t=n[e]??`(unset)`,i=r[e]??`(unset)`;t!==i&&(l[e]={from:t,to:i})}if(Object.keys(l).length===0)return;let u=c2(e,i),d=`${t}|${u}|${Object.keys(l).join(`,`)}`;if(o.has(d))return;o.add(d),a.push({trigger:t,label:u,changed:l});let f=v2(t);m2({total:f2.total+1,byTrigger:{...f2.byTrigger,[f]:(f2.byTrigger[f]??0)+1}})},d=e=>{let t=e.target;t instanceof Element&&s.has(t)&&setTimeout(()=>u(t,`hover`),50)},f=e=>{let t=e.target;t instanceof Element&&s.has(t)&&setTimeout(()=>u(t,`focus`),50)};e.addEventListener(`pointerover`,d,!0),e.addEventListener(`focusin`,f,!0);let p=new MutationObserver(e=>{for(let t of e){if(t.type!==`attributes`||!(t.target instanceof Element))continue;let e=t.target,n=t.attributeName??``,r=e.getAttribute(n)??``;setTimeout(()=>u(e,`attr:${n}=${r||`true`}`),50)}});p.observe(e,{subtree:!0,attributes:!0,attributeFilter:[`class`,`data-state`,`data-highlighted`,`aria-expanded`,`aria-selected`,`open`]});let m=new MutationObserver(t=>{for(let n of t)for(let t of Array.from(n.addedNodes))!(t instanceof Element)||e.contains(t)||t.id===`linear-grab-root`||t.closest?.(`#linear-grab-root`)||setTimeout(()=>{if(!t.isConnected||!a2(t))return;let{styles:e}=l2(t,r);if(Object.keys(e).length===0)return;let n=c2(t,i),s=`appeared|${n}`;if(o.has(s))return;o.add(s);let c={};for(let[t,n]of Object.entries(e))c[t]={from:`(absent)`,to:n};a.push({trigger:`appeared (portal/open)`,label:n,changed:c}),m2({total:f2.total+1,byTrigger:{...f2.byTrigger,open:(f2.byTrigger.open??0)+1}})},50)});m.observe(document.body,{childList:!0,subtree:!1}),m2({active:!0,msLeft:t,total:0,byTrigger:{}});let h=setInterval(()=>{let e=t-(Date.now()-g);n?.(Math.max(0,e)),m2({msLeft:Math.max(0,e)})},250),g=Date.now();return await new Promise(e=>{let n=setTimeout(e,t);g2=()=>{clearTimeout(n),e()}}),g2=null,m2({active:!1,msLeft:0}),clearInterval(h),e.removeEventListener(`pointerover`,d,!0),e.removeEventListener(`focusin`,f,!0),p.disconnect(),m.disconnect(),a}function b2(e){let t=[`# Design genome: ${e.title}`,`Extracted from ${e.pageUrl}`,``,`## Structure`];for(let n of e.nodes){t.push(`### ${n.label}${n.count>1?` ×${n.count}`:``}`),n.classes&&t.push(`classes: \`${n.classes}\``);let e=Object.entries(n.styles).map(([e,t])=>{let r=n.tokens[e];return`${e}: ${t}${r?` ← var(${r})`:``}`});e.length&&t.push("```",...e,"```")}if(e.states.length){t.push(``,`## Interaction states`);for(let n of e.states)t.push(`### ${n.label} — ${n.trigger}`),t.push("```",...Object.entries(n.changed).map(([e,t])=>`${e}: ${t.from} → ${t.to}`),"```")}return t.join(`
281
+ `)}function x2(){return new Promise(e=>{let t=document.createElement(`div`);t.setAttribute(`data-linear-grab`,`true`),t.style.cssText=`position:fixed;z-index:2147483647;pointer-events:none;border:1.5px solid #5e6ad2;border-radius:4px;background:rgba(94,106,210,0.08);display:none;`,document.body.appendChild(t);let n=null,r=e=>{let t=document.elementFromPoint(e.clientX,e.clientY);return!t||t.closest(`#linear-grab-root`)?null:t},i=e=>{let i=r(e);if(n=i,!i){t.style.display=`none`;return}let a=i.getBoundingClientRect();t.style.display=`block`,t.style.left=`${a.left-2}px`,t.style.top=`${a.top-2}px`,t.style.width=`${a.width+4}px`,t.style.height=`${a.height+4}px`},a=n=>{t.remove(),window.removeEventListener(`mousemove`,i,!0),window.removeEventListener(`click`,o,!0),window.removeEventListener(`keydown`,s,!0),e(n)},o=e=>{e.preventDefault(),e.stopPropagation(),a(n)},s=e=>{e.key===`Escape`&&(e.stopPropagation(),a(null))};window.addEventListener(`mousemove`,i,!0),window.addEventListener(`click`,o,!0),window.addEventListener(`keydown`,s,!0)})}function S2(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?parseFloat(t)||0:t.endsWith(`s`)?(parseFloat(t)||0)*1e3:0})}var C2=new Set(`width.height.min-width.min-height.max-width.max-height.top.left.right.bottom.inset.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.font-size.line-height.letter-spacing.box-shadow.filter.background-position.grid-template-columns.grid-template-rows.flex-basis.gap`.split(`.`));function w2(e){return e.includes(`all`)?[`all (includes layout/paint props)`]:e.filter(e=>C2.has(e))}function T2(e){let t=E2(e);if(t===`ease-in`||t===`ease-in-out`)return t;let n=t.match(/cubic-bezier\(\s*([\d.]+)\s*,\s*(-?[\d.]+)/);if(n){let e=parseFloat(n[1]),r=parseFloat(n[2]);if(e>=.4&&r<e/2)return t}return null}function E2(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===`(`)t++;else if(r===`)`)t--;else if(r===`,`&&t===0)return e.slice(0,n).trim()}return e.trim()}var D2=`[data-slot*="content"], [role="menu"], [role="dialog"], [role="listbox"]`,O2=new Set([`width`,`height`,`flex-basis`,`grid-template-columns`,`grid-template-rows`,`grid-template-areas`]);function k2(e,t){if(e instanceof SVGElement)return!0;try{if(e.closest(`svg`))return!0}catch{}try{if(e.closest(D2))return!0}catch{}try{if(e.closest(`[data-panel]`))return!t||t.length===0||t.every(e=>O2.has(e))}catch{}return!1}function A2(e){let t=e.id?`#${e.id}`:``,n=typeof e.className==`string`&&e.className?`.${e.className.split(/\s+/).filter(Boolean).slice(0,2).join(`.`)}`:``;return`${e.tagName.toLowerCase()}${t}${n}`}var j2=200;function M2(e){if(typeof e.className!=`string`)return;let t=e.className.split(/\s+/).filter(e=>/^(transition|duration-|delay-|ease-)/.test(e));return t.length?t.join(` `):void 0}function N2(e,t,n,r,i,a){let o=[];return n>0&&o.push(`remove the ${Math.round(n)}ms transition-delay`),(r?.includes(`transition-all`)||e.includes(`all`))&&o.push(`scope 'transition-all' to the intended properties (e.g. transition-colors)`),a?.length&&o.push(`JANK: transitions LAYOUT/PAINT props (${a.join(`, `)}) — reflow/repaint every frame; animate transform/opacity instead (box-shadow → animate a pseudo-element's opacity)`),i&&o.push(`easing '${i}' starts slow — §42 bans ease-in/ease-in-out on UI, use ease-out`),t>500?o.push(`${Math.round(t)}ms is over the 500ms HARD CAP for UI feedback`):t>300?o.push(`${Math.round(t)}ms is over the 300ms UI cap`):t>100&&o.push(`shorten ${Math.round(t)}ms → ≤100ms`),o.push(`make PRESS feedback instant: 'active:transition-none' (and data-[state=…]:transition-none for toggles) — animate only hover in/out`),o.join(`; `)}async function P2(){try{return(await Promise.resolve().then(()=>(YZ(),VZ))).getGlobalApi()??null}catch{return null}}async function F2(e){let t=await P2(),n=null,r=null;try{n=t?.getDisplayName?.(e)??null}catch{}try{let n=await t?.getSource?.(e);n?.filePath&&(r=`${n.filePath}${n.lineNumber==null?``:`:${n.lineNumber}`}`)}catch{}return{component:n,source:r}}var I2=[],L2=null;function R2(e){I2.push(e),L2??=setTimeout(()=>{L2=null;let e=I2.slice(0,50).map(e=>({kind:`css-slowdown`,...e}));I2=[],ek().then(t=>fetch(`${t}/scan/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({events:e}),keepalive:!0})).catch(()=>{})},1500)}var z2=[],B2=new Set;function V2(e){let t=e.mode===`live`?z2.find(t=>t.mode===`live`&&t.element===e.element&&(t.classHint??``)===(e.classHint??``)&&t.properties.join()===e.properties.join()):void 0;t?(t.count+=1,t.at=e.at,t.sinceInputMs=e.sinceInputMs,z2=[...z2]):z2=[e,...z2].slice(0,100);for(let e of B2)e(z2);R2(e)}function H2(e){return B2.add(e),e(z2),()=>void B2.delete(e)}function U2(){z2=[];for(let e of B2)e(z2)}var W2=!0;try{W2=localStorage.getItem(`linear-grab:css-watch`)!==`0`}catch{}var G2=new Set;function K2(){return W2}function q2(e){W2=e;try{localStorage.setItem(`linear-grab:css-watch`,e?`1`:`0`)}catch{}for(let t of G2)t(e)}function J2(e){return G2.add(e),e(W2),()=>void G2.delete(e)}var Y2=!1;function X2(){if(Y2||typeof window>`u`)return;Y2=!0;let e=0,t=()=>{e=performance.now()};for(let e of[`pointerdown`,`pointerup`,`keydown`])window.addEventListener(e,t,{capture:!0,passive:!0});let n=new Map,r=new Map;window.addEventListener(`transitionrun`,t=>{if(!W2)return;let i=performance.now()-e;if(i>j2)return;let a=t.target;if(!(a instanceof Element)||a.closest(`#linear-grab-root`)||a===document.documentElement||a===document.body||t.propertyName.startsWith(`--`))return;let o=getComputedStyle(a),s=o.transitionProperty.split(`,`).map(e=>e.trim());if(k2(a,s))return;let c=S2(o.transitionDuration),l=S2(o.transitionDelay),u=Math.max(0,s.indexOf(t.propertyName)),d=c[u%c.length]??c[0]??0,f=l[u%l.length]??l[0]??0;if(d+f<=100)return;let p=r.get(a);if(p){p.props.add(t.propertyName),p.duration=Math.max(p.duration,d),p.delay=Math.max(p.delay,f);return}let m={props:new Set([t.propertyName]),duration:d,delay:f,since:i,timer:setTimeout(()=>{r.delete(a);let e=A2(a),t=Date.now();if(t-(n.get(e)??0)<5e3)return;n.set(e,t);let i=M2(a),o=[...m.props],s=a.isConnected?T2(getComputedStyle(a).transitionTimingFunction):null,c=w2(o);F2(a).then(({component:n,source:r})=>{V2({mode:`live`,page:location.pathname,element:e,component:n,source:r,properties:o,durationMs:Math.round(m.duration),delayMs:Math.round(m.delay),sinceInputMs:Math.round(m.since),count:1,classHint:i,easing:s??void 0,jankProps:c.length?c:void 0,suggestion:N2(o,m.duration,m.delay,i,s,c),at:t})})},300)};r.set(a,m)},{capture:!0,passive:!0})}var Z2=`button, a, input, select, textarea, [role], [tabindex], [data-state], [aria-expanded]`;async function Q2(){let e=new Map,t=Array.from(document.querySelectorAll(Z2)).slice(0,3e3);for(let n of t){if(n.closest(`#linear-grab-root`))continue;let t=n.getBoundingClientRect();if(t.width<2&&t.height<2)continue;let r=getComputedStyle(n);if(r.cursor!==`pointer`&&!n.matches(`button, a, input, select, textarea`))continue;let i=r.transitionProperty.split(`,`).map(e=>e.trim());if(k2(n,i))continue;let a=S2(r.transitionDuration),o=S2(r.transitionDelay),s=Math.max(...a,0)+Math.max(...o,0);if(s<=100)continue;let c=M2(n),l=`${n.tagName}|${c??i.join()}|${Math.round(s)}`,u=e.get(l);if(u){u.finding.count+=1;continue}let d=T2(r.transitionTimingFunction),f=w2(i);e.set(l,{example:n,finding:{mode:`audit`,page:location.pathname,element:A2(n),component:null,source:null,properties:i,durationMs:Math.round(Math.max(...a,0)),delayMs:Math.round(Math.max(...o,0)),count:1,classHint:c,easing:d??void 0,jankProps:f.length?f:void 0,suggestion:N2(i,Math.max(...a,0),Math.max(...o,0),c,d,f),at:Date.now()}})}let n=[];for(let{finding:t,example:r}of e.values()){let{component:e,source:i}=await F2(r);t.component=e,t.source=i,n.push(t)}n.sort((e,t)=>t.durationMs+t.delayMs-(e.durationMs+e.delayMs)||t.count-e.count),z2=[...n,...z2.filter(e=>e.mode===`live`)].slice(0,100);for(let e of B2)e(z2);for(let e of n)R2(e);return n}function $2(e){return[`Below is a CSS-slowdown report from my running app (live-captured on real input + full-page audit).`,`Goal: ALL interaction feedback must be instant. Rules:`,``,`1. Most of these come from SHARED design-system variants — fix the VARIANT`,` DEFINITIONS, not the call sites. Grep for the exact class recipes in the`," findings' `classes:` lines (e.g. `transition-all`, `transition-colors duration-150`).","2. Press/toggle state changes get NO transition: add `active:transition-none`"," and `data-[state=on]:transition-none` / `data-[state=open]:transition-none`.",` Hover in/out may keep a transition but shorten it: duration-150 → duration-100`,` (duration-75 for small controls like tabs and icon buttons).`,"3. Replace every `transition-all` with the scoped variant (transition-colors /",` transition-transform / transition-opacity — per what actually changes).`,`3b. Findings marked ⚠ layout/paint: NEVER transition width/height/top/left/`,` margin/padding/box-shadow — they reflow or repaint every frame. Use`,` transform: translate/scale, and animate a pseudo-element's opacity for shadows.`,`3c. Findings marked ⚠ easing: never ease-in OR ease-in-out on UI (§42 bans`,` both) — replace with ease-out (house curve: cubic-bezier(.2,0,.1,1), the`,` theme default).`,`3d. Press must be instant GLOBALLY: keep the unlayered §42 rule in globals.css`," — `button:active, a:active, [role=button/tab/menuitem/option]:active"," { transition-duration: 0s }` — so pointer-down feedback snaps and only the",` release animates back. If a control still animates on press, that global`,` rule is missing or overridden.`,`4. Where a finding's source looks like a generic fallback (one file:line repeated`," for many components), locate the code by the `classes:` line instead.",`5. Do NOT touch entry/exit animations of popovers/menus or icon micro-motion`,` (chevron rotate etc.) — that is intentional; only input FEEDBACK must be instant.`,`6. PROOF REQUIRED: after the change I will re-run the audit — it must show zero`,` interactive elements ≥100ms and clicking must produce no live findings.`,` Do not claim done without stating what you changed per variant.`,``,`---`,``,e4(e)].join(`
282
+ `)}function e4(e){let t=[`# CSS slowdowns on ${location.host}${location.pathname}`,`Threshold: 100ms (interaction feedback should be instant).`,``];for(let n of e)t.push(`## ${n.component??n.element}${n.count>1?` ×${n.count}`:``} — ${n.durationMs}ms${n.delayMs?` +${n.delayMs}ms delay`:``}`),n.source&&t.push(`- source: ${n.source}`),t.push(`- transitions: ${n.properties.join(`, `)}`),n.classHint&&t.push(`- classes: \`${n.classHint}\``),n.jankProps?.length&&t.push(`- ⚠ layout/paint transition (reflows every frame): ${n.jankProps.join(`, `)}`),n.easing&&t.push(`- ⚠ easing: ${n.easing} (§42 bans ease-in/ease-in-out — use ease-out)`),n.sinceInputMs!=null&&t.push(`- fired ${n.sinceInputMs}ms after user input (live capture)`),t.push(`- fix: ${n.suggestion}`,``);return t.join(`
283
+ `)}function t4(e,t,n){return{ruleId:e.id,part:e.part,severity:e.severity,description:e.description,selector:A2(t),evidence:n,el:typeof WeakRef<`u`?new WeakRef(t):void 0}}function n4(e){return e.getBoundingClientRect()}function r4(e){return e.split(`/`)[0].trim().split(/\s+/).filter(Boolean).map(e=>e.endsWith(`px`)?parseFloat(e):NaN)}function i4(e){let t=e.match(/rgba?\(([^)]+)\)/);return t?t[1].split(`,`).map(e=>e.trim()).join(`,`):null}function a4(e,t){let n=t,r=n.maskImage||n.webkitMaskImage||``;if(r&&r!==`none`)return r;let i=(e.getAttribute(`style`)??``).match(/(?:^|;|\s)(?:-webkit-)?mask-image\s*:\s*([^;]+)/i);return i&&i[1].trim()&&i[1].trim()!==`none`?i[1].trim():``}var o4=new Set([0,8,12,16]),s4={light:i4(`rgb(240, 240, 241)`),dark:i4(`rgb(35, 35, 37)`)},c4=new Set([`#50e3c2`,`#ee0000`,`#f5a623`]),l4=`button, a, [role="button"], [role="tab"], [role="menuitem"], [role="option"], input, textarea, select`;function u4(e){let t=[],n=e=>{for(let r of Array.from(e)){let e=r;if(e.cssRules&&e.cssRules.length){n(e.cssRules);continue}let i=r.selectorText;i&&i.includes(`:hover`)&&t.push(i.replace(/:hover/g,``))}};for(let t of Array.from(e.styleSheets))try{n(t.cssRules)}catch{}return t}function d4(e,t){for(let n of t)if(n.trim())try{if(e.matches(n))return!0}catch{}return!1}function f4(e){return!e.matches(`button, [role="button"]`)||e.querySelectorAll(`svg`).length===0?!1:(e.textContent??``).trim().length===0}function p4(e){let t=e.parentElement;for(;t;){try{let e=m4(t).overflowY;if(e===`auto`||e===`scroll`)return t}catch{}t=t.parentElement}return null}var m4=e=>getComputedStyle(e),h4={id:`radius-vocabulary`,part:`§40`,severity:`error`,description:`§40: radius vocabulary is {8, 12, 16, full} — never rounded-md/[4px]/[6px]/[10px]. Off-vocabulary radius.`,check(e){let t=[];for(let n of e.els){let r=e.css(n).borderRadius;if(!r||r===`0px`)continue;let i=r4(r);if(i.some(e=>Number.isNaN(e)))continue;let a=Math.max(...i);if(a===0)continue;let o=n4(n),s=Math.min(o.width||0,o.height||0);s>0&&a>=s/2-.5||i.every(e=>o4.has(e))||t.push(t4(this,n,`border-radius: ${r}`))}return t}},g4={id:`row-radius-token`,part:`§40`,severity:`error`,description:`§40: list rows consume --row-radius (8px) or 0 — no bespoke per-surface row radius.`,check(e){let t=[];for(let n of e.els){let r=n4(n).height;if(r<26||r>50||!p4(n))continue;let i=n.parentElement;if(!i||Array.from(i.children).filter(e=>{let t=n4(e);return Math.abs(t.height-r)<2}).length<3)continue;let a=r4(e.css(n).borderRadius);if(a.some(e=>Number.isNaN(e)))continue;let o=Math.max(0,...a);o===0||o===8||t.push(t4(this,n,`row radius ${e.css(n).borderRadius} (want 0 or var(--row-radius)=8px)`))}return t}},_4={id:`active-fill-token`,part:`§11`,severity:`error`,description:`§11: active/selected fill must be var(--selected) (theme-safe) — never bg-secondary (#F0F0F1 / #232325).`,check(e){let t=[],n=null;try{let t=e.root.documentElement??document.documentElement;t&&(n=i4(e.css(t).getPropertyValue(`--selected`).trim()))}catch{}let r=[s4.light,s4.dark].filter(Boolean);if(n&&r.includes(n)){let t=e.root.documentElement??document.documentElement;return[t4({id:this.id,part:this.part,severity:`warn`,description:`§11: active-fill-token unverifiable — --selected resolves EQUAL to bg-secondary this theme; cannot distinguish the token from the anti-pattern.`},t??e.els[0],`--selected == bg-secondary (${n})`)]}for(let n of e.els){if(!(n.matches(`[role="tab"], [role="button"], [aria-selected], [role="option"]`)||n.closest(`[role="tablist"], [role="menu"], [data-rail], nav`)))continue;let i=i4(e.css(n).backgroundColor);i&&r.includes(i)&&t.push(t4(this,n,`background bg-secondary (${e.css(n).backgroundColor}) — use var(--selected)`))}return t}},v4={id:`inline-style-state`,part:`§40`,severity:`error`,description:`§40: the shared row-action class owns ALL visual states; inline styles carry LAYOUT ONLY — an inline background/color kills the class state.`,check(e){let t=[];for(let n of e.els){let e=typeof n.className==`string`?n.className:``;if(!/pb-row-action|row-action/.test(e))continue;let r=n.getAttribute(`style`)??``;/(^|;|\s)(background|color)\s*:/.test(r)&&t.push(t4(this,n,`inline style="${r}" on a row-action element`))}return t}},y4={id:`icon-button-no-hover`,part:`§40`,severity:`warn`,description:`§40/Part 10: every interactive control changes color on hover — icon-only button with no :hover rule and no .pb-row-action.`,check(e){let t=[],n=u4(e.root.styleSheets?e.root:document);for(let r of e.els){if(!f4(r))continue;let i=typeof r.className==`string`?r.className:``;/pb-row-action|row-action/.test(i)||r.hasAttribute(`data-framer-appear-id`)||Array.from(r.attributes).some(e=>e.name.startsWith(`data-framer`))||e.css(r).willChange.includes(`transform`)||d4(r,n)||t.push(t4(this,r,`icon-only ${r.tagName.toLowerCase()} with no hover rule / .pb-row-action`))}return t}},b4={id:`icon-button-no-tooltip`,part:`§7`,severity:`warn`,description:`§7: every icon-only button gets the shared Tooltip — needs aria-describedby / data-slot="tooltip-trigger" (menu-row title exempt).`,check(e){let t=[];for(let n of e.els)f4(n)&&(n.hasAttribute(`aria-describedby`)||n.getAttribute(`data-slot`)===`tooltip-trigger`||n.closest(`[data-slot="tooltip-trigger"]`)||n.closest(`[role="menuitem"]`)&&n.hasAttribute(`title`)||t.push(t4(this,n,`icon-only ${n.tagName.toLowerCase()} with no tooltip trigger / aria-describedby`)));return t}},x4={id:`unvirtualized-scroller`,part:`§0`,severity:`error`,description:`§0: every dynamic-length scrolling list virtualizes — a tall scroller with 60+ direct children is unvirtualized.`,check(e){let t=[];for(let n of e.els){let r=e.css(n);if(![r.overflowY,r.overflowX,r.overflow].some(e=>e===`auto`||e===`scroll`)||n.scrollHeight<=2*n.clientHeight)continue;let i=n.children.length;i<=60||t.push(t4(this,n,`${i} direct children, scrollHeight ${n.scrollHeight} > 2×clientHeight ${n.clientHeight}`))}return t}},S4={id:`scroll-no-fade`,part:`§1`,severity:`warn`,description:`§1: a horizontal scroller needs a truthful scroll fade — no scroll-fade-x/scroll-fade-x-js class and no mask-image.`,check(e){let t=[];for(let n of e.els){let r=e.css(n).overflowX;if(r!==`auto`&&r!==`scroll`||n.clientWidth<24||n.scrollWidth<=n.clientWidth+8)continue;let i=typeof n.className==`string`?n.className:``;/scroll-fade-x(-js)?/.test(i)||a4(n,e.css(n))||t.push(t4(this,n,`horizontal scroller (scrollWidth ${n.scrollWidth} > clientWidth ${n.clientWidth}) with no fade`))}return t}},C4={id:`phantom-fade`,part:`§1`,severity:`warn`,description:`§1: a fade must NEVER paint when nothing is hidden — mask-image present but scrollWidth ≤ clientWidth (the fade lies).`,check(e){let t=[];for(let n of e.els)a4(n,e.css(n))&&(n.scrollWidth>n.clientWidth||t.push(t4(this,n,`mask-image fade but scrollWidth ${n.scrollWidth} ≤ clientWidth ${n.clientWidth}`)));return t}},w4={id:`scrollbar-flush`,part:`Part 5`,severity:`warn`,description:`Part 5: scrollables carry asymmetric right padding so content clears the scrollbar — padding-right < 8px while overflowing vertically with content reaching the right edge.`,check(e){let t=[];for(let n of e.els){let r=e.css(n);if(![r.overflowY,r.overflow].some(e=>e===`auto`||e===`scroll`)||n.scrollHeight<=n.clientHeight)continue;let i=parseFloat(r.paddingRight)||0;if(i>=8)continue;let a=n4(n);Array.from(n.children).some(e=>{let t=n4(e);return a.right-t.right<=4})&&t.push(t4(this,n,`padding-right ${i}px (<8px) with content flush to the scrollbar`))}return t}},T4=/^("?(Geist|Geist Mono)"?|ui-monospace|ui-sans-serif|-apple-system|system-ui)/i,E4={id:`font-family`,part:`Part 5`,severity:`warn`,description:`Part 5: Geist / Geist Mono ONLY — computed font-family does not start with the Geist / ui-monospace fallback chain.`,check(e){let t=[];for(let n of e.els){if(!z4(n))continue;let r=e.css(n).fontFamily;r&&(T4.test(r.trim())||t.push(t4(this,n,`font-family: ${r}`)))}return t}},D4={id:`uppercase-label`,part:`§25`,severity:`error`,description:`§25: group/section labels are sentence-case — never uppercase (text-transform: uppercase on small <13px text).`,check(e){let t=[];for(let n of e.els){if(!z4(n))continue;let r=e.css(n);r.textTransform===`uppercase`&&((parseFloat(r.fontSize)||0)>=13||t.push(t4(this,n,`text-transform: uppercase at ${r.fontSize}`)))}return t}},O4={id:`hardcoded-status-hex`,part:`Part 5`,severity:`warn`,description:`Part 5: raw hex only for the status trio (#50E3C2/#EE0000/#F5A623) — a saturated non-token color on small UI text.`,check(e){let t=[],n=new Set;for(let e of c4){let t=i4(`rgb(${parseInt(e.slice(1,3),16)}, ${parseInt(e.slice(3,5),16)}, ${parseInt(e.slice(5,7),16)})`);t&&n.add(t)}try{let t=e.root,r=t.documentElement;if(r&&t.body){let i=e.css(r),a=t.createElement(`span`);a.setAttribute(`data-linear-grab`,`true`),a.style.display=`none`,t.body.appendChild(a);for(let e=0;e<i.length;e++){let t=i[e];if(!t.startsWith(`--`))continue;let r=i.getPropertyValue(t).trim();if(!r||r.length>40||(a.style.color=``,a.style.color=r,!a.style.color))continue;let o=i4(getComputedStyle(a).color);o&&n.add(o)}a.remove()}}catch{}for(let r of e.els){if(!z4(r))continue;let i=(r.getAttribute(`style`)??``).match(/#[0-9a-fA-F]{6}/g)??[],a=e.css(r);if((parseFloat(a.fontSize)||0)>=16)continue;for(let e of i)c4.has(e.toLowerCase())||t.push(t4(this,r,`hardcoded ${e} (not the brand status trio)`));let o=i4(a.color);if(o&&i.length===0&&!n.has(o)){let[e,n,i]=o.split(`,`).map(e=>parseFloat(e));Number.isFinite(e)&&B4(e,n,i)&&t.push(t4(this,r,`saturated non-token color ${a.color} on small UI text`))}}return t}},k4={id:`editor-shadow`,part:`Part 5`,severity:`error`,description:`Part 5: editor surfaces are FLAT — box-shadow that is not a 0.5px hairline ring / approved popover/card/input token shadow.`,check(e){let t=[];if(!(e.root.querySelector?.(`[data-editor-surface]`)||typeof location<`u`&&/\/editor\//.test(location.pathname)))return t;for(let n of e.els){if(!n.closest(`[data-editor-surface]`)&&!/\/editor\//.test(typeof location<`u`?location.pathname:``))continue;let r=e.css(n).boxShadow;!r||r===`none`||H4(r)||U4(r)||t.push(t4(this,n,`box-shadow: ${r}`))}return t}},A4={id:`focusring-clip`,part:`§24`,severity:`warn`,description:`§24/Part 5: focus rings never clip — a focusable element whose nearest overflow-hidden ancestor sits <4px from its border box.`,check(e){let t=[];for(let n of e.els){if(!n.matches(l4)&&n.getAttribute(`tabindex`)==null)continue;let r=n.parentElement;for(;r;){let t=e.css(r);if([t.overflow,t.overflowX,t.overflowY].some(e=>e===`hidden`))break;r=r.parentElement}if(!r)continue;let i=n4(n),a=n4(r);if(i.width===0&&i.height===0)continue;let o=Math.min(i.left-a.left,a.right-i.right,i.top-a.top,a.bottom-i.bottom);o>=4||t.push(t4(this,n,`overflow-hidden ancestor ${o.toFixed(1)}px from border box — focus ring will clip`))}return t}},j4={id:`fixed-width-in-pane`,part:`§24`,severity:`warn`,description:`§24: no fixed field widths in resizable panes — w-[Npx] (N ≥ 200) inside a [data-panel] / flex-basis sibling clips at the pane edge.`,check(e){let t=[];for(let n of e.els){if(!n.closest(`[data-panel]`))continue;let e=typeof n.className==`string`?n.className:``,r=n.getAttribute(`style`)??``,i=e.match(/w-\[(\d+)px\]/)??r.match(/(?:^|;|\s)width\s*:\s*(\d+)px/);if(!i)continue;let a=parseFloat(i[1]);a<200||t.push(t4(this,n,`fixed width ${a}px inside a resizable pane — use w-full max-w-[${a}px]`))}return t}},M4={id:`menu-icons-all-or-none`,part:`§21`,severity:`error`,description:`§21: within one menu ALL items carry a leading icon or NONE do — a mixed set reads broken.`,check(e){let t=[],n=Array.from(e.root.querySelectorAll(`[role="menu"]`));for(let e of n){let n=Array.from(e.querySelectorAll(`[role="menuitem"]`));if(n.length<2)continue;let r=n.filter(e=>e.querySelector(`svg`)).length;r===0||r===n.length||t.push(t4(this,e,`${r}/${n.length} menu items have a leading icon`))}return t}},N4={id:`menu-icon-mixed-weight`,part:`§21`,severity:`warn`,description:`§21: menu icons are ONE stroke family — some filled (fill=currentColor) and some stroke-based, or rendered sizes differing >2px, mixes two design systems.`,check(e){let t=[],n=Array.from(e.root.querySelectorAll(`[role="menu"]`));for(let e of n){let n=Array.from(e.querySelectorAll(`[role="menuitem"] svg`));if(n.length<2)continue;let r=0,i=0,a=[];for(let e of n){Array.from(e.querySelectorAll(`path, circle, rect, polygon`)).some(e=>{let t=(e.getAttribute(`fill`)??``).toLowerCase();return t===`currentcolor`||t&&t!==`none`})?r++:i++;let t=n4(e);a.push(Math.max(t.width,t.height))}let o=Math.max(...a),s=Math.min(...a),c=r>0&&i>0,l=o>0&&o-s>2;!c&&!l||t.push(t4(this,e,c?`${r} filled + ${i} stroke-based icons in one menu`:`icon sizes differ by ${(o-s).toFixed(1)}px`))}return t}},P4={id:`chrome-selectable`,part:`Part 5`,severity:`warn`,description:`Part 5: chrome (rails/pills/tabs) is select-none — a rail/pill/tab without user-select:none.`,check(e){let t=[];for(let n of e.els){if(!(n.matches(`[role="tab"]`)||n.closest(`[role="tablist"], [data-rail], nav`)||/\bpill\b/.test(typeof n.className==`string`?n.className:``)))continue;let r=e.css(n).userSelect||e.css(n).webkitUserSelect;r!==`none`&&t.push(t4(this,n,`chrome element without user-select:none (user-select: ${r||`auto`})`))}return t}},F4={id:`cursor-mismatch`,part:`Part 5`,severity:`warn`,description:`Part 5: cursor semantics — buttons get pointer, static text gets default. A button with cursor:text, or static text with cursor:pointer and no interactive ancestor.`,check(e){let t=[];for(let n of e.els){let r=e.css(n).cursor;if(n.matches(`button, [role="button"]`)&&r===`text`){t.push(t4(this,n,`interactive control with cursor:text`));continue}if(r===`pointer`&&n.matches(`p, h1, h2, h3, h4, h5, h6, span`)){if(n.closest(`button, a, [role="button"], [onclick], label`)||n.matches(`button, a, [role="button"]`))continue;t.push(t4(this,n,`static ${n.tagName.toLowerCase()} with cursor:pointer and no interactive ancestor`))}}return t}};function I4(e){let t=e.transitionProperty.split(`,`).map(e=>e.trim()).filter(Boolean);return t.length===1&&t[0]===`none`?[]:t}var L4=[h4,g4,_4,v4,y4,b4,x4,S4,C4,w4,E4,D4,O4,k4,A4,j4,M4,N4,P4,F4,{id:`transition-all`,part:`§42`,severity:`error`,description:`§42: never transition-all — scope to what changes (transition-colors / transition-[transform,...]).`,check(e){let t=[];for(let n of e.els){if(!n.matches(l4))continue;let r=I4(e.css(n));r.includes(`all`)&&(k2(n,r)||t.push(t4(this,n,`transition-property: all`)))}return t}},{id:`transition-paint-prop`,part:`§42`,severity:`error`,description:`§42: never transition layout/paint props (box-shadow, width, height, top/left, margin, padding) — they reflow/repaint every frame; focus rings SNAP, shadows animate a pseudo-element opacity.`,check(e){let t=[];for(let n of e.els){let r=I4(e.css(n)),i=w2(r).filter(e=>e!==`all (includes layout/paint props)`);i.length!==0&&(k2(n,r)||t.push(t4(this,n,`transitions layout/paint props: ${i.join(`, `)}`)))}return t}},{id:`transition-too-slow`,part:`§42`,severity:`error`,description:`§42: interaction feedback is ≤100ms (duration-75 for small controls) — the 100ms theme default is fine; an explicit duration-150+ crept in.`,check(e){let t=[];for(let n of e.els){if(!n.matches(l4))continue;let r=e.css(n),i=I4(r);if(i.length===0||k2(n,i))continue;let a=S2(r.transitionDuration),o=Math.max(0,...a);o<=100||t.push(t4(this,n,`transition-duration ${o}ms (>100ms) on [${i.join(`, `)}]`))}return t}},{id:`ease-in-feedback`,part:`§42`,severity:`warn`,description:`§42: house curve is cubic-bezier(.2,0,.1,1) ease-out — never ease-in / ease-in-out (or an ease-in-shaped bezier) on feedback.`,check(e){let t=[];for(let n of e.els){if(!n.matches(l4))continue;let r=e.css(n),i=I4(r);if(i.length===0||k2(n,i))continue;let a=T2(r.transitionTimingFunction);a&&t.push(t4(this,n,`transition-timing-function: ${a}`))}return t}},{id:`press-instant-rule-missing`,part:`§42`,severity:`error`,description:"§42: the global press-instant rule (globals.css) must exist — `button:active{transition-duration:0s}` (or transition:none). Absent = press feedback animates instead of snapping.",check(e){let t=e.root.styleSheets?e.root:document,n=!1,r=e=>{for(let t of Array.from(e)){if(n)return;let e=t;if(e.cssRules&&e.cssRules.length){r(e.cssRules);continue}let i=t,a=i.selectorText;if(a&&/:active\b/.test(a)&&/(^|[\s,])(button|a|\[role=("|')?(button|tab|menuitem|option)("|')?\])/i.test(a))try{let e=i.style.transitionDuration,t=i.style.transition;if(e===`0s`||/(^|\s)none(\s|$)/.test(t)||/\b0s\b/.test(t)){n=!0;return}}catch{}}};try{for(let e of Array.from(t.styleSheets)){if(n)break;try{r(e.cssRules)}catch{}}}catch{}if(n)return[];let i=e.root.documentElement??e.els[0]??document.documentElement;return[t4(this,i,"no `button:active { transition-duration: 0s }` rule on this page")]}}],R4=[];function z4(e){for(let t of Array.from(e.childNodes))if(t.nodeType===3&&(t.textContent??``).trim().length>0)return!0;return!1}function B4(e,t,n){let r=Math.max(e,t,n);return r<40?!1:r-Math.min(e,t,n)>60}function V4(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t.filter(Boolean)}function H4(e){return V4(e).every(e=>{if(/\btransparent\b/.test(e)||/(?:rgba?|hsla?|oklch|oklab|lab|lch|color)\([^)]*[/,]\s*0(?:\.0+)?\s*\)/.test(e))return!0;let t=e.match(/-?\d*\.?\d+(?:px|em|rem)/g)??[];return t.length>0&&t.every(e=>parseFloat(e)===0)})}function U4(e){return!!(/\b0px\s+0px\s+0px\s+0?\.?5px\b/.test(e)||/\b0px?\s+0px?\s+0px?\s+0?\.?5px\b/.test(e))}var W4=`#linear-grab-root, [data-linear-grab], [data-react-grab], #claude-agent-glow-border, [id^="react-scan"]`;function G4(e=typeof document<`u`?document:{}){let t=new Map,n=e=>{let n=t.get(e);return n||(n=getComputedStyle(e),t.set(e,n)),n};m4=n;let r=Array.from(e.querySelectorAll(`*`)),i=[],a=e.documentElement??null,o=e.body??null,s=(a?.getBoundingClientRect().width??0)>0;for(let e of r){if(e===a||e===o||e.closest(W4))continue;let t=n4(e);if(s){if(t.width<2||t.height<2)continue}else if(t.width===0&&t.height===0&&e.children.length===0)continue;i.push(e)}let c={root:e,els:i,css:n},l=[];for(let e of[...L4,...R4])try{l.push(...e.check(c))}catch{}m4=e=>getComputedStyle(e);let u=new Map;for(let e of l){let t=`${e.ruleId}|${e.selector}|${e.evidence}`,n=u.get(t);n?n.count=(n.count??1)+1:u.set(t,e)}return[...u.values()]}function K4(e){let t=new Map;for(let n of e){let e=t.get(n.ruleId);e?e.push(n):t.set(n.ruleId,[n])}let n=Array.from(t.entries()).sort((e,t)=>{let n=e[1][0].severity===`error`?0:1,r=t[1][0].severity===`error`?0:1;return n===r?t[1].length===e[1].length?e[0].localeCompare(t[0]):t[1].length-e[1].length:n-r}),r=e.length,i=e.filter(e=>e.severity===`error`).length,a=new Set(e.map(e=>e.page).filter(Boolean)).size>1,o=[`# Slop scan — ${i} error${i===1?``:`s`}, ${r-i} warn (${r} total)`,``];for(let[e,t]of n){let n=t[0],r=t.reduce((e,t)=>e+(t.count??1),0);o.push(`## ${e} — ${n.severity} ×${r} [${n.part}]`),o.push(n.description);for(let e of t){let t=e.component||e.source?` — ${[e.component,e.source].filter(Boolean).join(` @ `)}`:``,n=(e.count??1)>1?` ×${e.count}`:``;o.push(`- ${a&&e.page?`\`${e.page}\` `:``}\`${e.selector}\`${n} — ${e.evidence}${t}`)}o.push(``)}return o.join(`
284
+ `)}function q4(e){return[`Below is a design-system SLOP report from my running app — each finding is a`,"live-DOM violation of the Linear/Protocolbase primitives contract (`Linear","-primitives.md`). Every rule cites its §id. Goal: zero errors. Rules:",``,`1. Fix at the TOKEN / VARIANT level, not the call sites. Most of these come`,` from shared row/button/menu variants — change --row-radius, --selected,`,` .pb-row-action, the Button/Input variant, or the globals.css §42 rules —`,` not one component at a time.`,`2. Cite the primitives §id in your fix (each finding carries it). Radius →`,` §40 vocabulary {8,12,16,full}; active fill → §11 var(--selected); menus →`,` §21 all-or-none icons + one stroke family; uppercase labels → §25;`,` editor flatness → Part 5; scrollers → §0–1 virtualize + truthful fade.`,`3. §42 group (transition-all / paint-prop / too-slow / ease-in / press-`,` instant): scope transitions to what changes, drop box-shadow/width/height`,` from transition lists, keep feedback ≤100ms (duration-75 small controls),`,` use ease-out (cubic-bezier(.2,0,.1,1)), and keep the global`," `button:active{transition-duration:0s}` press-instant rule.",`4. Do NOT touch EXEMPT intentional motion — popover/menu/dialog entry-exit,`,` svg icon micro-motion, and panel width/height transitions are §42-blessed.`,` The scan already excludes them; do not "fix" them.`,`5. 'unverifiable' warnings mean the token collapsed to the anti-pattern this`,` theme — verify the intent in BOTH themes, do not just silence it.`,"6. Findings carry `Component @ file:line` when the fiber source resolved.",` When one file:line repeats across many components it is the nearest-`,` debug-fiber fallback — locate the real code by the selector classes.`,`7. PROOF REQUIRED: after the change I will re-run the scan — it must show 0`,` errors. State what you changed per token/variant; do not claim done blind.`,``,`---`,``,K4(e)].join(`
285
+ `)}var J4=[],Y4=new Set;function X4(e){return Y4.add(e),e(J4),()=>void Y4.delete(e)}function Z4(){J4=[];for(let e of Y4)e(J4)}function Q4(){let e=location.pathname,t=G4(document).map(t=>({...t,page:e}));J4=[...t,...J4.filter(t=>t.page!==e)];for(let e of Y4)e(J4);return $4(t).then(()=>{J4=[...J4];for(let e of Y4)e(J4);e3(t)}),t}async function $4(e){let t=null;try{t=(await Promise.resolve().then(()=>(YZ(),VZ))).getGlobalApi()??null}catch{return}if(!t)return;let n=new Map;for(let t of e){let e=t.el?.deref();if(!e)continue;let r=n.get(e);r?r.push(t):n.set(e,[t])}let r=300;for(let[e,i]of n){if(r--<=0)break;let n=null,a=null;try{n=t.getDisplayName?.(e)??null}catch{}try{let n=await t.getSource?.(e);n?.filePath&&(a=`${n.filePath}${n.lineNumber==null?``:`:${n.lineNumber}`}`)}catch{}if(!(!n&&!a))for(let e of i)e.component=n,e.source=a}}function e3(e){if(e.length===0)return;let t=Date.now(),n=e.slice(0,200).map(({el:e,...n})=>({kind:`slop-scan`,at:t,...n}));ek().then(e=>fetch(`${e}/scan/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({events:n}),keepalive:!0})).catch(()=>{})}var t3=!1;try{t3=localStorage.getItem(`linear-grab:slop-live`)===`1`}catch{}var n3=new Set;function r3(){return t3}function i3(e){t3=e;try{localStorage.setItem(`linear-grab:slop-live`,e?`1`:`0`)}catch{}for(let t of n3)t(e);e&&s3(300)}function a3(e){return n3.add(e),e(t3),()=>void n3.delete(e)}var o3=null;function s3(e){o3&&clearTimeout(o3),o3=setTimeout(()=>{if(o3=null,t3)try{Q4()}catch{}},e)}var c3=!1;function l3(){if(c3||typeof window>`u`)return;c3=!0;let e=location.pathname;setInterval(()=>{location.pathname!==e&&(e=location.pathname,t3&&s3(1e3))},500)}var u3=N(`<span class="inline-block min-w-[7ch] text-center">Extract`),d3=N(`<div class="relative flex flex-col gap-2 pl-4"><div class="bg-border absolute top-1 bottom-1 left-[5px] w-px"aria-hidden>`),f3=N(`<span class="text-success text-[12px] leading-none">✓`),p3=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M4 4l8 8M12 4l-8 8">`),m3=N(`<div class="flex items-center justify-end gap-1 px-1">`),h3=N(`<span class="relative inline-flex items-center justify-center"><svg width=12 height=12 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3.5 y=3 width=3.2 height=10 rx=1></rect><rect x=9.3 y=3 width=3.2 height=10 rx=1></rect></svg><span class="bg-success absolute -top-0.5 -right-0.5 size-1.5 animate-pulse rounded-full"aria-hidden>`),g3=N(`<span class="inline-block min-w-[5ch] text-center">Audit`),_3=N(`<div class="flex max-h-72 flex-col gap-1.5 overflow-y-auto pr-2">`),v3=N(`<span class="text-[12px] leading-none">✓`),y3=N(`<div class="flex items-center gap-1 px-1">`),b3=N(`<span class="text-text-faint font-normal tabular-nums"> · <!> pages`),x3=N(`<span class="inline-block min-w-[4ch] text-center">Scan`),S3=N(`<div class="flex items-center gap-1 px-1"><button class="border-border cursor-pointer rounded-full border px-2 py-0.5 text-[10px] font-medium tabular-nums"> errors</button><button class="border-border cursor-pointer rounded-full border px-2 py-0.5 text-[10px] font-medium tabular-nums"> warns`),C3=N(`<div class="flex h-full flex-col gap-3 overflow-y-auto pt-3 pb-4 pr-3 pl-2"><div class="flex items-center justify-between gap-2 px-1"><div class=min-w-0><p class="text-text text-[12.5px] font-semibold">Design genomes</p><p class="text-text-faint text-[10.5px] leading-snug">Point at a component → get its structure, tokens and interaction states as a spec you can hand to an agent.</p></div></div><div class="border-border mt-1 flex flex-col gap-2 border-t pt-3"><div class="flex items-center justify-between gap-2 px-1"><div class=min-w-0><p class="text-text text-[12.5px] font-semibold">CSS slowdowns</p><p class="text-text-faint text-[10.5px] leading-snug">Transitions/delays over the 100ms house cap (§42) on interactive elements — feedback that animates instead of being instant. Live hits appear as you use the app; Audit sweeps the whole page.</p></div><div class="flex shrink-0 items-center gap-1"></div></div></div><div class="border-border mt-1 flex flex-col gap-2 border-t pt-3"><div class="flex items-center justify-between gap-2 px-1"><div class=min-w-0><p class="text-text text-[12.5px] font-semibold">Slop scan</p><p class="text-text-faint text-[10.5px] leading-snug">Design-contract drift — Linear-primitives rules checked against the live DOM. Results accumulate per page as you navigate; re-scanning a page overwrites only that page's findings.</p></div><div class="flex shrink-0 items-center gap-1">`),w3=N(`<p class="text-text mt-1 text-[11px] font-semibold">Interaction states`),T3=N(`<svg width=12 height=12 viewBox="0 0 16 16"aria-hidden><rect x=3.5 y=3.5 width=9 height=9 rx=1.5 fill=currentColor>`),E3=N(`<span class="text-warn text-[10.5px] font-medium tabular-nums">s · <!> states`),D3=N(`<div class="border-border flex flex-col gap-2 border-t px-2.5 py-2"><p class="text-text-faint truncate text-[10px]"></p><div class="flex max-h-64 flex-col gap-2 overflow-y-auto pr-2"></div><div class="flex items-center gap-1">`),O3=N(`<div class=relative><span class="border-border bg-surface absolute top-3 -left-[13.5px] size-[9px] rounded-full border"aria-hidden></span><div class="bg-surface border-border flex flex-col rounded-lg border"><button class="flex w-full cursor-pointer items-center gap-2 px-2.5 py-2 text-left"><span class="text-accent min-w-0 truncate font-mono text-[12px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"> roles<!> · </span><svg width=10 height=10 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 class="text-text-faint shrink-0 transition-transform"aria-hidden><path d="m4 6 4 4 4-4">`),k3=N(`<span class=text-text-faint> ×`),A3=N(`<div class="flex flex-col gap-0.5"><p class="text-text text-[11px] font-medium">`),j3=N(`<span class=text-accent> ← var(<!>)`),M3=N(`<p class="text-text-dim font-mono text-[10px] leading-snug break-all">: `),N3=N(`<div class="flex flex-col gap-0.5"><p class="text-warn text-[10.5px] font-medium"> — `),P3=N(`<p class="text-text-dim font-mono text-[10px] leading-snug break-all">: <!> → `),F3=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=2 fill=currentColor stroke=none>`),I3=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),L3=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=currentColor aria-hidden><path d="M4.5 2.5v11l9-5.5z">`),R3=N(`<p class="text-text-faint px-1 text-[10.5px]">Nothing caught yet — interact with the app, or run Audit.`),z3=N(`<span class="text-text-dim font-mono text-[10px] break-all">`),B3=N(`<span class="text-danger text-[10px] leading-snug">⚠ layout/paint transition: `),V3=N(`<span class="text-danger text-[10px] leading-snug">⚠ ease-in easing: `),H3=N(`<div class="bg-surface border-border flex flex-col gap-0.5 rounded-lg border p-2"><div class="flex items-center gap-2"><span class="text-warn shrink-0 text-[10px] font-semibold tracking-wide uppercase"></span><span class="text-accent min-w-0 truncate font-mono text-[11.5px]"></span><span class="text-text ml-auto shrink-0 text-[11px] font-medium tabular-nums">ms</span></div><span class="text-text-dim text-[10px] leading-snug"></span><span class="text-text-faint text-[10px] leading-snug">`),U3=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 1.5 9.6 6l4.4 1.6L9.6 9.2 8 13.7 6.4 9.2 2 7.6 6.4 6Z"></path><path d="M13 11.5l.6 1.7 1.7.6-1.7.6-.6 1.7-.6-1.7-1.7-.6 1.7-.6Z">`),W3=N(`<p class="text-text-faint px-1 text-[10.5px]">No scan yet — click Scan to audit this page against the contract.`),G3=N(`<div class="border-border flex flex-col gap-1 border-t px-2 py-1.5"><p class="text-text-dim text-[10px] leading-snug">`),K3=N(`<div class="bg-surface border-border flex flex-col rounded-lg border"><button class="flex w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left"><span class="size-1.5 shrink-0 rounded-full"aria-hidden></span><span class="text-accent min-w-0 truncate font-mono text-[11.5px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums">×</span><svg width=10 height=10 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 class="text-text-faint shrink-0 transition-transform"aria-hidden><path d="m4 6 4 4 4-4">`),q3=N(`<span class=text-accent> `),J3=N(`<span class="text-text-faint tabular-nums"> ×`),Y3=N(`<button class="hover:bg-surface-2 flex w-full cursor-pointer flex-col gap-0.5 rounded px-1 py-0.5 text-left"title="Reveal on the page"><span class="text-text min-w-0 truncate font-mono text-[10.5px]"></span><span class="text-text-faint font-mono text-[10px] leading-snug break-all">`),X3=`linear-grab:genomes:v1`,Z3=30;function Q3(){try{return JSON.parse(localStorage.getItem(X3)??`[]`)}catch{return[]}}function $3(e){try{localStorage.setItem(X3,JSON.stringify(e.slice(0,Z3)))}catch{}}var e6=new Map;function t6(e){let t=e.el?.deref();if(!(t instanceof HTMLElement)||!t.isConnected)return!1;t.scrollIntoView({block:`center`,behavior:`smooth`});let n=t.style.outline,r=t.style.outlineOffset;return t.style.outline=`2px solid #e5a13a`,t.style.outlineOffset=`2px`,setTimeout(()=>{t.style.outline=n,t.style.outlineOffset=r},1400),!0}function n6(){let[e,t]=T(Q3()),[n,r]=T(null),[i,a]=T(null),[o,s]=T(null),[c,l]=T(null),[u,d]=T(null),[f,p]=T({active:!1,msLeft:0,total:0,byTrigger:{}});ae(h2(p));let[m,h]=T([]);ae(H2(h));let[g,_]=T(K2());ae(J2(_));let[v,y]=T(!1),[b,x]=T(!1),S=async()=>{y(!0);try{await Q2()}finally{y(!1)}},C=async()=>{try{await navigator.clipboard.writeText(e4(m())),x(!0),setTimeout(()=>x(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},[w,E]=T(!1),O=async()=>{try{await navigator.clipboard.writeText($2(m())),E(!0),setTimeout(()=>E(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},[k,ee]=T([]);ae(X4(ee));let[te,A]=T(r3());ae(a3(A));let[ne,re]=T(!1),[ie,oe]=T(null),[se,ce]=T(!0),[le,ue]=T(!0),[de,fe]=T(!1),[pe,me]=T(!1),he=()=>{l(null),re(!0);try{Q4(),oe(null)}catch(e){l(e instanceof Error?e.message:String(e))}finally{re(!1)}},ge=()=>{Z4(),oe(null)},_e=()=>new Set(k().map(e=>e.page)).size,ve=()=>k().filter(e=>e.severity===`error`?se():le()),ye=()=>{let e=new Map;for(let t of ve()){let n=e.get(t.ruleId);n?n.push(t):e.set(t.ruleId,[t])}return[...e.values()].sort((e,t)=>Number(t[0].severity===`error`)-Number(e[0].severity===`error`)||t.length-e.length)},be=()=>k().filter(e=>e.severity===`error`).length,xe=()=>k().length-be(),Se=async()=>{try{await navigator.clipboard.writeText(K4(ve())),fe(!0),setTimeout(()=>fe(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},Ce=async()=>{try{await navigator.clipboard.writeText(q4(ve())),me(!0),setTimeout(()=>me(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},we=e=>{t(e),$3(e)},Te=async()=>{l(null),a(`extract`),window.dispatchEvent(new CustomEvent(ZZ));try{let t=await x2();if(!t)return;let n=await d2(t),i=Date.now();e6.set(i,new WeakRef(t)),we([{id:i,genome:n},...e()]),r(i)}catch(e){l(e instanceof Error?e.message:String(e))}finally{a(null),fj(`design`),window.dispatchEvent(new CustomEvent(QZ))}},Ee=async t=>{l(null),a(t.id),window.dispatchEvent(new CustomEvent(ZZ));try{let n=e6.get(t.id)?.deref()??null;if(!n||!n.isConnected){if(n=await x2(),!n)return;e6.set(t.id,new WeakRef(n))}let r=await y2(n,8e3,e=>s(Math.ceil(e/1e3)));r.length===0&&l(`No state changes captured — hover/open the component while the 8s window runs.`),we(e().map(e=>e.id===t.id?{...e,genome:{...e.genome,states:[...e.genome.states,...r]}}:e))}catch(e){l(e instanceof Error?e.message:String(e))}finally{a(null),s(null),fj(`design`),window.dispatchEvent(new CustomEvent(QZ))}},De=async e=>{try{await navigator.clipboard.writeText(b2(e.genome)),d(e.id),setTimeout(()=>d(null),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},Oe=t=>{e6.delete(t),we(e().filter(e=>e.id!==t))},[ke,Ae]=T(!1),je=async()=>{try{let t=e().map(e=>b2(e.genome)).join(`
276
286
 
277
287
  ---
278
288
 
279
- `);await navigator.clipboard.writeText(t),Ae(!0),setTimeout(()=>Ae(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},Me=()=>{W3.clear(),we([]),r(null)};return(()=>{var t=p3(),a=t.firstChild;a.firstChild;var o=a.nextSibling,s=o.firstChild.firstChild.nextSibling,d=o.nextSibling,p=d.firstChild.firstChild,h=p.firstChild;h.firstChild;var _=p.nextSibling;return P(a,j(q,{variant:`primary`,class:`h-7 shrink-0 px-2.5 text-[11.5px]`,get loading(){return i()===`extract`},onClick:()=>void Te(),get children(){return e3()}}),null),P(t,j(M,{get when(){return c()},get children(){return j(Uj,{get message(){return c()}})}}),o),P(t,j(M,{get when(){return e().length>0},get fallback(){return j(Hj,{title:`No genomes yet`,children:`Click Extract and pick any component on the page — a dropdown, a card, a sidebar row. Then "Capture states" while you hover/open it to record the styles that only exist during interaction.`})},get children(){return[(()=>{var t=t3();return t.firstChild,P(t,j(We,{get each(){return e()},children:e=>{let t=()=>n()===e.id;return(()=>{var n=v3(),a=n.firstChild,o=a.nextSibling,s=o.firstChild,c=s.firstChild,l=c.nextSibling,d=l.firstChild,p=d.nextSibling;p.nextSibling;var m=l.nextSibling;return s.$$click=()=>r(t()?null:e.id),P(c,()=>e.genome.title),P(l,()=>e.genome.nodes.length,d),P(l,(()=>{var t=$e(()=>!!e.genome.states.length);return()=>t()?` · ${e.genome.states.length} states`:``})(),p),P(l,()=>Gj(e.genome.extractedAt),null),P(o,j(M,{get when(){return t()},get children(){var t=_3(),n=t.firstChild,r=n.nextSibling,a=r.nextSibling;return P(n,()=>e.genome.pageUrl),P(r,j(We,{get each(){return e.genome.nodes},children:e=>(()=>{var t=b3(),n=t.firstChild;return P(n,()=>e.label,null),P(n,j(M,{get when(){return e.count>1},get children(){var t=y3();return t.firstChild,P(t,()=>e.count,null),t}}),null),P(t,j(We,{get each(){return Object.entries(e.styles)},children:([t,n])=>(()=>{var r=S3(),i=r.firstChild;return P(r,t,i),P(r,n,null),P(r,j(M,{get when(){return e.tokens[t]},get children(){var n=x3(),r=n.firstChild.nextSibling;return r.nextSibling,P(n,()=>e.tokens[t],r),n}}),null),r})()}),null),t})()}),null),P(r,j(M,{get when(){return e.genome.states.length>0},get children(){return[m3(),j(We,{get each(){return e.genome.states},children:e=>(()=>{var t=C3(),n=t.firstChild,r=n.firstChild;return P(n,()=>e.label,r),P(n,()=>e.trigger,null),P(t,j(We,{get each(){return Object.entries(e.changed)},children:([e,t])=>(()=>{var n=w3(),r=n.firstChild,i=r.nextSibling;return i.nextSibling,P(n,e,r),P(n,()=>t.from,i),P(n,()=>t.to,null),n})()}),null),t})()})]}}),null),P(a,j(M,{get when(){return $e(()=>i()===e.id)()&&f().active},get fallback(){return j(q,{class:`size-7 px-0`,variant:`ghost`,get loading(){return i()===e.id},title:`Capture states — records hover/focus/open styles for 8s while you interact; the pill shows the timer and Stop`,"aria-label":`Capture interaction states`,onClick:()=>void Ee(e),get children(){return T3()}})},get children(){return[j(q,{class:`text-danger size-7 px-0`,variant:`ghost`,get title(){return`Stop recording — ${Math.ceil(f().msLeft/1e3)}s left · ${f().total} captured`},"aria-label":`Stop recording states`,onClick:()=>s2(),get children(){return h3()}}),(()=>{var e=g3(),t=e.firstChild,n=t.nextSibling;return n.nextSibling,P(e,()=>Math.ceil(f().msLeft/1e3),t),P(e,()=>f().total,n),e})()]}}),null),P(a,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return u()===e.id?`Copied!`:`Copy spec — markdown for an agent or issue`},"aria-label":`Copy genome spec`,onClick:()=>void De(e),get children(){return j(M,{get when(){return u()===e.id},get fallback(){return E3()},get children(){return n3()}})}}),null),P(a,j(q,{class:`text-danger ml-auto size-7 px-0`,variant:`ghost`,title:`Delete this genome`,"aria-label":`Delete genome`,onClick:()=>Oe(e.id),get children(){return r3()}}),null),t}}),null),D(e=>{var n={"bg-accent border-accent":t()},r=!!t();return e.e=lt(a,n,e.e),r!==e.t&&m.classList.toggle(`rotate-180`,e.t=r),e},{e:void 0,t:void 0}),n})()}}),null),t})(),(()=>{var e=i3();return P(e,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return ke()?`Copied!`:`Copy all genomes as one markdown document`},"aria-label":`Copy all genomes`,onClick:()=>void je(),get children(){return j(M,{get when(){return ke()},get fallback(){return E3()},get children(){return n3()}})}}),null),P(e,j(q,{class:`text-danger size-7 px-0`,variant:`ghost`,title:`Delete all saved genomes`,"aria-label":`Delete all genomes`,onClick:Me,get children(){return r3()}}),null),e})()]}}),o),P(s,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return g()?`Live capture ON — recording transitions fired by your input. Click to pause.`:`Live capture PAUSED — click to resume recording input-triggered transitions.`},get"aria-label"(){return g()?`Pause live capture`:`Start live capture`},onClick:()=>L2(!g()),get children(){return j(M,{get when(){return g()},get fallback(){return D3()},get children(){return a3()}})}}),null),P(s,j(q,{variant:`ghost`,class:`h-7 px-2.5 text-[11.5px]`,get loading(){return v()},onClick:()=>void S(),get children(){return o3()}}),null),P(o,j(M,{get when(){return m().length>0},get fallback(){return O3()},get children(){return[(()=>{var e=s3();return P(e,j(We,{get each(){return m()},children:e=>(()=>{var t=M3(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.firstChild,s=n.nextSibling,c=s.nextSibling;return P(r,()=>e.mode===`live`?`live`:`audit`),P(i,()=>e.component??e.element,null),P(i,j(M,{get when(){return e.count>1},get children(){return[` ×`,$e(()=>e.count)]}}),null),P(a,()=>e.durationMs,o),P(a,(()=>{var t=$e(()=>!!e.delayMs);return()=>t()?` +${e.delayMs}`:``})(),null),P(t,j(M,{get when(){return e.source},get children(){var t=k3();return P(t,()=>e.source),t}}),s),P(s,()=>e.properties.join(`, `),null),P(s,j(M,{get when(){return e.sinceInputMs!=null},get children(){return[` — fired `,$e(()=>e.sinceInputMs),`ms after input`]}}),null),P(t,j(M,{get when(){return e.jankProps?.length},get children(){var t=A3();return t.firstChild,P(t,()=>e.jankProps.join(`, `),null),t}}),c),P(t,j(M,{get when(){return e.easing},get children(){var t=j3();return t.firstChild,P(t,()=>e.easing,null),t}}),c),P(c,()=>e.suggestion),t})()})),e})(),(()=>{var e=l3();return P(e,j(q,{class:`size-7 px-0`,variant:`primary`,get title(){return w()?`Copied!`:`Copy AI prompt — report + fix rules, ready to paste into a Claude Code session`},"aria-label":`Copy AI fix prompt`,onClick:()=>void O(),get children(){return j(M,{get when(){return w()},get fallback(){return N3()},get children(){return c3()}})}}),null),P(e,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return b()?`Copied!`:`Copy report — plain markdown findings`},"aria-label":`Copy report`,onClick:()=>void C(),get children(){return j(M,{get when(){return b()},get fallback(){return E3()},get children(){return n3()}})}}),null),P(e,j(q,{class:`text-danger ml-auto size-7 px-0`,variant:`ghost`,title:`Clear all findings (live + audit)`,"aria-label":`Clear all findings`,onClick:N2,get children(){return r3()}}),null),e})()]}}),null),P(h,j(M,{get when(){return _e()>1},get children(){var e=u3(),t=e.firstChild.nextSibling;return t.nextSibling,P(e,_e,t),e}}),null),P(_,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return te()?`Live scan ON — re-scans automatically ~1s after each route change. Click to pause.`:`Live scan PAUSED — click to auto-scan every page you navigate to.`},get"aria-label"(){return te()?`Pause live scan`:`Start live scan`},onClick:()=>J4(!te()),get children(){return j(M,{get when(){return te()},get fallback(){return D3()},get children(){return a3()}})}}),null),P(_,j(q,{variant:`ghost`,class:`h-7 px-2.5 text-[11.5px]`,get loading(){return ne()},title:`Scan this page — cumulative: keeps other pages' findings, replaces this page's`,onClick:he,get children(){return d3()}}),null),P(d,j(M,{get when(){return k().length>0},get fallback(){return P3()},get children(){return[(()=>{var e=f3(),t=e.firstChild,n=t.firstChild,r=t.nextSibling,i=r.firstChild;return t.$$click=()=>ce(!se()),P(t,be,n),r.$$click=()=>ue(!le()),P(r,xe,i),D(e=>{var n={"text-danger bg-danger/10 border-danger/40":se(),"text-text-faint":!se()},i=se(),a={"text-warn bg-warn/10 border-warn/40":le(),"text-text-faint":!le()},o=le();return e.e=lt(t,n,e.e),i!==e.t&&it(t,`aria-pressed`,e.t=i),e.a=lt(r,a,e.a),o!==e.o&&it(r,`aria-pressed`,e.o=o),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),(()=>{var e=s3();return P(e,j(We,{get each(){return ye()},children:e=>{let t=e[0],n=()=>ie()===t.ruleId;return(()=>{var r=I3(),i=r.firstChild,a=i.firstChild,o=a.nextSibling,s=o.nextSibling;s.firstChild;var c=s.nextSibling;return i.$$click=()=>oe(n()?null:t.ruleId),P(o,()=>t.ruleId),P(s,()=>e.reduce((e,t)=>e+(t.count??1),0),null),P(r,j(M,{get when(){return n()},get children(){var n=F3(),r=n.firstChild;return P(r,()=>t.description),P(n,j(We,{each:e,children:e=>(()=>{var t=z3(),n=t.firstChild,r=n.nextSibling;return t.$$click=()=>{G3(e)||l(e.page===location.pathname?`Element is gone — run Scan again.`:`This finding is on ${e.page} — navigate there to reveal it.`)},P(n,j(M,{get when(){return _e()>1},get children(){var t=L3(),n=t.firstChild;return P(t,()=>e.page,n),t}}),null),P(n,j(M,{get when(){return e.component},get children(){var t=L3(),n=t.firstChild;return P(t,()=>e.component,n),t}}),null),P(n,()=>e.selector,null),P(n,j(M,{get when(){return(e.count??1)>1},get children(){var t=R3();return t.firstChild,P(t,()=>e.count,null),t}}),null),P(t,j(M,{get when(){return e.source},get children(){var t=k3();return P(t,()=>e.source),t}}),r),P(r,()=>e.evidence),t})()}),null),n}}),null),D(e=>{var r=t.severity===`error`,i=t.severity===`warn`,o=!!n();return r!==e.e&&a.classList.toggle(`bg-danger`,e.e=r),i!==e.t&&a.classList.toggle(`bg-warn`,e.t=i),o!==e.a&&c.classList.toggle(`rotate-180`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),r})()}})),e})(),(()=>{var e=l3();return P(e,j(q,{class:`size-7 px-0`,variant:`primary`,get title(){return pe()?`Copied!`:`Copy AI prompt — findings + contract fix rules, ready for a Claude Code session`},"aria-label":`Copy AI fix prompt`,onClick:()=>void Ce(),get children(){return j(M,{get when(){return pe()},get fallback(){return N3()},get children(){return c3()}})}}),null),P(e,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return de()?`Copied!`:`Copy report — findings grouped by rule, markdown`},"aria-label":`Copy slop report`,onClick:()=>void Se(),get children(){return j(M,{get when(){return de()},get fallback(){return E3()},get children(){return n3()}})}}),null),P(e,j(q,{class:`text-danger ml-auto size-7 px-0`,variant:`ghost`,title:`Clear scan results`,"aria-label":`Clear scan results`,onClick:ge,get children(){return r3()}}),null),e})()]}}),null),t})()}rt([`click`]);function q3(e){return Math.round(e*10)/10}function J3(e,t,n){return e.rules[t]?.severity??n}var Y3=/^(HotReload|Head|AppRouterAnnouncer|HistoryUpdater|AppRouter|Router|ServerRoot|SegmentViewNode|SegmentViewStateNode|SegmentStateProvider|InnerLayoutRouter|OuterLayoutRouter|TemplateContext|RenderFromTemplateContext|ScrollAndFocusHandler|RedirectBoundary|RedirectErrorBoundary|LoadingBoundary|ErrorBoundary|ErrorBoundaryHandler|HTTPAccessFallbackBoundary|HTTPAccessFallbackErrorBoundary|DevRootHTTPAccessFallbackBoundary|__next_root_layout_boundary__|Preloads|NonIndex|ReplaySsrOnlyErrors|AppDevOverlay\w*|DevOverlay\w*|PseudoHtml\w*)$/;function X3(e){return e?.length?e.map(e=>{try{let t=new RegExp(e);return e=>t.test(e)}catch{return t=>t===e}}):[]}function Z3(e,t){if(e.length<=2||Y3.test(e))return!0;for(let n of t)if(n(e))return!0;return!1}function Q3(e){let t=new Map;for(let n of e)for(let e of n.entries){let n=t.get(e.name);n||(n={name:e.name,updates:[],selfTime:0,el:e.el??void 0},t.set(e.name,n)),n.selfTime+=e.selfTime,e.el&&!n.el&&(n.el=e.el),e.phase===`update`&&n.updates.push(e.changes)}return t}function $3(e,t,n){let r=[],i=X3(n?.ignore),a=e.map(e=>({...e,entries:e.entries.filter(e=>!Z3(e.name,i)),mounts:Object.fromEntries(Object.entries(e.mounts).filter(([e])=>!Z3(e,i)))})),o=Q3(a),s=t.budgets;return c6(r,()=>{let e=[];for(let n of o.values()){if(n.updates.length<5||!n.updates.every(e=>e.length===0))continue;let r=n.updates.length;e.push({ruleId:`R9`,shape:`B`,severity:J3(t,`R9`,`error`),suspected:!0,description:`suspected R9 — ${n.name} re-rendered ${r}× with zero prop changes (dead memo or subscription-in-body)`,component:n.name,source:null,renders:r,selfTime:q3(n.selfTime),changes:[],evidence:`${r} renders · ${q3(n.selfTime)}ms self · all props identity-equal`,el:n.el})}return e}),c6(r,()=>{let e=[];for(let n of o.values()){if(n.updates.length<5||!n.updates.every(e=>e.length>0&&e.every(e=>/\((?:fn|ref)\)$/.test(e))))continue;let r=Array.from(new Set(n.updates.flat())),i=n.updates.length,a=r.join(`, `);e.push({ruleId:`R5`,shape:`B`,severity:J3(t,`R5`,`error`),suspected:!0,description:`suspected R5 — ${i} renders of ${n.name} with fresh ${a} identity per parent render (memo defeated)`,component:n.name,source:null,renders:i,selfTime:q3(n.selfTime),changes:r,evidence:`${i} renders · ${q3(n.selfTime)}ms self · churning ${a}`,el:n.el})}return e}),c6(r,()=>{let e=[],n=/Tooltip|Menu|Popover|Context|Dialog|Dropdown/i;for(let r of a)for(let i of Object.keys(r.mounts)){let a=r.mounts[i];if(a<(n.test(i)?10:15))continue;let o=r.entries.find(e=>e.name===i&&e.el);e.push({ruleId:`R4`,shape:`A`,severity:J3(t,`R4`,`error`),suspected:!0,description:`suspected R4 — ${a} ${i} instances mounted in one commit (per-row overlays should mount on intent)`,component:i,source:null,renders:a,selfTime:0,changes:[],evidence:`${i} ×${a} mounted in one commit`,el:o?.el??void 0})}return e}),c6(r,()=>{let e=[];for(let t of a){if(t.duration<=s.commitMs)continue;let n=[...t.entries].sort((e,t)=>t.selfTime-e.selfTime).slice(0,3).map(e=>`${e.name} ${q3(e.selfTime)}ms`).join(`, `),r=q3(t.duration),i=t.duration>16?` · ~${Math.round(1e3/t.duration)} FPS`:``;e.push({ruleId:null,shape:null,severity:`error`,suspected:!1,description:`commit exceeded budget: ${r}ms of React work (> ${s.commitMs}ms) — top: ${n}`,component:null,source:null,renders:t.entries.length,selfTime:r,changes:[],evidence:`${r}ms commit · ${t.entries.length} components${i}`})}return e}),c6(r,()=>{let e=[],t=new Map;for(let e of a){let n=new Map,r=new Map;for(let t of e.entries)n.set(t.name,(n.get(t.name)??0)+t.selfTime),t.el&&!r.has(t.name)&&r.set(t.name,t.el);for(let[e,i]of n){if(i<=s.selfMs)continue;let n=t.get(e)??{hits:0,worst:0,total:0,el:r.get(e)};n.hits+=1,n.worst=Math.max(n.worst,i),n.total+=i,n.el||=r.get(e),t.set(e,n)}}for(let[n,r]of t)r.hits<3||e.push({ruleId:null,shape:null,severity:`warn`,suspected:!1,description:`${n} is a hot component: ${r.hits} commits over the ${s.selfMs}ms self budget`,component:n,source:null,renders:r.hits,selfTime:q3(r.total),changes:[],evidence:`${r.hits} commits over ${s.selfMs}ms self (worst ${q3(r.worst)}ms)`,el:r.el});return e}),c6(r,()=>{let n=[],r=o6(e.filter(e=>e.nearInput).map(e=>e.at).sort((e,t)=>e-t),1e3);return r>=5&&n.push({ruleId:`R10`,shape:`B`,severity:J3(t,`R10`,`error`),suspected:!0,description:`suspected R10 — ${r} React commits during scroll/pointer movement (frame-rate state updates)`,component:null,source:null,renders:r,selfTime:0,changes:[],evidence:`${r} commits within a 1s scroll/pointer window`}),n}),c6(r,()=>{let n=[],{count:r,span:i}=s6(e.filter(e=>!e.nearInput).map(e=>e.at).sort((e,t)=>e-t),300);return r>=8&&n.push({ruleId:`R24`,shape:`B`,severity:J3(t,`R24`,`warn`),suspected:!0,description:`suspected R24 — ${r} commits in ${Math.round(i)}ms burst (multi-row writes / un-coalesced pokes?)`,component:null,source:null,renders:r,selfTime:0,changes:[],evidence:`${r} commits in a ${Math.round(i)}ms burst (no input)`}),n}),c6(r,()=>{let e=[];if(!i6())return e;for(let n of o.values()){if(n.updates.length<3)continue;let r=n.el?.deref();if(!r)continue;let i=!1;try{let e=r.getBoundingClientRect();i=!r.isConnected||e.width===0&&e.height===0}catch{continue}if(!i)continue;let a=n.updates.length;e.push({ruleId:`R3`,shape:`C`,severity:J3(t,`R3`,`error`),suspected:!0,description:`suspected R3 — ${n.name} re-rendered ${a}× while its DOM is hidden/detached (closed host without everOpened gate?) [R3/R7/R23 family]`,component:n.name,source:null,renders:a,selfTime:q3(n.selfTime),changes:[],evidence:`${a} renders while hidden/detached · ${q3(n.selfTime)}ms self`,el:n.el})}return e}),l6(r)}var e6=`#linear-grab-root, [data-linear-grab], [data-react-grab], #claude-agent-glow-border, [id^="react-scan"]`;function t6(e=typeof document<`u`?document:{}){let t=[];return c6(t,()=>{let t=[],n=Array.from(e.querySelectorAll(`[role="slider"], [role="progressbar"], [role="switch"]`)),r=a6(e);for(let e of n){if(e.closest(e6))continue;if(r)try{let t=e.getBoundingClientRect();if(t.width<2||t.height<2)continue}catch{}if(!n6(e))continue;let n=e.getAttribute(`role`)??`widget`;t.push({ruleId:`R8`,shape:`D`,severity:`warn`,suspected:!0,description:`suspected R8 — interactive ${n} widget used as a static picture (mount a CSS mock instead)`,component:null,source:null,renders:0,selfTime:0,changes:[],evidence:r6(e),el:typeof WeakRef<`u`?new WeakRef(e):void 0})}return t}),l6(t)}function n6(e){if(e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`)return!0;let t=e;for(let e=0;t&&e<=3;e++){try{if(getComputedStyle(t).pointerEvents===`none`)return!0}catch{}t=t.parentElement}return!1}function r6(e){let t=typeof e.className==`string`&&e.className?`.`+e.className.split(/\s+/).filter(Boolean).slice(0,2).join(`.`):``;return`${e.tagName.toLowerCase()}${t}`}function i6(){return typeof document>`u`?!1:(document.documentElement?.getBoundingClientRect().width??0)>0}function a6(e){return((e.documentElement??(typeof document<`u`?document.documentElement:null))?.getBoundingClientRect().width??0)>0}function o6(e,t){let n=0,r=0;for(let i=0;i<e.length;i++){for(;e[i]-e[r]>t;)r++;n=Math.max(n,i-r+1)}return n}function s6(e,t){let n=0,r=0,i=0;for(let a=0;a<e.length;a++){for(;e[a]-e[i]>t;)i++;let o=a-i+1;o>n&&(n=o,r=e[a]-e[i])}return{count:n,span:r}}function c6(e,t){try{e.push(...t())}catch{}}function l6(e){let t=new Map;for(let n of e){let e=`${n.ruleId}|${n.component}|${n.changes.join()}|${n.description}`,r=t.get(e);r?r.count=(r.count??1)+1:t.set(e,n)}return[...t.values()]}function u6(e){let t=new Map;for(let n of e){let e=n.ruleId??`budget`,r=t.get(e);r?r.push(n):t.set(e,[n])}let n=Array.from(t.entries()).sort((e,t)=>{let n=e[1][0].severity===`error`?0:1,r=t[1][0].severity===`error`?0:1;return n===r?t[1].length===e[1].length?e[0].localeCompare(t[0]):t[1].length-e[1].length:n-r}),r=e.reduce((e,t)=>e+(t.count??1),0),i=e.filter(e=>e.severity===`error`).reduce((e,t)=>e+(t.count??1),0),a=[`# Render scan — ${i} error${i===1?``:`s`}, ${r-i} warn (${r} total)`,``,`Diagnoses are SUSPECTED (heuristic). The numbers (renders, self ms) are measured.`,``];for(let[e,t]of n){let n=t[0],r=t.reduce((e,t)=>e+(t.count??1),0);a.push(`## ${e} — ${n.severity} ×${r}`);for(let e of t){let t=e.component||e.source?` — ${[e.component,e.source].filter(Boolean).join(` @ `)}`:``,n=(e.count??1)>1?` ×${e.count}`:``;a.push(`- ${e.description}${n}${t}`),a.push(` ${e.evidence}`)}a.push(``)}return a.join(`
280
- `)}function d6(e,t){let n=Array.from(new Set(e.map(e=>e.ruleId).filter(e=>!!e))).sort(),r=[];for(let e of n){let n=t.rules[e];n&&n.fixText?r.push(`- ${e} (${n.slug}): ${n.fixText}`):r.push(`- ${e}: see React-rerender-primitives.md ${e}`)}return[`Below is a RENDER-SCAN report from my running app — each finding is a measured`,`React re-render pattern graded against the re-render contract`,"(`React-rerender-primitives.md`). Rules are R-numbered.",``,`READ THIS FIRST: the DIAGNOSES are SUSPECTED — they are heuristic guesses at the`,`cause. The NUMBERS (render counts, self ms, FPS) are EXACT measurements. Trust the`,`numbers; verify each diagnosis against the code before you "fix" it.`,``,`How to fix:`,`1. Fix at the source of the identity churn / wasted render, not the symptom —`,` stabilize props (useCallback/useMemo, hoist constants), gate work behind an`,` everOpened/visible check, mount per-row overlays on intent.`,`2. Each distinct rule and its canonical fix:`,...r.map(e=>` ${e}`),`3. PROOF REQUIRED: after the change I will re-record and re-scan — the flagged`,` components must show the render counts drop. State what you changed per`,` component; do not claim done blind.`,``,`---`,``,u6(e)].join(`
281
- `)}var f6=`bippy-0.5.43`,p6=Object.defineProperty,m6=Object.prototype.hasOwnProperty,h6=()=>{},g6=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build`)})}catch{}},_6=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e),v6=!1,y6,b6=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>v6?!0:(e&&typeof e.inject==`function`&&(y6=e.inject.toString()),!!y6?.includes(`(injected)`)),x6=new Set,S6=new Set,C6=e=>{let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:f6,checkDCE:g6,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),S6.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,x6.forEach(e=>e())),i},on:h6,onCommitFiberRoot:h6,onCommitFiberUnmount:h6,onPostCommitFiberRoot:h6,renderers:t,supportsFiber:!0,supportsFlight:!0};try{p6(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{S6.add(e),t.renderers.set(n,e)}),w6(e))}}});let t=window.hasOwnProperty,n=!1;p6(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{w6(e)}return r},w6=e=>{e&&x6.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=g6,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=f6,t._instrumentationIsActive=!1;let e=_6(t);if(e||(t.on=h6),t.renderers.size){t._instrumentationIsActive=!0,x6.forEach(e=>e());return}let n=t.inject,r=b6(t);r&&!e&&(v6=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return S6.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,x6.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||b6())&&e?.()}catch{}},T6=()=>m6.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),E6=e=>T6()?(w6(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):C6(e),D6=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`));(()=>{try{D6()&&E6()}catch{}})();var O6=60111,k6=`Symbol(react.concurrent_mode)`,A6=`Symbol(react.async_mode)`,j6=e=>{switch(e.tag){case 5:case 26:case 27:return!0;default:return typeof e.type==`string`}},M6=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},N6=e=>{let t=e.memoizedProps,n=e.alternate?.memoizedProps||{},r=e.flags??e.effectTag??0;switch(e.tag){case 1:case 9:case 11:case 0:case 14:case 15:return(r&1)==1;default:return!e.alternate||n!==t||e.alternate.memoizedState!==e.memoizedState||e.alternate.ref!==e.ref}},P6=e=>{switch(e.tag){case 18:return!0;case 7:case 6:case 23:case 22:return!0;case 3:return!1;default:{let t=typeof e.type==`object`&&e.type!==null?e.type.$$typeof:e.type;switch(typeof t==`symbol`?t.toString():t){case O6:case k6:case A6:return!0;default:return!1}}}},F6=(e,t=!1)=>{let n=I6(e,j6,t);return n||=I6(e,j6,!t),n};function I6(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await R6(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=L6(i,t,n);if(e)return e;i=n?null:i.sibling}return null}var L6=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=L6(r,t,n);if(e)return e;r=n?null:r.sibling}return null},R6=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await R6(r,t,n);if(e)return e;r=n?null:r.sibling}return null},z6=e=>{let t=e?.actualDuration??0,n=t,r=e?.child??null;for(;t>0&&r!=null;)n-=r.actualDuration??0,r=r.sibling;return{selfTime:n,totalTime:t}},B6=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?B6(t.type||t.render):null},V6=e=>{let t=e;if(typeof t==`string`)return t;if(typeof t!=`function`&&!(typeof t==`object`&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=B6(t);return r&&(r.displayName||r.name)||null},H6=0,U6=new WeakMap,W6=(e,t=H6++)=>{U6.set(e,t)},G6=e=>{let t=U6.get(e);return!t&&e.alternate&&(t=U6.get(e.alternate)),t||(t=H6++,W6(e,t)),t},K6=(e,t,n)=>{let r=t;for(;r!=null;){if(U6.has(r)||G6(r),!P6(r)&&N6(r)&&e(r,`mount`),r.tag===13)if(r.memoizedState!==null){let t=r.child,n=t?t.sibling:null;if(n){let t=n.child;t!==null&&K6(e,t,!1)}}else{let t=null;r.child!==null&&(t=r.child.child),t!==null&&K6(e,t,!1)}else r.child!=null&&K6(e,r.child,!0);r=n?r.sibling:null}},q6=(e,t,n,r)=>{if(U6.has(t)||G6(t),!n)return;U6.has(n)||G6(n);let i=t.tag===13,a=!P6(t);a&&N6(t)&&e(t,`update`);let o=i&&n.memoizedState!==null,s=i&&t.memoizedState!==null;if(o&&s){let r=t.child?.sibling??null,i=n.child?.sibling??null;r!==null&&i!==null&&q6(e,r,i,t)}else if(o&&!s){let n=t.child;n!==null&&K6(e,n,!0)}else if(!o&&s){Y6(e,n);let r=t.child?.sibling??null;r!==null&&K6(e,r,!0)}else if(t.child!==n.child){let n=t.child;for(;n;){if(n.alternate){let i=n.alternate;q6(e,n,i,a?t:r)}else K6(e,n,!1);n=n.sibling}}},J6=(e,t)=>{(t.tag===3||!P6(t))&&e(t,`unmount`)},Y6=(e,t)=>{let n=t.tag===13&&t.memoizedState!==null,r=t.child;for(n&&(r=(t.child?.sibling??null)?.child??null);r!==null;)r.return!==null&&(J6(e,r),Y6(e,r)),r=r.sibling},X6=0,Z6=new WeakMap,Q6=(e,t)=>{let n=`current`in e?e.current:e,r=Z6.get(e);r||(r={id:X6++,prevFiber:null},Z6.set(e,r));let{prevFiber:i}=r;if(!n)J6(t,n);else if(i!==null){let e=i&&i.memoizedState!=null&&i.memoizedState.element!=null&&i.memoizedState.isDehydrated!==!0,r=n.memoizedState!=null&&n.memoizedState.element!=null&&n.memoizedState.isDehydrated!==!0;!e&&r?K6(t,n,!1):e&&r?q6(t,n,n.alternate,null):e&&!r&&J6(t,n)}else K6(t,n,!0);r.prevFiber=n},$6=e=>{let t=E6(e.onActive);t._instrumentationSource=e.name??f6;let n=t.onCommitFiberRoot;if(e.onCommitFiberRoot){let r=(t,i,a)=>{n!==r&&(n?.(t,i,a),e.onCommitFiberRoot?.(t,i,a))};t.onCommitFiberRoot=r}let r=t.onCommitFiberUnmount;if(e.onCommitFiberUnmount){let n=(i,a)=>{t.onCommitFiberUnmount===n&&(r?.(i,a),e.onCommitFiberUnmount?.(i,a))};t.onCommitFiberUnmount=n}let i=t.onPostCommitFiberRoot;if(e.onPostCommitFiberRoot){let n=(r,a)=>{t.onPostCommitFiberRoot===n&&(i?.(r,a),e.onPostCommitFiberRoot?.(r,a))};t.onPostCommitFiberRoot=n}return t},e8=!1,t8=!1,n8=[],r8=-1/0,i8=200,a8=4e3,o8=100;function s8(){r8=l8()}var c8=[`scroll`,`wheel`,`pointermove`];function l8(){return typeof performance<`u`?performance.now():Date.now()}function u8(e,t){let n=e&&typeof e==`object`?e:{},r=t&&typeof t==`object`?t:{},i=new Set([...Object.keys(n),...Object.keys(r)]),a=[];for(let e of i){if(e===`children`)continue;let t=n[e],i=r[e];Object.is(t,i)||(typeof t==`function`&&typeof i==`function`?a.push(`prop:${e}(fn)`):t&&i&&typeof t==`object`&&typeof i==`object`&&d8(t,i)?a.push(`prop:${e}(ref)`):a.push(`prop:${e}`))}return a}function d8(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.is(e[r],t[r]))return!1;return!0}function f8(e){let t=[],n={};Q6(e,(e,r)=>{if(r===`unmount`||!M6(e))return;let i=V6(e.type)??`Anonymous`;r===`mount`&&(n[i]=(n[i]??0)+1);let a=0;try{a=z6(e).selfTime||0}catch{}let o=[];if(r===`update`&&e.alternate)try{o=u8(e.alternate.memoizedProps,e.memoizedProps)}catch{o=[`prop:(unknown)`]}let s=null;try{let t=F6(e)?.stateNode;t&&typeof WeakRef<`u`&&t instanceof Element&&(s=new WeakRef(t))}catch{}t.push({name:i,selfTime:a,phase:r===`mount`?`mount`:`update`,changes:o,el:s})}),t.sort((e,t)=>t.selfTime-e.selfTime);let r=t.slice(0,i8),i=Math.max(0,t.length-i8),a=0;for(let e of t)a+=e.selfTime;let o=l8(),s=o-r8<=o8;n8.push({at:o,duration:a,entries:r,droppedEntries:i,mounts:n,nearInput:s})}function p8(){if(!e8&&!(typeof window>`u`)){e8=!0;try{$6({onCommitFiberRoot:(e,t)=>{if(t8&&!(n8.length>=a8))try{f8(t)}catch{}}})}catch{}}}function m8(){if(!(typeof window>`u`)&&!t8){n8=[],r8=-1/0,p8();try{for(let e of c8)window.addEventListener(e,s8,{capture:!0,passive:!0})}catch{}t8=!0}}function h8(){t8=!1;try{for(let e of c8)window.removeEventListener(e,s8,{capture:!0})}catch{}let e=n8;return n8=[],r8=-1/0,e}function g8(){let e=n8;return n8=[],e}var _8={budgets:{selfMs:2,commitMs:8},rules:{}},v8=/^###\s+(R\d+)\s*[·.\-–—:]?\s*`([^`]+)`.*?\((error|warn)\)\s*$/;function y8(e){return v8.test(e.trim())}function b8(e,t){let n=e.split(`
282
- `),r=RegExp(`^\\s*\\*\\*${t.source}[^*]*:\\*\\*\\s*(.*)$`,`i`),i=/^\s*\*\*[^*]+:\*\*/,a=0;for(;a<n.length&&!r.test(n[a]);a++);if(a>=n.length)return``;let o=n[a].replace(r,`$1`),s=[];for(o.trim()&&s.push(o.trim()),a+=1;a<n.length;a++){let e=n[a];if(i.test(e)||/^###\s/.test(e)||/^##\s/.test(e)||/^---\s*$/.test(e))break;if(e.trim())s.push(e.trim());else if(s.length){let e=a+1;for(;e<n.length&&!n[e].trim();)e++;if(e>=n.length||i.test(n[e])||/^###\s|^##\s|^---\s*$/.test(n[e]))break}}return x8(s.join(` `)).trim()}function x8(e){return e.replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/__([^_]+)__/g,`$1`).replace(/(^|[\s(])[*_]([^*_\s][^*_]*?)[*_]([\s.,;:)]|$)/g,`$1$2$3`).replace(/\s{2,}/g,` `)}function S8(e){let t=e.match(/≤(\d+(?:\.\d+)?)ms self/),n=e.match(/commit >(\d+(?:\.\d+)?)ms/)??e.match(/>(\d+(?:\.\d+)?)ms of React work/);return{selfMs:t?parseFloat(t[1]):_8.budgets.selfMs,commitMs:n?parseFloat(n[1]):_8.budgets.commitMs}}function C8(e){let t=S8(e),n={},r=e.split(`
283
- `),i=0;for(;i<r.length;){let e=r[i];if(!y8(e)){i++;continue}let t=e.trim(),a=[],o=i+1;for(;o<r.length;o++){let e=r[o];if(y8(e)||/^##\s/.test(e.trim())||/^---\s*$/.test(e.trim()))break;a.push(e)}try{let e=t.match(v8);if(e){let[,t,r,i]=e,o=a.join(`
284
- `);n[t]={id:t,slug:r,severity:i===`warn`?`warn`:`error`,ruleText:b8(o,/Rule/),fixText:b8(o,/Fix/),detectText:b8(o,/Detect/)}}}catch{}i=o}return{budgets:t,rules:n}}Br();var w8=[],T8=new Set;function E8(e){return T8.add(e),e(w8),()=>void T8.delete(e)}function D8(){w8=[];for(let e of T8)e(w8)}function O8(e,t){w8=[...e,...w8.filter(e=>e.page!==t)];for(let e of T8)e(w8);return e5(e).then(()=>{w8=[...w8];for(let e of T8)e(w8);t5(e)}),e}var k8=new Set,A8=!1,j8=null;function M8(e){return k8.add(e),e(A8,j8),()=>void k8.delete(e)}function N8(){if(!(F8||A8)){m8(),A8=!0,j8=Date.now();for(let e of k8)e(!0,j8)}}async function P8(){if(!A8)return[];let e=h8();A8=!1,j8=null;for(let e of k8)e(!1,null);let t=await X8(),n=location.pathname;return O8($3(e,t,{ignore:await Q8()}).map(e=>({...e,page:n})),n)}var F8=!1;try{F8=localStorage.getItem(`linear-grab:render-live`)===`1`}catch{}var I8=new Set;function L8(e){return I8.add(e),e(F8),()=>void I8.delete(e)}var R8=3e3,z8=4e3,B8=null,V8=[],H8=``;function U8(e){if(e!==F8&&!(e&&A8)){F8=e;try{localStorage.setItem(`linear-grab:render-live`,e?`1`:`0`)}catch{}for(let t of I8)t(e);e?(m8(),V8=[],H8=location.pathname,B8=setInterval(()=>void W8(!1),R8)):(B8&&clearInterval(B8),B8=null,W8(!0).finally(()=>{h8(),V8=[]}))}}async function W8(e){try{let t=location.pathname;if(t!==H8){let e=w8.filter(e=>e.page===H8);e5(e).then(()=>{w8=[...w8];for(let e of T8)e(w8);t5(e)}),V8=[],H8=t}V8.push(...g8()),V8.length>z8&&V8.splice(0,V8.length-z8);let n=await X8(),r=$3(V8,n,{ignore:await Q8()}).map(e=>({...e,page:t}));w8=[...r,...w8.filter(e=>e.page!==t)];for(let e of T8)e(w8);if(e){await e5(r),w8=[...w8];for(let e of T8)e(w8);t5(r)}}catch{}}function G8(){typeof window>`u`||!F8||B8||(m8(),V8=[],H8=location.pathname,B8=setInterval(()=>void W8(!1),R8))}function K8(){let e=location.pathname;return O8(t6(document).map(t=>({...t,page:e})),e)}var q8=5*6e4,J8=null,Y8=0;async function X8(){if(J8&&Date.now()-Y8<q8)return J8;let e=_8;try{let t=await XO(),n=await(await fetch(`${t}/scan/rulebook`)).json();n.ok&&n.text&&(e=C8(n.text))}catch{}return e=await $8(e),J8=e,Y8=Date.now(),e}function Z8(){return J8}async function Q8(){try{let e=await Tr();return Array.isArray(e.renderIgnore)?e.renderIgnore:void 0}catch{return}}async function $8(e){try{let t=(await Tr()).renderBudgets;if(t&&(t.selfMs!=null||t.commitMs!=null))return{...e,budgets:{selfMs:t.selfMs??e.budgets.selfMs,commitMs:t.commitMs??e.budgets.commitMs}}}catch{}return e}async function e5(e){let t=null;try{t=(await Promise.resolve().then(()=>(zZ(),jZ))).getGlobalApi()??null}catch{return}if(!t)return;let n=new Map;for(let t of e){let e=t.el?.deref();if(!e)continue;let r=n.get(e);r?r.push(t):n.set(e,[t])}let r=300;for(let[e,i]of n){if(r--<=0)break;let n=null,a=null;try{n=t.getDisplayName?.(e)??null}catch{}try{let n=await t.getSource?.(e);n?.filePath&&(a=`${n.filePath}${n.lineNumber==null?``:`:${n.lineNumber}`}`)}catch{}if(!(!n&&!a))for(let e of i)!e.component&&n&&(e.component=n),a&&(e.source=a)}}function t5(e){if(e.length===0)return;let t=Date.now(),n=e.slice(0,200).map(({el:e,...n})=>({kind:`render-scan`,at:t,...n}));XO().then(e=>fetch(`${e}/scan/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({events:n}),keepalive:!0})).catch(()=>{})}var n5=N(`<span class="text-text-faint font-normal tabular-nums"> · <!> pages`),r5=N(`<span class="bg-danger size-1.5 shrink-0 animate-pulse rounded-full"aria-hidden>`),i5=N(`<span class="text-danger inline-block min-w-[4ch] text-right text-[10.5px] font-medium tabular-nums">`),a5=N(`<svg width=13 height=13 viewBox="0 0 16 16"aria-hidden><rect x=3.5 y=3.5 width=9 height=9 rx=1.5 fill=currentColor>`),o5=N(`<svg width=13 height=13 viewBox="0 0 16 16"aria-hidden><rect x=4 y=3.5 width=3 height=9 rx=1 fill=currentColor></rect><rect x=9 y=3.5 width=3 height=9 rx=1 fill=currentColor>`),s5=N(`<span class="bg-success absolute -top-0.5 -right-0.5 size-1.5 animate-pulse rounded-full"aria-hidden>`),c5=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M5.5 3 6.5 1.5h3L10.5 3h2A1.5 1.5 0 0 1 14 4.5v7A1.5 1.5 0 0 1 12.5 13h-9A1.5 1.5 0 0 1 2 11.5v-7A1.5 1.5 0 0 1 3.5 3h2Z"></path><circle cx=8 cy=7.75 r=2.25>`),l5=N(`<span class="text-success text-[12px] leading-none">✓`),u5=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M4 4l8 8M12 4l-8 8">`),d5=N(`<p class="text-text-faint px-1 text-[10.5px] leading-snug">Recording commits… interact with the page.`),f5=N(`<p class="text-text-faint px-1 text-[10.5px] leading-snug">Live render scan — findings update as you interact and navigate.`),p5=N(`<div class="flex items-center gap-1 px-1"><button class="border-border cursor-pointer rounded-full border px-2 py-0.5 text-[10px] font-medium tabular-nums"> errors</button><button class="border-border cursor-pointer rounded-full border px-2 py-0.5 text-[10px] font-medium tabular-nums"> warns`),m5=N(`<div class="flex max-h-[28rem] flex-col gap-1.5 overflow-y-auto pr-3 pl-2">`),h5=N(`<div class="flex h-full flex-col gap-3 overflow-y-auto pt-3 pb-4 pr-3 pl-2"><div class="flex flex-col gap-1 px-1"><div class="flex items-center justify-between gap-2"><p class="text-text min-w-0 truncate text-[12.5px] font-semibold">Renders</p><div class="flex shrink-0 items-center gap-1"></div></div><p class="text-text-faint text-[10.5px] leading-snug">Commits graded against React-rerender-primitives.md — record then interact, go live, or snapshot the DOM. Accumulates per page.`),g5=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=2.25 fill=currentColor stroke=none>`),_5=N(`<svg width=13 height=13 viewBox="0 0 16 16"aria-hidden><path d="M5 3.3v9.4a.5.5 0 0 0 .77.42l7.1-4.7a.5.5 0 0 0 0-.84l-7.1-4.7A.5.5 0 0 0 5 3.3Z"fill=currentColor>`),v5=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 1.5 9.6 6l4.4 1.6L9.6 9.2 8 13.7 6.4 9.2 2 7.6 6.4 6Z"></path><path d="M13 11.5l.6 1.7 1.7.6-1.7.6-.6 1.7-.6-1.7-1.7-.6 1.7-.6Z">`),y5=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),b5=N(`<div class="border-border flex flex-col gap-1 border-t px-2 py-1.5">`),x5=N(`<div class="bg-surface border-border flex flex-col rounded-lg border"><button class="flex w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left"><span class="size-1.5 shrink-0 rounded-full"aria-hidden></span><span class="text-accent min-w-0 truncate font-mono text-[11.5px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums">×</span><svg width=10 height=10 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 class="text-text-faint shrink-0 transition-transform"aria-hidden><path d="m4 6 4 4 4-4">`),S5=N(`<span class="text-accent font-mono"> `),C5=N(`<span class="text-text-faint tabular-nums"> ×`),w5=N(`<span class="flex flex-wrap gap-1">`),T5=N(`<span class="text-text-dim font-mono"> · `),E5=N(`<div class="flex flex-col gap-0.5 rounded px-1 py-0.5 text-left"><span class="text-text-dim text-[10.5px] leading-snug"></span><span class="text-text-faint text-[10px] leading-snug tabular-nums">`),D5=N(`<span class="bg-surface-2 text-text-dim rounded px-1 font-mono text-[9.5px] leading-relaxed">`);function O5(e){let t=e.el?.deref();if(!(t instanceof HTMLElement)||!t.isConnected)return!1;t.scrollIntoView({block:`center`,behavior:`smooth`});let n=t.style.outline,r=t.style.outlineOffset;return t.style.outline=`2px solid #e5a13a`,t.style.outlineOffset=`2px`,setTimeout(()=>{t.style.outline=n,t.style.outlineOffset=r},1400),!0}function k5(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}function A5(e){return e.replace(/^prop:/,``)}function j5(){let[e,t]=T([]);ae(E8(t));let[n,r]=T(!1),[i,a]=T(null),[o,s]=T(Date.now()),c=null,l=()=>{c&&clearInterval(c),c=null};ae(l),ae(M8((e,t)=>{r(e),a(t),e?(s(Date.now()),c||=setInterval(()=>s(Date.now()),500)):l()}));let[u,d]=T(!1);ae(L8(d));let[f,p]=T(Z8());X8().then(p);let[m,h]=T(null),[g,_]=T(null),[v,y]=T(!0),[b,x]=T(!0),[S,C]=T(!1),[w,E]=T(!1),[O,k]=T(!1),ee=async()=>{if(h(null),n())try{let e=await P8();p(Z8()),_(null),e.length===0&&h(`No re-render anti-patterns caught — interact more (scroll, open menus, type) between record and stop.`)}catch(e){h(e instanceof Error?e.message:String(e))}else N8()},te=()=>{h(null),C(!0);try{K8(),_(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{C(!1)}},A=()=>{D8(),_(null)},ne=()=>new Set(e().map(e=>e.page)).size,re=()=>e().filter(e=>e.severity===`error`?v():b()),ie=()=>e().filter(e=>e.severity===`error`).reduce((e,t)=>e+(t.count??1),0),oe=()=>e().reduce((e,t)=>e+(t.count??1),0)-ie(),se=()=>{let e=new Map;for(let t of re()){let n=t.ruleId??`budget`,r=e.get(n);r?r.push(t):e.set(n,[t])}return[...e.entries()].sort((e,t)=>Number(t[1][0].severity===`error`)-Number(e[1][0].severity===`error`)||t[1].length-e[1].length)},ce=e=>{let t=e===`budget`?null:f()?.rules[e]?.slug??null;return t?`${e} · ${t}`:e},le=async()=>{try{await navigator.clipboard.writeText(u6(re())),E(!0),setTimeout(()=>E(!1),1600)}catch{h(`Clipboard was blocked — click Copy again.`)}},ue=async()=>{try{await navigator.clipboard.writeText(d6(re(),await X8())),k(!0),setTimeout(()=>k(!1),1600)}catch{h(`Clipboard was blocked — click Copy again.`)}};return(()=>{var t=h5(),r=t.firstChild.firstChild.firstChild;r.firstChild;var a=r.nextSibling;return P(r,j(M,{get when(){return ne()>1},get children(){var e=n5(),t=e.firstChild.nextSibling;return t.nextSibling,P(e,ne,t),e}}),null),P(a,j(M,{get when(){return n()},get children(){return[r5(),(()=>{var e=i5();return P(e,()=>k5(o()-(i()??o()))),e})()]}}),null),P(a,j(q,{class:`size-7 px-0`,get variant(){return n()?`danger`:`ghost`},"data-tip-pos":`bottom left`,get disabled(){return u()},get title(){return $e(()=>!!u())()?`Live scan owns the recorder — pause it first`:n()?`Stop & analyze`:`Record renders`},get"aria-label"(){return n()?`Stop and analyze`:`Record renders`},onClick:()=>void ee(),get children(){return j(M,{get when(){return n()},get fallback(){return g5()},get children(){return a5()}})}}),null),P(a,j(q,{class:`relative size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,get disabled(){return n()},get title(){return u()?`Pause live render scan`:`Live render scan — findings update as you browse`},"aria-label":`Toggle live render scan`,onClick:()=>U8(!u()),get children(){return[j(M,{get when(){return u()},get fallback(){return _5()},get children(){return o5()}}),j(M,{get when(){return u()},get children(){return s5()}})]}}),null),P(a,j(q,{class:`size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,get loading(){return S()},title:`Snapshot scan (passive DOM pass)`,"aria-label":`Snapshot scan`,onClick:te,get children(){return c5()}}),null),P(a,j(q,{class:`size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,get title(){return O()?`Copied!`:`Copy AI fix prompt`},"aria-label":`Copy AI fix prompt`,onClick:()=>void ue(),get children(){return j(M,{get when(){return O()},get fallback(){return v5()},get children(){return l5()}})}}),null),P(a,j(q,{class:`size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,get title(){return w()?`Copied!`:`Copy report`},"aria-label":`Copy report`,onClick:()=>void le(),get children(){return j(M,{get when(){return w()},get fallback(){return y5()},get children(){return l5()}})}}),null),P(a,j(q,{class:`text-danger size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,title:`Clear findings`,"aria-label":`Clear findings`,onClick:A,get children(){return u5()}}),null),P(t,j(M,{get when(){return m()},get children(){return j(Uj,{get message(){return m()}})}}),null),P(t,j(M,{get when(){return n()},get children(){return d5()}}),null),P(t,j(M,{get when(){return $e(()=>!!u())()&&!n()},get children(){return f5()}}),null),P(t,j(M,{get when(){return e().length>0},get fallback(){return j(M,{get when(){return $e(()=>!n())()&&!u()},get children(){return j(Hj,{title:`No renders scanned yet`,children:`Press record, then interact — scroll, open menus, navigate, type — and stop to analyze. Or go live and watch findings stream in as you browse. Snapshot grades the current DOM without recording.`})}})},get children(){return[(()=>{var e=p5(),t=e.firstChild,n=t.firstChild,r=t.nextSibling,i=r.firstChild;return t.$$click=()=>y(!v()),P(t,ie,n),r.$$click=()=>x(!b()),P(r,oe,i),D(e=>{var n={"text-danger bg-danger/10 border-danger/40":v(),"text-text-faint":!v()},i=v(),a={"text-warn bg-warn/10 border-warn/40":b(),"text-text-faint":!b()},o=b();return e.e=lt(t,n,e.e),i!==e.t&&it(t,`aria-pressed`,e.t=i),e.a=lt(r,a,e.a),o!==e.o&&it(r,`aria-pressed`,e.o=o),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),(()=>{var e=m5();return P(e,j(We,{get each(){return se()},children:([e,t])=>{let n=t[0],r=()=>g()===e;return(()=>{var i=x5(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,c=s.nextSibling;c.firstChild;var l=c.nextSibling;return a.$$click=()=>_(r()?null:e),P(s,()=>ce(e)),P(c,()=>t.reduce((e,t)=>e+(t.count??1),0),null),P(i,j(M,{get when(){return r()},get children(){var e=b5();return P(e,j(We,{each:t,children:e=>{let t=()=>e.el?.deref()!=null;return(()=>{var n=E5(),r=n.firstChild,i=r.nextSibling;return n.$$click=()=>{t()&&(O5(e)||h(e.page===location.pathname?`Element is gone — record or snapshot again.`:`This finding is on ${e.page} — navigate there to reveal it.`))},P(r,j(M,{get when(){return ne()>1},get children(){var t=S5(),n=t.firstChild;return P(t,()=>e.page,n),t}}),null),P(r,()=>e.description,null),P(r,j(M,{get when(){return(e.count??1)>1},get children(){var t=C5();return t.firstChild,P(t,()=>e.count,null),t}}),null),P(n,j(M,{get when(){return e.changes.length>0},get children(){var t=w5();return P(t,j(We,{get each(){return e.changes},children:e=>(()=>{var t=D5();return P(t,()=>A5(e)),t})()})),t}}),i),P(i,()=>e.evidence,null),P(i,j(M,{get when(){return e.component||e.source},get children(){var t=T5();return t.firstChild,P(t,()=>[e.component,e.source].filter(Boolean).join(` @ `),null),t}}),null),D(e=>{var r={"hover:bg-surface-2 cursor-pointer":t()},i=t()?`Reveal on the page`:void 0;return e.e=lt(n,r,e.e),i!==e.t&&it(n,`title`,e.t=i),e},{e:void 0,t:void 0}),n})()}})),e}}),null),D(e=>{var t=n.severity===`error`,i=n.severity===`warn`,a=!!r();return t!==e.e&&o.classList.toggle(`bg-danger`,e.e=t),i!==e.t&&o.classList.toggle(`bg-warn`,e.t=i),a!==e.a&&l.classList.toggle(`rotate-180`,e.a=a),e},{e:void 0,t:void 0,a:void 0}),i})()}})),e})()]}}),null),t})()}rt([`click`]);var M5=[`defaultTeamId`,`defaultProjectId`,`defaultLabelIds`,`defaultRepo`,`workflowMode`,`cursorModel`,`openaiModel`,`anthropicModel`,`stagingBranch`,`githubAssetsRepo`,`skillPaths`,`logUrl`,`logLines`,`issueTemplate`,`testUsername`,`renderBudgets`,`renderIgnore`];function N5(e){let t={};for(let n of M5){let r=e[n];r!==void 0&&r!==``&&!(Array.isArray(r)&&r.length===0)&&(t[n]=r)}return t}function P5(e,t){let n={};for(let r of M5)e[r]===void 0&&t[r]!==void 0&&(n[r]=t[r]);return Object.keys(n).length?n:null}Br();function F5(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function I5(e){let t=F5(crypto.getRandomValues(new Uint8Array(32))),n=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t)),r=F5(new Uint8Array(n)),i=F5(crypto.getRandomValues(new Uint8Array(16))),a=chrome.identity.getRedirectURL(),o=new URL(`https://linear.app/oauth/authorize`);o.searchParams.set(`client_id`,e),o.searchParams.set(`redirect_uri`,a),o.searchParams.set(`response_type`,`code`),o.searchParams.set(`scope`,`read,write`),o.searchParams.set(`state`,i),o.searchParams.set(`code_challenge`,r),o.searchParams.set(`code_challenge_method`,`S256`);let s=await chrome.identity.launchWebAuthFlow({url:o.toString(),interactive:!0});if(!s)throw Error(`OAuth flow was cancelled`);let c=new URL(s).searchParams;if(c.get(`state`)!==i)throw Error(`OAuth state mismatch`);let l=c.get(`code`);if(!l)throw Error(c.get(`error_description`)??`No authorization code returned`);let u=await fetch(`https://api.linear.app/oauth/token`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`authorization_code`,code:l,redirect_uri:a,client_id:e,code_verifier:t})}),d=await u.json().catch(()=>null);if(!u.ok||!d?.access_token)throw Error(`Token exchange failed — check the OAuth app callback URL and client id`);await Er({linearAccessToken:d.access_token,linearOauthClientId:e})}async function L5(){await Er({linearAccessToken:void 0,linearApiKey:void 0})}Br(),Sr(),Lx(),vD();var R5=N(`<div class="bg-surface-2 border-border flex rounded-md border p-0.5">`),z5=N(`<span class="text-text-faint text-[10.5px] leading-snug">Cloud: picking an element opens the panel to draft &amp; delegate to the Cursor agent. Local (react-grab style): picking auto-copies the element's context — source, stack, and your skills/memory paths — straight to the clipboard for a local Claude Code or Cursor session; the panel stays out of the way. Both share the same picker; switch anytime.`),B5=N(`<label class="flex cursor-pointer items-center gap-2 select-none"><input type=checkbox class="accent-accent rounded"><span class="text-text text-[12px]">Element screenshots`),V5=N(`<span class="text-text-faint text-[10.5px] leading-snug">Captures a highlighted screenshot of each picked element and attaches it to the issue. Costs a beat on huge pages — with this off, picking is instant (pure react-grab speed).`),H5=N(`<span class=text-text>Connected as <span class=font-medium></span> · <span class=text-text-dim>`),U5=N(`<div class="bg-surface border-border flex items-center justify-between rounded-lg border p-2.5"><span class="text-text text-[12px]">`),W5=N(`<option value>Select a team…`),G5=N(`<option value>No project`),K5=N(`<div class="flex flex-wrap gap-1">`),q5=N(`<label class="flex items-start gap-2"><input type=checkbox class="accent-accent mt-0.5"><span class="flex flex-col gap-0.5"><span class=text-[12px]>Let agents close out Linear themselves</span><span class="text-text-faint text-[10.5px] leading-snug">Embeds your Linear API key + raw GraphQL closeout recipes in every issue's Agent instructions — cloud agent VMs have no authenticated Linear MCP, so without this they can't comment, attach media, or move the issue. The key is visible to anyone who can read the issue.`),J5=N(`<p class="text-text-dim text-[11px]">No agents found — install the Cursor integration in Linear first.`),Y5=N(`<span class="text-text-faint text-[10.5px] leading-snug">Empty = the default above (computer-use testing, video demo, PR + review babysitting).`),X5=N(`<div class="flex flex-col gap-1.5">`),Z5=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Mode</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5"></div><span class="text-text-faint text-[10.5px] leading-snug">Beside page squeezes the app next to the panel, DevTools-style — nothing gets covered. Also toggleable from the dock icon in the panel header.`),Q5=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Dock side</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5"></div><span class="text-text-faint text-[10.5px] leading-snug">The launcher pill is draggable — park it anywhere it doesn't cover your app.`),$5=N(`<p class="text-text-faint text-[10.5px] leading-snug">A committed <code>.lineargrab.json</code> at the repo root (where the bridge runs) shares team/project/labels, skills, staging branch, and workflow defaults with every machine and teammate — it seeds any setting you haven't set locally. Secrets never belong in it.`),e7=N(`<span class="inline-block min-w-[10ch] text-center">`),t7=N(`<div class="flex items-center gap-2">`),n7=N(`<option value>Select a channel…`),r7=N(`<label class="flex cursor-pointer items-center gap-2 select-none"><input type=checkbox class="accent-accent rounded"><span class="text-text text-[12px]">Announce new issues on create`),i7=N(`<span class="text-text-faint text-[10.5px] leading-snug">⚠️ Tokens are embedded in issue Agent-instructions so agents can post the finished demo — everyone who can read the issue can read them. Use single-channel-scoped bots.`),a7=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Provider preference</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5"><button>Auto</button><button>OpenAI</button><button>Anthropic`),o7=N(`<p class="text-text-dim text-[11px]">`),s7=N(`<div class=min-h-[2lh]>`),c7=N(`<ol class="text-text-faint flex list-decimal flex-col gap-1 pl-4 text-[11px] leading-relaxed"><li>Pick an element on your running dev app.</li><li>Draft the issue (AI optional).</li><li>Create + delegate — Cursor's cloud agent fixes it and opens a PR.</li><li>Track and steer it from Activity.`),l7=N(`<div class="flex h-full flex-col gap-5 overflow-y-auto pt-3 pb-6 pl-3 pr-4">`),u7=N(`<button>`),d7=N(`<div class="flex gap-1.5">`),f7=N(`<p class="text-text-faint text-center text-[10.5px]">or`),p7=N(`<span class="text-text-faint text-[10.5px] leading-snug">Register this callback URL in your Linear OAuth app config:<br><span class="font-mono text-[10.5px] break-all">`),m7=N(`<div class="flex flex-col gap-3">`),h7=N(`<span class=text-text-dim>Connected — verifying…`),g7=N(`<option> (<!>)`),_7=N(`<option>`),v7=N(`<button type=button><span class="mr-1 inline-block size-2 rounded-full align-middle">`),y7=N(`<option value>Select the agent…`),b7=N(`<option>#`),x7=N(`<p class="text-text-dim text-[11px]">No key set — AI drafting disabled, manual drafting still works.`);function S7(){let e=sr(),t=_r(()=>({queryKey:[`settings`],queryFn:Tr,staleTime:0})),n=k(()=>t.data??{});async function r(t,n=!1){await Er(t),await e.invalidateQueries({queryKey:[`settings`]}),n&&(await e.invalidateQueries({queryKey:[`viewer`]}),await e.invalidateQueries({queryKey:[`teams`]}),await e.invalidateQueries({queryKey:[`agents`]}),await e.invalidateQueries({queryKey:[`my-issues`]}))}let i=k(()=>!!(n().linearApiKey||n().linearAccessToken)),a=_r(()=>({queryKey:[`viewer`],queryFn:dO,enabled:i(),retry:0})),o=_r(()=>({queryKey:[`teams`],queryFn:fO,enabled:i()})),s=_r(()=>({queryKey:[`linear-projects`],queryFn:SO,enabled:i()})),c=_r(()=>({queryKey:[`bridge-health`],queryFn:PO,retry:0})),[l,u]=T(!1),d=async()=>{try{await navigator.clipboard.writeText(JSON.stringify(N5(n()),null,2)+`
285
- `),u(!0),setTimeout(()=>u(!1),1800)}catch{}},f=()=>{let e=c.data?.projectConfig;if(!e)return;let t={};for(let n of M5)e[n]!==void 0&&(t[n]=e[n]);r(t)},p=_r(()=>({queryKey:[`linear-labels`],queryFn:CO,enabled:i()})),m=_r(()=>({queryKey:[`agents`],queryFn:pO,enabled:i()})),[h,g]=T(``),[_,v]=T(!1),[y,b]=T(``);async function x(){let e=h().trim();if(e){v(!0),b(``);try{await r({linearApiKey:e},!0),await dO(),g(``)}catch{b(`Key rejected — could not verify. Check the key and try again.`),await r({linearApiKey:void 0},!0)}finally{v(!1)}}}let[S,C]=T(``),[w,E]=T(!1),[O,ee]=T(``);async function te(){let t=(S()||n().linearOauthClientId||``).trim();if(!t){ee(`Enter an OAuth client ID first.`);return}E(!0),ee(``);try{await I5(t),await e.invalidateQueries({queryKey:[`settings`]}),await e.invalidateQueries({queryKey:[`viewer`]}),await e.invalidateQueries({queryKey:[`teams`]}),await e.invalidateQueries({queryKey:[`agents`]}),await e.invalidateQueries({queryKey:[`my-issues`]})}catch(e){ee(e instanceof Error?e.message:`OAuth flow failed.`)}finally{E(!1)}}let[A,ne]=T(!1);async function re(){ne(!0);try{await L5(),await e.invalidateQueries({queryKey:[`settings`]}),await e.invalidateQueries({queryKey:[`viewer`]}),await e.invalidateQueries({queryKey:[`teams`]}),await e.invalidateQueries({queryKey:[`agents`]}),await e.invalidateQueries({queryKey:[`my-issues`]})}finally{ne(!1)}}let ie=xr?chrome.identity.getRedirectURL():null,ae=_r(()=>({queryKey:[`slack-channels`,n().slackToken],queryFn:()=>nk(n().slackToken),enabled:!!n().slackToken,retry:0,staleTime:6e4})),oe=k(()=>Mx(n())),se=k(()=>{let e=oe();return e?`Drafting with ${e} — ${kx(n(),e,`fast`)} (fast) / ${kx(n(),e,`best`)} (best)`:null});return(()=>{var e=l7();return P(e,j(zj,{title:`Workflow`,get children(){return[(()=>{var e=R5();return P(e,j(We,{each:[{id:`cloud`,label:`Cloud · Linear + Cursor`},{id:`local`,label:`Local · clipboard`}],children:e=>(()=>{var t=u7();return t.$$click=()=>void r({workflowMode:e.id}),P(t,()=>e.label),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-1 text-[11.5px] font-medium transition-colors ${(n().workflowMode??`cloud`)===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),e})(),z5()]}}),null),P(e,j(zj,{title:`Capture`,get children(){return[(()=>{var e=B5(),t=e.firstChild;return t.addEventListener(`change`,e=>void r({captureShots:e.currentTarget.checked||void 0})),D(()=>t.checked=!!n().captureShots),e})(),V5()]}}),null),P(e,j(zj,{title:`Linear`,get children(){return j(M,{get when(){return i()},get fallback(){return(()=>{var e=m7();return P(e,j(Rj,{label:`Personal API key`,hint:`Create one at linear.app → Settings → API — fastest path.`,get children(){return[(()=>{var e=d7();return P(e,j(Mj,{type:`password`,placeholder:`lin_api_…`,get value(){return h()},onInput:e=>g(e.currentTarget.value),"on:keydown":e=>{e.key===`Enter`&&x()}}),null),P(e,j(q,{variant:`primary`,get loading(){return _()},get disabled(){return!h().trim()},onClick:()=>void x(),class:`shrink-0`,children:`Connect`}),null),e})(),j(M,{get when(){return y()},get children(){return j(Uj,{get message(){return y()}})}})]}}),null),P(e,j(M,{when:xr,get children(){return[f7(),j(Rj,{label:`OAuth client ID`,get children(){return[(()=>{var e=d7();return P(e,j(Mj,{placeholder:`your-client-id`,get value(){return S()||n().linearOauthClientId||``},onInput:e=>C(e.currentTarget.value)}),null),P(e,j(q,{variant:`ghost`,get loading(){return w()},onClick:()=>void te(),class:`shrink-0 whitespace-nowrap`,children:`Connect with OAuth`}),null),e})(),j(M,{get when(){return O()},get children(){return j(Uj,{get message(){return O()}})}}),(()=>{var e=p7(),t=e.firstChild.nextSibling.nextSibling;return P(t,ie),e})()]}})]}}),null),e})()},get children(){var e=U5(),t=e.firstChild;return P(t,j(M,{get when(){return!a.isLoading},get fallback(){return h7()},get children(){return j(M,{get when(){return a.data},get fallback(){return j(M,{get when(){return a.isError},get fallback(){return h7()},get children(){return j(Uj,{message:`Key rejected — reconnect`})}})},get children(){var e=H5(),t=e.firstChild.nextSibling,n=t.nextSibling.nextSibling;return P(t,()=>a.data.name),P(n,()=>a.data.email),e}})}})),P(e,j(q,{variant:`ghost`,get loading(){return A()},onClick:()=>void re(),class:`ml-2 shrink-0`,children:`Disconnect`}),null),e}})}}),null),P(e,j(M,{get when(){return i()},get children(){return j(zj,{title:`Workspace`,get children(){return[j(Rj,{label:`Default team`,get children(){return j(Pj,{get value(){return n().defaultTeamId??``},onChange:e=>{let t=e.currentTarget.value;r({defaultTeamId:t||void 0})},get disabled(){return o.isLoading},get children(){return[W5(),j(M,{get when(){return o.data},get children(){return j(We,{get each(){return o.data},children:e=>(()=>{var t=g7(),r=t.firstChild,i=r.nextSibling;return i.nextSibling,P(t,()=>e.name,r),P(t,()=>e.key,i),D(()=>t.selected=e.id===n().defaultTeamId),D(()=>t.value=e.id),t})()})}})]}})}}),j(Rj,{label:`Default project`,hint:`Every issue created from the panel is filed into this project.`,get children(){return j(Pj,{get value(){return n().defaultProjectId??``},onChange:e=>void r({defaultProjectId:e.currentTarget.value||void 0}),get disabled(){return s.isLoading},get children(){return[(()=>{var e=G5();return D(()=>e.selected=!n().defaultProjectId),e})(),j(We,{get each(){return s.data??[]},children:e=>(()=>{var t=_7();return P(t,()=>e.name),D(()=>t.selected=e.id===n().defaultProjectId),D(()=>t.value=e.id),t})()})]}})}}),j(Rj,{label:`Default labels`,hint:`Applied to every issue created from the panel.`,get children(){var e=K5();return P(e,j(We,{get each(){return p.data??[]},children:e=>{let t=()=>(n().defaultLabelIds??[]).includes(e.id);return(()=>{var i=v7(),a=i.firstChild;return i.$$click=()=>{let i=n().defaultLabelIds??[];r({defaultLabelIds:t()?i.filter(t=>t!==e.id):[...i,e.id]})},P(i,()=>e.name,null),D(n=>{var r=`h-6 cursor-pointer rounded-full border px-2.5 text-[11px] font-medium transition-colors ${t()?`bg-accent-soft text-accent border-accent/40`:`bg-surface-2 text-text-dim border-border hover:bg-surface-3`}`,o=e.color;return r!==n.e&&st(i,n.e=r),o!==n.t&&dt(a,`background`,n.t=o),n},{e:void 0,t:void 0}),i})()}})),e}}),(()=>{var e=q5(),t=e.firstChild;return t.addEventListener(`change`,e=>void r({shareLinearKey:e.currentTarget.checked})),D(()=>t.checked=!!n().shareLinearKey),e})(),j(Rj,{label:`Staging branch`,hint:`Stage buttons on PRs merge the PR branch here — point your staging domain (e.g. preview.ahmedbanihani.com) at this branch in Vercel.`,get children(){return j(Mj,{get value(){return n().stagingBranch??``},placeholder:`staging`,onChange:e=>void r({stagingBranch:e.currentTarget.value.trim()||void 0})})}}),j(Rj,{label:`Cursor agent`,hint:`App users in your workspace. Pick Cursor — requires the Cursor integration installed in Linear (workspace admin) with usage-based pricing enabled in Cursor.`,get children(){return j(M,{get when(){return $e(()=>!!m.data)()&&m.data.length===0},get fallback(){return j(Pj,{get value(){return n().cursorAgentId??``},onChange:e=>{let t=e.currentTarget.value;if(!t){r({cursorAgentId:void 0,cursorAgentName:void 0,cursorAgentUrl:void 0});return}let n=m.data?.find(e=>e.id===t);n&&r({cursorAgentId:n.id,cursorAgentName:n.displayName,cursorAgentUrl:n.url??void 0})},get disabled(){return m.isLoading},get children(){return[y7(),j(M,{get when(){return m.data},get children(){return j(We,{get each(){return m.data},children:e=>(()=>{var t=_7();return P(t,()=>e.displayName),D(()=>t.selected=e.id===n().cursorAgentId),D(()=>t.value=e.id),t})()})}})]}})},get children(){return J5()}})}}),j(Rj,{label:`Default repository`,hint:`Appended to delegated issues as [repo=…] so Cursor picks the right repo.`,get children(){return j(Mj,{placeholder:`owner/repository`,get value(){return n().defaultRepo??``},onBlur:e=>{r({defaultRepo:e.currentTarget.value.trim()||void 0})}})}}),j(Rj,{label:`Cursor cloud model`,hint:`Appended as [model=…] — e.g. claude-opus-4-8, gpt-5.2, composer. Empty = Cursor's default.`,get children(){return j(Mj,{placeholder:`Cursor's default`,get value(){return n().cursorModel??``},onBlur:e=>{r({cursorModel:e.currentTarget.value.trim()||void 0})}})}}),j(Rj,{label:`Agent instructions`,hint:`Appended to every issue as '### Agent instructions' and given to the AI draft. Add demo credentials (username/password) so the agent can log in, test, and record its video. Careful: credentials become visible to everyone who can read the issue.`,get children(){return[j(Nj,{rows:5,placeholder:_D,get value(){return n().issueTemplate??``},onBlur:e=>{r({issueTemplate:e.currentTarget.value.trim()||void 0})}}),Y5()]}}),j(Rj,{label:`Dev server log URL`,hint:`Tail of your dev-server log attached to issues (and fed to AI drafts). Serve the log over HTTP: "dev:http": "next dev 2>&1 | tee public/dev-server.log" (gitignore it), then use /dev-server.log here. Empty = disabled.`,get children(){return j(Mj,{placeholder:`/dev-server.log`,get value(){return n().logUrl??``},onBlur:e=>{r({logUrl:e.currentTarget.value.trim()||void 0})}})}}),j(Rj,{label:`Log lines to attach`,hint:`Trailing lines included in the issue (10–500).`,get children(){return j(Mj,{type:`number`,min:`10`,max:`500`,placeholder:`100`,get value(){return n().logLines??``},onBlur:e=>{let t=Number(e.currentTarget.value);r({logLines:Number.isFinite(t)&&t>0?Math.min(500,Math.max(10,Math.round(t))):void 0})}})}}),j(Rj,{label:`Skills & memory paths`,hint:`One path per line. The cloud agent works in a full repo checkout, so committed paths (e.g. .claude/skills/apple-hig-design-principles) are readable directly — every issue gets a MANDATORY-reading section pointing at them. Repo-relative for cloud agents; absolute paths also work when you paste the issue into a local Claude Code session. Per project: these settings live per dev origin.`,get children(){return j(Nj,{rows:4,placeholder:`.claude/skills/apple-hig-design-principles
289
+ `);await navigator.clipboard.writeText(t),Ae(!0),setTimeout(()=>Ae(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},Me=()=>{e6.clear(),we([]),r(null)};return(()=>{var t=C3(),a=t.firstChild;a.firstChild;var o=a.nextSibling,s=o.firstChild.firstChild.nextSibling,d=o.nextSibling,p=d.firstChild.firstChild,h=p.firstChild;h.firstChild;var _=p.nextSibling;return P(a,j(q,{variant:`primary`,class:`h-7 shrink-0 px-2.5 text-[11.5px]`,get loading(){return i()===`extract`},onClick:()=>void Te(),get children(){return u3()}}),null),P(t,j(M,{get when(){return c()},get children(){return j(qj,{get message(){return c()}})}}),o),P(t,j(M,{get when(){return e().length>0},get fallback(){return j(Kj,{title:`No genomes yet`,children:`Click Extract and pick any component on the page — a dropdown, a card, a sidebar row. Then "Capture states" while you hover/open it to record the styles that only exist during interaction.`})},get children(){return[(()=>{var t=d3();return t.firstChild,P(t,j(We,{get each(){return e()},children:e=>{let t=()=>n()===e.id;return(()=>{var n=O3(),a=n.firstChild,o=a.nextSibling,s=o.firstChild,c=s.firstChild,l=c.nextSibling,d=l.firstChild,p=d.nextSibling;p.nextSibling;var m=l.nextSibling;return s.$$click=()=>r(t()?null:e.id),P(c,()=>e.genome.title),P(l,()=>e.genome.nodes.length,d),P(l,(()=>{var t=$e(()=>!!e.genome.states.length);return()=>t()?` · ${e.genome.states.length} states`:``})(),p),P(l,()=>Yj(e.genome.extractedAt),null),P(o,j(M,{get when(){return t()},get children(){var t=D3(),n=t.firstChild,r=n.nextSibling,a=r.nextSibling;return P(n,()=>e.genome.pageUrl),P(r,j(We,{get each(){return e.genome.nodes},children:e=>(()=>{var t=A3(),n=t.firstChild;return P(n,()=>e.label,null),P(n,j(M,{get when(){return e.count>1},get children(){var t=k3();return t.firstChild,P(t,()=>e.count,null),t}}),null),P(t,j(We,{get each(){return Object.entries(e.styles)},children:([t,n])=>(()=>{var r=M3(),i=r.firstChild;return P(r,t,i),P(r,n,null),P(r,j(M,{get when(){return e.tokens[t]},get children(){var n=j3(),r=n.firstChild.nextSibling;return r.nextSibling,P(n,()=>e.tokens[t],r),n}}),null),r})()}),null),t})()}),null),P(r,j(M,{get when(){return e.genome.states.length>0},get children(){return[w3(),j(We,{get each(){return e.genome.states},children:e=>(()=>{var t=N3(),n=t.firstChild,r=n.firstChild;return P(n,()=>e.label,r),P(n,()=>e.trigger,null),P(t,j(We,{get each(){return Object.entries(e.changed)},children:([e,t])=>(()=>{var n=P3(),r=n.firstChild,i=r.nextSibling;return i.nextSibling,P(n,e,r),P(n,()=>t.from,i),P(n,()=>t.to,null),n})()}),null),t})()})]}}),null),P(a,j(M,{get when(){return $e(()=>i()===e.id)()&&f().active},get fallback(){return j(q,{class:`size-7 px-0`,variant:`ghost`,get loading(){return i()===e.id},title:`Capture states — records hover/focus/open styles for 8s while you interact; the pill shows the timer and Stop`,"aria-label":`Capture interaction states`,onClick:()=>void Ee(e),get children(){return F3()}})},get children(){return[j(q,{class:`text-danger size-7 px-0`,variant:`ghost`,get title(){return`Stop recording — ${Math.ceil(f().msLeft/1e3)}s left · ${f().total} captured`},"aria-label":`Stop recording states`,onClick:()=>_2(),get children(){return T3()}}),(()=>{var e=E3(),t=e.firstChild,n=t.nextSibling;return n.nextSibling,P(e,()=>Math.ceil(f().msLeft/1e3),t),P(e,()=>f().total,n),e})()]}}),null),P(a,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return u()===e.id?`Copied!`:`Copy spec — markdown for an agent or issue`},"aria-label":`Copy genome spec`,onClick:()=>void De(e),get children(){return j(M,{get when(){return u()===e.id},get fallback(){return I3()},get children(){return f3()}})}}),null),P(a,j(q,{class:`text-danger ml-auto size-7 px-0`,variant:`ghost`,title:`Delete this genome`,"aria-label":`Delete genome`,onClick:()=>Oe(e.id),get children(){return p3()}}),null),t}}),null),D(e=>{var n={"bg-accent border-accent":t()},r=!!t();return e.e=lt(a,n,e.e),r!==e.t&&m.classList.toggle(`rotate-180`,e.t=r),e},{e:void 0,t:void 0}),n})()}}),null),t})(),(()=>{var e=m3();return P(e,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return ke()?`Copied!`:`Copy all genomes as one markdown document`},"aria-label":`Copy all genomes`,onClick:()=>void je(),get children(){return j(M,{get when(){return ke()},get fallback(){return I3()},get children(){return f3()}})}}),null),P(e,j(q,{class:`text-danger size-7 px-0`,variant:`ghost`,title:`Delete all saved genomes`,"aria-label":`Delete all genomes`,onClick:Me,get children(){return p3()}}),null),e})()]}}),o),P(s,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return g()?`Live capture ON — recording transitions fired by your input. Click to pause.`:`Live capture PAUSED — click to resume recording input-triggered transitions.`},get"aria-label"(){return g()?`Pause live capture`:`Start live capture`},onClick:()=>q2(!g()),get children(){return j(M,{get when(){return g()},get fallback(){return L3()},get children(){return h3()}})}}),null),P(s,j(q,{variant:`ghost`,class:`h-7 px-2.5 text-[11.5px]`,get loading(){return v()},onClick:()=>void S(),get children(){return g3()}}),null),P(o,j(M,{get when(){return m().length>0},get fallback(){return R3()},get children(){return[(()=>{var e=_3();return P(e,j(We,{get each(){return m()},children:e=>(()=>{var t=H3(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.firstChild,s=n.nextSibling,c=s.nextSibling;return P(r,()=>e.mode===`live`?`live`:`audit`),P(i,()=>e.component??e.element,null),P(i,j(M,{get when(){return e.count>1},get children(){return[` ×`,$e(()=>e.count)]}}),null),P(a,()=>e.durationMs,o),P(a,(()=>{var t=$e(()=>!!e.delayMs);return()=>t()?` +${e.delayMs}`:``})(),null),P(t,j(M,{get when(){return e.source},get children(){var t=z3();return P(t,()=>e.source),t}}),s),P(s,()=>e.properties.join(`, `),null),P(s,j(M,{get when(){return e.sinceInputMs!=null},get children(){return[` — fired `,$e(()=>e.sinceInputMs),`ms after input`]}}),null),P(t,j(M,{get when(){return e.jankProps?.length},get children(){var t=B3();return t.firstChild,P(t,()=>e.jankProps.join(`, `),null),t}}),c),P(t,j(M,{get when(){return e.easing},get children(){var t=V3();return t.firstChild,P(t,()=>e.easing,null),t}}),c),P(c,()=>e.suggestion),t})()})),e})(),(()=>{var e=y3();return P(e,j(q,{class:`size-7 px-0`,variant:`primary`,get title(){return w()?`Copied!`:`Copy AI prompt — report + fix rules, ready to paste into a Claude Code session`},"aria-label":`Copy AI fix prompt`,onClick:()=>void O(),get children(){return j(M,{get when(){return w()},get fallback(){return U3()},get children(){return v3()}})}}),null),P(e,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return b()?`Copied!`:`Copy report — plain markdown findings`},"aria-label":`Copy report`,onClick:()=>void C(),get children(){return j(M,{get when(){return b()},get fallback(){return I3()},get children(){return f3()}})}}),null),P(e,j(q,{class:`text-danger ml-auto size-7 px-0`,variant:`ghost`,title:`Clear all findings (live + audit)`,"aria-label":`Clear all findings`,onClick:U2,get children(){return p3()}}),null),e})()]}}),null),P(h,j(M,{get when(){return _e()>1},get children(){var e=b3(),t=e.firstChild.nextSibling;return t.nextSibling,P(e,_e,t),e}}),null),P(_,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return te()?`Live scan ON — re-scans automatically ~1s after each route change. Click to pause.`:`Live scan PAUSED — click to auto-scan every page you navigate to.`},get"aria-label"(){return te()?`Pause live scan`:`Start live scan`},onClick:()=>i3(!te()),get children(){return j(M,{get when(){return te()},get fallback(){return L3()},get children(){return h3()}})}}),null),P(_,j(q,{variant:`ghost`,class:`h-7 px-2.5 text-[11.5px]`,get loading(){return ne()},title:`Scan this page — cumulative: keeps other pages' findings, replaces this page's`,onClick:he,get children(){return x3()}}),null),P(d,j(M,{get when(){return k().length>0},get fallback(){return W3()},get children(){return[(()=>{var e=S3(),t=e.firstChild,n=t.firstChild,r=t.nextSibling,i=r.firstChild;return t.$$click=()=>ce(!se()),P(t,be,n),r.$$click=()=>ue(!le()),P(r,xe,i),D(e=>{var n={"text-danger bg-danger/10 border-danger/40":se(),"text-text-faint":!se()},i=se(),a={"text-warn bg-warn/10 border-warn/40":le(),"text-text-faint":!le()},o=le();return e.e=lt(t,n,e.e),i!==e.t&&it(t,`aria-pressed`,e.t=i),e.a=lt(r,a,e.a),o!==e.o&&it(r,`aria-pressed`,e.o=o),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),(()=>{var e=_3();return P(e,j(We,{get each(){return ye()},children:e=>{let t=e[0],n=()=>ie()===t.ruleId;return(()=>{var r=K3(),i=r.firstChild,a=i.firstChild,o=a.nextSibling,s=o.nextSibling;s.firstChild;var c=s.nextSibling;return i.$$click=()=>oe(n()?null:t.ruleId),P(o,()=>t.ruleId),P(s,()=>e.reduce((e,t)=>e+(t.count??1),0),null),P(r,j(M,{get when(){return n()},get children(){var n=G3(),r=n.firstChild;return P(r,()=>t.description),P(n,j(We,{each:e,children:e=>(()=>{var t=Y3(),n=t.firstChild,r=n.nextSibling;return t.$$click=()=>{t6(e)||l(e.page===location.pathname?`Element is gone — run Scan again.`:`This finding is on ${e.page} — navigate there to reveal it.`)},P(n,j(M,{get when(){return _e()>1},get children(){var t=q3(),n=t.firstChild;return P(t,()=>e.page,n),t}}),null),P(n,j(M,{get when(){return e.component},get children(){var t=q3(),n=t.firstChild;return P(t,()=>e.component,n),t}}),null),P(n,()=>e.selector,null),P(n,j(M,{get when(){return(e.count??1)>1},get children(){var t=J3();return t.firstChild,P(t,()=>e.count,null),t}}),null),P(t,j(M,{get when(){return e.source},get children(){var t=z3();return P(t,()=>e.source),t}}),r),P(r,()=>e.evidence),t})()}),null),n}}),null),D(e=>{var r=t.severity===`error`,i=t.severity===`warn`,o=!!n();return r!==e.e&&a.classList.toggle(`bg-danger`,e.e=r),i!==e.t&&a.classList.toggle(`bg-warn`,e.t=i),o!==e.a&&c.classList.toggle(`rotate-180`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),r})()}})),e})(),(()=>{var e=y3();return P(e,j(q,{class:`size-7 px-0`,variant:`primary`,get title(){return pe()?`Copied!`:`Copy AI prompt — findings + contract fix rules, ready for a Claude Code session`},"aria-label":`Copy AI fix prompt`,onClick:()=>void Ce(),get children(){return j(M,{get when(){return pe()},get fallback(){return U3()},get children(){return v3()}})}}),null),P(e,j(q,{class:`size-7 px-0`,variant:`ghost`,get title(){return de()?`Copied!`:`Copy report — findings grouped by rule, markdown`},"aria-label":`Copy slop report`,onClick:()=>void Se(),get children(){return j(M,{get when(){return de()},get fallback(){return I3()},get children(){return f3()}})}}),null),P(e,j(q,{class:`text-danger ml-auto size-7 px-0`,variant:`ghost`,title:`Clear scan results`,"aria-label":`Clear scan results`,onClick:ge,get children(){return p3()}}),null),e})()]}}),null),t})()}rt([`click`]);function r6(e){return Math.round(e*10)/10}function i6(e,t,n){return e.rules[t]?.severity??n}var a6=/^(HotReload|Head|AppRouterAnnouncer|HistoryUpdater|AppRouter|Router|ServerRoot|SegmentViewNode|SegmentViewStateNode|SegmentStateProvider|InnerLayoutRouter|OuterLayoutRouter|TemplateContext|RenderFromTemplateContext|ScrollAndFocusHandler|RedirectBoundary|RedirectErrorBoundary|LoadingBoundary|ErrorBoundary|ErrorBoundaryHandler|HTTPAccessFallbackBoundary|HTTPAccessFallbackErrorBoundary|DevRootHTTPAccessFallbackBoundary|__next_root_layout_boundary__|Preloads|NonIndex|ReplaySsrOnlyErrors|AppDevOverlay\w*|DevOverlay\w*|PseudoHtml\w*)$/;function o6(e){return e?.length?e.map(e=>{try{let t=new RegExp(e);return e=>t.test(e)}catch{return t=>t===e}}):[]}function s6(e,t){if(e.length<=2||a6.test(e))return!0;for(let n of t)if(n(e))return!0;return!1}function c6(e){let t=new Map;for(let n of e)for(let e of n.entries){let n=t.get(e.name);n||(n={name:e.name,updates:[],selfTime:0,el:e.el??void 0},t.set(e.name,n)),n.selfTime+=e.selfTime,e.el&&!n.el&&(n.el=e.el),e.phase===`update`&&n.updates.push(e.changes)}return t}function l6(e,t,n){let r=[],i=o6(n?.ignore),a=e.map(e=>({...e,entries:e.entries.filter(e=>!s6(e.name,i)),mounts:Object.fromEntries(Object.entries(e.mounts).filter(([e])=>!s6(e,i)))})),o=c6(a),s=t.budgets;return v6(r,()=>{let e=[];for(let n of o.values()){if(n.updates.length<5||!n.updates.every(e=>e.length===0))continue;let r=n.updates.length;e.push({ruleId:`R9`,shape:`B`,severity:i6(t,`R9`,`error`),suspected:!0,description:`suspected R9 — ${n.name} re-rendered ${r}× with zero prop changes (dead memo or subscription-in-body)`,component:n.name,source:null,renders:r,selfTime:r6(n.selfTime),changes:[],evidence:`${r} renders · ${r6(n.selfTime)}ms self · all props identity-equal`,el:n.el})}return e}),v6(r,()=>{let e=[];for(let n of o.values()){if(n.updates.length<5||!n.updates.every(e=>e.length>0&&e.every(e=>/\((?:fn|ref)\)$/.test(e))))continue;let r=Array.from(new Set(n.updates.flat())),i=n.updates.length,a=r.join(`, `);e.push({ruleId:`R5`,shape:`B`,severity:i6(t,`R5`,`error`),suspected:!0,description:`suspected R5 — ${i} renders of ${n.name} with fresh ${a} identity per parent render (memo defeated)`,component:n.name,source:null,renders:i,selfTime:r6(n.selfTime),changes:r,evidence:`${i} renders · ${r6(n.selfTime)}ms self · churning ${a}`,el:n.el})}return e}),v6(r,()=>{let e=[],n=/Tooltip|Menu|Popover|Context|Dialog|Dropdown/i;for(let r of a)for(let i of Object.keys(r.mounts)){let a=r.mounts[i];if(a<(n.test(i)?10:15))continue;let o=r.entries.find(e=>e.name===i&&e.el);e.push({ruleId:`R4`,shape:`A`,severity:i6(t,`R4`,`error`),suspected:!0,description:`suspected R4 — ${a} ${i} instances mounted in one commit (per-row overlays should mount on intent)`,component:i,source:null,renders:a,selfTime:0,changes:[],evidence:`${i} ×${a} mounted in one commit`,el:o?.el??void 0})}return e}),v6(r,()=>{let e=[];for(let t of a){if(t.duration<=s.commitMs)continue;let n=[...t.entries].sort((e,t)=>t.selfTime-e.selfTime).slice(0,3).map(e=>`${e.name} ${r6(e.selfTime)}ms`).join(`, `),r=r6(t.duration),i=t.duration>16?` · ~${Math.round(1e3/t.duration)} FPS`:``;e.push({ruleId:null,shape:null,severity:`error`,suspected:!1,description:`commit exceeded budget: ${r}ms of React work (> ${s.commitMs}ms) — top: ${n}`,component:null,source:null,renders:t.entries.length,selfTime:r,changes:[],evidence:`${r}ms commit · ${t.entries.length} components${i}`})}return e}),v6(r,()=>{let e=[],t=new Map;for(let e of a){let n=new Map,r=new Map;for(let t of e.entries)n.set(t.name,(n.get(t.name)??0)+t.selfTime),t.el&&!r.has(t.name)&&r.set(t.name,t.el);for(let[e,i]of n){if(i<=s.selfMs)continue;let n=t.get(e)??{hits:0,worst:0,total:0,el:r.get(e)};n.hits+=1,n.worst=Math.max(n.worst,i),n.total+=i,n.el||=r.get(e),t.set(e,n)}}for(let[n,r]of t)r.hits<3||e.push({ruleId:null,shape:null,severity:`warn`,suspected:!1,description:`${n} is a hot component: ${r.hits} commits over the ${s.selfMs}ms self budget`,component:n,source:null,renders:r.hits,selfTime:r6(r.total),changes:[],evidence:`${r.hits} commits over ${s.selfMs}ms self (worst ${r6(r.worst)}ms)`,el:r.el});return e}),v6(r,()=>{let n=[],r=g6(e.filter(e=>e.nearInput).map(e=>e.at).sort((e,t)=>e-t),1e3);return r>=5&&n.push({ruleId:`R10`,shape:`B`,severity:i6(t,`R10`,`error`),suspected:!0,description:`suspected R10 — ${r} React commits during scroll/pointer movement (frame-rate state updates)`,component:null,source:null,renders:r,selfTime:0,changes:[],evidence:`${r} commits within a 1s scroll/pointer window`}),n}),v6(r,()=>{let n=[],{count:r,span:i}=_6(e.filter(e=>!e.nearInput).map(e=>e.at).sort((e,t)=>e-t),300);return r>=8&&n.push({ruleId:`R24`,shape:`B`,severity:i6(t,`R24`,`warn`),suspected:!0,description:`suspected R24 — ${r} commits in ${Math.round(i)}ms burst (multi-row writes / un-coalesced pokes?)`,component:null,source:null,renders:r,selfTime:0,changes:[],evidence:`${r} commits in a ${Math.round(i)}ms burst (no input)`}),n}),v6(r,()=>{let e=[];if(!m6())return e;for(let n of o.values()){if(n.updates.length<3)continue;let r=n.el?.deref();if(!r)continue;let i=!1;try{let e=r.getBoundingClientRect();i=!r.isConnected||e.width===0&&e.height===0}catch{continue}if(!i)continue;let a=n.updates.length;e.push({ruleId:`R3`,shape:`C`,severity:i6(t,`R3`,`error`),suspected:!0,description:`suspected R3 — ${n.name} re-rendered ${a}× while its DOM is hidden/detached (closed host without everOpened gate?) [R3/R7/R23 family]`,component:n.name,source:null,renders:a,selfTime:r6(n.selfTime),changes:[],evidence:`${a} renders while hidden/detached · ${r6(n.selfTime)}ms self`,el:n.el})}return e}),y6(r)}var u6=`#linear-grab-root, [data-linear-grab], [data-react-grab], #claude-agent-glow-border, [id^="react-scan"]`;function d6(e=typeof document<`u`?document:{}){let t=[];return v6(t,()=>{let t=[],n=Array.from(e.querySelectorAll(`[role="slider"], [role="progressbar"], [role="switch"]`)),r=h6(e);for(let e of n){if(e.closest(u6))continue;if(r)try{let t=e.getBoundingClientRect();if(t.width<2||t.height<2)continue}catch{}if(!f6(e))continue;let n=e.getAttribute(`role`)??`widget`;t.push({ruleId:`R8`,shape:`D`,severity:`warn`,suspected:!0,description:`suspected R8 — interactive ${n} widget used as a static picture (mount a CSS mock instead)`,component:null,source:null,renders:0,selfTime:0,changes:[],evidence:p6(e),el:typeof WeakRef<`u`?new WeakRef(e):void 0})}return t}),y6(t)}function f6(e){if(e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`)return!0;let t=e;for(let e=0;t&&e<=3;e++){try{if(getComputedStyle(t).pointerEvents===`none`)return!0}catch{}t=t.parentElement}return!1}function p6(e){let t=typeof e.className==`string`&&e.className?`.`+e.className.split(/\s+/).filter(Boolean).slice(0,2).join(`.`):``;return`${e.tagName.toLowerCase()}${t}`}function m6(){return typeof document>`u`?!1:(document.documentElement?.getBoundingClientRect().width??0)>0}function h6(e){return((e.documentElement??(typeof document<`u`?document.documentElement:null))?.getBoundingClientRect().width??0)>0}function g6(e,t){let n=0,r=0;for(let i=0;i<e.length;i++){for(;e[i]-e[r]>t;)r++;n=Math.max(n,i-r+1)}return n}function _6(e,t){let n=0,r=0,i=0;for(let a=0;a<e.length;a++){for(;e[a]-e[i]>t;)i++;let o=a-i+1;o>n&&(n=o,r=e[a]-e[i])}return{count:n,span:r}}function v6(e,t){try{e.push(...t())}catch{}}function y6(e){let t=new Map;for(let n of e){let e=`${n.ruleId}|${n.component}|${n.changes.join()}|${n.description}`,r=t.get(e);r?r.count=(r.count??1)+1:t.set(e,n)}return[...t.values()]}function b6(e){let t=new Map;for(let n of e){let e=n.ruleId??`budget`,r=t.get(e);r?r.push(n):t.set(e,[n])}let n=Array.from(t.entries()).sort((e,t)=>{let n=e[1][0].severity===`error`?0:1,r=t[1][0].severity===`error`?0:1;return n===r?t[1].length===e[1].length?e[0].localeCompare(t[0]):t[1].length-e[1].length:n-r}),r=e.reduce((e,t)=>e+(t.count??1),0),i=e.filter(e=>e.severity===`error`).reduce((e,t)=>e+(t.count??1),0),a=[`# Render scan — ${i} error${i===1?``:`s`}, ${r-i} warn (${r} total)`,``,`Diagnoses are SUSPECTED (heuristic). The numbers (renders, self ms) are measured.`,``];for(let[e,t]of n){let n=t[0],r=t.reduce((e,t)=>e+(t.count??1),0);a.push(`## ${e} — ${n.severity} ×${r}`);for(let e of t){let t=e.component||e.source?` — ${[e.component,e.source].filter(Boolean).join(` @ `)}`:``,n=(e.count??1)>1?` ×${e.count}`:``;a.push(`- ${e.description}${n}${t}`),a.push(` ${e.evidence}`)}a.push(``)}return a.join(`
290
+ `)}function x6(e,t){let n=Array.from(new Set(e.map(e=>e.ruleId).filter(e=>!!e))).sort(),r=[];for(let e of n){let n=t.rules[e];n&&n.fixText?r.push(`- ${e} (${n.slug}): ${n.fixText}`):r.push(`- ${e}: see React-rerender-primitives.md ${e}`)}return[`Below is a RENDER-SCAN report from my running app — each finding is a measured`,`React re-render pattern graded against the re-render contract`,"(`React-rerender-primitives.md`). Rules are R-numbered.",``,`READ THIS FIRST: the DIAGNOSES are SUSPECTED — they are heuristic guesses at the`,`cause. The NUMBERS (render counts, self ms, FPS) are EXACT measurements. Trust the`,`numbers; verify each diagnosis against the code before you "fix" it.`,``,`How to fix:`,`1. Fix at the source of the identity churn / wasted render, not the symptom —`,` stabilize props (useCallback/useMemo, hoist constants), gate work behind an`,` everOpened/visible check, mount per-row overlays on intent.`,`2. Each distinct rule and its canonical fix:`,...r.map(e=>` ${e}`),`3. PROOF REQUIRED: after the change I will re-record and re-scan — the flagged`,` components must show the render counts drop. State what you changed per`,` component; do not claim done blind.`,``,`---`,``,b6(e)].join(`
291
+ `)}var S6=`bippy-0.5.43`,C6=Object.defineProperty,w6=Object.prototype.hasOwnProperty,T6=()=>{},E6=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build`)})}catch{}},D6=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e),O6=!1,k6,A6=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>O6?!0:(e&&typeof e.inject==`function`&&(k6=e.inject.toString()),!!k6?.includes(`(injected)`)),j6=new Set,M6=new Set,N6=e=>{let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:S6,checkDCE:E6,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),M6.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,j6.forEach(e=>e())),i},on:T6,onCommitFiberRoot:T6,onCommitFiberUnmount:T6,onPostCommitFiberRoot:T6,renderers:t,supportsFiber:!0,supportsFlight:!0};try{C6(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{M6.add(e),t.renderers.set(n,e)}),P6(e))}}});let t=window.hasOwnProperty,n=!1;C6(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{P6(e)}return r},P6=e=>{e&&j6.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=E6,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=S6,t._instrumentationIsActive=!1;let e=D6(t);if(e||(t.on=T6),t.renderers.size){t._instrumentationIsActive=!0,j6.forEach(e=>e());return}let n=t.inject,r=A6(t);r&&!e&&(O6=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return M6.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,j6.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||A6())&&e?.()}catch{}},F6=()=>w6.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),I6=e=>F6()?(P6(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):N6(e),L6=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`));(()=>{try{L6()&&I6()}catch{}})();var R6=60111,z6=`Symbol(react.concurrent_mode)`,B6=`Symbol(react.async_mode)`,V6=e=>{switch(e.tag){case 5:case 26:case 27:return!0;default:return typeof e.type==`string`}},H6=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},U6=e=>{let t=e.memoizedProps,n=e.alternate?.memoizedProps||{},r=e.flags??e.effectTag??0;switch(e.tag){case 1:case 9:case 11:case 0:case 14:case 15:return(r&1)==1;default:return!e.alternate||n!==t||e.alternate.memoizedState!==e.memoizedState||e.alternate.ref!==e.ref}},W6=e=>{switch(e.tag){case 18:return!0;case 7:case 6:case 23:case 22:return!0;case 3:return!1;default:{let t=typeof e.type==`object`&&e.type!==null?e.type.$$typeof:e.type;switch(typeof t==`symbol`?t.toString():t){case R6:case z6:case B6:return!0;default:return!1}}}},G6=(e,t=!1)=>{let n=K6(e,V6,t);return n||=K6(e,V6,!t),n};function K6(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await J6(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=q6(i,t,n);if(e)return e;i=n?null:i.sibling}return null}var q6=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=q6(r,t,n);if(e)return e;r=n?null:r.sibling}return null},J6=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await J6(r,t,n);if(e)return e;r=n?null:r.sibling}return null},Y6=e=>{let t=e?.actualDuration??0,n=t,r=e?.child??null;for(;t>0&&r!=null;)n-=r.actualDuration??0,r=r.sibling;return{selfTime:n,totalTime:t}},X6=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?X6(t.type||t.render):null},Z6=e=>{let t=e;if(typeof t==`string`)return t;if(typeof t!=`function`&&!(typeof t==`object`&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=X6(t);return r&&(r.displayName||r.name)||null},Q6=0,$6=new WeakMap,e8=(e,t=Q6++)=>{$6.set(e,t)},t8=e=>{let t=$6.get(e);return!t&&e.alternate&&(t=$6.get(e.alternate)),t||(t=Q6++,e8(e,t)),t},n8=(e,t,n)=>{let r=t;for(;r!=null;){if($6.has(r)||t8(r),!W6(r)&&U6(r)&&e(r,`mount`),r.tag===13)if(r.memoizedState!==null){let t=r.child,n=t?t.sibling:null;if(n){let t=n.child;t!==null&&n8(e,t,!1)}}else{let t=null;r.child!==null&&(t=r.child.child),t!==null&&n8(e,t,!1)}else r.child!=null&&n8(e,r.child,!0);r=n?r.sibling:null}},r8=(e,t,n,r)=>{if($6.has(t)||t8(t),!n)return;$6.has(n)||t8(n);let i=t.tag===13,a=!W6(t);a&&U6(t)&&e(t,`update`);let o=i&&n.memoizedState!==null,s=i&&t.memoizedState!==null;if(o&&s){let r=t.child?.sibling??null,i=n.child?.sibling??null;r!==null&&i!==null&&r8(e,r,i,t)}else if(o&&!s){let n=t.child;n!==null&&n8(e,n,!0)}else if(!o&&s){a8(e,n);let r=t.child?.sibling??null;r!==null&&n8(e,r,!0)}else if(t.child!==n.child){let n=t.child;for(;n;){if(n.alternate){let i=n.alternate;r8(e,n,i,a?t:r)}else n8(e,n,!1);n=n.sibling}}},i8=(e,t)=>{(t.tag===3||!W6(t))&&e(t,`unmount`)},a8=(e,t)=>{let n=t.tag===13&&t.memoizedState!==null,r=t.child;for(n&&(r=(t.child?.sibling??null)?.child??null);r!==null;)r.return!==null&&(i8(e,r),a8(e,r)),r=r.sibling},o8=0,s8=new WeakMap,c8=(e,t)=>{let n=`current`in e?e.current:e,r=s8.get(e);r||(r={id:o8++,prevFiber:null},s8.set(e,r));let{prevFiber:i}=r;if(!n)i8(t,n);else if(i!==null){let e=i&&i.memoizedState!=null&&i.memoizedState.element!=null&&i.memoizedState.isDehydrated!==!0,r=n.memoizedState!=null&&n.memoizedState.element!=null&&n.memoizedState.isDehydrated!==!0;!e&&r?n8(t,n,!1):e&&r?r8(t,n,n.alternate,null):e&&!r&&i8(t,n)}else n8(t,n,!0);r.prevFiber=n},l8=e=>{let t=I6(e.onActive);t._instrumentationSource=e.name??S6;let n=t.onCommitFiberRoot;if(e.onCommitFiberRoot){let r=(t,i,a)=>{n!==r&&(n?.(t,i,a),e.onCommitFiberRoot?.(t,i,a))};t.onCommitFiberRoot=r}let r=t.onCommitFiberUnmount;if(e.onCommitFiberUnmount){let n=(i,a)=>{t.onCommitFiberUnmount===n&&(r?.(i,a),e.onCommitFiberUnmount?.(i,a))};t.onCommitFiberUnmount=n}let i=t.onPostCommitFiberRoot;if(e.onPostCommitFiberRoot){let n=(r,a)=>{t.onPostCommitFiberRoot===n&&(i?.(r,a),e.onPostCommitFiberRoot?.(r,a))};t.onPostCommitFiberRoot=n}return t},u8=!1,d8=!1,f8=[],p8=-1/0,m8=200,h8=4e3,g8=100;function _8(){p8=y8()}var v8=[`scroll`,`wheel`,`pointermove`];function y8(){return typeof performance<`u`?performance.now():Date.now()}function b8(e,t){let n=e&&typeof e==`object`?e:{},r=t&&typeof t==`object`?t:{},i=new Set([...Object.keys(n),...Object.keys(r)]),a=[];for(let e of i){if(e===`children`)continue;let t=n[e],i=r[e];Object.is(t,i)||(typeof t==`function`&&typeof i==`function`?a.push(`prop:${e}(fn)`):t&&i&&typeof t==`object`&&typeof i==`object`&&x8(t,i)?a.push(`prop:${e}(ref)`):a.push(`prop:${e}`))}return a}function x8(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.is(e[r],t[r]))return!1;return!0}function S8(e){let t=[],n={};c8(e,(e,r)=>{if(r===`unmount`||!H6(e))return;let i=Z6(e.type)??`Anonymous`;r===`mount`&&(n[i]=(n[i]??0)+1);let a=0;try{a=Y6(e).selfTime||0}catch{}let o=[];if(r===`update`&&e.alternate)try{o=b8(e.alternate.memoizedProps,e.memoizedProps)}catch{o=[`prop:(unknown)`]}let s=null;try{let t=G6(e)?.stateNode;t&&typeof WeakRef<`u`&&t instanceof Element&&(s=new WeakRef(t))}catch{}t.push({name:i,selfTime:a,phase:r===`mount`?`mount`:`update`,changes:o,el:s})}),t.sort((e,t)=>t.selfTime-e.selfTime);let r=t.slice(0,m8),i=Math.max(0,t.length-m8),a=0;for(let e of t)a+=e.selfTime;let o=y8(),s=o-p8<=g8;f8.push({at:o,duration:a,entries:r,droppedEntries:i,mounts:n,nearInput:s})}function C8(){if(!u8&&!(typeof window>`u`)){u8=!0;try{l8({onCommitFiberRoot:(e,t)=>{if(d8&&!(f8.length>=h8))try{S8(t)}catch{}}})}catch{}}}function w8(){if(!(typeof window>`u`)&&!d8){f8=[],p8=-1/0,C8();try{for(let e of v8)window.addEventListener(e,_8,{capture:!0,passive:!0})}catch{}d8=!0}}function T8(){d8=!1;try{for(let e of v8)window.removeEventListener(e,_8,{capture:!0})}catch{}let e=f8;return f8=[],p8=-1/0,e}function E8(){let e=f8;return f8=[],e}var D8={budgets:{selfMs:2,commitMs:8},rules:{}},O8=/^###\s+(R\d+)\s*[·.\-–—:]?\s*`([^`]+)`.*?\((error|warn)\)\s*$/;function k8(e){return O8.test(e.trim())}function A8(e,t){let n=e.split(`
292
+ `),r=RegExp(`^\\s*\\*\\*${t.source}[^*]*:\\*\\*\\s*(.*)$`,`i`),i=/^\s*\*\*[^*]+:\*\*/,a=0;for(;a<n.length&&!r.test(n[a]);a++);if(a>=n.length)return``;let o=n[a].replace(r,`$1`),s=[];for(o.trim()&&s.push(o.trim()),a+=1;a<n.length;a++){let e=n[a];if(i.test(e)||/^###\s/.test(e)||/^##\s/.test(e)||/^---\s*$/.test(e))break;if(e.trim())s.push(e.trim());else if(s.length){let e=a+1;for(;e<n.length&&!n[e].trim();)e++;if(e>=n.length||i.test(n[e])||/^###\s|^##\s|^---\s*$/.test(n[e]))break}}return j8(s.join(` `)).trim()}function j8(e){return e.replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/__([^_]+)__/g,`$1`).replace(/(^|[\s(])[*_]([^*_\s][^*_]*?)[*_]([\s.,;:)]|$)/g,`$1$2$3`).replace(/\s{2,}/g,` `)}function M8(e){let t=e.match(/≤(\d+(?:\.\d+)?)ms self/),n=e.match(/commit >(\d+(?:\.\d+)?)ms/)??e.match(/>(\d+(?:\.\d+)?)ms of React work/);return{selfMs:t?parseFloat(t[1]):D8.budgets.selfMs,commitMs:n?parseFloat(n[1]):D8.budgets.commitMs}}function N8(e){let t=M8(e),n={},r=e.split(`
293
+ `),i=0;for(;i<r.length;){let e=r[i];if(!k8(e)){i++;continue}let t=e.trim(),a=[],o=i+1;for(;o<r.length;o++){let e=r[o];if(k8(e)||/^##\s/.test(e.trim())||/^---\s*$/.test(e.trim()))break;a.push(e)}try{let e=t.match(O8);if(e){let[,t,r,i]=e,o=a.join(`
294
+ `);n[t]={id:t,slug:r,severity:i===`warn`?`warn`:`error`,ruleText:A8(o,/Rule/),fixText:A8(o,/Fix/),detectText:A8(o,/Detect/)}}}catch{}i=o}return{budgets:t,rules:n}}Br();var P8=[],F8=new Set;function I8(e){return F8.add(e),e(P8),()=>void F8.delete(e)}function L8(){P8=[];for(let e of F8)e(P8)}function R8(e,t){P8=[...e,...P8.filter(e=>e.page!==t)];for(let e of F8)e(P8);return u5(e).then(()=>{P8=[...P8];for(let e of F8)e(P8);d5(e)}),e}var z8=new Set,B8=!1,V8=null;function H8(e){return z8.add(e),e(B8,V8),()=>void z8.delete(e)}function U8(){if(!(G8||B8)){w8(),B8=!0,V8=Date.now();for(let e of z8)e(!0,V8)}}async function W8(){if(!B8)return[];let e=T8();B8=!1,V8=null;for(let e of z8)e(!1,null);let t=await o5(),n=location.pathname;return R8(l6(e,t,{ignore:await c5()}).map(e=>({...e,page:n})),n)}var G8=!1;try{G8=localStorage.getItem(`linear-grab:render-live`)===`1`}catch{}var K8=new Set;function q8(e){return K8.add(e),e(G8),()=>void K8.delete(e)}var J8=3e3,Y8=4e3,X8=null,Z8=[],Q8=``;function $8(e){if(e!==G8&&!(e&&B8)){G8=e;try{localStorage.setItem(`linear-grab:render-live`,e?`1`:`0`)}catch{}for(let t of K8)t(e);e?(w8(),Z8=[],Q8=location.pathname,X8=setInterval(()=>void e5(!1),J8)):(X8&&clearInterval(X8),X8=null,e5(!0).finally(()=>{T8(),Z8=[]}))}}async function e5(e){try{let t=location.pathname;if(t!==Q8){let e=P8.filter(e=>e.page===Q8);u5(e).then(()=>{P8=[...P8];for(let e of F8)e(P8);d5(e)}),Z8=[],Q8=t}Z8.push(...E8()),Z8.length>Y8&&Z8.splice(0,Z8.length-Y8);let n=await o5(),r=l6(Z8,n,{ignore:await c5()}).map(e=>({...e,page:t}));P8=[...r,...P8.filter(e=>e.page!==t)];for(let e of F8)e(P8);if(e){await u5(r),P8=[...P8];for(let e of F8)e(P8);d5(r)}}catch{}}function t5(){typeof window>`u`||!G8||X8||(w8(),Z8=[],Q8=location.pathname,X8=setInterval(()=>void e5(!1),J8))}function n5(){let e=location.pathname;return R8(d6(document).map(t=>({...t,page:e})),e)}var r5=5*6e4,i5=null,a5=0;async function o5(){if(i5&&Date.now()-a5<r5)return i5;let e=D8;try{let t=await ek(),n=await(await fetch(`${t}/scan/rulebook`)).json();n.ok&&n.text&&(e=N8(n.text))}catch{}return e=await l5(e),i5=e,a5=Date.now(),e}function s5(){return i5}async function c5(){try{let e=await Tr();return Array.isArray(e.renderIgnore)?e.renderIgnore:void 0}catch{return}}async function l5(e){try{let t=(await Tr()).renderBudgets;if(t&&(t.selfMs!=null||t.commitMs!=null))return{...e,budgets:{selfMs:t.selfMs??e.budgets.selfMs,commitMs:t.commitMs??e.budgets.commitMs}}}catch{}return e}async function u5(e){let t=null;try{t=(await Promise.resolve().then(()=>(YZ(),VZ))).getGlobalApi()??null}catch{return}if(!t)return;let n=new Map;for(let t of e){let e=t.el?.deref();if(!e)continue;let r=n.get(e);r?r.push(t):n.set(e,[t])}let r=300;for(let[e,i]of n){if(r--<=0)break;let n=null,a=null;try{n=t.getDisplayName?.(e)??null}catch{}try{let n=await t.getSource?.(e);n?.filePath&&(a=`${n.filePath}${n.lineNumber==null?``:`:${n.lineNumber}`}`)}catch{}if(!(!n&&!a))for(let e of i)!e.component&&n&&(e.component=n),a&&(e.source=a)}}function d5(e){if(e.length===0)return;let t=Date.now(),n=e.slice(0,200).map(({el:e,...n})=>({kind:`render-scan`,at:t,...n}));ek().then(e=>fetch(`${e}/scan/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({events:n}),keepalive:!0})).catch(()=>{})}var f5=N(`<span class="text-text-faint font-normal tabular-nums"> · <!> pages`),p5=N(`<span class="bg-danger size-1.5 shrink-0 animate-pulse rounded-full"aria-hidden>`),m5=N(`<span class="text-danger inline-block min-w-[4ch] text-right text-[10.5px] font-medium tabular-nums">`),h5=N(`<svg width=13 height=13 viewBox="0 0 16 16"aria-hidden><rect x=3.5 y=3.5 width=9 height=9 rx=1.5 fill=currentColor>`),g5=N(`<svg width=13 height=13 viewBox="0 0 16 16"aria-hidden><rect x=4 y=3.5 width=3 height=9 rx=1 fill=currentColor></rect><rect x=9 y=3.5 width=3 height=9 rx=1 fill=currentColor>`),_5=N(`<span class="bg-success absolute -top-0.5 -right-0.5 size-1.5 animate-pulse rounded-full"aria-hidden>`),v5=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M5.5 3 6.5 1.5h3L10.5 3h2A1.5 1.5 0 0 1 14 4.5v7A1.5 1.5 0 0 1 12.5 13h-9A1.5 1.5 0 0 1 2 11.5v-7A1.5 1.5 0 0 1 3.5 3h2Z"></path><circle cx=8 cy=7.75 r=2.25>`),y5=N(`<span class="text-success text-[12px] leading-none">✓`),b5=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M4 4l8 8M12 4l-8 8">`),x5=N(`<p class="text-text-faint px-1 text-[10.5px] leading-snug">Recording commits… interact with the page.`),S5=N(`<p class="text-text-faint px-1 text-[10.5px] leading-snug">Live render scan — findings update as you interact and navigate.`),C5=N(`<div class="flex items-center gap-1 px-1"><button class="border-border cursor-pointer rounded-full border px-2 py-0.5 text-[10px] font-medium tabular-nums"> errors</button><button class="border-border cursor-pointer rounded-full border px-2 py-0.5 text-[10px] font-medium tabular-nums"> warns`),w5=N(`<div class="flex max-h-[28rem] flex-col gap-1.5 overflow-y-auto pr-3 pl-2">`),T5=N(`<div class="flex h-full flex-col gap-3 overflow-y-auto pt-3 pb-4 pr-3 pl-2"><div class="flex flex-col gap-1 px-1"><div class="flex items-center justify-between gap-2"><p class="text-text min-w-0 truncate text-[12.5px] font-semibold">Renders</p><div class="flex shrink-0 items-center gap-1"></div></div><p class="text-text-faint text-[10.5px] leading-snug">Commits graded against React-rerender-primitives.md — record then interact, go live, or snapshot the DOM. Accumulates per page.`),E5=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=2.25 fill=currentColor stroke=none>`),D5=N(`<svg width=13 height=13 viewBox="0 0 16 16"aria-hidden><path d="M5 3.3v9.4a.5.5 0 0 0 .77.42l7.1-4.7a.5.5 0 0 0 0-.84l-7.1-4.7A.5.5 0 0 0 5 3.3Z"fill=currentColor>`),O5=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 1.5 9.6 6l4.4 1.6L9.6 9.2 8 13.7 6.4 9.2 2 7.6 6.4 6Z"></path><path d="M13 11.5l.6 1.7 1.7.6-1.7.6-.6 1.7-.6-1.7-1.7-.6 1.7-.6Z">`),k5=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),A5=N(`<div class="border-border flex flex-col gap-1 border-t px-2 py-1.5">`),j5=N(`<div class="bg-surface border-border flex flex-col rounded-lg border"><button class="flex w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left"><span class="size-1.5 shrink-0 rounded-full"aria-hidden></span><span class="text-accent min-w-0 truncate font-mono text-[11.5px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums">×</span><svg width=10 height=10 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 class="text-text-faint shrink-0 transition-transform"aria-hidden><path d="m4 6 4 4 4-4">`),M5=N(`<span class="text-accent font-mono"> `),N5=N(`<span class="text-text-faint tabular-nums"> ×`),P5=N(`<span class="flex flex-wrap gap-1">`),F5=N(`<span class="text-text-dim font-mono"> · `),I5=N(`<div class="flex flex-col gap-0.5 rounded px-1 py-0.5 text-left"><span class="text-text-dim text-[10.5px] leading-snug"></span><span class="text-text-faint text-[10px] leading-snug tabular-nums">`),L5=N(`<span class="bg-surface-2 text-text-dim rounded px-1 font-mono text-[9.5px] leading-relaxed">`);function R5(e){let t=e.el?.deref();if(!(t instanceof HTMLElement)||!t.isConnected)return!1;t.scrollIntoView({block:`center`,behavior:`smooth`});let n=t.style.outline,r=t.style.outlineOffset;return t.style.outline=`2px solid #e5a13a`,t.style.outlineOffset=`2px`,setTimeout(()=>{t.style.outline=n,t.style.outlineOffset=r},1400),!0}function z5(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}function B5(e){return e.replace(/^prop:/,``)}function V5(){let[e,t]=T([]);ae(I8(t));let[n,r]=T(!1),[i,a]=T(null),[o,s]=T(Date.now()),c=null,l=()=>{c&&clearInterval(c),c=null};ae(l),ae(H8((e,t)=>{r(e),a(t),e?(s(Date.now()),c||=setInterval(()=>s(Date.now()),500)):l()}));let[u,d]=T(!1);ae(q8(d));let[f,p]=T(s5());o5().then(p);let[m,h]=T(null),[g,_]=T(null),[v,y]=T(!0),[b,x]=T(!0),[S,C]=T(!1),[w,E]=T(!1),[O,k]=T(!1),ee=async()=>{if(h(null),n())try{let e=await W8();p(s5()),_(null),e.length===0&&h(`No re-render anti-patterns caught — interact more (scroll, open menus, type) between record and stop.`)}catch(e){h(e instanceof Error?e.message:String(e))}else U8()},te=()=>{h(null),C(!0);try{n5(),_(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{C(!1)}},A=()=>{L8(),_(null)},ne=()=>new Set(e().map(e=>e.page)).size,re=()=>e().filter(e=>e.severity===`error`?v():b()),ie=()=>e().filter(e=>e.severity===`error`).reduce((e,t)=>e+(t.count??1),0),oe=()=>e().reduce((e,t)=>e+(t.count??1),0)-ie(),se=()=>{let e=new Map;for(let t of re()){let n=t.ruleId??`budget`,r=e.get(n);r?r.push(t):e.set(n,[t])}return[...e.entries()].sort((e,t)=>Number(t[1][0].severity===`error`)-Number(e[1][0].severity===`error`)||t[1].length-e[1].length)},ce=e=>{let t=e===`budget`?null:f()?.rules[e]?.slug??null;return t?`${e} · ${t}`:e},le=async()=>{try{await navigator.clipboard.writeText(b6(re())),E(!0),setTimeout(()=>E(!1),1600)}catch{h(`Clipboard was blocked — click Copy again.`)}},ue=async()=>{try{await navigator.clipboard.writeText(x6(re(),await o5())),k(!0),setTimeout(()=>k(!1),1600)}catch{h(`Clipboard was blocked — click Copy again.`)}};return(()=>{var t=T5(),r=t.firstChild.firstChild.firstChild;r.firstChild;var a=r.nextSibling;return P(r,j(M,{get when(){return ne()>1},get children(){var e=f5(),t=e.firstChild.nextSibling;return t.nextSibling,P(e,ne,t),e}}),null),P(a,j(M,{get when(){return n()},get children(){return[p5(),(()=>{var e=m5();return P(e,()=>z5(o()-(i()??o()))),e})()]}}),null),P(a,j(q,{class:`size-7 px-0`,get variant(){return n()?`danger`:`ghost`},"data-tip-pos":`bottom left`,get disabled(){return u()},get title(){return $e(()=>!!u())()?`Live scan owns the recorder — pause it first`:n()?`Stop & analyze`:`Record renders`},get"aria-label"(){return n()?`Stop and analyze`:`Record renders`},onClick:()=>void ee(),get children(){return j(M,{get when(){return n()},get fallback(){return E5()},get children(){return h5()}})}}),null),P(a,j(q,{class:`relative size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,get disabled(){return n()},get title(){return u()?`Pause live render scan`:`Live render scan — findings update as you browse`},"aria-label":`Toggle live render scan`,onClick:()=>$8(!u()),get children(){return[j(M,{get when(){return u()},get fallback(){return D5()},get children(){return g5()}}),j(M,{get when(){return u()},get children(){return _5()}})]}}),null),P(a,j(q,{class:`size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,get loading(){return S()},title:`Snapshot scan (passive DOM pass)`,"aria-label":`Snapshot scan`,onClick:te,get children(){return v5()}}),null),P(a,j(q,{class:`size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,get title(){return O()?`Copied!`:`Copy AI fix prompt`},"aria-label":`Copy AI fix prompt`,onClick:()=>void ue(),get children(){return j(M,{get when(){return O()},get fallback(){return O5()},get children(){return y5()}})}}),null),P(a,j(q,{class:`size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,get title(){return w()?`Copied!`:`Copy report`},"aria-label":`Copy report`,onClick:()=>void le(),get children(){return j(M,{get when(){return w()},get fallback(){return k5()},get children(){return y5()}})}}),null),P(a,j(q,{class:`text-danger size-7 px-0`,variant:`ghost`,"data-tip-pos":`bottom left`,title:`Clear findings`,"aria-label":`Clear findings`,onClick:A,get children(){return b5()}}),null),P(t,j(M,{get when(){return m()},get children(){return j(qj,{get message(){return m()}})}}),null),P(t,j(M,{get when(){return n()},get children(){return x5()}}),null),P(t,j(M,{get when(){return $e(()=>!!u())()&&!n()},get children(){return S5()}}),null),P(t,j(M,{get when(){return e().length>0},get fallback(){return j(M,{get when(){return $e(()=>!n())()&&!u()},get children(){return j(Kj,{title:`No renders scanned yet`,children:`Press record, then interact — scroll, open menus, navigate, type — and stop to analyze. Or go live and watch findings stream in as you browse. Snapshot grades the current DOM without recording.`})}})},get children(){return[(()=>{var e=C5(),t=e.firstChild,n=t.firstChild,r=t.nextSibling,i=r.firstChild;return t.$$click=()=>y(!v()),P(t,ie,n),r.$$click=()=>x(!b()),P(r,oe,i),D(e=>{var n={"text-danger bg-danger/10 border-danger/40":v(),"text-text-faint":!v()},i=v(),a={"text-warn bg-warn/10 border-warn/40":b(),"text-text-faint":!b()},o=b();return e.e=lt(t,n,e.e),i!==e.t&&it(t,`aria-pressed`,e.t=i),e.a=lt(r,a,e.a),o!==e.o&&it(r,`aria-pressed`,e.o=o),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),(()=>{var e=w5();return P(e,j(We,{get each(){return se()},children:([e,t])=>{let n=t[0],r=()=>g()===e;return(()=>{var i=j5(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,c=s.nextSibling;c.firstChild;var l=c.nextSibling;return a.$$click=()=>_(r()?null:e),P(s,()=>ce(e)),P(c,()=>t.reduce((e,t)=>e+(t.count??1),0),null),P(i,j(M,{get when(){return r()},get children(){var e=A5();return P(e,j(We,{each:t,children:e=>{let t=()=>e.el?.deref()!=null;return(()=>{var n=I5(),r=n.firstChild,i=r.nextSibling;return n.$$click=()=>{t()&&(R5(e)||h(e.page===location.pathname?`Element is gone — record or snapshot again.`:`This finding is on ${e.page} — navigate there to reveal it.`))},P(r,j(M,{get when(){return ne()>1},get children(){var t=M5(),n=t.firstChild;return P(t,()=>e.page,n),t}}),null),P(r,()=>e.description,null),P(r,j(M,{get when(){return(e.count??1)>1},get children(){var t=N5();return t.firstChild,P(t,()=>e.count,null),t}}),null),P(n,j(M,{get when(){return e.changes.length>0},get children(){var t=P5();return P(t,j(We,{get each(){return e.changes},children:e=>(()=>{var t=L5();return P(t,()=>B5(e)),t})()})),t}}),i),P(i,()=>e.evidence,null),P(i,j(M,{get when(){return e.component||e.source},get children(){var t=F5();return t.firstChild,P(t,()=>[e.component,e.source].filter(Boolean).join(` @ `),null),t}}),null),D(e=>{var r={"hover:bg-surface-2 cursor-pointer":t()},i=t()?`Reveal on the page`:void 0;return e.e=lt(n,r,e.e),i!==e.t&&it(n,`title`,e.t=i),e},{e:void 0,t:void 0}),n})()}})),e}}),null),D(e=>{var t=n.severity===`error`,i=n.severity===`warn`,a=!!r();return t!==e.e&&o.classList.toggle(`bg-danger`,e.e=t),i!==e.t&&o.classList.toggle(`bg-warn`,e.t=i),a!==e.a&&l.classList.toggle(`rotate-180`,e.a=a),e},{e:void 0,t:void 0,a:void 0}),i})()}})),e})()]}}),null),t})()}rt([`click`]);var H5=[`defaultTeamId`,`defaultProjectId`,`defaultLabelIds`,`defaultRepo`,`workflowMode`,`cursorModel`,`openaiModel`,`anthropicModel`,`stagingBranch`,`githubAssetsRepo`,`skillPaths`,`logUrl`,`logLines`,`issueTemplate`,`testUsername`,`defaultEvidence`,`renderBudgets`,`renderIgnore`];function U5(e){let t={};for(let n of H5){let r=e[n];r!==void 0&&r!==``&&!(Array.isArray(r)&&r.length===0)&&(t[n]=r)}return t}function W5(e,t){let n={};for(let r of H5)e[r]===void 0&&t[r]!==void 0&&(n[r]=t[r]);return Object.keys(n).length?n:null}Br();function G5(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function K5(e){let t=G5(crypto.getRandomValues(new Uint8Array(32))),n=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t)),r=G5(new Uint8Array(n)),i=G5(crypto.getRandomValues(new Uint8Array(16))),a=chrome.identity.getRedirectURL(),o=new URL(`https://linear.app/oauth/authorize`);o.searchParams.set(`client_id`,e),o.searchParams.set(`redirect_uri`,a),o.searchParams.set(`response_type`,`code`),o.searchParams.set(`scope`,`read,write`),o.searchParams.set(`state`,i),o.searchParams.set(`code_challenge`,r),o.searchParams.set(`code_challenge_method`,`S256`);let s=await chrome.identity.launchWebAuthFlow({url:o.toString(),interactive:!0});if(!s)throw Error(`OAuth flow was cancelled`);let c=new URL(s).searchParams;if(c.get(`state`)!==i)throw Error(`OAuth state mismatch`);let l=c.get(`code`);if(!l)throw Error(c.get(`error_description`)??`No authorization code returned`);let u=await fetch(`https://api.linear.app/oauth/token`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`authorization_code`,code:l,redirect_uri:a,client_id:e,code_verifier:t})}),d=await u.json().catch(()=>null);if(!u.ok||!d?.access_token)throw Error(`Token exchange failed — check the OAuth app callback URL and client id`);await Er({linearAccessToken:d.access_token,linearOauthClientId:e})}async function q5(){await Er({linearAccessToken:void 0,linearApiKey:void 0})}Br(),Sr(),Lx(),bD();var J5=N(`<div class="bg-surface-2 border-border flex rounded-md border p-0.5">`),Y5=N(`<span class="text-text-faint text-[10.5px] leading-snug">Cloud: picking an element opens the panel to draft &amp; delegate to the Cursor agent. Local (react-grab style): picking auto-copies the element's context — source, stack, and your skills/memory paths — straight to the clipboard for a local Claude Code or Cursor session; the panel stays out of the way. Both share the same picker; switch anytime.`),X5=N(`<label class="flex cursor-pointer items-center gap-2 select-none"><input type=checkbox class="accent-accent rounded"><span class="text-text text-[12px]">Element screenshots`),Z5=N(`<span class="text-text-faint text-[10.5px] leading-snug">Captures a highlighted screenshot of each picked element and attaches it to the issue. Costs a beat on huge pages — with this off, picking is instant (pure react-grab speed).`),Q5=N(`<span class=text-text>Connected as <span class=font-medium></span> · <span class=text-text-dim>`),$5=N(`<div class="bg-surface border-border flex items-center justify-between rounded-lg border p-2.5"><span class="text-text text-[12px]">`),e7=N(`<option value>Select a team…`),t7=N(`<option value>No project`),n7=N(`<div class="flex flex-wrap gap-1">`),r7=N(`<label class="flex items-start gap-2"><input type=checkbox class="accent-accent mt-0.5"><span class="flex flex-col gap-0.5"><span class=text-[12px]>Let agents close out Linear themselves</span><span class="text-text-faint text-[10.5px] leading-snug">Embeds your Linear API key + raw GraphQL closeout recipes in every issue's Agent instructions — cloud agent VMs have no authenticated Linear MCP, so without this they can't comment, attach media, or move the issue. The key is visible to anyone who can read the issue.`),i7=N(`<p class="text-text-dim text-[11px]">No agents found — install the Cursor integration in Linear first.`),a7=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Default evidence</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5"></div><span class="text-text-faint text-[10.5px] leading-snug">What proof delegated agents must produce, baked into every issue's Agent instructions. Video demo = record a GIF/video with the test account. Spec-crawler 1:1 = computed-style evidence via the repo's spec-crawler MCP, no video. None = hands-on testing only. Draft can override it per issue.`),o7=N(`<span class="text-text-faint text-[10.5px] leading-snug">Empty = the default above (computer-use testing, video demo, PR + review babysitting).`),s7=N(`<div class="flex flex-col gap-1.5">`),c7=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Mode</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5"></div><span class="text-text-faint text-[10.5px] leading-snug">Beside page squeezes the app next to the panel, DevTools-style — nothing gets covered. Also toggleable from the dock icon in the panel header.`),l7=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Dock side</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5"></div><span class="text-text-faint text-[10.5px] leading-snug">The launcher pill is draggable — park it anywhere it doesn't cover your app.`),u7=N(`<p class="text-text-faint text-[10.5px] leading-snug">A committed <code>.lineargrab.json</code> at the repo root (where the bridge runs) shares team/project/labels, skills, staging branch, and workflow defaults with every machine and teammate — it seeds any setting you haven't set locally. Secrets never belong in it.`),d7=N(`<span class="inline-block min-w-[10ch] text-center">`),f7=N(`<div class="flex items-center gap-2">`),p7=N(`<option value>Select a channel…`),m7=N(`<label class="flex cursor-pointer items-center gap-2 select-none"><input type=checkbox class="accent-accent rounded"><span class="text-text text-[12px]">Announce new issues on create`),h7=N(`<span class="text-text-faint text-[10.5px] leading-snug">⚠️ Tokens are embedded in issue Agent-instructions so agents can post the finished demo — everyone who can read the issue can read them. Use single-channel-scoped bots.`),g7=N(`<div class="flex flex-col gap-1"><span class="text-text-dim text-[11px] font-medium">Provider preference</span><div class="bg-surface-2 border-border flex rounded-md border p-0.5"><button>Auto</button><button>OpenAI</button><button>Anthropic`),_7=N(`<p class="text-text-dim text-[11px]">`),v7=N(`<div class=min-h-[2lh]>`),y7=N(`<ol class="text-text-faint flex list-decimal flex-col gap-1 pl-4 text-[11px] leading-relaxed"><li>Pick an element on your running dev app.</li><li>Draft the issue (AI optional).</li><li>Create + delegate — Cursor's cloud agent fixes it and opens a PR.</li><li>Track and steer it from Activity.`),b7=N(`<div class="flex h-full flex-col gap-5 overflow-y-auto pt-3 pb-6 pl-3 pr-4">`),x7=N(`<button>`),S7=N(`<div class="flex gap-1.5">`),C7=N(`<p class="text-text-faint text-center text-[10.5px]">or`),w7=N(`<span class="text-text-faint text-[10.5px] leading-snug">Register this callback URL in your Linear OAuth app config:<br><span class="font-mono text-[10.5px] break-all">`),T7=N(`<div class="flex flex-col gap-3">`),E7=N(`<span class=text-text-dim>Connected — verifying…`),D7=N(`<option> (<!>)`),O7=N(`<option>`),k7=N(`<button type=button><span class="mr-1 inline-block size-2 rounded-full align-middle">`),A7=N(`<option value>Select the agent…`),j7=N(`<button type=button>`),M7=N(`<option>#`),N7=N(`<p class="text-text-dim text-[11px]">No key set — AI drafting disabled, manual drafting still works.`);function P7(){let e=sr(),t=_r(()=>({queryKey:[`settings`],queryFn:Tr,staleTime:0})),n=k(()=>t.data??{});async function r(t,n=!1){await Er(t),await e.invalidateQueries({queryKey:[`settings`]}),n&&(await e.invalidateQueries({queryKey:[`viewer`]}),await e.invalidateQueries({queryKey:[`teams`]}),await e.invalidateQueries({queryKey:[`agents`]}),await e.invalidateQueries({queryKey:[`my-issues`]}))}let i=k(()=>!!(n().linearApiKey||n().linearAccessToken)),a=_r(()=>({queryKey:[`viewer`],queryFn:pO,enabled:i(),retry:0})),o=_r(()=>({queryKey:[`teams`],queryFn:mO,enabled:i()})),s=_r(()=>({queryKey:[`linear-projects`],queryFn:wO,enabled:i()})),c=_r(()=>({queryKey:[`bridge-health`],queryFn:IO,retry:0})),[l,u]=T(!1),d=async()=>{try{await navigator.clipboard.writeText(JSON.stringify(U5(n()),null,2)+`
295
+ `),u(!0),setTimeout(()=>u(!1),1800)}catch{}},f=()=>{let e=c.data?.projectConfig;if(!e)return;let t={};for(let n of H5)e[n]!==void 0&&(t[n]=e[n]);r(t)},p=_r(()=>({queryKey:[`linear-labels`],queryFn:TO,enabled:i()})),m=_r(()=>({queryKey:[`agents`],queryFn:hO,enabled:i()})),[h,g]=T(``),[_,v]=T(!1),[y,b]=T(``);async function x(){let e=h().trim();if(e){v(!0),b(``);try{await r({linearApiKey:e},!0),await pO(),g(``)}catch{b(`Key rejected — could not verify. Check the key and try again.`),await r({linearApiKey:void 0},!0)}finally{v(!1)}}}let[S,C]=T(``),[w,E]=T(!1),[O,ee]=T(``);async function te(){let t=(S()||n().linearOauthClientId||``).trim();if(!t){ee(`Enter an OAuth client ID first.`);return}E(!0),ee(``);try{await K5(t),await e.invalidateQueries({queryKey:[`settings`]}),await e.invalidateQueries({queryKey:[`viewer`]}),await e.invalidateQueries({queryKey:[`teams`]}),await e.invalidateQueries({queryKey:[`agents`]}),await e.invalidateQueries({queryKey:[`my-issues`]})}catch(e){ee(e instanceof Error?e.message:`OAuth flow failed.`)}finally{E(!1)}}let[A,ne]=T(!1);async function re(){ne(!0);try{await q5(),await e.invalidateQueries({queryKey:[`settings`]}),await e.invalidateQueries({queryKey:[`viewer`]}),await e.invalidateQueries({queryKey:[`teams`]}),await e.invalidateQueries({queryKey:[`agents`]}),await e.invalidateQueries({queryKey:[`my-issues`]})}finally{ne(!1)}}let ie=xr?chrome.identity.getRedirectURL():null,ae=_r(()=>({queryKey:[`slack-channels`,n().slackToken],queryFn:()=>ok(n().slackToken),enabled:!!n().slackToken,retry:0,staleTime:6e4})),oe=k(()=>Mx(n())),se=k(()=>{let e=oe();return e?`Drafting with ${e} — ${kx(n(),e,`fast`)} (fast) / ${kx(n(),e,`best`)} (best)`:null});return(()=>{var e=b7();return P(e,j(Uj,{title:`Workflow`,get children(){return[(()=>{var e=J5();return P(e,j(We,{each:[{id:`cloud`,label:`Cloud · Linear + Cursor`},{id:`local`,label:`Local · clipboard`}],children:e=>(()=>{var t=x7();return t.$$click=()=>void r({workflowMode:e.id}),P(t,()=>e.label),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-1 text-[11.5px] font-medium transition-colors ${(n().workflowMode??`cloud`)===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),e})(),Y5()]}}),null),P(e,j(Uj,{title:`Capture`,get children(){return[(()=>{var e=X5(),t=e.firstChild;return t.addEventListener(`change`,e=>void r({captureShots:e.currentTarget.checked||void 0})),D(()=>t.checked=!!n().captureShots),e})(),Z5()]}}),null),P(e,j(Uj,{title:`Linear`,get children(){return j(M,{get when(){return i()},get fallback(){return(()=>{var e=T7();return P(e,j(Hj,{label:`Personal API key`,hint:`Create one at linear.app → Settings → API — fastest path.`,get children(){return[(()=>{var e=S7();return P(e,j(Ij,{type:`password`,placeholder:`lin_api_…`,get value(){return h()},onInput:e=>g(e.currentTarget.value),"on:keydown":e=>{e.key===`Enter`&&x()}}),null),P(e,j(q,{variant:`primary`,get loading(){return _()},get disabled(){return!h().trim()},onClick:()=>void x(),class:`shrink-0`,children:`Connect`}),null),e})(),j(M,{get when(){return y()},get children(){return j(qj,{get message(){return y()}})}})]}}),null),P(e,j(M,{when:xr,get children(){return[C7(),j(Hj,{label:`OAuth client ID`,get children(){return[(()=>{var e=S7();return P(e,j(Ij,{placeholder:`your-client-id`,get value(){return S()||n().linearOauthClientId||``},onInput:e=>C(e.currentTarget.value)}),null),P(e,j(q,{variant:`ghost`,get loading(){return w()},onClick:()=>void te(),class:`shrink-0 whitespace-nowrap`,children:`Connect with OAuth`}),null),e})(),j(M,{get when(){return O()},get children(){return j(qj,{get message(){return O()}})}}),(()=>{var e=w7(),t=e.firstChild.nextSibling.nextSibling;return P(t,ie),e})()]}})]}}),null),e})()},get children(){var e=$5(),t=e.firstChild;return P(t,j(M,{get when(){return!a.isLoading},get fallback(){return E7()},get children(){return j(M,{get when(){return a.data},get fallback(){return j(M,{get when(){return a.isError},get fallback(){return E7()},get children(){return j(qj,{message:`Key rejected — reconnect`})}})},get children(){var e=Q5(),t=e.firstChild.nextSibling,n=t.nextSibling.nextSibling;return P(t,()=>a.data.name),P(n,()=>a.data.email),e}})}})),P(e,j(q,{variant:`ghost`,get loading(){return A()},onClick:()=>void re(),class:`ml-2 shrink-0`,children:`Disconnect`}),null),e}})}}),null),P(e,j(M,{get when(){return i()},get children(){return j(Uj,{title:`Workspace`,get children(){return[j(Hj,{label:`Default team`,get children(){return j(Rj,{get value(){return n().defaultTeamId??``},onChange:e=>{let t=e.currentTarget.value;r({defaultTeamId:t||void 0})},get disabled(){return o.isLoading},get children(){return[e7(),j(M,{get when(){return o.data},get children(){return j(We,{get each(){return o.data},children:e=>(()=>{var t=D7(),r=t.firstChild,i=r.nextSibling;return i.nextSibling,P(t,()=>e.name,r),P(t,()=>e.key,i),D(()=>t.selected=e.id===n().defaultTeamId),D(()=>t.value=e.id),t})()})}})]}})}}),j(Hj,{label:`Default project`,hint:`Every issue created from the panel is filed into this project.`,get children(){return j(Rj,{get value(){return n().defaultProjectId??``},onChange:e=>void r({defaultProjectId:e.currentTarget.value||void 0}),get disabled(){return s.isLoading},get children(){return[(()=>{var e=t7();return D(()=>e.selected=!n().defaultProjectId),e})(),j(We,{get each(){return s.data??[]},children:e=>(()=>{var t=O7();return P(t,()=>e.name),D(()=>t.selected=e.id===n().defaultProjectId),D(()=>t.value=e.id),t})()})]}})}}),j(Hj,{label:`Default labels`,hint:`Applied to every issue created from the panel.`,get children(){var e=n7();return P(e,j(We,{get each(){return p.data??[]},children:e=>{let t=()=>(n().defaultLabelIds??[]).includes(e.id);return(()=>{var i=k7(),a=i.firstChild;return i.$$click=()=>{let i=n().defaultLabelIds??[];r({defaultLabelIds:t()?i.filter(t=>t!==e.id):[...i,e.id]})},P(i,()=>e.name,null),D(n=>{var r=`h-6 cursor-pointer rounded-full border px-2.5 text-[11px] font-medium transition-colors ${t()?`bg-accent-soft text-accent border-accent/40`:`bg-surface-2 text-text-dim border-border hover:bg-surface-3`}`,o=e.color;return r!==n.e&&st(i,n.e=r),o!==n.t&&dt(a,`background`,n.t=o),n},{e:void 0,t:void 0}),i})()}})),e}}),(()=>{var e=r7(),t=e.firstChild;return t.addEventListener(`change`,e=>void r({shareLinearKey:e.currentTarget.checked})),D(()=>t.checked=!!n().shareLinearKey),e})(),j(Hj,{label:`Staging branch`,hint:`Stage buttons on PRs merge the PR branch here — point your staging domain (e.g. preview.ahmedbanihani.com) at this branch in Vercel.`,get children(){return j(Ij,{get value(){return n().stagingBranch??``},placeholder:`staging`,onChange:e=>void r({stagingBranch:e.currentTarget.value.trim()||void 0})})}}),j(Hj,{label:`Cursor agent`,hint:`App users in your workspace. Pick Cursor — requires the Cursor integration installed in Linear (workspace admin) with usage-based pricing enabled in Cursor.`,get children(){return j(M,{get when(){return $e(()=>!!m.data)()&&m.data.length===0},get fallback(){return j(Rj,{get value(){return n().cursorAgentId??``},onChange:e=>{let t=e.currentTarget.value;if(!t){r({cursorAgentId:void 0,cursorAgentName:void 0,cursorAgentUrl:void 0});return}let n=m.data?.find(e=>e.id===t);n&&r({cursorAgentId:n.id,cursorAgentName:n.displayName,cursorAgentUrl:n.url??void 0})},get disabled(){return m.isLoading},get children(){return[A7(),j(M,{get when(){return m.data},get children(){return j(We,{get each(){return m.data},children:e=>(()=>{var t=O7();return P(t,()=>e.displayName),D(()=>t.selected=e.id===n().cursorAgentId),D(()=>t.value=e.id),t})()})}})]}})},get children(){return i7()}})}}),j(Hj,{label:`Default repository`,hint:`Appended to delegated issues as [repo=…] so Cursor picks the right repo.`,get children(){return j(Ij,{placeholder:`owner/repository`,get value(){return n().defaultRepo??``},onBlur:e=>{r({defaultRepo:e.currentTarget.value.trim()||void 0})}})}}),j(Hj,{label:`Cursor cloud model`,hint:`Appended as [model=…] — e.g. claude-opus-4-8, gpt-5.2, composer. Empty = Cursor's default.`,get children(){return j(Ij,{placeholder:`Cursor's default`,get value(){return n().cursorModel??``},onBlur:e=>{r({cursorModel:e.currentTarget.value.trim()||void 0})}})}}),(()=>{var e=a7(),t=e.firstChild.nextSibling;return P(t,j(We,{each:[{id:`video`,label:`Video demo`},{id:`spec`,label:`Spec-crawler 1:1`},{id:`none`,label:`None`}],children:e=>(()=>{var t=j7();return t.$$click=()=>void r({defaultEvidence:e.id===`video`?void 0:e.id}),P(t,()=>e.label),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${(n().defaultEvidence??`video`)===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),e})(),j(Hj,{label:`Agent instructions`,hint:`Appended to every issue as '### Agent instructions' and given to the AI draft. Add demo credentials (username/password) so the agent can log in, test, and record its video. Careful: credentials become visible to everyone who can read the issue.`,get children(){return[j(Lj,{rows:5,placeholder:yD,get value(){return n().issueTemplate??``},onBlur:e=>{r({issueTemplate:e.currentTarget.value.trim()||void 0})}}),o7()]}}),j(Hj,{label:`Dev server log URL`,hint:`Tail of your dev-server log attached to issues (and fed to AI drafts). Serve the log over HTTP: "dev:http": "next dev 2>&1 | tee public/dev-server.log" (gitignore it), then use /dev-server.log here. Empty = disabled.`,get children(){return j(Ij,{placeholder:`/dev-server.log`,get value(){return n().logUrl??``},onBlur:e=>{r({logUrl:e.currentTarget.value.trim()||void 0})}})}}),j(Hj,{label:`Log lines to attach`,hint:`Trailing lines included in the issue (10–500).`,get children(){return j(Ij,{type:`number`,min:`10`,max:`500`,placeholder:`100`,get value(){return n().logLines??``},onBlur:e=>{let t=Number(e.currentTarget.value);r({logLines:Number.isFinite(t)&&t>0?Math.min(500,Math.max(10,Math.round(t))):void 0})}})}}),j(Hj,{label:`Skills & memory paths`,hint:`One path per line. The cloud agent works in a full repo checkout, so committed paths (e.g. .claude/skills/apple-hig-design-principles) are readable directly — every issue gets a MANDATORY-reading section pointing at them. Repo-relative for cloud agents; absolute paths also work when you paste the issue into a local Claude Code session. Per project: these settings live per dev origin.`,get children(){return j(Lj,{rows:4,placeholder:`.claude/skills/apple-hig-design-principles
286
296
  .claude/CLAUDE.md
287
- docs/design-tokens.md`,get value(){return n().skillPaths??``},onBlur:e=>{r({skillPaths:e.currentTarget.value.trim()||void 0})}})}}),j(Rj,{label:`Test account`,hint:`The cloud agent logs into the app with this while testing and recording its demo. Added to every issue's Agent instructions. Use a throwaway account — it's visible to everyone who can read the issue.`,get children(){var e=X5();return P(e,j(Mj,{placeholder:`Username or email (e.g. demo@yourapp.com)`,get value(){return n().testUsername??``},onBlur:e=>{r({testUsername:e.currentTarget.value.trim()||void 0})}}),null),P(e,j(Mj,{type:`password`,placeholder:`Password`,get value(){return n().testPassword??``},onBlur:e=>{r({testPassword:e.currentTarget.value.trim()||void 0})}}),null),e}})]}})}}),null),P(e,j(M,{when:!xr,get children(){return j(zj,{title:`Panel`,get children(){return[(()=>{var e=Z5(),t=e.firstChild.nextSibling;return P(t,j(We,{each:[{id:`overlay`,label:`Overlay`},{id:`pinned`,label:`Beside page`}],children:e=>(()=>{var t=u7();return t.$$click=()=>void r({panelMode:e.id,panelPos:void 0}),P(t,()=>e.label),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${(n().panelMode??`overlay`)===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),e})(),(()=>{var e=Q5(),t=e.firstChild.nextSibling;return P(t,j(We,{each:[`left`,`right`],children:e=>(()=>{var t=u7();return t.$$click=()=>void r({panelSide:e}),P(t,e===`left`?`Left`:`Right`),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${(n().panelSide??`right`)===e?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),e})()]}})}}),null),P(e,j(zj,{title:`Local Claude Code`,get children(){return j(Rj,{label:`Bridge URL`,hint:'Run `npx linear-grab-bridge` in your repo\'s terminal (binds localhost only). Enables "Delegate to → Local Claude Code" in Draft, the Local tab, and relays blocked uploads to Linear storage.',get children(){return j(Mj,{placeholder:`http://localhost:4577`,get value(){return n().bridgeUrl??``},onBlur:e=>{r({bridgeUrl:e.currentTarget.value.trim()||void 0})}})}})}}),null),P(e,j(zj,{title:`Project config (.lineargrab.json)`,get children(){return[$5(),(()=>{var e=t7();return P(e,j(M,{get when(){return c.data?.projectConfig},get fallback(){return j(Bj,{title:`No .lineargrab.json found at the bridge's cwd (or bridge offline / outdated)`,children:`not detected`})},get children(){return[j(Bj,{class:`text-success`,children:`detected`}),j(q,{variant:`ghost`,class:`h-7 px-2 text-[11px]`,title:`Overwrite your local settings with every value from the repo's config`,onClick:f,children:`Apply all`})]}}),null),P(e,j(q,{variant:`ghost`,class:`h-7 px-2 text-[11px]`,get title(){return l()?`Copied!`:`Copy your current shareable settings as .lineargrab.json — commit it to the repo root`},onClick:()=>void d(),get children(){var e=e7();return P(e,()=>l()?`Copied ✓`:`Copy config`),e}}),null),e})()]}}),null),P(e,j(zj,{title:`Asset uploads`,get children(){return[j(Rj,{label:`GitHub token`,hint:`Linear's storage blocks browser uploads in some browsers (Safari). With this set, GIFs/screenshots upload to your GitHub repo instead and embed automatically. Fine-grained PAT with Contents read/write on the assets repo.`,get children(){return j(Mj,{type:`password`,placeholder:`github_pat_…`,get value(){return n().githubToken??``},onBlur:e=>{r({githubToken:e.currentTarget.value.trim()||void 0})}})}}),j(Rj,{label:`Assets repository`,hint:`owner/repo — must be PUBLIC so Linear (and agents) can render the images. Files land under linear-grab/.`,get children(){return j(Mj,{placeholder:`ahmedbanihanibh/linear-grab-assets`,get value(){return n().githubAssetsRepo??``},onBlur:e=>{r({githubAssetsRepo:e.currentTarget.value.trim()||void 0})}})}})]}}),null),P(e,j(zj,{title:`Notifications`,get children(){return[j(Rj,{label:`Slack bot token`,hint:`Bot token (xoxb-…) with chat:write + channels:read + files:write. New issues get announced with links + demo, and the AGENT receives the token to post its finished demo video itself.`,get children(){return j(Mj,{type:`password`,placeholder:`xoxb-…`,get value(){return n().slackToken??``},onBlur:e=>{r({slackToken:e.currentTarget.value.trim()||void 0})}})}}),j(M,{get when(){return n().slackToken},get children(){return j(Rj,{label:`Slack channel`,get children(){return j(M,{get when(){return!ae.isError},get fallback(){return j(Uj,{message:`Couldn't list channels — check the token scopes (channels:read).`})},get children(){return j(Pj,{get value(){return n().slackChannelId??``},get disabled(){return ae.isLoading},onChange:e=>{let t=e.currentTarget.value,n=ae.data?.find(e=>e.id===t);r({slackChannelId:t||void 0,slackChannelName:n?.name})},get children(){return[n7(),j(We,{get each(){return ae.data??[]},children:e=>(()=>{var t=b7();return t.firstChild,P(t,()=>e.name,null),D(()=>t.selected=e.id===n().slackChannelId),D(()=>t.value=e.id),t})()})]}})}})}})}}),j(Rj,{label:`Telegram bot token`,hint:`From @BotFather. The agent also receives it to send the demo video (sendVideo).`,get children(){return j(Mj,{type:`password`,placeholder:`123456:ABC-…`,get value(){return n().telegramToken??``},onBlur:e=>{r({telegramToken:e.currentTarget.value.trim()||void 0})}})}}),j(M,{get when(){return n().telegramToken},get children(){return j(Rj,{label:`Telegram chat ID`,hint:`Add the bot to your group/channel, send a message, then read the chat id from api.telegram.org/bot<token>/getUpdates.`,get children(){return j(Mj,{placeholder:`-1001234567890`,get value(){return n().telegramChatId??``},onBlur:e=>{r({telegramChatId:e.currentTarget.value.trim()||void 0})}})}})}}),(()=>{var e=r7(),t=e.firstChild;return t.addEventListener(`change`,e=>void r({notifyOnCreate:e.currentTarget.checked?void 0:!1})),D(()=>t.checked=n().notifyOnCreate!==!1),e})(),i7()]}}),null),P(e,j(zj,{title:`AI providers`,get children(){return[j(Rj,{label:`OpenAI API key`,get children(){return j(Mj,{type:`password`,placeholder:`sk-…`,get value(){return n().openaiKey??``},onBlur:e=>{r({openaiKey:e.currentTarget.value.trim()||void 0})}})}}),j(Rj,{label:`OpenAI model`,get hint(){return`Model id used for drafting (both tiers). Empty = defaults: ${Fx.openai.fast} (fast) / ${Fx.openai.best} (best).`},get children(){return j(Mj,{get placeholder(){return Fx.openai.fast},get value(){return n().openaiModel??``},onBlur:e=>{r({openaiModel:e.currentTarget.value.trim()||void 0})}})}}),j(Rj,{label:`Anthropic API key`,get children(){return j(Mj,{type:`password`,placeholder:`sk-ant-…`,get value(){return n().anthropicKey??``},onBlur:e=>{r({anthropicKey:e.currentTarget.value.trim()||void 0})}})}}),j(Rj,{label:`Anthropic model`,get hint(){return`Model id used for drafting (both tiers). Empty = defaults: ${Fx.anthropic.fast} (fast) / ${Fx.anthropic.best} (best).`},get children(){return j(Mj,{get placeholder(){return Fx.anthropic.fast},get value(){return n().anthropicModel??``},onBlur:e=>{r({anthropicModel:e.currentTarget.value.trim()||void 0})}})}}),(()=>{var e=a7(),t=e.firstChild.nextSibling.firstChild,i=t.nextSibling,a=i.nextSibling;return t.$$click=()=>void r({preferredProvider:void 0}),i.$$click=()=>void r({preferredProvider:`openai`}),a.$$click=()=>void r({preferredProvider:`anthropic`}),D(e=>{var r=`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${n().preferredProvider===void 0?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`,o=`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors disabled:cursor-not-allowed ${n().preferredProvider===`openai`?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer disabled:text-text-faint`}`,s=!n().openaiKey,c=`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors disabled:cursor-not-allowed ${n().preferredProvider===`anthropic`?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer disabled:text-text-faint`}`,l=!n().anthropicKey;return r!==e.e&&st(t,e.e=r),o!==e.t&&st(i,e.t=o),s!==e.a&&(i.disabled=e.a=s),c!==e.o&&st(a,e.o=c),l!==e.i&&(a.disabled=e.i=l),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e})(),(()=>{var e=s7();return P(e,j(M,{get when(){return se()},get fallback(){return x7()},get children(){var e=o7();return P(e,se),e}})),e})()]}}),null),P(e,j(zj,{title:`How it works`,get children(){return c7()}}),null),e})()}rt([`click`]);var C7=`linear-grab`,w7=`queries`,T7=[`my-issues`,`issue`,`sessions`,`teams`,`agents`];function E7(){return new Promise(e=>{try{let t=indexedDB.open(C7,1);t.onupgradeneeded=()=>t.result.createObjectStore(w7),t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)}catch{e(null)}})}function D7(e){return typeof e[0]==`string`&&T7.includes(e[0])}async function O7(e){let t=await E7();if(!t)return()=>{};await new Promise(n=>{try{let r=t.transaction(w7,`readonly`).objectStore(w7).openCursor();r.onsuccess=()=>{let t=r.result;if(!t)return n();try{let{queryKey:n,data:r}=t.value;D7(n)&&e.getQueryData(n)===void 0&&e.setQueryData(n,r,{updatedAt:0})}catch{}t.continue()},r.onerror=()=>n()}catch{n()}});let n=new Map,r=e.getQueryCache().subscribe(r=>{if(r.type!==`updated`||r.action.type!==`success`)return;let{queryKey:i,queryHash:a}=r.query;if(!D7(i))return;let o=n.get(a);o&&clearTimeout(o),n.set(a,setTimeout(()=>{n.delete(a);try{let n=e.getQueryData(i);if(n===void 0)return;t.transaction(w7,`readwrite`).objectStore(w7).put({queryKey:i,data:n},a)}catch{}},400))});return()=>{r();for(let e of n.values())clearTimeout(e);t.close()}}Br();var k7=N(`<svg viewBox="0 0 100 100"fill=currentColor aria-hidden><path d="M1.22541 61.5228c-.2225-.9485.90748-1.5459 1.59638-.857L39.3342 97.1782c.6889.6889.0915 1.8189-.857 1.5964C20.0515 94.4522 5.54779 79.9485 1.22541 61.5228ZM.00189135 46.8891c-.01764375.2833.08887215.5599.28957165.7606L52.3503 99.7085c.2007.2007.4773.3075.7606.2896 2.3692-.1476 4.6938-.46 6.9624-.9259.7645-.157 1.0301-1.0963.4782-1.6481L2.57595 39.4485c-.55186-.5519-1.49117-.2863-1.648174.4782-.465915 2.2686-.77832 4.5932-.92588465 6.9624ZM4.21093 29.7054c-.16649.3738-.08169.8106.20765 1.1l64.77602 64.776c.2894.2894.7262.3742 1.1.2077 1.7861-.7956 3.5171-1.6927 5.1855-2.684.5521-.328.6373-1.0867.1832-1.5407L8.43566 24.3367c-.45409-.4541-1.21271-.3689-1.54074.1832-.99132 1.6684-1.88843 3.3994-2.68399 5.1855ZM12.6587 18.074c-.3701-.3701-.393-.9637-.0443-1.3541C21.7795 6.45931 35.1114 0 49.9519 0 77.5927 0 100 22.4073 100 50.0481c0 14.8405-6.4593 28.1724-16.7199 37.3375-.3903.3487-.984.3258-1.3541-.0443L12.6587 18.074Z">`),A7=N(`<button><svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><rect x=1.5 y=2.5 width=13 height=11 rx=1.5></rect><path d="M10 2.5v11">`),j7=N(`<button aria-label="Minimize to launcher"title="Minimize to launcher"class="text-text-dim hover:text-text hover:bg-surface-3 grid size-6 shrink-0 cursor-pointer place-items-center rounded-md text-[15px] leading-none transition-colors">–`),M7=N(`<div class="bg-bg text-text flex h-full flex-col"><header><span class="text-accent mr-0.5 inline-flex shrink-0"title="Linear Grab"></span><div class="no-scrollbar flex min-w-0 flex-1 items-center gap-1 overflow-x-auto"></div></header><main class="min-h-0 flex-1"><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full>`),N7=N(`<button>`),P7=[{id:`draft`,label:`Draft`},{id:`capture`,label:`Capture`},{id:`activity`,label:`Activity`},{id:`running`,label:`Running`},{id:`cloud`,label:`Cloud`},{id:`local`,label:`Local`},{id:`prs`,label:`PRs`},{id:`design`,label:`Design`},{id:`renders`,label:`Renders`},{id:`settings`,label:`Settings`}],F7=new Set;function I7(e,t,n){if(F7.has(e)||typeof Notification>`u`)return;F7.add(e);let r=()=>new Notification(t,{body:n});Notification.permission===`granted`?r():Notification.permission==="default"&&Notification.requestPermission().then(e=>e===`granted`&&r())}function L7(){setInterval(()=>{FO().then(e=>{for(let t of e){if(t.status!==`running`)continue;let e=t.lastEventAt??t.startedAt;Date.now()-e>10*6e4&&I7(`local-stuck:${t.id}:${e}`,`Local agent may be stuck`,`${t.title.slice(0,80)} — no output for ${Math.round((Date.now()-e)/6e4)}m. Nudge or interrupt it in the Local tab.`)}}).catch(()=>{}),vO().then(e=>{for(let t of e)/awaitingInput|elicit/i.test(t.status)&&I7(`cloud-input:${t.id}`,`Cloud agent needs input`,`${t.issue?.identifier??`Session`} — ${t.issue?.title?.slice(0,80)??`a Cursor agent`} is waiting for you.`)}).catch(()=>{})},6e4)}L7();var R7=new gr({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});function z7(e){return(()=>{var t=k7();return D(n=>{var r=e.size??14,i=e.size??14;return r!==n.e&&it(t,`width`,n.e=r),i!==n.t&&it(t,`height`,n.t=i),n},{e:void 0,t:void 0}),t})()}function B7(e){let[t,n]=T(`draft`),r=()=>{R7.invalidateQueries({queryKey:[`grab`]}),uj()===`capture`&&n(`capture`),e.onGrab?.()};return O(()=>{let e=ij();e&&n(e)}),ie(()=>{let e=O7(R7),t=ZZ(r),n=()=>{XO().then(b$),UO(),PO().then(async e=>{if(!e.projectConfig)return;let t=P5(await Tr(),e.projectConfig);t&&await Er(t)}).catch(()=>{})};n();let i=Mr(e=>{e===`settings`&&(R7.invalidateQueries({queryKey:[`settings`]}),n()),e===`grab`&&r()});ae(()=>{t(),i(),e.then(e=>e())})}),j(cr,{client:R7,get children(){var r=M7(),i=r.firstChild,a=i.firstChild,o=a.nextSibling,s=i.nextSibling.firstChild,c=s.nextSibling,l=c.nextSibling,u=l.nextSibling,d=u.nextSibling,f=d.nextSibling,p=f.nextSibling,m=p.nextSibling,h=m.nextSibling,g=h.nextSibling;return i.$$pointerdown=t=>e.onHeaderPointerDown?.(t),P(a,j(z7,{size:14})),P(o,j(We,{each:P7,children:e=>(()=>{var r=N7();return r.$$click=()=>n(e.id),P(r,()=>e.label),D(()=>st(r,`h-6 shrink-0 rounded-md px-2 text-[12px] font-medium whitespace-nowrap transition-colors ${t()===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),r})()})),P(i,j(M,{get when(){return e.onTogglePin},get children(){var t=A7();return t.$$click=()=>e.onTogglePin?.(),D(n=>{var r=e.pinned?`Switch to overlay`:`Dock beside page`,i=e.pinned?`Overlay the page`:`Dock beside page (squeezes the app, DevTools-style)`,a=`hover:bg-surface-3 grid size-6 shrink-0 cursor-pointer place-items-center rounded-md transition-colors ${e.pinned?`text-accent`:`text-text-dim hover:text-text`}`;return r!==n.e&&it(t,`aria-label`,n.e=r),i!==n.t&&it(t,`title`,n.t=i),a!==n.a&&st(t,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t}}),null),P(i,j(M,{get when(){return e.onClose},get children(){var t=j7();return t.$$click=()=>e.onClose?.(),t}}),null),P(s,j(TM,{onCreated:()=>n(`activity`)})),P(c,j(EQ,{})),P(l,j(v1,{})),P(u,j(V1,{})),P(d,j(F1,{})),P(f,j(E0,{})),P(p,j(V0,{onOpenIssue:()=>n(`activity`)})),P(m,j(K3,{})),P(h,j(j5,{})),P(g,j(S7,{})),D(n=>{var r=`border-border bg-surface flex shrink-0 items-center gap-1 border-b px-2 py-1.5 select-none ${e.onHeaderPointerDown?`cursor-grab active:cursor-grabbing`:``}`,a=t()!==`draft`,o=t()!==`capture`,_=t()!==`activity`,v=t()!==`running`,y=t()!==`cloud`,b=t()!==`local`,x=t()!==`prs`,S=t()!==`design`,C=t()!==`renders`,w=t()!==`settings`;return r!==n.e&&st(i,n.e=r),a!==n.t&&s.classList.toggle(`hidden`,n.t=a),o!==n.a&&c.classList.toggle(`hidden`,n.a=o),_!==n.o&&l.classList.toggle(`hidden`,n.o=_),v!==n.i&&u.classList.toggle(`hidden`,n.i=v),y!==n.n&&d.classList.toggle(`hidden`,n.n=y),b!==n.s&&f.classList.toggle(`hidden`,n.s=b),x!==n.h&&p.classList.toggle(`hidden`,n.h=x),S!==n.r&&m.classList.toggle(`hidden`,n.r=S),C!==n.d&&h.classList.toggle(`hidden`,n.d=C),w!==n.l&&g.classList.toggle(`hidden`,n.l=w),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),r}})}rt([`pointerdown`,`click`]);var V7=`/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */
288
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, "SF Mono", Menlo, monospace;--color-red-500:oklch(63.7% .237 25.331);--color-white:#fff;--spacing:.25rem;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-wide:.025em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:4px;--radius-md:6px;--radius-lg:10px;--radius-xl:.75rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#0b0c0e;--color-surface:#141517;--color-surface-2:#1c1d21;--color-surface-3:#24262b;--color-border:#26282d;--color-border-strong:#34363d;--color-text:#e8e9eb;--color-text-dim:#8b8e98;--color-text-faint:#5c5f6a;--color-accent:#5e6ad2;--color-accent-hover:#6e79e0;--color-accent-soft:#5e6ad226;--color-success:#4cb782;--color-warn:#f2c94c;--color-danger:#eb5757;--color-danger-soft:#eb575726}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.-top-0{top:0}.-top-0\\.5{top:calc(var(--spacing) * -.5)}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-\\[2px\\]{top:2px}.top-full{top:100%}.-right-0{right:0}.-right-0\\.5{right:calc(var(--spacing) * -.5)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-4{right:calc(var(--spacing) * 4)}.right-full{right:100%}.bottom-0{bottom:0}.bottom-1{bottom:var(--spacing)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-\\[2px\\]{bottom:2px}.bottom-full{bottom:100%}.-left-\\[13\\.5px\\]{left:-13.5px}.left-0{left:0}.left-1{left:var(--spacing)}.left-1\\/2{left:50%}.left-\\[5px\\]{left:5px}.left-full{left:100%}.z-1{z-index:1}.z-10{z-index:10}.z-\\[2147483645\\]{z-index:2147483645}.z-\\[2147483646\\]{z-index:2147483646}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-m-0{margin:0}.-m-0\\.5{margin:calc(var(--spacing) * -.5)}.-m-4{margin:calc(var(--spacing) * -4)}.m-0{margin:0}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-my-1{margin-block:calc(var(--spacing) * -1)}.-my-1\\.5{margin-block:calc(var(--spacing) * -1.5)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-px{margin-top:1px}.mr-0{margin-right:0}.mr-0\\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:var(--spacing)}.mr-1\\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-2\\.5{margin-right:calc(var(--spacing) * 2.5)}.-mb-4{margin-bottom:calc(var(--spacing) * -4)}.mb-0{margin-bottom:0}.mb-0\\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-2\\.5{margin-left:calc(var(--spacing) * 2.5)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.ml-px{margin-left:1px}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.list-item{display:list-item}.table{display:table}.size-0{width:0;height:0}.size-1{width:var(--spacing);height:var(--spacing)}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-\\[9px\\]{width:9px;height:9px}.size-\\[12px\\]{width:12px;height:12px}.size-\\[16px\\]{width:16px;height:16px}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-16{height:calc(var(--spacing) * 16)}.h-\\[8px\\]{height:8px}.h-\\[17px\\]{height:17px}.h-\\[18px\\]{height:18px}.h-\\[20px\\]{height:20px}.h-\\[24px\\]{height:24px}.h-fit{height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-44{max-height:calc(var(--spacing) * 44)}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\\[28rem\\]{max-height:28rem}.max-h-\\[var\\(--rg-edit-list-max-h\\)\\]{max-height:var(--rg-edit-list-max-h)}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[2lh\\]{min-height:2lh}.min-h-\\[28px\\]{min-height:28px}.w-1{width:var(--spacing)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-16{width:calc(var(--spacing) * 16)}.w-28{width:calc(var(--spacing) * 28)}.w-72{width:calc(var(--spacing) * 72)}.w-\\[2px\\]{width:2px}.w-\\[Npx\\]{width:Npx}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\\[55\\%\\]{max-width:55%}.max-w-\\[100vw\\]{max-width:100vw}.max-w-\\[110px\\]{max-width:110px}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-\\[3\\.5ch\\]{min-width:3.5ch}.min-w-\\[3ch\\]{min-width:3ch}.min-w-\\[4ch\\]{min-width:4ch}.min-w-\\[5ch\\]{min-width:5ch}.min-w-\\[6ch\\]{min-width:6ch}.min-w-\\[7ch\\]{min-width:7ch}.min-w-\\[8ch\\]{min-width:8ch}.min-w-\\[10ch\\]{min-width:10ch}.min-w-\\[12ch\\]{min-width:12ch}.min-w-\\[36px\\]{min-width:36px}.min-w-\\[52px\\]{min-width:52px}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-rotate-90{rotate:-90deg}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.list-decimal{list-style-type:decimal}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.grid-rows-\\[0fr\\]{grid-template-rows:0fr}.grid-rows-\\[1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-\\[5px\\]{gap:5px}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-clip{overflow:clip}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[6px\\]{border-radius:6px}.rounded-\\[13px\\]{border-radius:13px}.rounded-\\[14px\\]{border-radius:14px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[var\\(--rg-border-button\\)\\]{border-color:var(--rg-border-button)}.border-accent{border-color:var(--color-accent)}.border-accent\\/40{border-color:#5e6ad266}@supports (color:color-mix(in lab, red, red)){.border-accent\\/40{border-color:color-mix(in oklab, var(--color-accent) 40%, transparent)}}.border-border{border-color:var(--color-border)}.border-danger{border-color:var(--color-danger)}.border-danger\\/40{border-color:#eb575766}@supports (color:color-mix(in lab, red, red)){.border-danger\\/40{border-color:color-mix(in oklab, var(--color-danger) 40%, transparent)}}.border-success{border-color:var(--color-success)}.border-success\\/40{border-color:#4cb78266}@supports (color:color-mix(in lab, red, red)){.border-success\\/40{border-color:color-mix(in oklab, var(--color-success) 40%, transparent)}}.border-text-dim{border-color:var(--color-text-dim)}.border-transparent{border-color:#0000}.border-warn{border-color:var(--color-warn)}.border-warn\\/40{border-color:#f2c94c66}@supports (color:color-mix(in lab, red, red)){.border-warn\\/40{border-color:color-mix(in oklab, var(--color-warn) 40%, transparent)}}.border-t-\\[var\\(--rg-border-subtle\\)\\]{border-top-color:var(--rg-border-subtle)}.border-t-transparent{border-top-color:#0000}.bg-\\[var\\(--rg-error-bg\\)\\]{background-color:var(--rg-error-bg)}.bg-\\[var\\(--rg-panel-bg\\)\\]{background-color:var(--rg-panel-bg)}.bg-\\[var\\(--rg-submit-bg\\)\\]{background-color:var(--rg-submit-bg)}.bg-\\[var\\(--rg-surface-active\\)\\]{background-color:var(--rg-surface-active)}.bg-\\[var\\(--rg-surface-hover\\)\\]{background-color:var(--rg-surface-hover)}.bg-\\[var\\(--rg-text-primary\\)\\]{background-color:var(--rg-text-primary)}.bg-\\[var\\(--rg-text-secondary\\)\\]{background-color:var(--rg-text-secondary)}.bg-accent{background-color:var(--color-accent)}.bg-accent-soft{background-color:var(--color-accent-soft)}.bg-bg{background-color:var(--color-bg)}.bg-bg\\/80{background-color:#0b0c0ecc}@supports (color:color-mix(in lab, red, red)){.bg-bg\\/80{background-color:color-mix(in oklab, var(--color-bg) 80%, transparent)}}.bg-border{background-color:var(--color-border)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--color-danger)}.bg-danger-soft{background-color:var(--color-danger-soft)}.bg-danger\\/10{background-color:#eb57571a}@supports (color:color-mix(in lab, red, red)){.bg-danger\\/10{background-color:color-mix(in oklab, var(--color-danger) 10%, transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-success{background-color:var(--color-success)}.bg-surface{background-color:var(--color-surface)}.bg-surface-2{background-color:var(--color-surface-2)}.bg-surface-3{background-color:var(--color-surface-3)}.bg-text-faint{background-color:var(--color-text-faint)}.bg-transparent{background-color:#0000}.bg-warn{background-color:var(--color-warn)}.bg-warn\\/10{background-color:#f2c94c1a}@supports (color:color-mix(in lab, red, red)){.bg-warn\\/10{background-color:color-mix(in oklab, var(--color-warn) 10%, transparent)}}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:0}.px-0\\.25{padding-inline:calc(var(--spacing) * .25)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-0\\.25{padding-block:calc(var(--spacing) * .25)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-px{padding-block:1px}.pt-0{padding-top:0}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-0{padding-left:0}.pl-0\\.5{padding-left:calc(var(--spacing) * .5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-end{text-align:end}.text-justify{text-align:justify}.text-left{text-align:left}.text-right{text-align:right}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-\\[9\\.5px\\]{font-size:9.5px}.text-\\[9px\\]{font-size:9px}.text-\\[10\\.5px\\]{font-size:10.5px}.text-\\[10px\\]{font-size:10px}.text-\\[11\\.5px\\]{font-size:11.5px}.text-\\[11px\\]{font-size:11px}.text-\\[12\\.5px\\]{font-size:12.5px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.leading-3{--tw-leading:calc(var(--spacing) * 3);line-height:calc(var(--spacing) * 3)}.leading-3\\.5{--tw-leading:calc(var(--spacing) * 3.5);line-height:calc(var(--spacing) * 3.5)}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-extralight{--tw-font-weight:var(--font-weight-extralight);font-weight:var(--font-weight-extralight)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.font-thin{--tw-font-weight:var(--font-weight-thin);font-weight:var(--font-weight-thin)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-normal{overflow-wrap:normal;word-break:normal}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.break-keep{word-break:keep-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-break-spaces{white-space:break-spaces}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--rg-error-text\\)\\]{color:var(--rg-error-text)}.text-\\[var\\(--rg-submit-fg\\)\\]{color:var(--rg-submit-fg)}.text-\\[var\\(--rg-text-primary\\)\\]{color:var(--rg-text-primary)}.text-\\[var\\(--rg-text-primary-85\\)\\]{color:var(--rg-text-primary-85)}.text-\\[var\\(--rg-text-secondary\\)\\]{color:var(--rg-text-secondary)}.text-accent{color:var(--color-accent)}.text-danger{color:var(--color-danger)}.text-success{color:var(--color-success)}.text-text{color:var(--color-text)}.text-text-dim{color:var(--color-text-dim)}.text-text-faint{color:var(--color-text-faint)}.text-warn{color:var(--color-warn)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.accent-accent{accent-color:var(--color-accent)}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[box-shadow\\:var\\(--rg-shadow\\)\\]{box-shadow:var(--rg-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\\[filter\\:var\\(--rg-drop-shadow\\)\\]{filter:var(--rg-drop-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-columns\\]{transition-property:grid-template-columns;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[padding\\,border-radius\\,transform\\]{transition-property:padding,border-radius,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[top\\,left\\,width\\,height\\,opacity\\,border-radius\\]{transition-property:top,left,width,height,opacity,border-radius;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,color\\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.delay-\\[80ms\\]{transition-delay:80ms}.duration-60{--tw-duration:60ms;transition-duration:60ms}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-140{--tw-duration:.14s;transition-duration:.14s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-180{--tw-duration:.18s;transition-duration:.18s}.duration-220{--tw-duration:.22s;transition-duration:.22s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.ease-\\[cubic-bezier\\(0\\,0\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-\\[opacity\\,transform\\]{will-change:opacity,transform}.will-change-transform{will-change:transform}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}.group-open\\:rotate-90:is(:where(.group):is([open],:popover-open,:open) *){rotate:90deg}@media (hover:hover){.group-hover\\:text-\\[var\\(--rg-text-primary\\)\\]:is(:where(.group):hover *){color:var(--rg-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\\:text-text-faint::placeholder{color:var(--color-text-faint)}@media (hover:hover){.hover\\:bg-\\[var\\(--rg-error-bg-hover\\)\\]:hover{background-color:var(--rg-error-bg-hover)}.hover\\:bg-\\[var\\(--rg-surface-active\\)\\]:hover{background-color:var(--rg-surface-active)}.hover\\:bg-\\[var\\(--rg-surface-hover\\)\\]:hover{background-color:var(--rg-surface-hover)}.hover\\:bg-accent-hover:hover{background-color:var(--color-accent-hover)}.hover\\:bg-accent\\/50:hover{background-color:#5e6ad280}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/50:hover{background-color:color-mix(in oklab, var(--color-accent) 50%, transparent)}}.hover\\:bg-danger\\/30:hover{background-color:#eb57574d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-danger\\/30:hover{background-color:color-mix(in oklab, var(--color-danger) 30%, transparent)}}.hover\\:bg-surface-2:hover{background-color:var(--color-surface-2)}.hover\\:bg-surface-3:hover{background-color:var(--color-surface-3)}.hover\\:text-\\[var\\(--rg-text-primary\\)\\]:hover{color:var(--rg-text-primary)}.hover\\:text-accent:hover{color:var(--color-accent)}.hover\\:text-danger:hover{color:var(--color-danger)}.hover\\:text-text:hover{color:var(--color-text)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}}.focus\\:border-accent:focus{border-color:var(--color-accent)}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-accent:active{background-color:var(--color-accent)}.active\\:transition-none:active{transition-property:none}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-surface-3:disabled{background-color:var(--color-surface-3)}.disabled\\:text-text-faint:disabled{color:var(--color-text-faint)}.disabled\\:opacity-40:disabled{opacity:.4}@media (hover:hover){.disabled\\:hover\\:bg-surface-2:disabled:hover{background-color:var(--color-surface-2)}}.data-\\[state\\=on\\]\\:transition-none[data-state=on],.data-\\[state\\=open\\]\\:transition-none[data-state=open],.data-\\[state\\=…\\]\\:transition-none[data-state=…]{transition-property:none}}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}[data-theme=light],:host([data-theme=light]){--color-bg:#fbfbfc;--color-surface:#fff;--color-surface-2:#f4f4f6;--color-surface-3:#e9e9ee;--color-border:#e2e2e8;--color-border-strong:#cfcfd8;--color-text:#1b1c20;--color-text-dim:#5c5f6a;--color-text-faint:#9a9da8;--color-accent-soft:#5e6ad21f;--color-danger-soft:#eb57571a;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:light){:root:not([data-theme=dark]){--color-bg:#fbfbfc;--color-surface:#fff;--color-surface-2:#f4f4f6;--color-surface-3:#e9e9ee;--color-border:#e2e2e8;--color-border-strong:#cfcfd8;--color-text:#1b1c20;--color-text-dim:#5c5f6a;--color-text-faint:#9a9da8;--color-accent-soft:#5e6ad21f;--color-danger-soft:#eb57571a;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}}body{background-color:var(--color-bg);font-family:var(--font-sans);color:var(--color-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-width:320px;margin:0;font-size:13px}@keyframes geist-spinner-fade{0%{opacity:1}to{opacity:.15}}[data-tip]{position:relative}[data-tip]:hover:after{content:attr(data-tip);color:#fff;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;z-index:60;background:#1b1c20;border-radius:6px;max-width:260px;padding:3px 8px;font-size:10.5px;font-weight:500;line-height:1.35;position:absolute;bottom:calc(100% + 6px);left:50%;overflow:hidden;transform:translate(-50%);box-shadow:0 4px 12px #0000004d}[data-tip][data-tip-pos~=right]:hover:after{left:0;transform:none}[data-tip][data-tip-pos~=left]:hover:after{left:auto;right:0;transform:none}[data-tip][data-tip-pos~=bottom]:hover:after{top:calc(100% + 6px);bottom:auto}.no-scrollbar{scrollbar-width:none}.no-scrollbar::-webkit-scrollbar{display:none}.lg-md p{margin:0 0 6px}.lg-md p:last-child{margin-bottom:0}.lg-md a{color:var(--color-accent);word-break:break-all;text-decoration:none}.lg-md a:hover{text-decoration:underline}.lg-md code{background:var(--color-surface-2);border:1px solid var(--color-border);font-family:var(--font-mono);border-radius:4px;padding:0 4px;font-size:11px}.lg-md pre{background:var(--color-surface-2);border:1px solid var(--color-border);border-radius:6px;margin:6px 0;padding:8px;overflow-x:auto}.lg-md pre code{white-space:pre;background:0 0;border:none;padding:0;font-size:11px}.lg-md ul,.lg-md ol{flex-direction:column;gap:2px;margin:4px 0 6px;padding-left:18px;display:flex}.lg-md ul{list-style:outside}.lg-md ol{list-style:decimal}.lg-md h4{margin:8px 0 4px;font-size:12px;font-weight:600}.lg-md lg-media{display:block}.lg-md lg-media img,.lg-md lg-media video{border:1px solid var(--color-border);border-radius:6px;max-width:100%;margin:4px 0}.lg-md video{border:1px solid var(--color-border);background:#000;border-radius:6px;max-width:100%;margin:4px 0}.lg-md img{border:1px solid var(--color-border);border-radius:6px;max-width:100%;margin:4px 0}.lg-md strong{font-weight:600}*{scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:var(--color-border-strong);border-radius:4px}::-webkit-scrollbar-track{background:0 0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}`;Br();var H7=N(`<span aria-hidden class="bg-danger size-2 shrink-0 animate-pulse rounded-full">`),U7=N(`<span class="text-text min-w-[5ch] text-[11px] font-medium tabular-nums">`),W7=N(`<button class="bg-accent hover:bg-accent-hover h-7 cursor-pointer rounded-full px-2.5 text-[11px] font-medium text-white transition-colors"><span class="inline-block min-w-[4ch] text-center">Stop`),G7=N(`<p class="text-warn px-1.5 pt-1 pb-1.5 text-[10.5px] font-semibold tracking-wide uppercase">Needs review`),K7=N(`<div><p class="text-text-dim px-1.5 pt-1 pb-1.5 text-[10.5px] font-semibold tracking-wide uppercase">Running agents`),q7=N(`<div class="fixed z-[2147483646] select-none"><div class="bg-surface border-border text-text flex h-9 cursor-grab items-center gap-1 rounded-full border py-1 pr-1 pl-2.5 font-sans shadow-lg active:cursor-grabbing">`),J7=N(`<div><div title="Drag to resize">`),Y7=N(`<button title="Open Linear Grab"aria-label="Open Linear Grab"class="text-accent hover:opacity-80 inline-flex cursor-pointer items-center gap-1.5">`),X7=N(`<span class="bg-border h-4 w-px"aria-hidden>`),Z7=N(`<span aria-hidden class="bg-warn size-2 rounded-full">`),Q7=N(`<span class="text-warn min-w-[3.5ch] text-left text-[11px] font-medium tabular-nums"> rev`),$7=N(`<button title="Running agents"aria-label="Running agents"class="hover:bg-surface-2 flex h-7 cursor-pointer items-center gap-1.5 rounded-full px-2 transition-colors"><span aria-hidden></span><span>`),e9=N(`<span aria-hidden class="bg-accent size-2 shrink-0 animate-pulse rounded-full">`),t9=N(`<span class="text-text min-w-[3ch] text-[11px] font-medium tabular-nums">s`),n9=N(`<span class="text-text-dim min-w-[7ch] text-[11px] tabular-nums"> states`),r9=N(`<p class="text-text-faint px-1.5 pb-1.5 text-[11.5px]">No agents running right now.`),i9=N(`<button class="hover:bg-surface-2 flex w-full cursor-pointer flex-col gap-0.5 rounded-md px-1.5 py-1.5 text-left transition-colors"><span class="flex min-w-0 items-center gap-1.5"><span aria-hidden class="size-1.5 shrink-0 rounded-full"></span><span class="font-mono text-text-dim shrink-0 text-[10.5px]"></span><span class="text-text truncate text-[11.5px]"></span></span><span class="text-text-faint pl-3 text-[10.5px] tabular-nums"> · <!> · `);function a9(e={}){if(typeof window>`u`||window.__LINEAR_GRAB_PAGE__)return;window.__LINEAR_GRAB_PAGE__=!0;let t=()=>{dk(),B2(),$4(),G8(),YZ();let t=document.createElement(`div`);t.id=`linear-grab-root`,document.body.appendChild(t);let n=e=>{let n=e.composedPath();if(!n.includes(t))return;e.stopImmediatePropagation();let r=n[0];e instanceof KeyboardEvent&&r&&r!==t&&r.dispatchEvent(new KeyboardEvent(e.type,{key:e.key,code:e.code,location:e.location,repeat:e.repeat,isComposing:e.isComposing,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,bubbles:!1,cancelable:!1}))};for(let e of[`keydown`,`keyup`,`keypress`])window.addEventListener(e,n,{capture:!0});let r=t.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=V7,r.appendChild(i);let a=document.createElement(`div`);r.appendChild(a);let o=()=>a.setAttribute(`data-theme`,o9());o(),matchMedia(`(prefers-color-scheme: light)`).addEventListener(`change`,o),nt(()=>j(f9,{get defaultOpen(){return e.defaultOpen??!1}}),a)};document.body?t():document.addEventListener(`DOMContentLoaded`,t,{once:!0})}function o9(){try{let e=[document.body,document.documentElement];for(let t of e){let e=getComputedStyle(t).backgroundColor.match(/rgba?\(([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+))?/);if(!(!e||e[4]!==void 0&&Number(e[4])===0))return .2126*e[1]+.7152*e[2]+.0722*e[3]>140?`light`:`dark`}}catch{}return matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}var s9=130,c9=36,l9=380,u9=280,d9=720;function f9(e){let[t,n]=T(e.defaultOpen),[r,i]=T(`right`),[a,o]=T({x:Math.max(8,window.innerWidth-s9-24),y:Math.max(8,window.innerHeight-c9-20)}),[s,c]=T({running:[],review:[]}),l=()=>s().running,u=()=>s().review,[d,f]=T(!1),[p,m]=T(WD().phase),[h,g]=T({active:!1,msLeft:0,total:0,byTrigger:{}}),[_,v]=T(0);ie(()=>{let e=setInterval(()=>{p()===`recording`&&v(Date.now()-(WD().startedAt??Date.now()))},250);ae(()=>clearInterval(e))});let y=e=>{let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},[b,x]=T(null),S=e=>({x:Math.min(Math.max(8,e.x),window.innerWidth-s9-8),y:Math.min(Math.max(8,e.y),window.innerHeight-c9-8)}),C=e=>({x:Math.min(Math.max(8-(ne()-80),e.x),window.innerWidth-80),y:Math.min(Math.max(0,e.y),window.innerHeight-80)}),[w,E]=T(!1),[k,ee]=T(`cloud`),[te,A]=T(!1),[ne,re]=T(l9),oe=e=>Math.min(d9,Math.max(u9,Math.min(e,window.innerWidth-60)));O(()=>{let e=document.documentElement,n=t()&&w();e.style.marginRight=n&&r()===`right`?`${ne()}px`:``,e.style.marginLeft=n&&r()===`left`?`${ne()}px`:``}),ae(()=>{document.documentElement.style.marginRight=``,document.documentElement.style.marginLeft=``});let se=()=>{let e=!w();E(e),e&&x(null),Er({panelMode:e?`pinned`:`overlay`,panelPos:void 0})};ie(()=>{Tr().then(e=>{e.panelSide&&i(e.panelSide),e.launcherPos&&o(S(e.launcherPos)),e.panelPos&&x(C(e.panelPos)),e.panelWidth&&re(oe(e.panelWidth)),E(e.panelMode===`pinned`),ee(e.workflowMode??`cloud`)});let e=Mr(e=>{e===`settings`&&Tr().then(e=>{i(e.panelSide??`right`),E(e.panelMode===`pinned`),ee(e.workflowMode??`cloud`)}),e===`grab`&&k()!==`local`&&n(!0)}),t=()=>{A(!0),setTimeout(()=>A(!1),1600)};window.addEventListener(BZ,t);let r=()=>{f(!1),w()||n(!1)};window.addEventListener(VZ,r);let s=()=>n(!0);window.addEventListener(`linear-grab:picker-finished`,s),ae(()=>{window.removeEventListener(BZ,t),window.removeEventListener(VZ,r),window.removeEventListener(`linear-grab:picker-finished`,s)});let l=t$(c);ae(a2(g));let u=WD().phase,d=GD(e=>{m(e.phase),e.phase===`recording`&&u!==`recording`&&!w()&&n(!1),e.phase===`ready`&&u!==`ready`&&(cj(`capture`),n(!0)),u=e.phase}),p=()=>{o(S(a()));let e=b();e&&x(C(e))};window.addEventListener(`resize`,p),ae(()=>{e(),l(),d(),window.removeEventListener(`resize`,p)})});let ce=!1,le=e=>{if(e.button!==0)return;let t={x:e.clientX,y:e.clientY},n=a();ce=!1;let r=e=>{let r=e.clientX-t.x,i=e.clientY-t.y;Math.abs(r)+Math.abs(i)>4&&(ce=!0),ce&&o(S({x:n.x+r,y:n.y+i}))},i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),ce&&Er({launcherPos:a()}),setTimeout(()=>{ce=!1},0)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)},ue=()=>a().y>260,de=e=>{f(!1),cj(`activity`,e),n(!0)},fe=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=e.clientX,n=ne(),i=b(),a=e=>{let a=e.clientX-t,o=r()===`right`?-a:a,s=oe(n+o);re(s),i&&r()===`right`&&x(C({x:i.x+(n-s),y:i.y}))},o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),Er({panelWidth:ne(),...b()?{panelPos:b()}:{}})};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)},pe=e=>{if(e.button!==0)return;if(e.detail===2){x(null),Er({panelPos:void 0});return}let t={x:e.clientX,y:e.clientY},n=b()??{x:r()===`right`?window.innerWidth-ne():0,y:0},i=!1,a=e=>{let r=e.clientX-t.x,a=e.clientY-t.y;Math.abs(r)+Math.abs(a)>4&&(i=!0),i&&x(C({x:n.x+r,y:n.y+a}))},o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o);let e=b();i&&e&&Er({panelPos:e})};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)};return[j(M,{get when(){return!t()},get children(){var e=q7(),t=e.firstChild;return t.$$click=()=>{ce||p()===`recording`||h().active||(f(!1),n(!0))},t.$$pointerdown=le,P(t,j(M,{get when(){return p()===`recording`||h().active},get fallback(){return[(()=>{var e=Y7();return e.$$click=()=>{ce||(f(!1),n(!0))},P(e,j(z7,{size:13})),e})(),X7(),(()=>{var e=$7(),t=e.firstChild,n=t.nextSibling;return e.$$click=e=>{e.stopPropagation(),!ce&&f(e=>!e)},P(n,(()=>{var e=$e(()=>!!te());return()=>e()?`Copied ✓`:`${l().length} run`})()),P(e,j(M,{get when(){return $e(()=>!te())()&&u().length>0},get children(){return[Z7(),(()=>{var e=Q7(),t=e.firstChild;return P(e,()=>u().length,t),e})()]}}),null),D(e=>{var r=`size-2 rounded-full ${te()?`bg-success`:l().length?`bg-success animate-pulse`:`bg-text-faint`}`,i=`min-w-[3.5ch] text-left text-[11px] font-medium tabular-nums ${te()?`text-success`:`text-text-dim`}`;return r!==e.e&&st(t,e.e=r),i!==e.t&&st(n,e.t=i),e},{e:void 0,t:void 0}),e})()]},get children(){return j(M,{get when(){return p()===`recording`},get fallback(){return[e9(),(()=>{var e=t9(),t=e.firstChild;return P(e,()=>Math.ceil(h().msLeft/1e3),t),e})(),(()=>{var e=n9(),t=e.firstChild;return P(e,()=>h().total,t),D(()=>it(e,`title`,Object.entries(h().byTrigger).map(([e,t])=>`${t} ${e}`).join(` · `)||`hover / open the component to record its states`)),e})(),(()=>{var e=W7();return e.$$click=e=>{e.stopPropagation(),!ce&&s2()},e})()]},get children(){return[H7(),(()=>{var e=U7();return P(e,()=>y(_())),e})(),(()=>{var e=W7();return e.$$click=()=>{ce||nO()},e})()]}})}})),P(e,j(M,{get when(){return d()},get children(){var e=K7(),t=e.firstChild;return P(e,j(M,{get when(){return u().length>0},get children(){return[G7(),j(We,{get each(){return u()},children:e=>j(p9,{agent:e,review:!0,onOpen:de})})]}}),t),P(e,j(M,{get when(){return l().length>0},get fallback(){return r9()},get children(){return j(We,{get each(){return l()},children:e=>j(p9,{agent:e,onOpen:de})})}}),null),D(()=>st(e,`bg-surface border-border absolute w-72 rounded-lg border p-1.5 font-sans shadow-2xl ${ue()?`bottom-full mb-2`:`top-full mt-2`} ${a().x>window.innerWidth-300?`right-0`:`left-0`}`)),e}}),null),D(t=>{var n=`${a().x}px`,r=`${a().y}px`;return n!==t.e&&dt(e,`left`,t.e=n),r!==t.t&&dt(e,`top`,t.t=r),t},{e:void 0,t:void 0}),e}}),j(M,{get when(){return t()},get children(){var e=J7(),t=e.firstChild;return t.$$pointerdown=fe,P(e,j(B7,{onGrab:()=>n(!0),onClose:()=>n(!1),get onHeaderPointerDown(){return w()?void 0:pe},get pinned(){return w()},onTogglePin:se}),null),D(n=>{var i=`bg-bg text-text border-border fixed z-[2147483645] flex max-w-[100vw] flex-col overflow-hidden font-sans text-[13px] antialiased ${w()?``:`shadow-2xl`} ${!w()&&b()?`rounded-xl border`:r()===`right`?`top-0 right-0 h-screen border-l`:`top-0 left-0 h-screen border-r`}`,a={width:`${ne()}px`,...!w()&&b()?{left:`${b().x}px`,top:`${b().y}px`,height:`${Math.min(680,window.innerHeight-16)}px`}:{}},o=`hover:bg-accent/50 active:bg-accent absolute top-0 z-10 h-full w-1 cursor-col-resize transition-colors ${r()===`right`?`left-0`:`right-0`}`;return i!==n.e&&st(e,n.e=i),n.t=ut(e,a,n.t),o!==n.a&&st(t,n.a=o),n},{e:void 0,t:void 0,a:void 0}),e}})]}function p9(e){return(()=>{var t=i9(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=n.nextSibling,s=o.firstChild,c=s.nextSibling;return c.nextSibling,t.$$click=()=>e.onOpen(e.agent.id),P(i,()=>e.agent.identifier),P(a,()=>e.agent.title),P(o,(()=>{var t=$e(()=>!!e.review);return()=>t()?`PR ready · needs review`:e.agent.stateName})(),s),P(o,()=>e.agent.delegateName,c),P(o,()=>m9(e.agent.updatedAt),null),D(t=>dt(r,`background`,e.review?`var(--color-warn)`:e.agent.stateColor)),t})()}function m9(e){let t=Math.max(0,Math.floor((Date.now()-Date.parse(e))/1e3));return t<60?`now`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`}rt([`pointerdown`,`click`]),a9()})();
297
+ docs/design-tokens.md`,get value(){return n().skillPaths??``},onBlur:e=>{r({skillPaths:e.currentTarget.value.trim()||void 0})}})}}),j(Hj,{label:`Test account`,hint:`The cloud agent logs into the app with this while testing and recording its demo. Added to every issue's Agent instructions. Use a throwaway account — it's visible to everyone who can read the issue.`,get children(){var e=s7();return P(e,j(Ij,{placeholder:`Username or email (e.g. demo@yourapp.com)`,get value(){return n().testUsername??``},onBlur:e=>{r({testUsername:e.currentTarget.value.trim()||void 0})}}),null),P(e,j(Ij,{type:`password`,placeholder:`Password`,get value(){return n().testPassword??``},onBlur:e=>{r({testPassword:e.currentTarget.value.trim()||void 0})}}),null),e}})]}})}}),null),P(e,j(M,{when:!xr,get children(){return j(Uj,{title:`Panel`,get children(){return[(()=>{var e=c7(),t=e.firstChild.nextSibling;return P(t,j(We,{each:[{id:`overlay`,label:`Overlay`},{id:`pinned`,label:`Beside page`}],children:e=>(()=>{var t=x7();return t.$$click=()=>void r({panelMode:e.id,panelPos:void 0}),P(t,()=>e.label),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${(n().panelMode??`overlay`)===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),e})(),(()=>{var e=l7(),t=e.firstChild.nextSibling;return P(t,j(We,{each:[`left`,`right`],children:e=>(()=>{var t=x7();return t.$$click=()=>void r({panelSide:e}),P(t,e===`left`?`Left`:`Right`),D(()=>st(t,`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${(n().panelSide??`right`)===e?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),e})()]}})}}),null),P(e,j(Uj,{title:`Local Claude Code`,get children(){return j(Hj,{label:`Bridge URL`,hint:'Run `npx linear-grab-bridge` in your repo\'s terminal (binds localhost only). Enables "Delegate to → Local Claude Code" in Draft, the Local tab, and relays blocked uploads to Linear storage.',get children(){return j(Ij,{placeholder:`http://localhost:4577`,get value(){return n().bridgeUrl??``},onBlur:e=>{r({bridgeUrl:e.currentTarget.value.trim()||void 0})}})}})}}),null),P(e,j(Uj,{title:`Project config (.lineargrab.json)`,get children(){return[u7(),(()=>{var e=f7();return P(e,j(M,{get when(){return c.data?.projectConfig},get fallback(){return j(Wj,{title:`No .lineargrab.json found at the bridge's cwd (or bridge offline / outdated)`,children:`not detected`})},get children(){return[j(Wj,{class:`text-success`,children:`detected`}),j(q,{variant:`ghost`,class:`h-7 px-2 text-[11px]`,title:`Overwrite your local settings with every value from the repo's config`,onClick:f,children:`Apply all`})]}}),null),P(e,j(q,{variant:`ghost`,class:`h-7 px-2 text-[11px]`,get title(){return l()?`Copied!`:`Copy your current shareable settings as .lineargrab.json — commit it to the repo root`},onClick:()=>void d(),get children(){var e=d7();return P(e,()=>l()?`Copied ✓`:`Copy config`),e}}),null),e})()]}}),null),P(e,j(Uj,{title:`Asset uploads`,get children(){return[j(Hj,{label:`GitHub token`,hint:`Linear's storage blocks browser uploads in some browsers (Safari). With this set, GIFs/screenshots upload to your GitHub repo instead and embed automatically. Fine-grained PAT with Contents read/write on the assets repo.`,get children(){return j(Ij,{type:`password`,placeholder:`github_pat_…`,get value(){return n().githubToken??``},onBlur:e=>{r({githubToken:e.currentTarget.value.trim()||void 0})}})}}),j(Hj,{label:`Assets repository`,hint:`owner/repo — must be PUBLIC so Linear (and agents) can render the images. Files land under linear-grab/.`,get children(){return j(Ij,{placeholder:`ahmedbanihanibh/linear-grab-assets`,get value(){return n().githubAssetsRepo??``},onBlur:e=>{r({githubAssetsRepo:e.currentTarget.value.trim()||void 0})}})}})]}}),null),P(e,j(Uj,{title:`Notifications`,get children(){return[j(Hj,{label:`Slack bot token`,hint:`Bot token (xoxb-…) with chat:write + channels:read + files:write. New issues get announced with links + demo, and the AGENT receives the token to post its finished demo video itself.`,get children(){return j(Ij,{type:`password`,placeholder:`xoxb-…`,get value(){return n().slackToken??``},onBlur:e=>{r({slackToken:e.currentTarget.value.trim()||void 0})}})}}),j(M,{get when(){return n().slackToken},get children(){return j(Hj,{label:`Slack channel`,get children(){return j(M,{get when(){return!ae.isError},get fallback(){return j(qj,{message:`Couldn't list channels — check the token scopes (channels:read).`})},get children(){return j(Rj,{get value(){return n().slackChannelId??``},get disabled(){return ae.isLoading},onChange:e=>{let t=e.currentTarget.value,n=ae.data?.find(e=>e.id===t);r({slackChannelId:t||void 0,slackChannelName:n?.name})},get children(){return[p7(),j(We,{get each(){return ae.data??[]},children:e=>(()=>{var t=M7();return t.firstChild,P(t,()=>e.name,null),D(()=>t.selected=e.id===n().slackChannelId),D(()=>t.value=e.id),t})()})]}})}})}})}}),j(Hj,{label:`Telegram bot token`,hint:`From @BotFather. The agent also receives it to send the demo video (sendVideo).`,get children(){return j(Ij,{type:`password`,placeholder:`123456:ABC-…`,get value(){return n().telegramToken??``},onBlur:e=>{r({telegramToken:e.currentTarget.value.trim()||void 0})}})}}),j(M,{get when(){return n().telegramToken},get children(){return j(Hj,{label:`Telegram chat ID`,hint:`Add the bot to your group/channel, send a message, then read the chat id from api.telegram.org/bot<token>/getUpdates.`,get children(){return j(Ij,{placeholder:`-1001234567890`,get value(){return n().telegramChatId??``},onBlur:e=>{r({telegramChatId:e.currentTarget.value.trim()||void 0})}})}})}}),(()=>{var e=m7(),t=e.firstChild;return t.addEventListener(`change`,e=>void r({notifyOnCreate:e.currentTarget.checked?void 0:!1})),D(()=>t.checked=n().notifyOnCreate!==!1),e})(),h7()]}}),null),P(e,j(Uj,{title:`AI providers`,get children(){return[j(Hj,{label:`OpenAI API key`,get children(){return j(Ij,{type:`password`,placeholder:`sk-…`,get value(){return n().openaiKey??``},onBlur:e=>{r({openaiKey:e.currentTarget.value.trim()||void 0})}})}}),j(Hj,{label:`OpenAI model`,get hint(){return`Model id used for drafting (both tiers). Empty = defaults: ${Fx.openai.fast} (fast) / ${Fx.openai.best} (best).`},get children(){return j(Ij,{get placeholder(){return Fx.openai.fast},get value(){return n().openaiModel??``},onBlur:e=>{r({openaiModel:e.currentTarget.value.trim()||void 0})}})}}),j(Hj,{label:`Anthropic API key`,get children(){return j(Ij,{type:`password`,placeholder:`sk-ant-…`,get value(){return n().anthropicKey??``},onBlur:e=>{r({anthropicKey:e.currentTarget.value.trim()||void 0})}})}}),j(Hj,{label:`Anthropic model`,get hint(){return`Model id used for drafting (both tiers). Empty = defaults: ${Fx.anthropic.fast} (fast) / ${Fx.anthropic.best} (best).`},get children(){return j(Ij,{get placeholder(){return Fx.anthropic.fast},get value(){return n().anthropicModel??``},onBlur:e=>{r({anthropicModel:e.currentTarget.value.trim()||void 0})}})}}),(()=>{var e=g7(),t=e.firstChild.nextSibling.firstChild,i=t.nextSibling,a=i.nextSibling;return t.$$click=()=>void r({preferredProvider:void 0}),i.$$click=()=>void r({preferredProvider:`openai`}),a.$$click=()=>void r({preferredProvider:`anthropic`}),D(e=>{var r=`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors ${n().preferredProvider===void 0?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`,o=`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors disabled:cursor-not-allowed ${n().preferredProvider===`openai`?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer disabled:text-text-faint`}`,s=!n().openaiKey,c=`flex-1 rounded-[5px] px-2 py-0.5 text-[11.5px] font-medium transition-colors disabled:cursor-not-allowed ${n().preferredProvider===`anthropic`?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer disabled:text-text-faint`}`,l=!n().anthropicKey;return r!==e.e&&st(t,e.e=r),o!==e.t&&st(i,e.t=o),s!==e.a&&(i.disabled=e.a=s),c!==e.o&&st(a,e.o=c),l!==e.i&&(a.disabled=e.i=l),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e})(),(()=>{var e=v7();return P(e,j(M,{get when(){return se()},get fallback(){return N7()},get children(){var e=_7();return P(e,se),e}})),e})()]}}),null),P(e,j(Uj,{title:`How it works`,get children(){return y7()}}),null),e})()}rt([`click`]);var F7=`linear-grab`,I7=`queries`,L7=[`my-issues`,`issue`,`sessions`,`teams`,`agents`];function R7(){return new Promise(e=>{try{let t=indexedDB.open(F7,1);t.onupgradeneeded=()=>t.result.createObjectStore(I7),t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)}catch{e(null)}})}function z7(e){return typeof e[0]==`string`&&L7.includes(e[0])}async function B7(e){let t=await R7();if(!t)return()=>{};await new Promise(n=>{try{let r=t.transaction(I7,`readonly`).objectStore(I7).openCursor();r.onsuccess=()=>{let t=r.result;if(!t)return n();try{let{queryKey:n,data:r}=t.value;z7(n)&&e.getQueryData(n)===void 0&&e.setQueryData(n,r,{updatedAt:0})}catch{}t.continue()},r.onerror=()=>n()}catch{n()}});let n=new Map,r=e.getQueryCache().subscribe(r=>{if(r.type!==`updated`||r.action.type!==`success`)return;let{queryKey:i,queryHash:a}=r.query;if(!z7(i))return;let o=n.get(a);o&&clearTimeout(o),n.set(a,setTimeout(()=>{n.delete(a);try{let n=e.getQueryData(i);if(n===void 0)return;t.transaction(I7,`readwrite`).objectStore(I7).put({queryKey:i,data:n},a)}catch{}},400))});return()=>{r();for(let e of n.values())clearTimeout(e);t.close()}}Br();var V7=N(`<svg viewBox="0 0 100 100"fill=currentColor aria-hidden><path d="M1.22541 61.5228c-.2225-.9485.90748-1.5459 1.59638-.857L39.3342 97.1782c.6889.6889.0915 1.8189-.857 1.5964C20.0515 94.4522 5.54779 79.9485 1.22541 61.5228ZM.00189135 46.8891c-.01764375.2833.08887215.5599.28957165.7606L52.3503 99.7085c.2007.2007.4773.3075.7606.2896 2.3692-.1476 4.6938-.46 6.9624-.9259.7645-.157 1.0301-1.0963.4782-1.6481L2.57595 39.4485c-.55186-.5519-1.49117-.2863-1.648174.4782-.465915 2.2686-.77832 4.5932-.92588465 6.9624ZM4.21093 29.7054c-.16649.3738-.08169.8106.20765 1.1l64.77602 64.776c.2894.2894.7262.3742 1.1.2077 1.7861-.7956 3.5171-1.6927 5.1855-2.684.5521-.328.6373-1.0867.1832-1.5407L8.43566 24.3367c-.45409-.4541-1.21271-.3689-1.54074.1832-.99132 1.6684-1.88843 3.3994-2.68399 5.1855ZM12.6587 18.074c-.3701-.3701-.393-.9637-.0443-1.3541C21.7795 6.45931 35.1114 0 49.9519 0 77.5927 0 100 22.4073 100 50.0481c0 14.8405-6.4593 28.1724-16.7199 37.3375-.3903.3487-.984.3258-1.3541-.0443L12.6587 18.074Z">`),H7=N(`<button><svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><rect x=1.5 y=2.5 width=13 height=11 rx=1.5></rect><path d="M10 2.5v11">`),U7=N(`<button aria-label="Minimize to launcher"title="Minimize to launcher"class="text-text-dim hover:text-text hover:bg-surface-3 grid size-6 shrink-0 cursor-pointer place-items-center rounded-md text-[15px] leading-none transition-colors">–`),W7=N(`<div class="bg-bg text-text flex h-full flex-col"><header><span class="text-accent mr-0.5 inline-flex shrink-0"title="Linear Grab"></span><div class="no-scrollbar flex min-w-0 flex-1 items-center gap-1 overflow-x-auto"></div></header><main class="min-h-0 flex-1"><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full></div><div class=h-full>`),G7=N(`<button>`),K7=[{id:`draft`,label:`Draft`},{id:`capture`,label:`Capture`},{id:`activity`,label:`Activity`},{id:`running`,label:`Running`},{id:`cloud`,label:`Cloud`},{id:`local`,label:`Local`},{id:`prs`,label:`PRs`},{id:`design`,label:`Design`},{id:`renders`,label:`Renders`},{id:`settings`,label:`Settings`}],q7=new Set;function J7(e,t,n){if(q7.has(e)||typeof Notification>`u`)return;q7.add(e);let r=()=>new Notification(t,{body:n});Notification.permission===`granted`?r():Notification.permission==="default"&&Notification.requestPermission().then(e=>e===`granted`&&r())}function Y7(){setInterval(()=>{LO().then(e=>{for(let t of e){if(t.status!==`running`)continue;let e=t.lastEventAt??t.startedAt;Date.now()-e>10*6e4&&J7(`local-stuck:${t.id}:${e}`,`Local agent may be stuck`,`${t.title.slice(0,80)} — no output for ${Math.round((Date.now()-e)/6e4)}m. Nudge or interrupt it in the Local tab.`)}}).catch(()=>{}),bO().then(e=>{for(let t of e)/awaitingInput|elicit/i.test(t.status)&&J7(`cloud-input:${t.id}`,`Cloud agent needs input`,`${t.issue?.identifier??`Session`} — ${t.issue?.title?.slice(0,80)??`a Cursor agent`} is waiting for you.`)}).catch(()=>{})},6e4)}Y7();var X7=new gr({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});function Z7(e){return(()=>{var t=V7();return D(n=>{var r=e.size??14,i=e.size??14;return r!==n.e&&it(t,`width`,n.e=r),i!==n.t&&it(t,`height`,n.t=i),n},{e:void 0,t:void 0}),t})()}function Q7(e){let[t,n]=T(`draft`),r=()=>{X7.invalidateQueries({queryKey:[`grab`]}),mj()===`capture`&&n(`capture`),e.onGrab?.()};return O(()=>{let e=cj();e&&n(e)}),ie(()=>{let e=B7(X7),t=sQ(r),n=()=>{ek().then(A$),qO(),IO().then(async e=>{if(!e.projectConfig)return;let t=W5(await Tr(),e.projectConfig);t&&await Er(t)}).catch(()=>{})};n();let i=Mr(e=>{e===`settings`&&(X7.invalidateQueries({queryKey:[`settings`]}),n()),e===`grab`&&r()});ae(()=>{t(),i(),e.then(e=>e())})}),j(cr,{client:X7,get children(){var r=W7(),i=r.firstChild,a=i.firstChild,o=a.nextSibling,s=i.nextSibling.firstChild,c=s.nextSibling,l=c.nextSibling,u=l.nextSibling,d=u.nextSibling,f=d.nextSibling,p=f.nextSibling,m=p.nextSibling,h=m.nextSibling,g=h.nextSibling;return i.$$pointerdown=t=>e.onHeaderPointerDown?.(t),P(a,j(Z7,{size:14})),P(o,j(We,{each:K7,children:e=>(()=>{var r=G7();return r.$$click=()=>n(e.id),P(r,()=>e.label),D(()=>st(r,`h-6 shrink-0 rounded-md px-2 text-[12px] font-medium whitespace-nowrap transition-colors ${t()===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),r})()})),P(i,j(M,{get when(){return e.onTogglePin},get children(){var t=H7();return t.$$click=()=>e.onTogglePin?.(),D(n=>{var r=e.pinned?`Switch to overlay`:`Dock beside page`,i=e.pinned?`Overlay the page`:`Dock beside page (squeezes the app, DevTools-style)`,a=`hover:bg-surface-3 grid size-6 shrink-0 cursor-pointer place-items-center rounded-md transition-colors ${e.pinned?`text-accent`:`text-text-dim hover:text-text`}`;return r!==n.e&&it(t,`aria-label`,n.e=r),i!==n.t&&it(t,`title`,n.t=i),a!==n.a&&st(t,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t}}),null),P(i,j(M,{get when(){return e.onClose},get children(){var t=U7();return t.$$click=()=>e.onClose?.(),t}}),null),P(s,j(FM,{onCreated:()=>n(`activity`)})),P(c,j(IQ,{})),P(l,j(O1,{})),P(u,j(Z1,{})),P(d,j(G1,{})),P(f,j(I0,{})),P(p,j(Z0,{onOpenIssue:()=>n(`activity`)})),P(m,j(n6,{})),P(h,j(V5,{})),P(g,j(P7,{})),D(n=>{var r=`border-border bg-surface flex shrink-0 items-center gap-1 border-b px-2 py-1.5 select-none ${e.onHeaderPointerDown?`cursor-grab active:cursor-grabbing`:``}`,a=t()!==`draft`,o=t()!==`capture`,_=t()!==`activity`,v=t()!==`running`,y=t()!==`cloud`,b=t()!==`local`,x=t()!==`prs`,S=t()!==`design`,C=t()!==`renders`,w=t()!==`settings`;return r!==n.e&&st(i,n.e=r),a!==n.t&&s.classList.toggle(`hidden`,n.t=a),o!==n.a&&c.classList.toggle(`hidden`,n.a=o),_!==n.o&&l.classList.toggle(`hidden`,n.o=_),v!==n.i&&u.classList.toggle(`hidden`,n.i=v),y!==n.n&&d.classList.toggle(`hidden`,n.n=y),b!==n.s&&f.classList.toggle(`hidden`,n.s=b),x!==n.h&&p.classList.toggle(`hidden`,n.h=x),S!==n.r&&m.classList.toggle(`hidden`,n.r=S),C!==n.d&&h.classList.toggle(`hidden`,n.d=C),w!==n.l&&g.classList.toggle(`hidden`,n.l=w),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),r}})}rt([`pointerdown`,`click`]);var $7=`/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */
298
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, "SF Mono", Menlo, monospace;--color-red-500:oklch(63.7% .237 25.331);--color-white:#fff;--spacing:.25rem;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-wide:.025em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:4px;--radius-md:6px;--radius-lg:10px;--radius-xl:.75rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#0b0c0e;--color-surface:#141517;--color-surface-2:#1c1d21;--color-surface-3:#24262b;--color-border:#26282d;--color-border-strong:#34363d;--color-text:#e8e9eb;--color-text-dim:#8b8e98;--color-text-faint:#5c5f6a;--color-accent:#5e6ad2;--color-accent-hover:#6e79e0;--color-accent-soft:#5e6ad226;--color-success:#4cb782;--color-warn:#f2c94c;--color-danger:#eb5757;--color-danger-soft:#eb575726}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.-top-0{top:0}.-top-0\\.5{top:calc(var(--spacing) * -.5)}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-\\[2px\\]{top:2px}.top-full{top:100%}.-right-0{right:0}.-right-0\\.5{right:calc(var(--spacing) * -.5)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-4{right:calc(var(--spacing) * 4)}.right-full{right:100%}.bottom-0{bottom:0}.bottom-1{bottom:var(--spacing)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-\\[2px\\]{bottom:2px}.bottom-full{bottom:100%}.-left-\\[13\\.5px\\]{left:-13.5px}.left-0{left:0}.left-1{left:var(--spacing)}.left-1\\/2{left:50%}.left-\\[5px\\]{left:5px}.left-full{left:100%}.z-1{z-index:1}.z-10{z-index:10}.z-\\[2147483645\\]{z-index:2147483645}.z-\\[2147483646\\]{z-index:2147483646}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-m-0{margin:0}.-m-0\\.5{margin:calc(var(--spacing) * -.5)}.-m-4{margin:calc(var(--spacing) * -4)}.m-0{margin:0}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-my-1{margin-block:calc(var(--spacing) * -1)}.-my-1\\.5{margin-block:calc(var(--spacing) * -1.5)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-px{margin-top:1px}.mr-0{margin-right:0}.mr-0\\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:var(--spacing)}.mr-1\\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-2\\.5{margin-right:calc(var(--spacing) * 2.5)}.-mb-4{margin-bottom:calc(var(--spacing) * -4)}.mb-0{margin-bottom:0}.mb-0\\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-2\\.5{margin-left:calc(var(--spacing) * 2.5)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.ml-px{margin-left:1px}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.list-item{display:list-item}.table{display:table}.size-0{width:0;height:0}.size-1{width:var(--spacing);height:var(--spacing)}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-\\[9px\\]{width:9px;height:9px}.size-\\[12px\\]{width:12px;height:12px}.size-\\[16px\\]{width:16px;height:16px}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-16{height:calc(var(--spacing) * 16)}.h-\\[8px\\]{height:8px}.h-\\[17px\\]{height:17px}.h-\\[18px\\]{height:18px}.h-\\[20px\\]{height:20px}.h-\\[24px\\]{height:24px}.h-fit{height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-44{max-height:calc(var(--spacing) * 44)}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\\[28rem\\]{max-height:28rem}.max-h-\\[var\\(--rg-edit-list-max-h\\)\\]{max-height:var(--rg-edit-list-max-h)}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[2lh\\]{min-height:2lh}.min-h-\\[28px\\]{min-height:28px}.w-1{width:var(--spacing)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-16{width:calc(var(--spacing) * 16)}.w-28{width:calc(var(--spacing) * 28)}.w-72{width:calc(var(--spacing) * 72)}.w-\\[2px\\]{width:2px}.w-\\[Npx\\]{width:Npx}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\\[55\\%\\]{max-width:55%}.max-w-\\[100vw\\]{max-width:100vw}.max-w-\\[110px\\]{max-width:110px}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-\\[3\\.5ch\\]{min-width:3.5ch}.min-w-\\[3ch\\]{min-width:3ch}.min-w-\\[4ch\\]{min-width:4ch}.min-w-\\[5ch\\]{min-width:5ch}.min-w-\\[6ch\\]{min-width:6ch}.min-w-\\[7ch\\]{min-width:7ch}.min-w-\\[8ch\\]{min-width:8ch}.min-w-\\[10ch\\]{min-width:10ch}.min-w-\\[12ch\\]{min-width:12ch}.min-w-\\[36px\\]{min-width:36px}.min-w-\\[52px\\]{min-width:52px}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-rotate-90{rotate:-90deg}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.list-decimal{list-style-type:decimal}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.grid-rows-\\[0fr\\]{grid-template-rows:0fr}.grid-rows-\\[1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-\\[5px\\]{gap:5px}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-clip{overflow:clip}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[6px\\]{border-radius:6px}.rounded-\\[13px\\]{border-radius:13px}.rounded-\\[14px\\]{border-radius:14px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[var\\(--rg-border-button\\)\\]{border-color:var(--rg-border-button)}.border-accent{border-color:var(--color-accent)}.border-accent\\/40{border-color:#5e6ad266}@supports (color:color-mix(in lab, red, red)){.border-accent\\/40{border-color:color-mix(in oklab, var(--color-accent) 40%, transparent)}}.border-border{border-color:var(--color-border)}.border-danger{border-color:var(--color-danger)}.border-danger\\/40{border-color:#eb575766}@supports (color:color-mix(in lab, red, red)){.border-danger\\/40{border-color:color-mix(in oklab, var(--color-danger) 40%, transparent)}}.border-success{border-color:var(--color-success)}.border-success\\/40{border-color:#4cb78266}@supports (color:color-mix(in lab, red, red)){.border-success\\/40{border-color:color-mix(in oklab, var(--color-success) 40%, transparent)}}.border-text-dim{border-color:var(--color-text-dim)}.border-transparent{border-color:#0000}.border-warn{border-color:var(--color-warn)}.border-warn\\/40{border-color:#f2c94c66}@supports (color:color-mix(in lab, red, red)){.border-warn\\/40{border-color:color-mix(in oklab, var(--color-warn) 40%, transparent)}}.border-t-\\[var\\(--rg-border-subtle\\)\\]{border-top-color:var(--rg-border-subtle)}.border-t-transparent{border-top-color:#0000}.bg-\\[var\\(--rg-error-bg\\)\\]{background-color:var(--rg-error-bg)}.bg-\\[var\\(--rg-panel-bg\\)\\]{background-color:var(--rg-panel-bg)}.bg-\\[var\\(--rg-submit-bg\\)\\]{background-color:var(--rg-submit-bg)}.bg-\\[var\\(--rg-surface-active\\)\\]{background-color:var(--rg-surface-active)}.bg-\\[var\\(--rg-surface-hover\\)\\]{background-color:var(--rg-surface-hover)}.bg-\\[var\\(--rg-text-primary\\)\\]{background-color:var(--rg-text-primary)}.bg-\\[var\\(--rg-text-secondary\\)\\]{background-color:var(--rg-text-secondary)}.bg-accent{background-color:var(--color-accent)}.bg-accent-soft{background-color:var(--color-accent-soft)}.bg-bg{background-color:var(--color-bg)}.bg-bg\\/80{background-color:#0b0c0ecc}@supports (color:color-mix(in lab, red, red)){.bg-bg\\/80{background-color:color-mix(in oklab, var(--color-bg) 80%, transparent)}}.bg-border{background-color:var(--color-border)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--color-danger)}.bg-danger-soft{background-color:var(--color-danger-soft)}.bg-danger\\/10{background-color:#eb57571a}@supports (color:color-mix(in lab, red, red)){.bg-danger\\/10{background-color:color-mix(in oklab, var(--color-danger) 10%, transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-success{background-color:var(--color-success)}.bg-surface{background-color:var(--color-surface)}.bg-surface-2{background-color:var(--color-surface-2)}.bg-surface-3{background-color:var(--color-surface-3)}.bg-text-faint{background-color:var(--color-text-faint)}.bg-transparent{background-color:#0000}.bg-warn{background-color:var(--color-warn)}.bg-warn\\/10{background-color:#f2c94c1a}@supports (color:color-mix(in lab, red, red)){.bg-warn\\/10{background-color:color-mix(in oklab, var(--color-warn) 10%, transparent)}}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:0}.px-0\\.25{padding-inline:calc(var(--spacing) * .25)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-0\\.25{padding-block:calc(var(--spacing) * .25)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-px{padding-block:1px}.pt-0{padding-top:0}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-0{padding-left:0}.pl-0\\.5{padding-left:calc(var(--spacing) * .5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-end{text-align:end}.text-justify{text-align:justify}.text-left{text-align:left}.text-right{text-align:right}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-\\[9\\.5px\\]{font-size:9.5px}.text-\\[9px\\]{font-size:9px}.text-\\[10\\.5px\\]{font-size:10.5px}.text-\\[10px\\]{font-size:10px}.text-\\[11\\.5px\\]{font-size:11.5px}.text-\\[11px\\]{font-size:11px}.text-\\[12\\.5px\\]{font-size:12.5px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.leading-3{--tw-leading:calc(var(--spacing) * 3);line-height:calc(var(--spacing) * 3)}.leading-3\\.5{--tw-leading:calc(var(--spacing) * 3.5);line-height:calc(var(--spacing) * 3.5)}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-extralight{--tw-font-weight:var(--font-weight-extralight);font-weight:var(--font-weight-extralight)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.font-thin{--tw-font-weight:var(--font-weight-thin);font-weight:var(--font-weight-thin)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-normal{overflow-wrap:normal;word-break:normal}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.break-keep{word-break:keep-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-break-spaces{white-space:break-spaces}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--rg-error-text\\)\\]{color:var(--rg-error-text)}.text-\\[var\\(--rg-submit-fg\\)\\]{color:var(--rg-submit-fg)}.text-\\[var\\(--rg-text-primary\\)\\]{color:var(--rg-text-primary)}.text-\\[var\\(--rg-text-primary-85\\)\\]{color:var(--rg-text-primary-85)}.text-\\[var\\(--rg-text-secondary\\)\\]{color:var(--rg-text-secondary)}.text-accent{color:var(--color-accent)}.text-danger{color:var(--color-danger)}.text-success{color:var(--color-success)}.text-text{color:var(--color-text)}.text-text-dim{color:var(--color-text-dim)}.text-text-faint{color:var(--color-text-faint)}.text-warn{color:var(--color-warn)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.accent-accent{accent-color:var(--color-accent)}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[box-shadow\\:var\\(--rg-shadow\\)\\]{box-shadow:var(--rg-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\\[filter\\:var\\(--rg-drop-shadow\\)\\]{filter:var(--rg-drop-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-columns\\]{transition-property:grid-template-columns;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[padding\\,border-radius\\,transform\\]{transition-property:padding,border-radius,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[top\\,left\\,width\\,height\\,opacity\\,border-radius\\]{transition-property:top,left,width,height,opacity,border-radius;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,color\\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.delay-\\[80ms\\]{transition-delay:80ms}.duration-60{--tw-duration:60ms;transition-duration:60ms}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-140{--tw-duration:.14s;transition-duration:.14s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-180{--tw-duration:.18s;transition-duration:.18s}.duration-220{--tw-duration:.22s;transition-duration:.22s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.ease-\\[cubic-bezier\\(0\\,0\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-\\[opacity\\,transform\\]{will-change:opacity,transform}.will-change-transform{will-change:transform}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}.group-open\\:rotate-90:is(:where(.group):is([open],:popover-open,:open) *){rotate:90deg}@media (hover:hover){.group-hover\\:text-\\[var\\(--rg-text-primary\\)\\]:is(:where(.group):hover *){color:var(--rg-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\\:text-text-faint::placeholder{color:var(--color-text-faint)}@media (hover:hover){.hover\\:bg-\\[var\\(--rg-error-bg-hover\\)\\]:hover{background-color:var(--rg-error-bg-hover)}.hover\\:bg-\\[var\\(--rg-surface-active\\)\\]:hover{background-color:var(--rg-surface-active)}.hover\\:bg-\\[var\\(--rg-surface-hover\\)\\]:hover{background-color:var(--rg-surface-hover)}.hover\\:bg-accent-hover:hover{background-color:var(--color-accent-hover)}.hover\\:bg-accent\\/50:hover{background-color:#5e6ad280}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/50:hover{background-color:color-mix(in oklab, var(--color-accent) 50%, transparent)}}.hover\\:bg-danger\\/30:hover{background-color:#eb57574d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-danger\\/30:hover{background-color:color-mix(in oklab, var(--color-danger) 30%, transparent)}}.hover\\:bg-surface-2:hover{background-color:var(--color-surface-2)}.hover\\:bg-surface-3:hover{background-color:var(--color-surface-3)}.hover\\:text-\\[var\\(--rg-text-primary\\)\\]:hover{color:var(--rg-text-primary)}.hover\\:text-accent:hover{color:var(--color-accent)}.hover\\:text-danger:hover{color:var(--color-danger)}.hover\\:text-text:hover{color:var(--color-text)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}}.focus\\:border-accent:focus{border-color:var(--color-accent)}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-accent:active{background-color:var(--color-accent)}.active\\:transition-none:active{transition-property:none}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-surface-3:disabled{background-color:var(--color-surface-3)}.disabled\\:text-text-faint:disabled{color:var(--color-text-faint)}.disabled\\:opacity-40:disabled{opacity:.4}@media (hover:hover){.disabled\\:hover\\:bg-surface-2:disabled:hover{background-color:var(--color-surface-2)}}.data-\\[state\\=on\\]\\:transition-none[data-state=on],.data-\\[state\\=open\\]\\:transition-none[data-state=open],.data-\\[state\\=…\\]\\:transition-none[data-state=…]{transition-property:none}}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}[data-theme=light],:host([data-theme=light]){--color-bg:#fbfbfc;--color-surface:#fff;--color-surface-2:#f4f4f6;--color-surface-3:#e9e9ee;--color-border:#e2e2e8;--color-border-strong:#cfcfd8;--color-text:#1b1c20;--color-text-dim:#5c5f6a;--color-text-faint:#9a9da8;--color-accent-soft:#5e6ad21f;--color-danger-soft:#eb57571a;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:light){:root:not([data-theme=dark]){--color-bg:#fbfbfc;--color-surface:#fff;--color-surface-2:#f4f4f6;--color-surface-3:#e9e9ee;--color-border:#e2e2e8;--color-border-strong:#cfcfd8;--color-text:#1b1c20;--color-text-dim:#5c5f6a;--color-text-faint:#9a9da8;--color-accent-soft:#5e6ad21f;--color-danger-soft:#eb57571a;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}}body{background-color:var(--color-bg);font-family:var(--font-sans);color:var(--color-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-width:320px;margin:0;font-size:13px}@keyframes geist-spinner-fade{0%{opacity:1}to{opacity:.15}}[data-tip]{position:relative}[data-tip]:hover:after{content:attr(data-tip);color:#fff;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;z-index:60;background:#1b1c20;border-radius:6px;max-width:260px;padding:3px 8px;font-size:10.5px;font-weight:500;line-height:1.35;position:absolute;bottom:calc(100% + 6px);left:50%;overflow:hidden;transform:translate(-50%);box-shadow:0 4px 12px #0000004d}[data-tip][data-tip-pos~=right]:hover:after{left:0;transform:none}[data-tip][data-tip-pos~=left]:hover:after{left:auto;right:0;transform:none}[data-tip][data-tip-pos~=bottom]:hover:after{top:calc(100% + 6px);bottom:auto}.no-scrollbar{scrollbar-width:none}.no-scrollbar::-webkit-scrollbar{display:none}.lg-md p{margin:0 0 6px}.lg-md p:last-child{margin-bottom:0}.lg-md a{color:var(--color-accent);word-break:break-all;text-decoration:none}.lg-md a:hover{text-decoration:underline}.lg-md code{background:var(--color-surface-2);border:1px solid var(--color-border);font-family:var(--font-mono);border-radius:4px;padding:0 4px;font-size:11px}.lg-md pre{background:var(--color-surface-2);border:1px solid var(--color-border);border-radius:6px;margin:6px 0;padding:8px;overflow-x:auto}.lg-md pre code{white-space:pre;background:0 0;border:none;padding:0;font-size:11px}.lg-md ul,.lg-md ol{flex-direction:column;gap:2px;margin:4px 0 6px;padding-left:18px;display:flex}.lg-md ul{list-style:outside}.lg-md ol{list-style:decimal}.lg-md h4{margin:8px 0 4px;font-size:12px;font-weight:600}.lg-md lg-media{display:block}.lg-md lg-media img,.lg-md lg-media video{border:1px solid var(--color-border);border-radius:6px;max-width:100%;margin:4px 0}.lg-md video{border:1px solid var(--color-border);background:#000;border-radius:6px;max-width:100%;margin:4px 0}.lg-md img{border:1px solid var(--color-border);border-radius:6px;max-width:100%;margin:4px 0}.lg-md strong{font-weight:600}*{scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:var(--color-border-strong);border-radius:4px}::-webkit-scrollbar-track{background:0 0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}`;Br();var e9=N(`<span aria-hidden class="bg-danger size-2 shrink-0 animate-pulse rounded-full">`),t9=N(`<span class="text-text min-w-[5ch] text-[11px] font-medium tabular-nums">`),n9=N(`<button class="bg-accent hover:bg-accent-hover h-7 cursor-pointer rounded-full px-2.5 text-[11px] font-medium text-white transition-colors"><span class="inline-block min-w-[4ch] text-center">Stop`),r9=N(`<p class="text-warn px-1.5 pt-1 pb-1.5 text-[10.5px] font-semibold tracking-wide uppercase">Needs review`),i9=N(`<div><p class="text-text-dim px-1.5 pt-1 pb-1.5 text-[10.5px] font-semibold tracking-wide uppercase">Running agents`),a9=N(`<div class="fixed z-[2147483646] select-none"><div class="bg-surface border-border text-text flex h-9 cursor-grab items-center gap-1 rounded-full border py-1 pr-1 pl-2.5 font-sans shadow-lg active:cursor-grabbing">`),o9=N(`<div><div title="Drag to resize">`),s9=N(`<button title="Open Linear Grab"aria-label="Open Linear Grab"class="text-accent hover:opacity-80 inline-flex cursor-pointer items-center gap-1.5">`),c9=N(`<span class="bg-border h-4 w-px"aria-hidden>`),l9=N(`<span aria-hidden class="bg-warn size-2 rounded-full">`),u9=N(`<span class="text-warn min-w-[3.5ch] text-left text-[11px] font-medium tabular-nums"> rev`),d9=N(`<button title="Running agents"aria-label="Running agents"class="hover:bg-surface-2 flex h-7 cursor-pointer items-center gap-1.5 rounded-full px-2 transition-colors"><span aria-hidden></span><span>`),f9=N(`<span aria-hidden class="bg-accent size-2 shrink-0 animate-pulse rounded-full">`),p9=N(`<span class="text-text min-w-[3ch] text-[11px] font-medium tabular-nums">s`),m9=N(`<span class="text-text-dim min-w-[7ch] text-[11px] tabular-nums"> states`),h9=N(`<p class="text-text-faint px-1.5 pb-1.5 text-[11.5px]">No agents running right now.`),g9=N(`<button class="hover:bg-surface-2 flex w-full cursor-pointer flex-col gap-0.5 rounded-md px-1.5 py-1.5 text-left transition-colors"><span class="flex min-w-0 items-center gap-1.5"><span aria-hidden class="size-1.5 shrink-0 rounded-full"></span><span class="font-mono text-text-dim shrink-0 text-[10.5px]"></span><span class="text-text truncate text-[11.5px]"></span></span><span class="text-text-faint pl-3 text-[10.5px] tabular-nums"> · <!> · `);function _9(e={}){if(typeof window>`u`||window.__LINEAR_GRAB_PAGE__)return;window.__LINEAR_GRAB_PAGE__=!0;let t=()=>{hk(),X2(),l3(),t5(),aQ();let t=document.createElement(`div`);t.id=`linear-grab-root`,document.body.appendChild(t);let n=e=>{let n=e.composedPath();if(!n.includes(t))return;e.stopImmediatePropagation();let r=n[0];e instanceof KeyboardEvent&&r&&r!==t&&r.dispatchEvent(new KeyboardEvent(e.type,{key:e.key,code:e.code,location:e.location,repeat:e.repeat,isComposing:e.isComposing,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,bubbles:!1,cancelable:!1}))};for(let e of[`keydown`,`keyup`,`keypress`])window.addEventListener(e,n,{capture:!0});let r=t.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=$7,r.appendChild(i);let a=document.createElement(`div`);r.appendChild(a);let o=()=>a.setAttribute(`data-theme`,v9());o(),matchMedia(`(prefers-color-scheme: light)`).addEventListener(`change`,o),nt(()=>j(w9,{get defaultOpen(){return e.defaultOpen??!1}}),a)};document.body?t():document.addEventListener(`DOMContentLoaded`,t,{once:!0})}function v9(){try{let e=[document.body,document.documentElement];for(let t of e){let e=getComputedStyle(t).backgroundColor.match(/rgba?\(([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+))?/);if(!(!e||e[4]!==void 0&&Number(e[4])===0))return .2126*e[1]+.7152*e[2]+.0722*e[3]>140?`light`:`dark`}}catch{}return matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}var y9=130,b9=36,x9=380,S9=280,C9=720;function w9(e){let[t,n]=T(e.defaultOpen),[r,i]=T(`right`),[a,o]=T({x:Math.max(8,window.innerWidth-y9-24),y:Math.max(8,window.innerHeight-b9-20)}),[s,c]=T({running:[],review:[]}),l=()=>s().running,u=()=>s().review,[d,f]=T(!1),[p,m]=T(KD().phase),[h,g]=T({active:!1,msLeft:0,total:0,byTrigger:{}}),[_,v]=T(0);ie(()=>{let e=setInterval(()=>{p()===`recording`&&v(Date.now()-(KD().startedAt??Date.now()))},250);ae(()=>clearInterval(e))});let y=e=>{let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},[b,x]=T(null),S=e=>({x:Math.min(Math.max(8,e.x),window.innerWidth-y9-8),y:Math.min(Math.max(8,e.y),window.innerHeight-b9-8)}),C=e=>({x:Math.min(Math.max(8-(ne()-80),e.x),window.innerWidth-80),y:Math.min(Math.max(0,e.y),window.innerHeight-80)}),[w,E]=T(!1),[k,ee]=T(`cloud`),[te,A]=T(!1),[ne,re]=T(x9),oe=e=>Math.min(C9,Math.max(S9,Math.min(e,window.innerWidth-60)));O(()=>{let e=document.documentElement,n=t()&&w();e.style.marginRight=n&&r()===`right`?`${ne()}px`:``,e.style.marginLeft=n&&r()===`left`?`${ne()}px`:``}),ae(()=>{document.documentElement.style.marginRight=``,document.documentElement.style.marginLeft=``});let se=()=>{let e=!w();E(e),e&&x(null),Er({panelMode:e?`pinned`:`overlay`,panelPos:void 0})};ie(()=>{Tr().then(e=>{e.panelSide&&i(e.panelSide),e.launcherPos&&o(S(e.launcherPos)),e.panelPos&&x(C(e.panelPos)),e.panelWidth&&re(oe(e.panelWidth)),E(e.panelMode===`pinned`),ee(e.workflowMode??`cloud`)});let e=Mr(e=>{e===`settings`&&Tr().then(e=>{i(e.panelSide??`right`),E(e.panelMode===`pinned`),ee(e.workflowMode??`cloud`)}),e===`grab`&&k()!==`local`&&n(!0)}),t=()=>{A(!0),setTimeout(()=>A(!1),1600)};window.addEventListener(XZ,t);let r=()=>{f(!1),w()||n(!1)};window.addEventListener(ZZ,r);let s=()=>n(!0);window.addEventListener(`linear-grab:picker-finished`,s),ae(()=>{window.removeEventListener(XZ,t),window.removeEventListener(ZZ,r),window.removeEventListener(`linear-grab:picker-finished`,s)});let l=d$(c);ae(h2(g));let u=KD().phase,d=qD(e=>{m(e.phase),e.phase===`recording`&&u!==`recording`&&!w()&&n(!1),e.phase===`ready`&&u!==`ready`&&(fj(`capture`),n(!0)),u=e.phase}),p=()=>{o(S(a()));let e=b();e&&x(C(e))};window.addEventListener(`resize`,p),ae(()=>{e(),l(),d(),window.removeEventListener(`resize`,p)})});let ce=!1,le=e=>{if(e.button!==0)return;let t={x:e.clientX,y:e.clientY},n=a();ce=!1;let r=e=>{let r=e.clientX-t.x,i=e.clientY-t.y;Math.abs(r)+Math.abs(i)>4&&(ce=!0),ce&&o(S({x:n.x+r,y:n.y+i}))},i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),ce&&Er({launcherPos:a()}),setTimeout(()=>{ce=!1},0)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)},ue=()=>a().y>260,de=e=>{f(!1),fj(`activity`,e),n(!0)},fe=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=e.clientX,n=ne(),i=b(),a=e=>{let a=e.clientX-t,o=r()===`right`?-a:a,s=oe(n+o);re(s),i&&r()===`right`&&x(C({x:i.x+(n-s),y:i.y}))},o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),Er({panelWidth:ne(),...b()?{panelPos:b()}:{}})};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)},pe=e=>{if(e.button!==0)return;if(e.detail===2){x(null),Er({panelPos:void 0});return}let t={x:e.clientX,y:e.clientY},n=b()??{x:r()===`right`?window.innerWidth-ne():0,y:0},i=!1,a=e=>{let r=e.clientX-t.x,a=e.clientY-t.y;Math.abs(r)+Math.abs(a)>4&&(i=!0),i&&x(C({x:n.x+r,y:n.y+a}))},o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o);let e=b();i&&e&&Er({panelPos:e})};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)};return[j(M,{get when(){return!t()},get children(){var e=a9(),t=e.firstChild;return t.$$click=()=>{ce||p()===`recording`||h().active||(f(!1),n(!0))},t.$$pointerdown=le,P(t,j(M,{get when(){return p()===`recording`||h().active},get fallback(){return[(()=>{var e=s9();return e.$$click=()=>{ce||(f(!1),n(!0))},P(e,j(Z7,{size:13})),e})(),c9(),(()=>{var e=d9(),t=e.firstChild,n=t.nextSibling;return e.$$click=e=>{e.stopPropagation(),!ce&&f(e=>!e)},P(n,(()=>{var e=$e(()=>!!te());return()=>e()?`Copied ✓`:`${l().length} run`})()),P(e,j(M,{get when(){return $e(()=>!te())()&&u().length>0},get children(){return[l9(),(()=>{var e=u9(),t=e.firstChild;return P(e,()=>u().length,t),e})()]}}),null),D(e=>{var r=`size-2 rounded-full ${te()?`bg-success`:l().length?`bg-success animate-pulse`:`bg-text-faint`}`,i=`min-w-[3.5ch] text-left text-[11px] font-medium tabular-nums ${te()?`text-success`:`text-text-dim`}`;return r!==e.e&&st(t,e.e=r),i!==e.t&&st(n,e.t=i),e},{e:void 0,t:void 0}),e})()]},get children(){return j(M,{get when(){return p()===`recording`},get fallback(){return[f9(),(()=>{var e=p9(),t=e.firstChild;return P(e,()=>Math.ceil(h().msLeft/1e3),t),e})(),(()=>{var e=m9(),t=e.firstChild;return P(e,()=>h().total,t),D(()=>it(e,`title`,Object.entries(h().byTrigger).map(([e,t])=>`${t} ${e}`).join(` · `)||`hover / open the component to record its states`)),e})(),(()=>{var e=n9();return e.$$click=e=>{e.stopPropagation(),!ce&&_2()},e})()]},get children(){return[e9(),(()=>{var e=t9();return P(e,()=>y(_())),e})(),(()=>{var e=n9();return e.$$click=()=>{ce||iO()},e})()]}})}})),P(e,j(M,{get when(){return d()},get children(){var e=i9(),t=e.firstChild;return P(e,j(M,{get when(){return u().length>0},get children(){return[r9(),j(We,{get each(){return u()},children:e=>j(T9,{agent:e,review:!0,onOpen:de})})]}}),t),P(e,j(M,{get when(){return l().length>0},get fallback(){return h9()},get children(){return j(We,{get each(){return l()},children:e=>j(T9,{agent:e,onOpen:de})})}}),null),D(()=>st(e,`bg-surface border-border absolute w-72 rounded-lg border p-1.5 font-sans shadow-2xl ${ue()?`bottom-full mb-2`:`top-full mt-2`} ${a().x>window.innerWidth-300?`right-0`:`left-0`}`)),e}}),null),D(t=>{var n=`${a().x}px`,r=`${a().y}px`;return n!==t.e&&dt(e,`left`,t.e=n),r!==t.t&&dt(e,`top`,t.t=r),t},{e:void 0,t:void 0}),e}}),j(M,{get when(){return t()},get children(){var e=o9(),t=e.firstChild;return t.$$pointerdown=fe,P(e,j(Q7,{onGrab:()=>n(!0),onClose:()=>n(!1),get onHeaderPointerDown(){return w()?void 0:pe},get pinned(){return w()},onTogglePin:se}),null),D(n=>{var i=`bg-bg text-text border-border fixed z-[2147483645] flex max-w-[100vw] flex-col overflow-hidden font-sans text-[13px] antialiased ${w()?``:`shadow-2xl`} ${!w()&&b()?`rounded-xl border`:r()===`right`?`top-0 right-0 h-screen border-l`:`top-0 left-0 h-screen border-r`}`,a={width:`${ne()}px`,...!w()&&b()?{left:`${b().x}px`,top:`${b().y}px`,height:`${Math.min(680,window.innerHeight-16)}px`}:{}},o=`hover:bg-accent/50 active:bg-accent absolute top-0 z-10 h-full w-1 cursor-col-resize transition-colors ${r()===`right`?`left-0`:`right-0`}`;return i!==n.e&&st(e,n.e=i),n.t=ut(e,a,n.t),o!==n.a&&st(t,n.a=o),n},{e:void 0,t:void 0,a:void 0}),e}})]}function T9(e){return(()=>{var t=g9(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=n.nextSibling,s=o.firstChild,c=s.nextSibling;return c.nextSibling,t.$$click=()=>e.onOpen(e.agent.id),P(i,()=>e.agent.identifier),P(a,()=>e.agent.title),P(o,(()=>{var t=$e(()=>!!e.review);return()=>t()?`PR ready · needs review`:e.agent.stateName})(),s),P(o,()=>e.agent.delegateName,c),P(o,()=>E9(e.agent.updatedAt),null),D(t=>dt(r,`background`,e.review?`var(--color-warn)`:e.agent.stateColor)),t})()}function E9(e){let t=Math.max(0,Math.floor((Date.now()-Date.parse(e))/1e3));return t<60?`now`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`}rt([`pointerdown`,`click`]),_9()})();