@cuongtran001/kanna 1.76.3 → 1.77.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.
- package/dist/client/assets/{BoardsPage-DCh9hj51.js → BoardsPage-CDshMr32.js} +1 -1
- package/dist/client/assets/{BoardsRoutePage-DPw5ve6w.js → BoardsRoutePage-Bt5yV0UK.js} +1 -1
- package/dist/client/assets/ChatPage-y4FSht9S.js +98 -0
- package/dist/client/assets/{CronJobRow-D2ex-2ZV.js → CronJobRow-C2bb_zyw.js} +1 -1
- package/dist/client/assets/{CronJobsPage-BGk_HGOZ.js → CronJobsPage-Bk3pYUIF.js} +1 -1
- package/dist/client/assets/FilePreviewSheet-QX9IjaMc.js +11 -0
- package/dist/client/assets/{FlowSurface-RRPSX4vy.js → FlowSurface-Ci5BUZ0U.js} +1 -1
- package/dist/client/assets/GenUIBlock-CanpXpjp.js +2 -0
- package/dist/client/assets/{KannaSocketProvider-CNmZYIUz.js → KannaSocketProvider-B_w2o9lp.js} +1 -1
- package/dist/client/assets/{LocalProjectsPage-Dr5JrPMN.js → LocalProjectsPage-DU_h_M8x.js} +1 -1
- package/dist/client/assets/{SettingsPage-Bhy_51Vm.js → SettingsPage-ztk2-RMb.js} +1 -1
- package/dist/client/assets/{StackBoardsRoutePage-B-O5uIvz.js → StackBoardsRoutePage-BFAHFlA9.js} +1 -1
- package/dist/client/assets/ToolCallMessage-iN0F9bXz.js +4 -0
- package/dist/client/assets/{VChartSurface-C_LuezMZ.js → VChartSurface-i5pDpMeO.js} +1 -1
- package/dist/client/assets/{WorkflowsPage-BmGlYGWF.js → WorkflowsPage-DaqqMqdU.js} +1 -1
- package/dist/client/assets/{WorkflowsSection-SjENofEr.js → WorkflowsSection-DVPLXuBj.js} +1 -1
- package/dist/client/assets/{chart-renderer-Ce4S2Bew.js → chart-renderer-CootI0ca.js} +1 -1
- package/dist/client/assets/{chatSounds-ih86yh5r.js → chatSounds-CNFotzn3.js} +1 -1
- package/dist/client/assets/chevron-left-D_EmAMOd.js +1 -0
- package/dist/client/assets/{clipboard.adapter-BLu7Xx3Q.js → clipboard.adapter-Dfr_G1eU.js} +1 -1
- package/dist/client/assets/{columnStyle-CXivQEvf.js → columnStyle-CttzKm8w.js} +1 -1
- package/dist/client/assets/{contextWindow-Cpz1HmWo.js → contextWindow-CP46e9Bl.js} +1 -1
- package/dist/client/assets/{copyFeedbackStore-NslkB2Ap.js → copyFeedbackStore-T_iiMkJf.js} +1 -1
- package/dist/client/assets/{createScopedStore-CZBfIcri.js → createScopedStore-B9MoX0Yk.js} +1 -1
- package/dist/client/assets/{dist-DHxwilnY.js → dist-CNz-veBZ.js} +1 -1
- package/dist/client/assets/{ellipsis-Ba-nFhTR.js → ellipsis-D_L4kdMs.js} +1 -1
- package/dist/client/assets/{flow-kinds-BIh-hHN9.js → flow-kinds-C5Vp2my7.js} +1 -1
- package/dist/client/assets/{folder-B34crHxE.js → folder-D8QghOii.js} +1 -1
- package/dist/client/assets/{formatDuration-JKx5LBF4.js → formatDuration-DosmZjMh.js} +1 -1
- package/dist/client/assets/{genui-DmCmYDHH.js → genui-Bk-RFOJ9.js} +1 -1
- package/dist/client/assets/{globe-DV73QVTP.js → globe-CJ4vvlxj.js} +1 -1
- package/dist/client/assets/{host-FY7xgVKG.js → host-BwLxDlOk.js} +1 -1
- package/dist/client/assets/{index-MU4WHdaY.js → index-DDnkNfhN.js} +3 -3
- package/dist/client/assets/index-da9Oqw44.css +1 -0
- package/dist/client/assets/{info-COBF8Hkz.js → info-CuU6iz_g.js} +1 -1
- package/dist/client/assets/{input-BJRDZBOh.js → input-DhaKWLZX.js} +1 -1
- package/dist/client/assets/{lexicalToReact-BVHTqlu5.js → lexicalToReact-C0mubAok.js} +3 -3
- package/dist/client/assets/{log-7NXJbErN.js → log-Divm5wOC.js} +1 -1
- package/dist/client/assets/{monitor-Wl8GxNgR.js → monitor-Dmk-SumR.js} +1 -1
- package/dist/client/assets/{pendingActionsStore-DDpYeRNm.js → pendingActionsStore-Cnarb0K6.js} +1 -1
- package/dist/client/assets/{play-CmxvHVzO.js → play-BPtOxK-T.js} +1 -1
- package/dist/client/assets/{plus-C3QbbvBk.js → plus-B7lCsTZ4.js} +1 -1
- package/dist/client/assets/{popover-Dm-pdC4M.js → popover-C_hhpljU.js} +1 -1
- package/dist/client/assets/{pushClient-COMO42mb.js → pushClient-Cu6HxjIW.js} +1 -1
- package/dist/client/assets/runDetached-2gt4-pgN.js +1 -0
- package/dist/client/assets/{segmented-control-CfauwRtX.js → segmented-control-Dzd0_Dmv.js} +1 -1
- package/dist/client/assets/{select-7zTZH1xA.js → select-SFy49-QY.js} +1 -1
- package/dist/client/assets/{settings-header-button-TMNvLQQs.js → settings-header-button-D5V2Emxn.js} +1 -1
- package/dist/client/assets/{sidebarPendingActions-Bd_2oNH_.js → sidebarPendingActions-rcdthbAS.js} +1 -1
- package/dist/client/assets/{square-pen-BB5GlYSZ.js → square-pen-DdoLzzrk.js} +1 -1
- package/dist/client/assets/{state-mark-x5ennY81.js → state-mark-Foa-Y6ag.js} +1 -1
- package/dist/client/assets/{terminal-D5pfyUjC.js → terminal-DuZtawSD.js} +1 -1
- package/dist/client/assets/{timer.adapter-C5oNrWbM.js → timer.adapter-BUc1NRbm.js} +1 -1
- package/dist/client/assets/{tools-BlXGwwwh.js → tools-D8TzG2-S.js} +1 -1
- package/dist/client/assets/{triangle-alert-BwAIBaGG.js → triangle-alert-6-TWBzpz.js} +1 -1
- package/dist/client/assets/{useAppGlobalState-BL9aCLak.js → useAppGlobalState-wpxCO-JN.js} +1 -1
- package/dist/client/assets/useKannaState-CTiwKNJL.js +5 -0
- package/dist/client/assets/{useTheme-9knhPtrR.js → useTheme-0KFNcCXu.js} +1 -1
- package/dist/client/index.html +34 -34
- package/package.json +1 -1
- package/src/server/kanna-mcp-tools/chat-tasks.ts +1 -1
- package/dist/client/assets/ChatPage-CEeRSI6r.js +0 -93
- package/dist/client/assets/FilePreviewSheet-BnQeVNHq.js +0 -11
- package/dist/client/assets/GenUIBlock-DKGMRQmN.js +0 -2
- package/dist/client/assets/ToolCallMessage-C8Z9pIBo.js +0 -4
- package/dist/client/assets/chevron-left-DZQr0sRY.js +0 -1
- package/dist/client/assets/index-BYus2o1t.css +0 -1
- package/dist/client/assets/runDetached-mjGecpjX.js +0 -1
- package/dist/client/assets/useKannaState-DTILzHBb.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r,t as i}from"./rolldown-runtime-C0FnF6B9.js";import{t as a}from"./react-DiVRNtpo.js";import{t as o}from"./jsx-runtime-BdxMnOeJ.js";import{d as s}from"./log-7NXJbErN.js";import{n as c}from"./useTheme-9knhPtrR.js";import{O as l}from"./genui-DmCmYDHH.js";import{t as u}from"./runDetached-mjGecpjX.js";import{t as d}from"./chart-renderer-Ce4S2Bew.js";var f=n(a(),1);function p(e){let t=e.h*Math.PI/180,n=e.c*Math.cos(t),r=e.c*Math.sin(t),i=e.l+.3963377774*n+.2158037573*r,a=e.l-.1055613458*n-.0638541728*r,o=e.l-.0894841775*n-1.291485548*r,s=i**3,c=a**3,l=o**3;return[4.0767416621*s-3.3077115913*c+.2309699292*l,-1.2684380046*s+2.6097574011*c-.3413193965*l,-.0041960863*s-.7034186147*c+1.707614701*l]}var m=/^oklch\(\s*([0-9.]+)(%?)\s+([0-9.]+)\s+([0-9.]+)\s*(?:\/\s*([0-9.]+)(%?)\s*)?\)$/i;function h(e){let t=m.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=t[5]===void 0?1:Number(t[5])/(t[6]?100:1);return{l:t[2]?n/100:n,c:Number(t[3]),h:Number(t[4]),alpha:r}}function g(e){let t=Math.max(0,Math.min(1,e)),n=t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055;return Math.round(n*255)}function _(e,t=1){let[n,r,i]=p(e).map(g);return t>=1?`rgb(${n}, ${r}, ${i})`:`rgba(${n}, ${r}, ${i}, ${t})`}function v(e,t){let n=h(e);return n?_(n,n.alpha):e.trim()||t}function y(e){let t=(t,n)=>v(e(t,``),n),n=Array.from({length:8},(e,n)=>t(`--chart-${n+1}`,`rgb(42, 120, 214)`)),r=t(`--muted-foreground`,`rgb(115, 107, 108)`);return{series:n,compare:r,increase:n[0]??r,decrease:n[7]??r,total:r,grid:t(`--chart-grid`,`rgb(236, 232, 232)`),axis:t(`--chart-axis`,`rgb(204, 198, 198)`),text:t(`--foreground`,`rgb(30, 24, 25)`),mutedText:r,surface:t(`--card`,`rgb(255, 253, 253)`),fontFamily:e(`--kanna-font-body`,`ui-sans-serif, system-ui, sans-serif`)}}var b=.1,x=[4,3],S=11;function C(e,t){return{x:e.x,xLabel:e.xLabel,series:e.series,seriesLabel:t.get(e.series)??e.series,value:e.value,start:e.start??0,end:e.end??e.value}}function w(e,t){switch(e.role){case`compare`:return t.compare;case`increase`:return t.increase;case`decrease`:return t.decrease;case`total`:return t.total;default:return t.series[e.slot??0]??t.series[0]??t.text}}function T(e,t){return{type:`ordinal`,domain:e.series.map(e=>e.label),range:e.series.map(e=>w(e,t))}}function E(e,t){return e.series.some(e=>e.label===t&&e.role===`compare`)}var D=`seriesLabel`;function O(e,t){let n=e?.[t];return typeof n==`string`?n:``}function k(e){let t=e?.value;return typeof t==`number`?t:null}function A(e){let t=t=>l(k(t),e.format);return{mark:{title:{value:e=>O(e,`xLabel`)},content:[{key:e=>O(e,`seriesLabel`),value:t}]},dimension:{title:{value:e=>O(e,`xLabel`)},content:[{key:e=>O(e,`seriesLabel`),value:t}]}}}function ee(e){return e.kind!==`line`&&e.kind!==`area`}function te(e,t){let n={fill:t.mutedText,fontSize:S,fontFamily:t.fontFamily};return[{orient:`left`,type:`linear`,label:{style:n,formatMethod:t=>l(Number(t),e.format,{compact:!0})},grid:{visible:!0,style:{stroke:t.grid,lineWidth:1,lineDash:[]}},domainLine:{visible:!1},tick:{visible:!1}},{orient:`bottom`,type:`band`,sampling:!ee(e),label:{style:n,autoLimit:!0,formatMethod:t=>e.xLabels[String(t)]??String(t)},domainLine:{visible:!0,style:{stroke:t.axis,lineWidth:1}},tick:{visible:!1},grid:{visible:!1}}]}function ne(e,t){return{visible:e.series.length>=2,orient:`top`,position:`start`,item:{label:{style:{fill:t.text,fontSize:S,fontFamily:t.fontFamily}}}}}function re(e,t){let n=new Map(e.series.map(e=>[e.id,e.label]));return{data:[{id:`points`,values:e.points.map(e=>C(e,n))}],background:`transparent`,padding:{top:8,right:12,bottom:4,left:4},color:T(e,t),tooltip:A(e),legends:ne(e,t)}}function ie(e,t){switch(e.kind){case`line`:return oe(e,t);case`area`:return se(e,t);case`bar`:case`stacked-bar`:return ce(e,t);case`combo`:return le(e,t);case`waterfall`:return ue(e,t);case`composition`:return de(e,t)}}function ae(e){return{xField:{visible:!0,line:{type:`line`,style:{stroke:e.axis,lineWidth:1}}}}}function oe(e,t){return{type:`line`,...re(e,t),xField:`x`,yField:`value`,seriesField:D,axes:te(e,t),crosshair:ae(t),line:{style:{lineWidth:2,lineCap:`round`,lineJoin:`round`,lineDash:t=>E(e,O(t,`seriesLabel`))?x:[]}},point:{style:{size:8,stroke:t.surface,lineWidth:2}}}}function se(e,t){return{type:`area`,...re(e,t),xField:`x`,yField:`value`,seriesField:D,axes:te(e,t),crosshair:ae(t),line:{style:{lineWidth:2,lineCap:`round`,lineJoin:`round`}},area:{style:{fillOpacity:t=>E(e,O(t,`seriesLabel`))?0:b}},point:{visible:!1}}}function ce(e,t){let n=e.kind===`stacked-bar`,r=!n&&e.series.length>1;return{type:`bar`,...re(e,t),xField:r?[`x`,D]:`x`,yField:`value`,seriesField:D,stack:n,barMaxWidth:24,barGapInGroup:2,axes:te(e,t),bar:{style:{cornerRadius:n?0:[4,4,0,0],stroke:t.surface,lineWidth:n?2:0}}}}function le(e,t){let[n,r]=e.series,i=re(e,t),a=new Map(e.series.map(e=>[e.id,e.label])),o=t=>e.points.filter(e=>e.series===t).map(e=>C(e,a));return{type:`common`,background:i.background,padding:i.padding,color:i.color,tooltip:i.tooltip,legends:i.legends,data:[{id:`bars`,values:o(n?.id)},{id:`line`,values:o(r?.id)}],series:[{type:`bar`,dataIndex:0,xField:`x`,yField:`value`,seriesField:D,barMaxWidth:24,bar:{style:{cornerRadius:[4,4,0,0]}}},{type:`line`,dataIndex:1,xField:`x`,yField:`value`,seriesField:D,line:{style:{lineWidth:2}},point:{style:{size:8,stroke:t.surface,lineWidth:2}}}],axes:te(e,t).map(e=>e.orient===`left`?{...e,seriesIndex:[0,1]}:e)}}function ue(e,t){return{type:`rangeColumn`,...re(e,t),xField:`x`,minField:`start`,maxField:`end`,seriesField:D,barMaxWidth:24,axes:te(e,t),bar:{style:{cornerRadius:2}}}}function de(e,t){return{type:`pie`,...re(e,t),categoryField:D,valueField:`value`,innerRadius:.62,outerRadius:.9,pie:{style:{stroke:t.surface,lineWidth:2}}}}var fe=e=>e,pe;(function(e){e[`desktop-browser`]=`desktop-browser`,e[`mobile-browser`]=`mobile-browser`,e.node=`node`,e.worker=`worker`,e.miniApp=`miniApp`,e.wx=`wx`,e.tt=`tt`,e.harmony=`harmony`,e[`desktop-miniApp`]=`desktop-miniApp`,e.lynx=`lynx`})(pe||={});var j;(function(e){e.cartesianAxis=`cartesianAxis`,e.cartesianBandAxis=`cartesianAxis-band`,e.cartesianLinearAxis=`cartesianAxis-linear`,e.cartesianTimeAxis=`cartesianAxis-time`,e.cartesianLogAxis=`cartesianAxis-log`,e.cartesianSymlogAxis=`cartesianAxis-symlog`,e.polarAxis=`polarAxis`,e.polarBandAxis=`polarAxis-band`,e.polarLinearAxis=`polarAxis-linear`,e.crosshair=`crosshair`,e.cartesianCrosshair=`cartesianCrosshair`,e.polarCrosshair=`polarCrosshair`,e.dataZoom=`dataZoom`,e.geoCoordinate=`geoCoordinate`,e.indicator=`indicator`,e.discreteLegend=`discreteLegend`,e.continuousLegend=`continuousLegend`,e.colorLegend=`colorLegend`,e.sizeLegend=`sizeLegend`,e.markLine=`markLine`,e.markArea=`markArea`,e.markPoint=`markPoint`,e.polarMarkLine=`polarMarkLine`,e.polarMarkArea=`polarMarkArea`,e.polarMarkPoint=`polarMarkPoint`,e.geoMarkPoint=`geoMarkPoint`,e.tooltip=`tooltip`,e.title=`title`,e.player=`player`,e.scrollBar=`scrollBar`,e.label=`label`,e.totalLabel=`totalLabel`,e.brush=`brush`,e.poptip=`poptip`,e.customMark=`customMark`})(j||={});var me=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})),he,ge=t((()=>{he=(e,t)=>Object.prototype.toString.call(e)===`[object ${t}]`})),_e,ve=t((()=>{ge(),_e=(e,t=!1)=>t?typeof e==`boolean`:!0===e||!1===e||he(e,`Boolean`)})),M,ye=t((()=>{M=e=>typeof e==`function`})),N,be=t((()=>{N=e=>e==null})),P,xe=t((()=>{P=e=>e!=null})),F,Se=t((()=>{F=e=>{let t=typeof e;return e!==null&&t===`object`||t===`function`}})),Ce,we=t((()=>{Ce=e=>typeof e==`object`&&!!e})),Te,Ee=t((()=>{we(),ge(),Te=function(e){if(!Ce(e)||!he(e,`Object`))return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}})),De,Oe=t((()=>{De=e=>e===void 0})),ke,Ae=t((()=>{ge(),ke=(e,t=!1)=>{let n=typeof e;return t?n===`string`:n===`string`||he(e,`String`)}})),I,je=t((()=>{ge(),I=e=>Array.isArray?Array.isArray(e):he(e,`Array`)})),Me,Ne=t((()=>{Me=function(e){return e!==null&&typeof e!=`function`&&Number.isFinite(e.length)}})),Pe,Fe=t((()=>{ge(),Pe=e=>he(e,`Date`)})),L,Ie=t((()=>{ge(),L=(e,t=!1)=>{let n=typeof e;return t?n===`number`:n===`number`||he(e,`Number`)}})),R,Le=t((()=>{Ie(),R=e=>L(e)&&Number.isFinite(e)})),Re,ze=t((()=>{Re=e=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(e)})),Be,Ve=t((()=>{Be=e=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(e)})),He,Ue=t((()=>{He=e=>({}).toString.call(e).replace(/^\[object /,``).replace(/]$/,``)})),We,Ge,Ke=t((()=>{We=Object.prototype,Ge=function(e){let t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||We)}}));function z(e){if(N(e))return!0;if(Me(e))return!e.length;let t=He(e);if(t===`Map`||t===`Set`)return!e.size;if(Ge(e))return!Object.keys(e).length;for(let t in e)if(qe.call(e,t))return!1;return!0}var qe,Je=t((()=>{be(),Ne(),Ue(),Ke(),qe=Object.prototype.hasOwnProperty})),Ye,Xe=t((()=>{Ae(),Ye=(e,t,n)=>{let r=ke(t)?t.split(`.`):t;for(let t=0;t<r.length;t++)e=e?e[r[t]]:void 0;return e===void 0?n:e}})),Ze,Qe,$e=t((()=>{Ze=Object.prototype.hasOwnProperty,Qe=(e,t)=>e!=null&&Ze.call(e,t)}));function et(e,t,n){let r;if(!P(e)||typeof e!=`object`||t&&t(e))return e;let i=I(e),a=e.length;r=i?Array(a):typeof e==`object`?{}:_e(e)||L(e)||ke(e)?e:Pe(e)?new Date(+e):void 0;let o=i?void 0:Object.keys(Object(e)),s=-1;if(r)for(;++s<(o||e).length;){let i=o?o[s]:s,a=e[i];n&&n.includes(i.toString())?r[i]=a:r[i]=et(a,t,n)}return r}var tt=t((()=>{je(),ve(),Fe(),Ie(),Ae(),xe()}));function nt(e,t,n=!1,r=!1){if(t){if(e===t)return;if(P(t)&&typeof t==`object`){let i=Object(t),a=[];for(let e in i)a.push(e);let{length:o}=a,s=-1;for(;o--;){let o=a[++s];!P(i[o])||typeof i[o]!=`object`||r&&I(e[o])?it(e,o,i[o]):rt(e,t,o,n,r)}}}}function rt(e,t,n,r=!1,i=!1){let a=e[n],o=t[n],s=t[n],c=!0;if(I(o)){if(r)s=[];else if(I(a))s=a;else if(Me(a)){s=Array(a.length);let e=-1,t=a.length;for(;++e<t;)s[e]=a[e]}}else Te(o)?(s=a??{},typeof a!=`function`&&typeof a==`object`||(s={})):c=!1;c&&nt(s,o,r,i),it(e,n,s)}function it(e,t,n){(n!==void 0&&!at(e[t],n)||n===void 0&&!(t in e))&&(e[t]=n)}function at(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function ot(e,...t){let n=-1,r=t.length;for(;++n<r;)nt(e,t[n],!0);return e}var st=t((()=>{je(),Ne(),Ee(),xe()}));function ct(e,t){if(!e||!Te(e))return e;let n={};return Object.keys(e).forEach((r=>{let i=e[r],a=!1;t.forEach((e=>{(ke(e)&&e===r||e instanceof RegExp&&r.match(e))&&(a=!0)})),a||(n[r]=i)})),n}var lt=t((()=>{Ee(),Ae()}));function ut(e){return Object.prototype.toString.call(e)}function dt(e){return Object.keys(e)}function ft(e,t,n){if(e===t)return!0;if(typeof e!=typeof t||e==null||t==null)return!1;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(ut(e)!==ut(t))return!1;if(M(e))return!!n?.skipFunction;if(typeof e!=`object`)return!1;if(I(e)){if(e.length!==t.length)return!1;for(let r=e.length-1;r>=0;r--)if(!ft(e[r],t[r],n))return!1;return!0}if(!Te(e))return!1;let r=dt(e),i=dt(t);if(r.length!==i.length)return!1;r.sort(),i.sort();for(let e=r.length-1;e>=0;e--)if(r[e]!=i[e])return!1;for(let i=r.length-1;i>=0;i--){let a=r[i];if(!ft(e[a],t[a],n))return!1}return!0}var pt=t((()=>{je(),ye(),Ee()}));function mt(e){if(!e)return[];if(Object.keys)return Object.keys(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(n);return t}function ht(e,t,n){let r=mt(t);for(let i=0;i<r.length;i++){let a=r[i];(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}return e}function gt(e,t,n=!0){if(e=`prototype`in e?e.prototype:e,t=`prototype`in t?t.prototype:t,Object.getOwnPropertyNames){let r=Object.getOwnPropertyNames(t);for(let i=0;i<r.length;i++){let a=r[i];a!==`constructor`&&(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}}else ht(e,t,n)}var _t=t((()=>{}));function B(e){return P(e)?I(e)?e:[e]:[]}function vt(e){if(Me(e))return e[e.length-1]}function yt(e,t){if(!I(e)||!I(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bt(e){if(!I(e))return[e];let t=[];for(let n of e)t.push(...bt(n));return t}var xt,St,Ct=t((()=>{je(),Ne(),xe(),xt=(e,t)=>{if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(t?.(i,n)??i-n)>0&&(n=i)}return n},St=(e,t)=>{if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(t?.(i,n)??i-n)<0&&(n=i)}return n}}));function wt(e,t,n){P(t)||(t=e,e=0),P(n)||(n=1);let r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),a=Array(i);for(;++r<i;)a[r]=e+r*n;return a}var Tt=t((()=>{xe()}));function Et(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Dt=t((()=>{}));function Ot(e){return Number(e)}var kt=t((()=>{})),At=t((()=>{}));function jt(e,t,n){let r=[t].concat([].slice.call(n));Mt&&console[e].apply(console,r)}var Mt,Nt,Pt,Ft=t((()=>{Ie(),Mt=typeof console<`u`,(function(e){e[e.None=0]=`None`,e[e.Error=1]=`Error`,e[e.Warn=2]=`Warn`,e[e.Info=3]=`Info`,e[e.Debug=4]=`Debug`})(Nt||={}),Pt=class e{static getInstance(t,n){return e._instance&&L(t)?e._instance.level(t):e._instance||=new e(t,n),e._instance}static setInstance(t){return e._instance=t}static setInstanceLevel(t){e._instance?e._instance.level(t):e._instance=new e(t)}static clearInstance(){e._instance=null}constructor(e=Nt.None,t){this._onErrorHandler=[],this._level=e,this._method=t}addErrorHandler(e){this._onErrorHandler.find((t=>t===e))||this._onErrorHandler.push(e)}removeErrorHandler(e){let t=this._onErrorHandler.findIndex((t=>t===e));t<0||this._onErrorHandler.splice(t,1)}callErrorHandler(...e){this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=Nt.Info}canLogDebug(){return this._level>=Nt.Debug}canLogError(){return this._level>=Nt.Error}canLogWarn(){return this._level>=Nt.Warn}level(e){return arguments.length?(this._level=+e,this):this._level}error(...e){return this._level>=Nt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...e):jt(this._method??`error`,`ERROR`,e)),this}warn(...e){return this._level>=Nt.Warn&&jt(this._method||`warn`,`WARN`,e),this}info(...e){return this._level>=Nt.Info&&jt(this._method||`log`,`INFO`,e),this}debug(...e){return this._level>=Nt.Debug&&jt(this._method||`log`,`DEBUG`,e),this}},Pt._instance=null}));function It(e,t,n=0,r){for(N(r)&&(r=e.length);n<r;){let i=n+r>>>1;Et(e[i],t)>0?r=i:n=i+1}return n}var Lt,Rt=t((()=>{Dt(),be(),Lt=(e,t,n)=>{let r=e,i=t;for(;r<i;){let e=Math.floor((r+i)/2);n(e)>=0?i=e:r=e+1}return r}}));function zt(e,t,n=Ut,r=Ht){let i=r,a=n*Math.max(e,t);return Math.abs(e-t)<=Math.max(i,a)}function Bt(e,t,n,r){return e>t&&!zt(e,t,n,r)}function Vt(e,t,n,r){return e<t&&!zt(e,t,n,r)}var Ht,Ut,Wt=t((()=>{Ht=1e-10,Ut=1e-10})),Gt,Kt=t((()=>{Gt=e=>{let t=null,n=null;return(...r)=>(t&&r.every(((e,n)=>e===t[n]))||(t=r,n=e(...r)),n)}})),qt,Jt=t((()=>{qt=function(e,t,n){return e<t?t:e>n?n:e}})),Yt,Xt=t((()=>{Yt=(e,t,n)=>{let[r,i]=e;i<r&&(r=e[1],i=e[0]);let a=i-r;return a>=n-t?[t,n]:(r=Math.min(Math.max(r,t),n-a),[r,r+a])}}));function Zt(e,t){let n;return e>t&&(n=e,e=t,t=n),n=>Math.max(e,Math.min(t,n))}var Qt=t((()=>{}));function $t(e,t,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&en;if(typeof e!=`function`)throw TypeError(`Expected a function`);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(cancelAnimationFrame(s),requestAnimationFrame(e)):setTimeout(e,t)}function g(e){let n=e-c;return c===void 0||n>=t||n<0||d&&e-l>=a}function _(){let e=Date.now();if(g(e))return v(e);s=h(_,function(e){let n=e-l,r=t-(e-c);return d?Math.min(r,a-n):r}(e))}function v(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function y(...e){let n=Date.now(),a=g(n);if(r=e,i=this,c=n,a){if(s===void 0)return function(e){return l=e,s=h(_,t),u?m(e):o}(c);if(d)return s=h(_,t),m(c)}return s===void 0&&(s=h(_,t)),o}return t=+t||0,F(n)&&(u=!!n.leading,d=`maxWait`in n,d&&(a=Math.max(R(n.maxWait)?n.maxWait:0,t)),f=`trailing`in n?!!n.trailing:f),y.cancel=function(){s!==void 0&&function(e){if(p)return cancelAnimationFrame(e);clearTimeout(e)}(s),l=0,r=c=i=s=void 0},y.flush=function(){return s===void 0?o:v(Date.now())},y.pending=function(){return s!==void 0},y}var en,tn=t((()=>{Se(),Le(),en=!1;try{en=typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`}catch{en=!1}en=!1}));function nn(e,t,n){let r=!0,i=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);return F(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),$t(e,t,{leading:r,trailing:i,maxWait:t})}var rn=t((()=>{tn(),Se()}));function an(e,t){return n=>e*(1-n)+t*n}function on(e,t){return function(n){return Math.round(e*(1-n)+t*n)}}function sn(e,t){let n=e.valueOf(),r=t.valueOf(),i=new Date;return e=>(i.setTime(n*(1-e)+r*e),i)}var cn,ln=t((()=>{cn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,new RegExp(cn.source,`g`)})),un=t((()=>{})),dn=t((()=>{})),fn=t((()=>{})),pn=t((()=>{})),mn=t((()=>{})),hn=t((()=>{})),gn=t((()=>{})),_n=t((()=>{})),vn=t((()=>{})),yn=t((()=>{})),bn=t((()=>{})),xn=t((()=>{ve(),ye(),be(),xe(),Se(),we(),Ee(),ge(),Oe(),Ae(),je(),Ne(),Fe(),Ie(),Le(),ze(),Ve(),Je(),Xe(),$e(),tt(),st(),lt(),pt(),_t(),Ct(),Tt(),At(),Rt(),At(),Wt(),Kt(),Jt(),Xt(),Qt(),tn(),rn(),ln(),kt(),un(),dn(),fn(),pn(),mn(),hn(),gn(),_n(),vn(),yn(),bn()})),Sn=t((()=>{}));function Cn(e){return e>1?0:e<-1?jn:Math.acos(e)}function wn(e){return e>=1?Mn:e<=-1?-Mn:Math.asin(e)}function Tn(e,t,n,r,i){let a=n,o=r;return typeof e==`number`&&typeof n==`number`&&(a=(1-i)*e+i*n),typeof t==`number`&&typeof r==`number`&&(o=(1-i)*t+i*r),{x:a,y:o}}function En(e,t){return e[0]*t[1]-e[1]*t[0]}function Dn(e,t){return Pn(e[0]-t[0])+Pn(e[1]-t[1])<1e-12}function On(e,t=10){return Math.round(e*t)/t}function kn(e){let t=e.toString().split(/[eE]/),n=(t[0].split(`.`)[1]||``).length-(+t[1]||0);return n>0?n:0}function An(e,t){return On(e-t,10**Math.max(kn(e),kn(t)))}var jn,Mn,Nn,V,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn=t((()=>{jn=Math.PI,Mn=jn/2,Nn=2*jn,V=2*Math.PI,Pn=Math.abs,Fn=Math.atan2,In=Math.cos,Ln=Math.max,Rn=Math.min,zn=Math.sin,Bn=Math.sqrt,Vn=Math.pow})),Un,Wn,Gn=t((()=>{Ie(),Hn(),Un=class e{constructor(e=0,t=0,n,r){this.x=0,this.y=0,this.x=e,this.y=t,this.x1=n,this.y1=r}clone(){return new e(this.x,this.y)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x1=e.x1,this.y1=e.y1,this.defined=e.defined,this.context=e.context,this}set(e,t){return this.x=e,this.y=t,this}add(e){return L(e)?(this.x+=e,void(this.y+=e)):(this.x+=e.x,this.y+=e.y,this)}sub(e){return L(e)?(this.x-=e,void(this.y-=e)):(this.x-=e.x,this.y-=e.y,this)}multi(e){throw Error(`暂不支持`)}div(e){throw Error(`暂不支持`)}},Wn=class{static distancePP(e,t){return Bn(Vn(e.x-t.x,2)+Vn(e.y-t.y,2))}static distanceNN(e,t,n,r){return Bn(Vn(e-n,2)+Vn(t-r,2))}static distancePN(e,t,n){return Bn(Vn(t-e.x,2)+Vn(n-e.y,2))}static pointAtPP(e,t,n){return new Un((t.x-e.x)*n+e.x,(t.y-e.y)*n+e.y)}}})),Kn=t((()=>{}));function qn(e){return Math.PI/180*e}function Jn(e){return 180*e/Math.PI}function Yn(e,t,n){return t?{x:e.x+t*Math.cos(n),y:e.y+t*Math.sin(n)}:{x:e.x,y:e.y}}function Xn(e){for(;e<0;)e+=2*Math.PI;for(;e>=2*Math.PI;)e-=2*Math.PI;return e}function Zn(e,t){let n=Math.abs(t-e);if(n>=2*Math.PI||2*Math.PI-n<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];let r=Xn(Math.min(e,t)),i=r+n,a=[r,i],o=Math.floor(r/Math.PI)*Math.PI/2;for(;o<i;)o>r&&a.push(o),o+=Math.PI/2;return a}function Qn(e,t,n,r){let{x:i,y:a}=t,o=Zn(n,r),{width:s,height:c}=e,l=[];return o.forEach((e=>{let t=Math.sin(e),n=Math.cos(e);t===1?l.push(c-a):t===-1?l.push(a):n===1?l.push(s-i):n===-1?l.push(i):(t>0?l.push(Math.abs((c-a)/t)):l.push(Math.abs(a/t)),n>0?l.push(Math.abs((s-i)/n)):l.push(Math.abs(i/n)))})),Math.min.apply(null,l)}function $n(e){return(e=Xn(e))>0&&e<=Math.PI/2?2:e>Math.PI/2&&e<=Math.PI?3:e>Math.PI&&e<=3*Math.PI/2?4:1}var er,tr,nr=t((()=>{Hn(),er=(e=0)=>{if(e<0)for(;e<-Nn;)e+=Nn;else if(e>0)for(;e>Nn;)e-=Nn;return e},tr=er}));function rr(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1]}function ir(e,t,n,r){let i=e[0],a=t[0],o=n[0],s=r[0];return a<i&&([i,a]=[a,i]),s<o&&([s,o]=[o,s]),!(a<o||s<i)&&(i=e[1],a=t[1],o=n[1],s=r[1],a<i&&([i,a]=[a,i]),s<o&&([s,o]=[o,s]),!(a<o||s<i))}function ar(e,t,n,r){if(!ir(e,t,n,r))return!1;let i=[0,0],a=[0,0],o=[0,0];if(rr(i,t,e),rr(a,r,n),Dn(i,a))return!0;rr(o,n,e);let s=En(o,a)/En(i,a);return s>=0&&s<=1&&[e[0]+i[0]*s,e[1]+i[1]*s]}function or(e,t,n){if(e===null)return t;if(t===null)return e;let{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}=hr(e,t,n);return r>=c||i<=s||a>=u||o<=l?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,s),y1:Math.max(a,l),x2:Math.min(i,c),y2:Math.min(o,u)}}function sr(e,t,n){if(e&&t){if(!n)return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1);let{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}=hr(e,t,!0);return!(r>c||i<s||a>u||o<l)}return!0}function cr(e,t,n){if(!t)return!0;if(!n)return e.x>=t.x1&&e.x<=t.x2&&e.y>=t.y1&&e.y<=t.y2;let r=t.x1,i=t.x2,a=t.y1,o=t.y2;return r>i&&([r,i]=[i,r]),a>o&&([a,o]=[o,a]),e.x>=r&&e.x<=i&&e.y>=a&&e.y<=o}function lr(e,t){return Math.abs(t[0]*e[0]+t[1]*e[1])}function ur({x:e,y:t},n,r={x:0,y:0}){return{x:(e-r.x)*Math.cos(n)-(t-r.y)*Math.sin(n)+r.x,y:(e-r.x)*Math.sin(n)+(t-r.y)*Math.cos(n)+r.y}}function dr(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function fr(e,t){let n=t?qn(e.angle):e.angle,r=dr(e);return[ur({x:e.x1,y:e.y1},n,r),ur({x:e.x2,y:e.y1},n,r),ur({x:e.x2,y:e.y2},n,r),ur({x:e.x1,y:e.y2},n,r)]}function pr(e,t,n=!1){let r=fr(e,n),i=fr(t,n),a=(e,t)=>[t.x-e.x,t.y-e.y],o=a(dr(e),dr(t)),s=a(r[0],r[1]),c=a(r[1],r[2]),l=a(i[0],i[1]),u=a(i[1],i[2]),d=n?qn(e.angle):e.angle,f=n?qn(90-e.angle):e.angle+Mn,p=n?qn(t.angle):t.angle,m=n?qn(90-t.angle):t.angle+Mn;f>V&&(f-=V),m>V&&(m-=V);let h=(e,t,n,r)=>{let i=[Math.cos(t),Math.sin(t)];return e+(lr(i,n)+lr(i,r))/2>lr(i,o)};return h((e.x2-e.x1)/2,d,l,u)&&h((e.y2-e.y1)/2,f,l,u)&&h((t.x2-t.x1)/2,p,s,c)&&h((t.y2-t.y1)/2,m,s,c)}var mr,hr,gr=t((()=>{nr(),Hn(),(function(e){e[e.NONE=0]=`NONE`,e[e.BBOX1=1]=`BBOX1`,e[e.BBOX2=2]=`BBOX2`})(mr||={}),hr=(e,t,n)=>{let r=e.x1,i=e.x2,a=e.y1,o=e.y2,s=t.x1,c=t.x2,l=t.y1,u=t.y2;return n&&(r>i&&([r,i]=[i,r]),a>o&&([a,o]=[o,a]),s>c&&([s,c]=[c,s]),l>u&&([l,u]=[u,l])),{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}}})),_r=t((()=>{})),vr=t((()=>{})),yr=t((()=>{gr(),_r(),vr()})),br=t((()=>{}));function xr(e,t,n,r,i,a){if(a>t&&a>r||a<t&&a<r||r===t)return 0;let o=(a-t)/(r-t),s=r<t?1:-1;o!==1&&o!==0||(s=r<t?.5:-.5);let c=o*(n-e)+e;return c===i?1/0:c>i?s:0}var Sr=t((()=>{})),Cr=t((()=>{})),wr,Tr=t((()=>{wr=e=>{let t=e.charCodeAt(0),n=e.length===2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r===12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r===8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r===172||r===175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r===161||r===164||167<=r&&r<=168||r===170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r===198||r===208||215<=r&&r<=216||222<=r&&r<=225||r===230||232<=r&&r<=234||236<=r&&r<=237||r===240||242<=r&&r<=243||247<=r&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||294<=r&&r<=295||r===299||305<=r&&r<=307||r===312||319<=r&&r<=322||r===324||328<=r&&r<=331||r===333||338<=r&&r<=339||358<=r&&r<=359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||713<=r&&r<=715||r===717||r===720||728<=r&&r<=731||r===733||r===735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r===1025||1040<=r&&r<=1103||r===1105||r===8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r===8240||8242<=r&&r<=8243||r===8245||r===8251||r===8254||r===8308||r===8319||8321<=r&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||8481<=r&&r<=8482||r===8486||r===8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r===8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r===8658||r===8660||r===8679||r===8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r===8715||r===8719||r===8721||r===8725||r===8730||8733<=r&&r<=8736||r===8739||r===8741||8743<=r&&r<=8748||r===8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r===8776||r===8780||r===8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r===8853||r===8857||r===8869||r===8895||r===8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r===9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r===9711||9733<=r&&r<=9734||r===9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r===9756||r===9758||r===9792||r===9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r===9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r===9955||9960<=r&&r<=9983||r===10045||r===10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r===65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`}}));function Er(e,t={},n){n||=1;let{fontStyle:r=t.fontStyle,fontVariant:i=t.fontVariant,fontWeight:a=t.fontWeight,fontSize:o=t.fontSize,fontFamily:s=t.fontFamily}=e;return(r?r+` `:``)+(i?i+` `:``)+(a?a+` `:``)+o*n+`px `+(s||`sans-serif`)}var Dr=t((()=>{})),Or,kr=t((()=>{xn(),Tr(),Dr(),Or=class e{constructor(e,t){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet=`-/: .,@%'"~`,this._option=e,this._userSpec=t??{},this.textSpec=this._initSpec(),P(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=P(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(N(this._canvas)&&(P(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),N(this._canvas)&&typeof window<`u`&&window.document!==void 0&&globalThis&&P(globalThis.document)&&(this._canvas=globalThis.document.createElement(`canvas`))),N(this._context)&&P(this._canvas)){let e=this._canvas.getContext(`2d`);P(e)&&(e.save(),e.font=Er(this.textSpec),this._contextSaved=!0,this._context=e)}return!N(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){let{defaultFontParams:e={}}=this._option,{fontStyle:t=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight??`normal`,fontSize:i=e.fontSize??12,fontFamily:a=e.fontFamily??`sans-serif`,align:o,textAlign:s=o??`center`,baseline:c,textBaseline:l=c??`middle`,ellipsis:u,limit:d}=this._userSpec,{lineHeight:f=i}=this._userSpec;return ke(f)&&f[f.length-1]===`%`&&(f=i*(Number.parseFloat(f.substring(0,f.length-1))/100)),{fontStyle:t,fontVariant:n,fontFamily:a,fontSize:i,fontWeight:r,textAlign:s,textBaseline:l,ellipsis:u,limit:d,lineHeight:f}}measure(e,t){switch(t){case`vrender`:case`canopus`:return this.fullMeasure(e);case`canvas`:return this.measureWithNaiveCanvas(e);case`simple`:return this.quickMeasureWithoutCanvas(e);default:return this.quickMeasure(e)}}fullMeasure(e){if(N(e))return{width:0,height:0};if(N(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(e);let{fontFamily:t,fontSize:n,fontWeight:r,textAlign:i,textBaseline:a,ellipsis:o,limit:s,lineHeight:c}=this.textSpec,l;try{let u=this._option.getTextBounds({text:e,fontFamily:t,fontSize:n,fontWeight:r,textAlign:i,textBaseline:a,ellipsis:!!o,maxLineWidth:s||1/0,lineHeight:c});l={width:u.width(),height:u.height()}}catch{this._notSupportVRender=!0,l=this.measureWithNaiveCanvas(e)}return l}measureWithNaiveCanvas(e){return this._measureReduce(e,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(e){if(!this.initContext())return this._quickMeasureWithoutCanvas(e);let t=this._context.measureText(e),{fontSize:n,lineHeight:r}=this.textSpec;return{width:t.width,height:r??n,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}quickMeasure(e){return this._measureReduce(e,this._quickMeasure.bind(this))}_quickMeasure(t){let n={width:0,height:0};for(let r=0;r<t.length;r++){let i=t[r],a=this._measureSpecialChar(i);N(a)&&e.NUMBERS_CHAR_SET.includes(i)&&(a=this._measureNumberChar()),N(a)&&[`F`,`W`].includes(wr(i))&&(a=this._measureFullSizeChar()),N(a)&&(a=this._measureLetterChar()),n.width+=a.width,n.height=Math.max(n.height,a.height),!N(a.fontBoundingBoxAscent)&&(n.fontBoundingBoxAscent=a.fontBoundingBoxAscent),!N(a.fontBoundingBoxDescent)&&(n.fontBoundingBoxDescent=a.fontBoundingBoxDescent)}return n}quickMeasureWithoutCanvas(e){return this._measureReduce(e,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(e){let t={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let r=0;r<e.length;r++){let i=e[r],a=[`F`,`W`].includes(wr(i))?1:.53;t.width+=a*n}return t.height=r??n,t}_measureReduce(e,t){let{fontSize:n,lineHeight:r}=this.textSpec,i={width:0,height:0};if(N(e))return i;if(I(e)){let a=e.filter(P).map((e=>e.toString()));return a.length===0?i:a.length===1?t(a[0]):{width:a.reduce(((e,n)=>Math.max(e,t(n).width)),0),height:a.length*((r??n)+1)+1}}return t(e.toString())}_measureNumberChar(){if(N(this._numberCharSize)){let t=this._standardMethod(e.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/e.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return N(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(e.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(N(this._letterCharSize)){let t=this._standardMethod(e.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/e.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(e){return P(this._specialCharSizeMap[e])?this._specialCharSizeMap[e]:this.specialCharSet.includes(e)?(this._specialCharSizeMap[e]=this._standardMethod(e),this._specialCharSizeMap[e]):null}release(){P(this._canvas)&&(this._canvas=null),P(this._context)&&(this._contextSaved&&=(this._context.restore(),!1),this._context=null)}},Or.ALPHABET_CHAR_SET=`abcdefghijklmnopqrstuvwxyz`,Or.NUMBERS_CHAR_SET=`0123456789`,Or.FULL_SIZE_CHAR=`字`})),Ar=t((()=>{})),jr=t((()=>{kr(),Ar(),Dr()})),Mr=t((()=>{Tr(),jr()})),Nr,Pr,Fr,Ir=t((()=>{Nr=(e,t)=>{let{x1:n,x2:r,y1:i,y2:a}=e,o=Math.abs(r-n),s=Math.abs(a-i),c=(n+r)/2,l=(i+a)/2,u=0,d=0;switch(t){case`top`:case`inside-top`:d=-.5;break;case`bottom`:case`inside-bottom`:d=.5;break;case`left`:case`inside-left`:u=-.5;break;case`right`:case`inside-right`:u=.5;break;case`top-right`:u=.5,d=-.5;break;case`top-left`:u=-.5,d=-.5;break;case`bottom-right`:u=.5,d=.5;break;case`bottom-left`:u=-.5,d=.5}return c+=u*o,l+=d*s,{x:c,y:l}},Pr=(e,t)=>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),Fr=(e,t)=>{let n=[{x:Math.cos(e.angle),y:Math.sin(e.angle)},{x:-Math.sin(e.angle),y:Math.cos(e.angle)},{x:Math.cos(t.angle),y:Math.sin(e.angle)},{x:-Math.sin(t.angle),y:Math.cos(e.angle)}];function r(e,t,n){let r=e.getRotatedCorners().map((e=>e.x*t+e.y*n));return{min:Math.min(...r),max:Math.max(...r)}}let i=0;for(let a of n){let n=r(e,a.x,a.y),o=r(t,a.x,a.y),s;s=n.max<o.min?o.min-n.max:o.max<n.min?n.min-o.max:0,i=Math.max(i,s)}return i}})),Lr=t((()=>{Kn(),yr(),br(),Sr(),Cr(),Mr(),Ir()}));function Rr(e,t,n){let{x1:r,y1:i,x2:a,y2:o}=t;return n.onlyTranslate()?(e!==t&&e.setValue(t.x1,t.y1,t.x2,t.y2),e.translate(n.e,n.f),t):(e.clear(),e.add(n.a*r+n.c*i+n.e,n.b*r+n.d*i+n.f),e.add(n.a*a+n.c*i+n.e,n.b*a+n.d*i+n.f),e.add(n.a*a+n.c*o+n.e,n.b*a+n.d*o+n.f),e.add(n.a*r+n.c*o+n.e,n.b*r+n.d*o+n.f),t)}var zr,Br,Vr,Hr=t((()=>{xn(),Lr(),zr=class e{constructor(e){e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}clone(){return new e(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2}setValue(e=0,t=0,n=0,r=0){return this.x1=e,this.y1=t,this.x2=n,this.y2=r,this}set(e=0,t=0,n=0,r=0){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),r<t?(this.y2=t,this.y1=r):(this.y1=t,this.y2=r),this}add(e=0,t=0){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this}expand(e=0){return I(e)?(this.y1-=e[0],this.x2+=e[1],this.y2+=e[2],this.x1-=e[3]):(this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(e=0,t=0){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}rotate(e=0,t=0,n=0){let r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])}scale(e=0,t=0,n=0,r=0){let i=this.scalePoints(e,t,n,r);return this.clear().add(i[0],i[1]).add(i[2],i[3])}union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this}intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this}encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2}alignsWith(e){return e&&(this.x1===e.x1||this.x2===e.x2||this.y1===e.y1||this.y2===e.y2)}intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)}contains(e=0,t=0){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)}containsPoint(e){return!(e.x<this.x1||e.x>this.x2||e.y<this.y1||e.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(e=0){return this.x1*=e,this.x2*=e,this}scaleY(e=0){return this.y1*=e,this.y2*=e,this}transformWithMatrix(e){return Rr(this,this,e),this}copy(e){return this.x1=e.x1,this.y1=e.y1,this.x2=e.x2,this.y2=e.y2,this}rotatedPoints(e,t,n){let{x1:r,y1:i,x2:a,y2:o}=this,s=Math.cos(e),c=Math.sin(e),l=t-t*s+n*c,u=n-t*c-n*s;return[s*r-c*i+l,c*r+s*i+u,s*r-c*o+l,c*r+s*o+u,s*a-c*i+l,c*a+s*i+u,s*a-c*o+l,c*a+s*o+u]}scalePoints(e,t,n,r){let{x1:i,y1:a,x2:o,y2:s}=this;return[e*i+(1-e)*n,t*a+(1-t)*r,e*o+(1-e)*n,t*s+(1-t)*r]}},Br=class extends zr{},Vr=class e extends zr{constructor(e,t=0){super(e),e&&(this.angle=e.angle??t)}intersects(e){return pr(this,e)}setValue(e=0,t=0,n=0,r=0,i=0){return super.setValue(e,t,n,r),this.angle=i,this}clone(){return new e(this)}getRotatedCorners(){let e={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[ur({x:this.x1,y:this.y1},this.angle,e),ur({x:this.x2,y:this.y1},this.angle,e),ur({x:this.x1,y:this.y2},this.angle,e),ur({x:this.x2,y:this.y2},this.angle,e)]}}}));function Ur(e,t,n,r,i,a,o,s){let c=t.a,l=t.b,u=t.c,d=t.d,f=t.e,p=t.f,m=In(o),h=zn(o),g,_;s?(g=s[0],_=s[1]):(g=n,_=r);let v=g-n,y=_-r,b=c*m+u*h,x=l*m+d*h,S=u*m-c*h,C=d*m-l*h;e.a=i*b,e.b=i*x,e.c=a*S,e.d=a*C,e.e=f+c*g+u*_-b*v-S*y,e.f=p+l*g+d*_-x*v-C*y}var Wr,Gr=t((()=>{nr(),Hn(),Wr=class e{constructor(e=1,t=0,n=0,r=1,i=0,a=0){this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a}equalToMatrix(e){return this.e===e.e&&this.f===e.f&&this.a===e.a&&this.d===e.d&&this.b===e.b&&this.c===e.c}equalTo(e,t,n,r,i,a){return this.e===i&&this.f===a&&this.a===e&&this.d===r&&this.b===t&&this.c===n}setValue(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){let t=this.a,n=this.b,r=this.c,i=this.d,a=this.e,o=this.f,s=new e,c=t*i-n*r;return s.a=i/c,s.b=-n/c,s.c=-r/c,s.d=t/c,s.e=(r*o-i*a)/c,s.f=-(t*o-n*a)/c,s}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.a*t+this.c*n,i=this.b*t+this.d*n,a=this.a*-n+this.c*t,o=this.b*-n+this.d*t;return this.a=r,this.b=i,this.c=a,this.d=o,this}rotateByCenter(e,t,n){let r=Math.cos(e),i=Math.sin(e),a=(1-r)*t+i*n,o=(1-r)*n-i*t,s=r*this.a-i*this.b,c=i*this.a+r*this.b,l=r*this.c-i*this.d,u=i*this.c+r*this.d,d=r*this.e-i*this.f+a,f=i*this.e+r*this.f+o;return this.a=s,this.b=c,this.c=l,this.d=u,this.e=d,this.f=f,this}scale(e,t){return this.a*=e,this.b*=e,this.c*=t,this.d*=t,this}setScale(e,t){return this.b=this.b/this.a*e,this.c=this.c/this.d*t,this.a=e,this.d=t,this}transform(e,t,n,r,i,a){return this.multiply(e,t,n,r,i,a),this}translate(e,t){return this.e+=this.a*e+this.c*t,this.f+=this.b*e+this.d*t,this}transpose(){let{a:e,b:t,c:n,d:r,e:i,f:a}=this;return this.a=t,this.b=e,this.c=r,this.d=n,this.e=a,this.f=i,this}multiply(e,t,n,r,i,a){let o=this.a,s=this.b,c=this.c,l=this.d,u=o*e+c*t,d=s*e+l*t,f=o*n+c*r,p=s*n+l*r,m=o*i+c*a+this.e,h=s*i+l*a+this.f;return this.a=u,this.b=d,this.c=f,this.d=p,this.e=m,this.f=h,this}interpolate(t,n){let r=new e;return r.a=this.a+(t.a-this.a)*n,r.b=this.b+(t.b-this.b)*n,r.c=this.c+(t.c-this.c)*n,r.d=this.d+(t.d-this.d)*n,r.e=this.e+(t.e-this.e)*n,r.f=this.f+(t.f-this.f)*n,r}transformPoint(e,t){let{a:n,b:r,c:i,d:a,e:o,f:s}=this,c=n*a-r*i,l=a/c,u=-r/c,d=-i/c,f=n/c,p=(i*s-a*o)/c,m=-(n*s-r*o)/c,{x:h,y:g}=e;t.x=h*l+g*d+p,t.y=h*u+g*f+m}onlyTranslate(e=1){return this.a===e&&this.b===0&&this.c===0&&this.d===e}clone(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){let e=this.a,t=this.b,n=this.c,r=this.d,i=e*r-t*n,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!==0||t!==0){let o=Math.sqrt(e*e+t*t);a.rotateDeg=t>0?Math.acos(e/o):-Math.acos(e/o),a.scaleX=o,a.scaleY=i/o,a.skewX=(e*n+t*r)/i,a.skewY=0}else if(n!==0||r!==0){let o=Math.sqrt(n*n+r*r);a.rotateDeg=Math.PI/2-(r>0?Math.acos(-n/o):-Math.acos(n/o)),a.scaleX=i/o,a.scaleY=o,a.skewX=0,a.skewY=(e*n+t*r)/i}return a.rotateDeg=Jn(a.rotateDeg),a}}})),Kr=t((()=>{Sn(),Gn(),Hr(),Gr()})),qr,Jr=t((()=>{qr=class{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(e,t){let{CLEAN_THRESHOLD:n=this.CLEAN_THRESHOLD,L_TIME:r=this.L_TIME,R_COUNT:i=this.R_COUNT}=t;if(e.size<n)return 0;let a=0,o=t=>{a++,e.delete(t)},s=Date.now();return e.forEach(((e,t)=>{if(e.timestamp.length<i)return o(t);let n=0;for(;s-e.timestamp[e.timestamp.length-1-n]<r&&(n++,!(n>=i)););if(n<i)return o(t);for(;s-e.timestamp[0]>r;)e.timestamp.shift()})),a}addLimitedTimestamp(e,t,n){let{R_TIMESTAMP_MAX_SIZE:r=this.R_TIMESTAMP_MAX_SIZE}=n;e.timestamp.length>r&&e.timestamp.shift(),e.timestamp.push(t)}clearTimeStamp(e,t){let{L_TIME:n=this.L_TIME}=t,r=Date.now();e.forEach((e=>{for(;r-e.timestamp[0]>n;)e.timestamp.shift()}))}clearItemTimestamp(e,t){let{L_TIME:n=this.L_TIME}=t,r=Date.now();for(;r-e.timestamp[0]>n;)e.timestamp.shift()}}}));function Yr(e,t,n){t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=0,s=0,c=0;return 0<=e&&e<60?(o=r,s=i,c=0):60<=e&&e<120?(o=i,s=r,c=0):120<=e&&e<180?(o=0,s=r,c=i):180<=e&&e<240?(o=0,s=i,c=r):240<=e&&e<300?(o=i,s=0,c=r):300<=e&&e<360&&(o=r,s=0,c=i),o=Math.round(255*(o+a)),s=Math.round(255*(s+a)),c=Math.round(255*(c+a)),{r:o,g:s,b:c}}var Xr=t((()=>{}));function Zr(e,t,n){e/=255,t/=255,n/=255;let r=Math.min(e,t,n),i=Math.max(e,t,n),a=i-r,o=0,s=0,c=0;return o=a===0?0:i===e?(t-n)/a%6:i===t?(n-e)/a+2:(e-t)/a+4,o=Math.round(60*o),o<0&&(o+=360),c=(i+r)/2,s=a===0?0:a/(1-Math.abs(2*c-1)),s=+(100*s).toFixed(1),c=+(100*c).toFixed(1),{h:o,s,l:c}}var Qr=t((()=>{}));function $r(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?`0`:``)+e.toString(16)}function ei(e){return L(e)?new li(e>>16,e>>8&255,255&e,1):I(e)?new li(e[0],e[1],e[2]):new li(255,255,255)}function ti(e){return L(e)?new li(e>>>24,e>>>16&255,e>>>8&255,255&e):I(e)?new li(e[0],e[1],e[2],e[3]):new li(255,255,255,1)}function ni(e){return e<.04045?.0773993808*e:(.9478672986*e+.0521327014)**2.4}function ri(e){return e<.0031308?12.92*e:1.055*e**.41666-.055}var ii,ai,oi,si,ci,li,ui=t((()=>{xn(),Xr(),Qr(),ii=/^#([0-9a-f]{3,8})$/,ai={transparent:4294967040},oi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},si=(e,t)=>{let n=ii.exec(e);if(t||n){let e=parseInt(n[1],16),t=n[1].length;return t===3?new li((e>>8&15)+((e>>8&15)<<4),(e>>4&15)+((e>>4&15)<<4),(15&e)+((15&e)<<4),1):t===6?ei(e):t===8?new li(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):null}},ci=class e{static Brighter(t,n=1){return n===1?t:new e(t).brighter(n).toRGBA()}static SetOpacity(t,n=1){return n===1?t:new e(t).setOpacity(n).toRGBA()}static getColorBrightness(t,n=`hsl`){let r=t instanceof e?t:new e(t);switch(n){case`hsv`:default:return r.getHSVBrightness();case`hsl`:return r.getHSLBrightness();case`lum`:return r.getLuminance();case`lum2`:return r.getLuminance2();case`lum3`:return r.getLuminance3();case`wcag`:return r.getLuminanceWCAG()}}static parseColorString(e){if(P(ai[e]))return ti(ai[e]);if(P(oi[e]))return ei(oi[e]);let t=`${e}`.trim().toLowerCase(),n=si(t);if(n!==void 0)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(t)){let e=t.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,``).split(`,`);return new li(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(t)){let e=t.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,``).split(`,`),n=Yr(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10));return new li(n.r,n.g,n.b,parseFloat(e[3]))}}constructor(t){let n=e.parseColorString(t);n?this.color=n:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new li(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(e){let{r:t,g:n,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(t*e))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*e))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*e))),this}add(e){let{r:t,g:n,b:r}=this.color;return this.color.r+=Math.min(255,t+e.color.r),this.color.g+=Math.min(255,n+e.color.g),this.color.b+=Math.min(255,r+e.color.b),this}sub(e){return this.color.r=Math.max(0,this.color.r-e.color.r),this.color.g=Math.max(0,this.color.g-e.color.g),this.color.b=Math.max(0,this.color.b-e.color.b),this}multiply(e){let{r:t,g:n,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(t*e.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*e.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*e.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(e,t,n){let r=this.color.opacity,i=Zr(this.color.r,this.color.g,this.color.b),a=Yr(N(e)?i.h:qt(e,0,360),N(t)?i.s:t>=0&&t<=1?100*t:t,N(n)?i.l:n<=1&&n>=0?100*n:n);return this.color=new li(a.r,a.g,a.b,r),this}setRGB(e,t,n){return!N(e)&&(this.color.r=e),!N(t)&&(this.color.g=t),!N(n)&&(this.color.b=n),this}setHex(e){let t=`${e}`.trim().toLowerCase();return si(t,!0)??this}setColorName(e){let t=oi[e.toLowerCase()];return t===void 0?console.warn(`THREE.Color: Unknown color `+e):this.setHex(t),this}setScalar(e){return this.color.r=e,this.color.g=e,this.color.b=e,this}setOpacity(e=1){return this.color.opacity=e,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){let e=this.color.r/255,t=this.color.g/255,n=this.color.b/255,r,i,a;return r=e<=.03928?e/12.92:((e+.055)/1.055)**2.4,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,.2126*r+.7152*i+.0722*a}clone(){return new e(this.color.toString())}copyGammaToLinear(e,t=2){return this.color.r=e.color.r**+t,this.color.g=e.color.g**+t,this.color.b=e.color.b**+t,this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.color.r=e.color.r**+n,this.color.g=e.color.g**+n,this.color.b=e.color.b**+n,this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.color.r=ni(e.color.r),this.color.g=ni(e.color.g),this.color.b=ni(e.color.b),this}copyLinearToSRGB(e){return this.color.r=ri(e.color.r),this.color.g=ri(e.color.g),this.color.b=ri(e.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}},li=class{constructor(e,t,n,r){this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.opacity=P(r)?isNaN(+r)?1:Math.max(0,Math.min(1,+r)):1}formatHex(){return`#${$r(this.r)+$r(this.g)+$r(this.b)+(this.opacity===1?``:$r(255*this.opacity))}`}formatRgb(){let e=this.opacity;return`${e===1?`rgb(`:`rgba(`}${this.r},${this.g},${this.b}${e===1?`)`:`,${e})`}`}formatHsl(){let e=this.opacity,{h:t,s:n,l:r}=Zr(this.r,this.g,this.b);return`${e===1?`hsl(`:`hsla(`}${t},${n}%,${r}%${e===1?`)`:`,${e})`}`}toString(){return this.formatHex()}}}));function di(e){let t=``,n=``,r=``,i=+(e[0]===`#`);for(let a=i;a<e.length;a++)e[a]!==`#`&&(a<i+2?t+=e[a]:a<i+4?n+=e[a]:a<i+6&&(r+=e[a]));return[parseInt(t,16),parseInt(n,16),parseInt(r,16)]}var fi=t((()=>{}));function pi(e,t,n){return Number((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}var mi=t((()=>{}));function hi(e,t){let n=e.r,r=t.r,i=e.g,a=t.g,o=e.b,s=t.b,c=e.opacity,l=t.opacity;return e=>{let t=Math.round(n*(1-e)+r*e),u=Math.round(i*(1-e)+a*e),d=Math.round(o*(1-e)+s*e);return new li(t,u,d,c*(1-e)+l*e)}}var gi=t((()=>{ui()})),_i=r({Color:()=>ci,DEFAULT_COLORS:()=>oi,RGB:()=>li,hexToRgb:()=>di,hslToRgb:()=>Yr,interpolateRgb:()=>hi,rgbToHex:()=>pi,rgbToHsl:()=>Zr}),vi=t((()=>{ui(),fi(),Xr(),mi(),Qr(),gi()})),yi=t((()=>{}));function bi(e){if(R(e))return[e,e,e,e];if(I(e)){let t=e.length;if(t===1){let t=e[0];return[t,t,t,t]}if(t===2){let[t,n]=e;return[t,n,t,n]}if(t===3){let[t,n,r]=e;return[t,n,r,n]}if(t===4)return e}if(F(e)){let{top:t=0,right:n=0,bottom:r=0,left:i=0}=e;return[t,n,r,i]}return[0,0,0,0]}var xi=t((()=>{Le(),je(),Se()})),Si=t((()=>{})),Ci=t((()=>{})),wi=t((()=>{Si(),Ci()}));function Ti(e,t=0,n=0){if(!e)return{width:t,height:n};let r;try{r=window==null?void 0:window.getComputedStyle}catch{r=()=>({})}let i=r(e);if(/^(\d*\.?\d+)(px)$/.exec(i.width)){let r=parseFloat(i.width)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)||e.clientWidth-1,a=parseFloat(i.height)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)||e.clientHeight-1;return{width:r<=0?t:r,height:a<=0?n:a}}return{width:t,height:n}}function Ei(e){let{x:t,y:n}=e.getBoundingClientRect();return{x:t,y:n}}var Di,Oi,ki=t((()=>{Di=(e=``)=>{let t={};return e.split(`;`).forEach((e=>{if(e){let n=e.split(`:`);if(n.length===2){let e=n[0].trim(),r=n[1].trim();e&&r&&(t[e]=r)}}})),t},Oi=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase()})),Ai=t((()=>{})),ji=t((()=>{})),Mi=t((()=>{})),Ni=t((()=>{})),Pi=t((()=>{Ai(),ji(),Ni(),Mi()})),Fi,Ii=t((()=>{Fi=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.locale_shortWeekdays=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],this.locale_periods=[`AM`,`PM`],this.locale_weekdays=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],this.locale_shortMonths=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],this.numberRe=/^\s*\d+/,this.pads={"-":``,_:` `,0:`0`},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],this.formatShortWeekday=e=>this.locale_shortWeekdays[e.getDay()],this.formatWeekday=e=>this.locale_weekdays[e.getDay()],this.formatShortMonth=e=>this.locale_shortMonths[e.getMonth()],this.formatMonth=e=>this.locale_months[e.getMonth()],this.formatDayOfMonth=(e,t)=>this.pad(e.getDate(),t,2),this.formatHour24=(e,t)=>this.pad(e.getHours(),t,2),this.formatHour12=(e,t)=>this.pad(e.getHours()%12||12,t,2),this.formatMilliseconds=(e,t)=>this.pad(e.getMilliseconds(),t,3),this.formatMonthNumber=(e,t)=>this.pad(e.getMonth()+1,t,2),this.formatMinutes=(e,t)=>this.pad(e.getMinutes(),t,2),this.formatPeriod=e=>this.locale_periods[+(e.getHours()>=12)],this.formatSeconds=(e,t)=>this.pad(e.getSeconds(),t,2),this.formatFullYear=(e,t)=>this.pad(e.getFullYear()%1e4,t,4),this.formatUTCShortWeekday=e=>this.locale_shortWeekdays[e.getUTCDay()],this.formatUTCWeekday=e=>this.locale_weekdays[e.getUTCDay()],this.formatUTCShortMonth=e=>this.locale_shortMonths[e.getUTCMonth()],this.formatUTCMonth=e=>this.locale_months[e.getUTCMonth()],this.formatUTCDayOfMonth=(e,t)=>this.pad(e.getUTCDate(),t,2),this.formatUTCHour24=(e,t)=>this.pad(e.getUTCHours(),t,2),this.formatUTCHour12=(e,t)=>this.pad(e.getUTCHours()%12||12,t,2),this.formatUTCMilliseconds=(e,t)=>this.pad(e.getUTCMilliseconds(),t,3),this.formatUTCMonthNumber=(e,t)=>this.pad(e.getUTCMonth()+1,t,2),this.formatUTCMinutes=(e,t)=>this.pad(e.getUTCMinutes(),t,2),this.formatUTCPeriod=e=>this.locale_periods[+(e.getUTCHours()>=12)],this.formatUTCSeconds=(e,t)=>this.pad(e.getUTCSeconds(),t,2),this.formatUTCFullYear=(e,t)=>this.pad(e.getUTCFullYear()%1e4,t,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(e,t,n)=>{let r=this.shortWeekdayRe.exec(t.slice(n));return r?(e.w=this.shortWeekdayLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseWeekday=(e,t,n)=>{let r=this.weekdayRe.exec(t.slice(n));return r?(e.w=this.weekdayLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseShortMonth=(e,t,n)=>{let r=this.shortMonthRe.exec(t.slice(n));return r?(e.m=this.shortMonthLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseMonth=(e,t,n)=>{let r=this.monthRe.exec(t.slice(n));return r?(e.m=this.monthLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseDayOfMonth=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1},this.parseHour24=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1},this.parseMilliseconds=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1},this.parseMonthNumber=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.m=r-1,n+r[0].length):-1},this.parseMinutes=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1},this.parsePeriod=(e,t,n)=>{let r=this.periodRe.exec(t.slice(n));return r?(e.p=this.periodLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseSeconds=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1},this.parseFullYear=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(e,t)=>this.newFormat(e,this.formats)(new Date(this.getFullTimeStamp(t))),this.timeUTCFormat=(e,t)=>this.newFormat(e,this.utcFormats)(new Date(this.getFullTimeStamp(t))),this.timeParse=(e,t)=>this.newParse(e,!1)(t+``),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(e){return e.replace(this.requoteRe,`\\$&`)}localDate(e){if(0<=e.y&&e.y<100){let t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}utcDate(e){if(0<=e.y&&e.y<100){let t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}newDate(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}formatRe(e){return RegExp(`^(?:`+e.map(this.requoteF).join(`|`)+`)`,`i`)}formatLookup(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}pad(e,t,n){let r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}parseSpecifier(e,t,n,r){let i=0,a=t.length,o=n.length,s,c;for(;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=this.parses[s in this.pads?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!==n.charCodeAt(r++))return-1}return r}newParse(e,t){let n=this;return function(r){let i=n.newDate(1900,void 0,1);return n.parseSpecifier(i,e,r+=``,0)===r.length?`Q`in i?new Date(i.Q):`s`in i?new Date(1e3*i.s+(`L`in i?i.L:0)):(t&&!(`Z`in i)&&(i.Z=0),`p`in i&&(i.H=i.H%12+12*i.p),i.m===void 0&&(i.m=`q`in i?i.q:0),`Z`in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,n.utcDate(i)):n.localDate(i)):null}}newFormat(e,t){let n=this;return function(r){let i=[],a=-1,o=0,s=e.length,c,l,u;for(r instanceof Date||(r=new Date(+r));++a<s;)e.charCodeAt(a)===37&&(i.push(e.slice(o,a)),(l=n.pads[c=e.charAt(++a)])?c=e.charAt(++a):l=c===`e`?` `:`0`,u=t[c],c=u(r,l),i.push(c),o=a+1);return i.push(e.slice(o,a)),i.join(``)}}getFullTimeStamp(e){let t=parseInt(e+``,10);return String(t).length===10?1e3*t:t}}})),Li=t((()=>{})),Ri=t((()=>{})),zi=t((()=>{Ri(),Li()})),Bi=t((()=>{})),Vi=t((()=>{})),Hi=t((()=>{})),Ui=t((()=>{Bi(),Vi(),Hi()})),Wi,H=t((()=>{Wi=n(me()),xn(),Kr(),Jr(),Hn(),nr(),vi(),Lr(),yi(),Ft(),xi(),wi(),ki(),Pi(),vi(),Ii(),zi(),Ui()})),Gi=(e,t)=>{let{callback:n}=t;return n&&(e=e.filter(n)),e};H();var Ki=function(e,...t){return Yi(et(e),...t)};function qi(e,t,n){let r=t[n];if(r===void 0)e[n]=null;else if(F(r)){F(e[n])||(e[n]={});for(let t in r)qi(e[n],r,t)}else e[n]=r}function Ji(e,t){if(F(t)&&e!==t)for(let n in t)qi(e,t,n)}function Yi(e,...t){e||={};let n=-1,r=t.length;for(;++n<r;)Ji(e,t[n]);return e}var Xi;(function(e){e.DSV=`dsv`,e.TREE=`tree`,e.GEO=`geo`,e.BYTE=`bytejson`,e.HEX=`hex`,e.GRAPH=`graph`,e.TABLE=`table`,e.GEO_GRATICULE=`geo-graticule`})(Xi||={});var Zi=(e,t)=>{let{fields:n,key:r,value:i,retains:a}=t,o=[];for(let t=0;t<e.length;t++)n.forEach((s=>{let c={};if(c[r]=s,c[i]=e[t][s],a)a.forEach((n=>{c[n]=e[t][n]}));else for(let r in e[t])n.indexOf(r)===-1&&(c[r]=e[t][r]);o.push(c)}));return o};H();var Qi=(e,t)=>{if(!t?.fields||e.length===0)return e;let n=t.fields,r=e[0],i={},a=[];for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){let o=n[t];if(o.sort&&(R(o.sortIndex)||(o.sortIndex=0),P(o.sortReverse)||(o.sortReverse=o.sort===`desc`)),!o.type){let n=r;t in r||(n=e.find((e=>t in e))??r),o.type=typeof n[t]==`number`?`linear`:`ordinal`}let s;if(typeof o.sortIndex==`number`&&(s={key:t,type:o.type,index:o.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===o.sortReverse},a.push(s)),o.domain?.length>0){if(o.type===`ordinal`){o._domainCache={},i[t]=o;let e={};o.domain.forEach(((t,n)=>{e[t]=n,o._domainCache[t]=n})),s&&(s.sortIndex=e,s.sortIndexCount=o.domain.length)}else o.domain.length>=2&&(i[t]=o)}}return Object.keys(i).length>0&&(e=e.filter((e=>{for(let t in i){let n=i[t];if(n.type===`ordinal`){if(!(e[t]in n._domainCache))return!1}else if(n.domain[0]>e[t]||n.domain[1]<e[t])return!1}return!0}))),a.sort(((e,t)=>e.index-t.index)),e.sort(((e,t)=>$i(e,t,a))),e};function $i(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=0;if(i.type===`ordinal`?(i.sortIndex[t[i.key]]===void 0&&(i.sortIndex[t[i.key]]=i.sortIndexCount++),i.sortIndex[e[i.key]]===void 0&&(i.sortIndex[e[i.key]]=i.sortIndexCount++),a=i.sortIndex[e[i.key]]-i.sortIndex[t[i.key]]):i.type===`linear`&&(a=e[i.key]-t[i.key]),i.sortReverse&&(a=-a),a!==0)return a}return 0}var ea={},ta={},na=34,ra=10,ia=13;function aa(e){return Function(`d`,`return {`+e.map(function(e,t){return JSON.stringify(e)+`: d[`+t+`] || ""`}).join(`,`)+`}`)}function oa(e,t){var n=aa(e);return function(r,i){return t(n(r),i,e)}}function sa(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var r in e)r in t||n.push(t[r]=r)}),n}function ca(e,t){var n=e+``,r=n.length;return r<t?Array(t-r+1).join(0)+n:n}function la(e){return e<0?`-`+ca(-e,6):e>9999?`+`+ca(e,6):ca(e,4)}function ua(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?`Invalid Date`:la(e.getUTCFullYear(),4)+`-`+ca(e.getUTCMonth()+1,2)+`-`+ca(e.getUTCDate(),2)+(i?`T`+ca(t,2)+`:`+ca(n,2)+`:`+ca(r,2)+`.`+ca(i,3)+`Z`:r?`T`+ca(t,2)+`:`+ca(n,2)+`:`+ca(r,2)+`Z`:n||t?`T`+ca(t,2)+`:`+ca(n,2)+`Z`:``)}function da(e){var t=RegExp(`["`+e+`
|
|
1
|
+
import{a as e,n as t,o as n,r,t as i}from"./rolldown-runtime-C0FnF6B9.js";import{t as a}from"./react-DiVRNtpo.js";import{t as o}from"./jsx-runtime-BdxMnOeJ.js";import{d as s}from"./log-Divm5wOC.js";import{n as c}from"./useTheme-0KFNcCXu.js";import{O as l}from"./genui-Bk-RFOJ9.js";import{t as u}from"./runDetached-2gt4-pgN.js";import{t as d}from"./chart-renderer-CootI0ca.js";var f=n(a(),1);function p(e){let t=e.h*Math.PI/180,n=e.c*Math.cos(t),r=e.c*Math.sin(t),i=e.l+.3963377774*n+.2158037573*r,a=e.l-.1055613458*n-.0638541728*r,o=e.l-.0894841775*n-1.291485548*r,s=i**3,c=a**3,l=o**3;return[4.0767416621*s-3.3077115913*c+.2309699292*l,-1.2684380046*s+2.6097574011*c-.3413193965*l,-.0041960863*s-.7034186147*c+1.707614701*l]}var m=/^oklch\(\s*([0-9.]+)(%?)\s+([0-9.]+)\s+([0-9.]+)\s*(?:\/\s*([0-9.]+)(%?)\s*)?\)$/i;function h(e){let t=m.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=t[5]===void 0?1:Number(t[5])/(t[6]?100:1);return{l:t[2]?n/100:n,c:Number(t[3]),h:Number(t[4]),alpha:r}}function g(e){let t=Math.max(0,Math.min(1,e)),n=t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055;return Math.round(n*255)}function _(e,t=1){let[n,r,i]=p(e).map(g);return t>=1?`rgb(${n}, ${r}, ${i})`:`rgba(${n}, ${r}, ${i}, ${t})`}function v(e,t){let n=h(e);return n?_(n,n.alpha):e.trim()||t}function y(e){let t=(t,n)=>v(e(t,``),n),n=Array.from({length:8},(e,n)=>t(`--chart-${n+1}`,`rgb(42, 120, 214)`)),r=t(`--muted-foreground`,`rgb(115, 107, 108)`);return{series:n,compare:r,increase:n[0]??r,decrease:n[7]??r,total:r,grid:t(`--chart-grid`,`rgb(236, 232, 232)`),axis:t(`--chart-axis`,`rgb(204, 198, 198)`),text:t(`--foreground`,`rgb(30, 24, 25)`),mutedText:r,surface:t(`--card`,`rgb(255, 253, 253)`),fontFamily:e(`--kanna-font-body`,`ui-sans-serif, system-ui, sans-serif`)}}var b=.1,x=[4,3],S=11;function C(e,t){return{x:e.x,xLabel:e.xLabel,series:e.series,seriesLabel:t.get(e.series)??e.series,value:e.value,start:e.start??0,end:e.end??e.value}}function w(e,t){switch(e.role){case`compare`:return t.compare;case`increase`:return t.increase;case`decrease`:return t.decrease;case`total`:return t.total;default:return t.series[e.slot??0]??t.series[0]??t.text}}function T(e,t){return{type:`ordinal`,domain:e.series.map(e=>e.label),range:e.series.map(e=>w(e,t))}}function E(e,t){return e.series.some(e=>e.label===t&&e.role===`compare`)}var D=`seriesLabel`;function O(e,t){let n=e?.[t];return typeof n==`string`?n:``}function k(e){let t=e?.value;return typeof t==`number`?t:null}function A(e){let t=t=>l(k(t),e.format);return{mark:{title:{value:e=>O(e,`xLabel`)},content:[{key:e=>O(e,`seriesLabel`),value:t}]},dimension:{title:{value:e=>O(e,`xLabel`)},content:[{key:e=>O(e,`seriesLabel`),value:t}]}}}function ee(e){return e.kind!==`line`&&e.kind!==`area`}function te(e,t){let n={fill:t.mutedText,fontSize:S,fontFamily:t.fontFamily};return[{orient:`left`,type:`linear`,label:{style:n,formatMethod:t=>l(Number(t),e.format,{compact:!0})},grid:{visible:!0,style:{stroke:t.grid,lineWidth:1,lineDash:[]}},domainLine:{visible:!1},tick:{visible:!1}},{orient:`bottom`,type:`band`,sampling:!ee(e),label:{style:n,autoLimit:!0,formatMethod:t=>e.xLabels[String(t)]??String(t)},domainLine:{visible:!0,style:{stroke:t.axis,lineWidth:1}},tick:{visible:!1},grid:{visible:!1}}]}function ne(e,t){return{visible:e.series.length>=2,orient:`top`,position:`start`,item:{label:{style:{fill:t.text,fontSize:S,fontFamily:t.fontFamily}}}}}function re(e,t){let n=new Map(e.series.map(e=>[e.id,e.label]));return{data:[{id:`points`,values:e.points.map(e=>C(e,n))}],background:`transparent`,padding:{top:8,right:12,bottom:4,left:4},color:T(e,t),tooltip:A(e),legends:ne(e,t)}}function ie(e,t){switch(e.kind){case`line`:return oe(e,t);case`area`:return se(e,t);case`bar`:case`stacked-bar`:return ce(e,t);case`combo`:return le(e,t);case`waterfall`:return ue(e,t);case`composition`:return de(e,t)}}function ae(e){return{xField:{visible:!0,line:{type:`line`,style:{stroke:e.axis,lineWidth:1}}}}}function oe(e,t){return{type:`line`,...re(e,t),xField:`x`,yField:`value`,seriesField:D,axes:te(e,t),crosshair:ae(t),line:{style:{lineWidth:2,lineCap:`round`,lineJoin:`round`,lineDash:t=>E(e,O(t,`seriesLabel`))?x:[]}},point:{style:{size:8,stroke:t.surface,lineWidth:2}}}}function se(e,t){return{type:`area`,...re(e,t),xField:`x`,yField:`value`,seriesField:D,axes:te(e,t),crosshair:ae(t),line:{style:{lineWidth:2,lineCap:`round`,lineJoin:`round`}},area:{style:{fillOpacity:t=>E(e,O(t,`seriesLabel`))?0:b}},point:{visible:!1}}}function ce(e,t){let n=e.kind===`stacked-bar`,r=!n&&e.series.length>1;return{type:`bar`,...re(e,t),xField:r?[`x`,D]:`x`,yField:`value`,seriesField:D,stack:n,barMaxWidth:24,barGapInGroup:2,axes:te(e,t),bar:{style:{cornerRadius:n?0:[4,4,0,0],stroke:t.surface,lineWidth:n?2:0}}}}function le(e,t){let[n,r]=e.series,i=re(e,t),a=new Map(e.series.map(e=>[e.id,e.label])),o=t=>e.points.filter(e=>e.series===t).map(e=>C(e,a));return{type:`common`,background:i.background,padding:i.padding,color:i.color,tooltip:i.tooltip,legends:i.legends,data:[{id:`bars`,values:o(n?.id)},{id:`line`,values:o(r?.id)}],series:[{type:`bar`,dataIndex:0,xField:`x`,yField:`value`,seriesField:D,barMaxWidth:24,bar:{style:{cornerRadius:[4,4,0,0]}}},{type:`line`,dataIndex:1,xField:`x`,yField:`value`,seriesField:D,line:{style:{lineWidth:2}},point:{style:{size:8,stroke:t.surface,lineWidth:2}}}],axes:te(e,t).map(e=>e.orient===`left`?{...e,seriesIndex:[0,1]}:e)}}function ue(e,t){return{type:`rangeColumn`,...re(e,t),xField:`x`,minField:`start`,maxField:`end`,seriesField:D,barMaxWidth:24,axes:te(e,t),bar:{style:{cornerRadius:2}}}}function de(e,t){return{type:`pie`,...re(e,t),categoryField:D,valueField:`value`,innerRadius:.62,outerRadius:.9,pie:{style:{stroke:t.surface,lineWidth:2}}}}var fe=e=>e,pe;(function(e){e[`desktop-browser`]=`desktop-browser`,e[`mobile-browser`]=`mobile-browser`,e.node=`node`,e.worker=`worker`,e.miniApp=`miniApp`,e.wx=`wx`,e.tt=`tt`,e.harmony=`harmony`,e[`desktop-miniApp`]=`desktop-miniApp`,e.lynx=`lynx`})(pe||={});var j;(function(e){e.cartesianAxis=`cartesianAxis`,e.cartesianBandAxis=`cartesianAxis-band`,e.cartesianLinearAxis=`cartesianAxis-linear`,e.cartesianTimeAxis=`cartesianAxis-time`,e.cartesianLogAxis=`cartesianAxis-log`,e.cartesianSymlogAxis=`cartesianAxis-symlog`,e.polarAxis=`polarAxis`,e.polarBandAxis=`polarAxis-band`,e.polarLinearAxis=`polarAxis-linear`,e.crosshair=`crosshair`,e.cartesianCrosshair=`cartesianCrosshair`,e.polarCrosshair=`polarCrosshair`,e.dataZoom=`dataZoom`,e.geoCoordinate=`geoCoordinate`,e.indicator=`indicator`,e.discreteLegend=`discreteLegend`,e.continuousLegend=`continuousLegend`,e.colorLegend=`colorLegend`,e.sizeLegend=`sizeLegend`,e.markLine=`markLine`,e.markArea=`markArea`,e.markPoint=`markPoint`,e.polarMarkLine=`polarMarkLine`,e.polarMarkArea=`polarMarkArea`,e.polarMarkPoint=`polarMarkPoint`,e.geoMarkPoint=`geoMarkPoint`,e.tooltip=`tooltip`,e.title=`title`,e.player=`player`,e.scrollBar=`scrollBar`,e.label=`label`,e.totalLabel=`totalLabel`,e.brush=`brush`,e.poptip=`poptip`,e.customMark=`customMark`})(j||={});var me=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})),he,ge=t((()=>{he=(e,t)=>Object.prototype.toString.call(e)===`[object ${t}]`})),_e,ve=t((()=>{ge(),_e=(e,t=!1)=>t?typeof e==`boolean`:!0===e||!1===e||he(e,`Boolean`)})),M,ye=t((()=>{M=e=>typeof e==`function`})),N,be=t((()=>{N=e=>e==null})),P,xe=t((()=>{P=e=>e!=null})),F,Se=t((()=>{F=e=>{let t=typeof e;return e!==null&&t===`object`||t===`function`}})),Ce,we=t((()=>{Ce=e=>typeof e==`object`&&!!e})),Te,Ee=t((()=>{we(),ge(),Te=function(e){if(!Ce(e)||!he(e,`Object`))return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}})),De,Oe=t((()=>{De=e=>e===void 0})),ke,Ae=t((()=>{ge(),ke=(e,t=!1)=>{let n=typeof e;return t?n===`string`:n===`string`||he(e,`String`)}})),I,je=t((()=>{ge(),I=e=>Array.isArray?Array.isArray(e):he(e,`Array`)})),Me,Ne=t((()=>{Me=function(e){return e!==null&&typeof e!=`function`&&Number.isFinite(e.length)}})),Pe,Fe=t((()=>{ge(),Pe=e=>he(e,`Date`)})),L,Ie=t((()=>{ge(),L=(e,t=!1)=>{let n=typeof e;return t?n===`number`:n===`number`||he(e,`Number`)}})),R,Le=t((()=>{Ie(),R=e=>L(e)&&Number.isFinite(e)})),Re,ze=t((()=>{Re=e=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(e)})),Be,Ve=t((()=>{Be=e=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(e)})),He,Ue=t((()=>{He=e=>({}).toString.call(e).replace(/^\[object /,``).replace(/]$/,``)})),We,Ge,Ke=t((()=>{We=Object.prototype,Ge=function(e){let t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||We)}}));function z(e){if(N(e))return!0;if(Me(e))return!e.length;let t=He(e);if(t===`Map`||t===`Set`)return!e.size;if(Ge(e))return!Object.keys(e).length;for(let t in e)if(qe.call(e,t))return!1;return!0}var qe,Je=t((()=>{be(),Ne(),Ue(),Ke(),qe=Object.prototype.hasOwnProperty})),Ye,Xe=t((()=>{Ae(),Ye=(e,t,n)=>{let r=ke(t)?t.split(`.`):t;for(let t=0;t<r.length;t++)e=e?e[r[t]]:void 0;return e===void 0?n:e}})),Ze,Qe,$e=t((()=>{Ze=Object.prototype.hasOwnProperty,Qe=(e,t)=>e!=null&&Ze.call(e,t)}));function et(e,t,n){let r;if(!P(e)||typeof e!=`object`||t&&t(e))return e;let i=I(e),a=e.length;r=i?Array(a):typeof e==`object`?{}:_e(e)||L(e)||ke(e)?e:Pe(e)?new Date(+e):void 0;let o=i?void 0:Object.keys(Object(e)),s=-1;if(r)for(;++s<(o||e).length;){let i=o?o[s]:s,a=e[i];n&&n.includes(i.toString())?r[i]=a:r[i]=et(a,t,n)}return r}var tt=t((()=>{je(),ve(),Fe(),Ie(),Ae(),xe()}));function nt(e,t,n=!1,r=!1){if(t){if(e===t)return;if(P(t)&&typeof t==`object`){let i=Object(t),a=[];for(let e in i)a.push(e);let{length:o}=a,s=-1;for(;o--;){let o=a[++s];!P(i[o])||typeof i[o]!=`object`||r&&I(e[o])?it(e,o,i[o]):rt(e,t,o,n,r)}}}}function rt(e,t,n,r=!1,i=!1){let a=e[n],o=t[n],s=t[n],c=!0;if(I(o)){if(r)s=[];else if(I(a))s=a;else if(Me(a)){s=Array(a.length);let e=-1,t=a.length;for(;++e<t;)s[e]=a[e]}}else Te(o)?(s=a??{},typeof a!=`function`&&typeof a==`object`||(s={})):c=!1;c&&nt(s,o,r,i),it(e,n,s)}function it(e,t,n){(n!==void 0&&!at(e[t],n)||n===void 0&&!(t in e))&&(e[t]=n)}function at(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function ot(e,...t){let n=-1,r=t.length;for(;++n<r;)nt(e,t[n],!0);return e}var st=t((()=>{je(),Ne(),Ee(),xe()}));function ct(e,t){if(!e||!Te(e))return e;let n={};return Object.keys(e).forEach((r=>{let i=e[r],a=!1;t.forEach((e=>{(ke(e)&&e===r||e instanceof RegExp&&r.match(e))&&(a=!0)})),a||(n[r]=i)})),n}var lt=t((()=>{Ee(),Ae()}));function ut(e){return Object.prototype.toString.call(e)}function dt(e){return Object.keys(e)}function ft(e,t,n){if(e===t)return!0;if(typeof e!=typeof t||e==null||t==null)return!1;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(ut(e)!==ut(t))return!1;if(M(e))return!!n?.skipFunction;if(typeof e!=`object`)return!1;if(I(e)){if(e.length!==t.length)return!1;for(let r=e.length-1;r>=0;r--)if(!ft(e[r],t[r],n))return!1;return!0}if(!Te(e))return!1;let r=dt(e),i=dt(t);if(r.length!==i.length)return!1;r.sort(),i.sort();for(let e=r.length-1;e>=0;e--)if(r[e]!=i[e])return!1;for(let i=r.length-1;i>=0;i--){let a=r[i];if(!ft(e[a],t[a],n))return!1}return!0}var pt=t((()=>{je(),ye(),Ee()}));function mt(e){if(!e)return[];if(Object.keys)return Object.keys(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(n);return t}function ht(e,t,n){let r=mt(t);for(let i=0;i<r.length;i++){let a=r[i];(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}return e}function gt(e,t,n=!0){if(e=`prototype`in e?e.prototype:e,t=`prototype`in t?t.prototype:t,Object.getOwnPropertyNames){let r=Object.getOwnPropertyNames(t);for(let i=0;i<r.length;i++){let a=r[i];a!==`constructor`&&(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}}else ht(e,t,n)}var _t=t((()=>{}));function B(e){return P(e)?I(e)?e:[e]:[]}function vt(e){if(Me(e))return e[e.length-1]}function yt(e,t){if(!I(e)||!I(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bt(e){if(!I(e))return[e];let t=[];for(let n of e)t.push(...bt(n));return t}var xt,St,Ct=t((()=>{je(),Ne(),xe(),xt=(e,t)=>{if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(t?.(i,n)??i-n)>0&&(n=i)}return n},St=(e,t)=>{if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(t?.(i,n)??i-n)<0&&(n=i)}return n}}));function wt(e,t,n){P(t)||(t=e,e=0),P(n)||(n=1);let r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),a=Array(i);for(;++r<i;)a[r]=e+r*n;return a}var Tt=t((()=>{xe()}));function Et(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Dt=t((()=>{}));function Ot(e){return Number(e)}var kt=t((()=>{})),At=t((()=>{}));function jt(e,t,n){let r=[t].concat([].slice.call(n));Mt&&console[e].apply(console,r)}var Mt,Nt,Pt,Ft=t((()=>{Ie(),Mt=typeof console<`u`,(function(e){e[e.None=0]=`None`,e[e.Error=1]=`Error`,e[e.Warn=2]=`Warn`,e[e.Info=3]=`Info`,e[e.Debug=4]=`Debug`})(Nt||={}),Pt=class e{static getInstance(t,n){return e._instance&&L(t)?e._instance.level(t):e._instance||=new e(t,n),e._instance}static setInstance(t){return e._instance=t}static setInstanceLevel(t){e._instance?e._instance.level(t):e._instance=new e(t)}static clearInstance(){e._instance=null}constructor(e=Nt.None,t){this._onErrorHandler=[],this._level=e,this._method=t}addErrorHandler(e){this._onErrorHandler.find((t=>t===e))||this._onErrorHandler.push(e)}removeErrorHandler(e){let t=this._onErrorHandler.findIndex((t=>t===e));t<0||this._onErrorHandler.splice(t,1)}callErrorHandler(...e){this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=Nt.Info}canLogDebug(){return this._level>=Nt.Debug}canLogError(){return this._level>=Nt.Error}canLogWarn(){return this._level>=Nt.Warn}level(e){return arguments.length?(this._level=+e,this):this._level}error(...e){return this._level>=Nt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...e):jt(this._method??`error`,`ERROR`,e)),this}warn(...e){return this._level>=Nt.Warn&&jt(this._method||`warn`,`WARN`,e),this}info(...e){return this._level>=Nt.Info&&jt(this._method||`log`,`INFO`,e),this}debug(...e){return this._level>=Nt.Debug&&jt(this._method||`log`,`DEBUG`,e),this}},Pt._instance=null}));function It(e,t,n=0,r){for(N(r)&&(r=e.length);n<r;){let i=n+r>>>1;Et(e[i],t)>0?r=i:n=i+1}return n}var Lt,Rt=t((()=>{Dt(),be(),Lt=(e,t,n)=>{let r=e,i=t;for(;r<i;){let e=Math.floor((r+i)/2);n(e)>=0?i=e:r=e+1}return r}}));function zt(e,t,n=Ut,r=Ht){let i=r,a=n*Math.max(e,t);return Math.abs(e-t)<=Math.max(i,a)}function Bt(e,t,n,r){return e>t&&!zt(e,t,n,r)}function Vt(e,t,n,r){return e<t&&!zt(e,t,n,r)}var Ht,Ut,Wt=t((()=>{Ht=1e-10,Ut=1e-10})),Gt,Kt=t((()=>{Gt=e=>{let t=null,n=null;return(...r)=>(t&&r.every(((e,n)=>e===t[n]))||(t=r,n=e(...r)),n)}})),qt,Jt=t((()=>{qt=function(e,t,n){return e<t?t:e>n?n:e}})),Yt,Xt=t((()=>{Yt=(e,t,n)=>{let[r,i]=e;i<r&&(r=e[1],i=e[0]);let a=i-r;return a>=n-t?[t,n]:(r=Math.min(Math.max(r,t),n-a),[r,r+a])}}));function Zt(e,t){let n;return e>t&&(n=e,e=t,t=n),n=>Math.max(e,Math.min(t,n))}var Qt=t((()=>{}));function $t(e,t,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&en;if(typeof e!=`function`)throw TypeError(`Expected a function`);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(cancelAnimationFrame(s),requestAnimationFrame(e)):setTimeout(e,t)}function g(e){let n=e-c;return c===void 0||n>=t||n<0||d&&e-l>=a}function _(){let e=Date.now();if(g(e))return v(e);s=h(_,function(e){let n=e-l,r=t-(e-c);return d?Math.min(r,a-n):r}(e))}function v(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function y(...e){let n=Date.now(),a=g(n);if(r=e,i=this,c=n,a){if(s===void 0)return function(e){return l=e,s=h(_,t),u?m(e):o}(c);if(d)return s=h(_,t),m(c)}return s===void 0&&(s=h(_,t)),o}return t=+t||0,F(n)&&(u=!!n.leading,d=`maxWait`in n,d&&(a=Math.max(R(n.maxWait)?n.maxWait:0,t)),f=`trailing`in n?!!n.trailing:f),y.cancel=function(){s!==void 0&&function(e){if(p)return cancelAnimationFrame(e);clearTimeout(e)}(s),l=0,r=c=i=s=void 0},y.flush=function(){return s===void 0?o:v(Date.now())},y.pending=function(){return s!==void 0},y}var en,tn=t((()=>{Se(),Le(),en=!1;try{en=typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`}catch{en=!1}en=!1}));function nn(e,t,n){let r=!0,i=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);return F(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),$t(e,t,{leading:r,trailing:i,maxWait:t})}var rn=t((()=>{tn(),Se()}));function an(e,t){return n=>e*(1-n)+t*n}function on(e,t){return function(n){return Math.round(e*(1-n)+t*n)}}function sn(e,t){let n=e.valueOf(),r=t.valueOf(),i=new Date;return e=>(i.setTime(n*(1-e)+r*e),i)}var cn,ln=t((()=>{cn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,new RegExp(cn.source,`g`)})),un=t((()=>{})),dn=t((()=>{})),fn=t((()=>{})),pn=t((()=>{})),mn=t((()=>{})),hn=t((()=>{})),gn=t((()=>{})),_n=t((()=>{})),vn=t((()=>{})),yn=t((()=>{})),bn=t((()=>{})),xn=t((()=>{ve(),ye(),be(),xe(),Se(),we(),Ee(),ge(),Oe(),Ae(),je(),Ne(),Fe(),Ie(),Le(),ze(),Ve(),Je(),Xe(),$e(),tt(),st(),lt(),pt(),_t(),Ct(),Tt(),At(),Rt(),At(),Wt(),Kt(),Jt(),Xt(),Qt(),tn(),rn(),ln(),kt(),un(),dn(),fn(),pn(),mn(),hn(),gn(),_n(),vn(),yn(),bn()})),Sn=t((()=>{}));function Cn(e){return e>1?0:e<-1?jn:Math.acos(e)}function wn(e){return e>=1?Mn:e<=-1?-Mn:Math.asin(e)}function Tn(e,t,n,r,i){let a=n,o=r;return typeof e==`number`&&typeof n==`number`&&(a=(1-i)*e+i*n),typeof t==`number`&&typeof r==`number`&&(o=(1-i)*t+i*r),{x:a,y:o}}function En(e,t){return e[0]*t[1]-e[1]*t[0]}function Dn(e,t){return Pn(e[0]-t[0])+Pn(e[1]-t[1])<1e-12}function On(e,t=10){return Math.round(e*t)/t}function kn(e){let t=e.toString().split(/[eE]/),n=(t[0].split(`.`)[1]||``).length-(+t[1]||0);return n>0?n:0}function An(e,t){return On(e-t,10**Math.max(kn(e),kn(t)))}var jn,Mn,Nn,V,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn=t((()=>{jn=Math.PI,Mn=jn/2,Nn=2*jn,V=2*Math.PI,Pn=Math.abs,Fn=Math.atan2,In=Math.cos,Ln=Math.max,Rn=Math.min,zn=Math.sin,Bn=Math.sqrt,Vn=Math.pow})),Un,Wn,Gn=t((()=>{Ie(),Hn(),Un=class e{constructor(e=0,t=0,n,r){this.x=0,this.y=0,this.x=e,this.y=t,this.x1=n,this.y1=r}clone(){return new e(this.x,this.y)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x1=e.x1,this.y1=e.y1,this.defined=e.defined,this.context=e.context,this}set(e,t){return this.x=e,this.y=t,this}add(e){return L(e)?(this.x+=e,void(this.y+=e)):(this.x+=e.x,this.y+=e.y,this)}sub(e){return L(e)?(this.x-=e,void(this.y-=e)):(this.x-=e.x,this.y-=e.y,this)}multi(e){throw Error(`暂不支持`)}div(e){throw Error(`暂不支持`)}},Wn=class{static distancePP(e,t){return Bn(Vn(e.x-t.x,2)+Vn(e.y-t.y,2))}static distanceNN(e,t,n,r){return Bn(Vn(e-n,2)+Vn(t-r,2))}static distancePN(e,t,n){return Bn(Vn(t-e.x,2)+Vn(n-e.y,2))}static pointAtPP(e,t,n){return new Un((t.x-e.x)*n+e.x,(t.y-e.y)*n+e.y)}}})),Kn=t((()=>{}));function qn(e){return Math.PI/180*e}function Jn(e){return 180*e/Math.PI}function Yn(e,t,n){return t?{x:e.x+t*Math.cos(n),y:e.y+t*Math.sin(n)}:{x:e.x,y:e.y}}function Xn(e){for(;e<0;)e+=2*Math.PI;for(;e>=2*Math.PI;)e-=2*Math.PI;return e}function Zn(e,t){let n=Math.abs(t-e);if(n>=2*Math.PI||2*Math.PI-n<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];let r=Xn(Math.min(e,t)),i=r+n,a=[r,i],o=Math.floor(r/Math.PI)*Math.PI/2;for(;o<i;)o>r&&a.push(o),o+=Math.PI/2;return a}function Qn(e,t,n,r){let{x:i,y:a}=t,o=Zn(n,r),{width:s,height:c}=e,l=[];return o.forEach((e=>{let t=Math.sin(e),n=Math.cos(e);t===1?l.push(c-a):t===-1?l.push(a):n===1?l.push(s-i):n===-1?l.push(i):(t>0?l.push(Math.abs((c-a)/t)):l.push(Math.abs(a/t)),n>0?l.push(Math.abs((s-i)/n)):l.push(Math.abs(i/n)))})),Math.min.apply(null,l)}function $n(e){return(e=Xn(e))>0&&e<=Math.PI/2?2:e>Math.PI/2&&e<=Math.PI?3:e>Math.PI&&e<=3*Math.PI/2?4:1}var er,tr,nr=t((()=>{Hn(),er=(e=0)=>{if(e<0)for(;e<-Nn;)e+=Nn;else if(e>0)for(;e>Nn;)e-=Nn;return e},tr=er}));function rr(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1]}function ir(e,t,n,r){let i=e[0],a=t[0],o=n[0],s=r[0];return a<i&&([i,a]=[a,i]),s<o&&([s,o]=[o,s]),!(a<o||s<i)&&(i=e[1],a=t[1],o=n[1],s=r[1],a<i&&([i,a]=[a,i]),s<o&&([s,o]=[o,s]),!(a<o||s<i))}function ar(e,t,n,r){if(!ir(e,t,n,r))return!1;let i=[0,0],a=[0,0],o=[0,0];if(rr(i,t,e),rr(a,r,n),Dn(i,a))return!0;rr(o,n,e);let s=En(o,a)/En(i,a);return s>=0&&s<=1&&[e[0]+i[0]*s,e[1]+i[1]*s]}function or(e,t,n){if(e===null)return t;if(t===null)return e;let{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}=hr(e,t,n);return r>=c||i<=s||a>=u||o<=l?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,s),y1:Math.max(a,l),x2:Math.min(i,c),y2:Math.min(o,u)}}function sr(e,t,n){if(e&&t){if(!n)return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1);let{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}=hr(e,t,!0);return!(r>c||i<s||a>u||o<l)}return!0}function cr(e,t,n){if(!t)return!0;if(!n)return e.x>=t.x1&&e.x<=t.x2&&e.y>=t.y1&&e.y<=t.y2;let r=t.x1,i=t.x2,a=t.y1,o=t.y2;return r>i&&([r,i]=[i,r]),a>o&&([a,o]=[o,a]),e.x>=r&&e.x<=i&&e.y>=a&&e.y<=o}function lr(e,t){return Math.abs(t[0]*e[0]+t[1]*e[1])}function ur({x:e,y:t},n,r={x:0,y:0}){return{x:(e-r.x)*Math.cos(n)-(t-r.y)*Math.sin(n)+r.x,y:(e-r.x)*Math.sin(n)+(t-r.y)*Math.cos(n)+r.y}}function dr(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function fr(e,t){let n=t?qn(e.angle):e.angle,r=dr(e);return[ur({x:e.x1,y:e.y1},n,r),ur({x:e.x2,y:e.y1},n,r),ur({x:e.x2,y:e.y2},n,r),ur({x:e.x1,y:e.y2},n,r)]}function pr(e,t,n=!1){let r=fr(e,n),i=fr(t,n),a=(e,t)=>[t.x-e.x,t.y-e.y],o=a(dr(e),dr(t)),s=a(r[0],r[1]),c=a(r[1],r[2]),l=a(i[0],i[1]),u=a(i[1],i[2]),d=n?qn(e.angle):e.angle,f=n?qn(90-e.angle):e.angle+Mn,p=n?qn(t.angle):t.angle,m=n?qn(90-t.angle):t.angle+Mn;f>V&&(f-=V),m>V&&(m-=V);let h=(e,t,n,r)=>{let i=[Math.cos(t),Math.sin(t)];return e+(lr(i,n)+lr(i,r))/2>lr(i,o)};return h((e.x2-e.x1)/2,d,l,u)&&h((e.y2-e.y1)/2,f,l,u)&&h((t.x2-t.x1)/2,p,s,c)&&h((t.y2-t.y1)/2,m,s,c)}var mr,hr,gr=t((()=>{nr(),Hn(),(function(e){e[e.NONE=0]=`NONE`,e[e.BBOX1=1]=`BBOX1`,e[e.BBOX2=2]=`BBOX2`})(mr||={}),hr=(e,t,n)=>{let r=e.x1,i=e.x2,a=e.y1,o=e.y2,s=t.x1,c=t.x2,l=t.y1,u=t.y2;return n&&(r>i&&([r,i]=[i,r]),a>o&&([a,o]=[o,a]),s>c&&([s,c]=[c,s]),l>u&&([l,u]=[u,l])),{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}}})),_r=t((()=>{})),vr=t((()=>{})),yr=t((()=>{gr(),_r(),vr()})),br=t((()=>{}));function xr(e,t,n,r,i,a){if(a>t&&a>r||a<t&&a<r||r===t)return 0;let o=(a-t)/(r-t),s=r<t?1:-1;o!==1&&o!==0||(s=r<t?.5:-.5);let c=o*(n-e)+e;return c===i?1/0:c>i?s:0}var Sr=t((()=>{})),Cr=t((()=>{})),wr,Tr=t((()=>{wr=e=>{let t=e.charCodeAt(0),n=e.length===2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r===12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r===8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r===172||r===175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r===161||r===164||167<=r&&r<=168||r===170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r===198||r===208||215<=r&&r<=216||222<=r&&r<=225||r===230||232<=r&&r<=234||236<=r&&r<=237||r===240||242<=r&&r<=243||247<=r&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||294<=r&&r<=295||r===299||305<=r&&r<=307||r===312||319<=r&&r<=322||r===324||328<=r&&r<=331||r===333||338<=r&&r<=339||358<=r&&r<=359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||713<=r&&r<=715||r===717||r===720||728<=r&&r<=731||r===733||r===735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r===1025||1040<=r&&r<=1103||r===1105||r===8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r===8240||8242<=r&&r<=8243||r===8245||r===8251||r===8254||r===8308||r===8319||8321<=r&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||8481<=r&&r<=8482||r===8486||r===8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r===8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r===8658||r===8660||r===8679||r===8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r===8715||r===8719||r===8721||r===8725||r===8730||8733<=r&&r<=8736||r===8739||r===8741||8743<=r&&r<=8748||r===8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r===8776||r===8780||r===8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r===8853||r===8857||r===8869||r===8895||r===8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r===9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r===9711||9733<=r&&r<=9734||r===9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r===9756||r===9758||r===9792||r===9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r===9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r===9955||9960<=r&&r<=9983||r===10045||r===10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r===65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`}}));function Er(e,t={},n){n||=1;let{fontStyle:r=t.fontStyle,fontVariant:i=t.fontVariant,fontWeight:a=t.fontWeight,fontSize:o=t.fontSize,fontFamily:s=t.fontFamily}=e;return(r?r+` `:``)+(i?i+` `:``)+(a?a+` `:``)+o*n+`px `+(s||`sans-serif`)}var Dr=t((()=>{})),Or,kr=t((()=>{xn(),Tr(),Dr(),Or=class e{constructor(e,t){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet=`-/: .,@%'"~`,this._option=e,this._userSpec=t??{},this.textSpec=this._initSpec(),P(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=P(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(N(this._canvas)&&(P(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),N(this._canvas)&&typeof window<`u`&&window.document!==void 0&&globalThis&&P(globalThis.document)&&(this._canvas=globalThis.document.createElement(`canvas`))),N(this._context)&&P(this._canvas)){let e=this._canvas.getContext(`2d`);P(e)&&(e.save(),e.font=Er(this.textSpec),this._contextSaved=!0,this._context=e)}return!N(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){let{defaultFontParams:e={}}=this._option,{fontStyle:t=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight??`normal`,fontSize:i=e.fontSize??12,fontFamily:a=e.fontFamily??`sans-serif`,align:o,textAlign:s=o??`center`,baseline:c,textBaseline:l=c??`middle`,ellipsis:u,limit:d}=this._userSpec,{lineHeight:f=i}=this._userSpec;return ke(f)&&f[f.length-1]===`%`&&(f=i*(Number.parseFloat(f.substring(0,f.length-1))/100)),{fontStyle:t,fontVariant:n,fontFamily:a,fontSize:i,fontWeight:r,textAlign:s,textBaseline:l,ellipsis:u,limit:d,lineHeight:f}}measure(e,t){switch(t){case`vrender`:case`canopus`:return this.fullMeasure(e);case`canvas`:return this.measureWithNaiveCanvas(e);case`simple`:return this.quickMeasureWithoutCanvas(e);default:return this.quickMeasure(e)}}fullMeasure(e){if(N(e))return{width:0,height:0};if(N(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(e);let{fontFamily:t,fontSize:n,fontWeight:r,textAlign:i,textBaseline:a,ellipsis:o,limit:s,lineHeight:c}=this.textSpec,l;try{let u=this._option.getTextBounds({text:e,fontFamily:t,fontSize:n,fontWeight:r,textAlign:i,textBaseline:a,ellipsis:!!o,maxLineWidth:s||1/0,lineHeight:c});l={width:u.width(),height:u.height()}}catch{this._notSupportVRender=!0,l=this.measureWithNaiveCanvas(e)}return l}measureWithNaiveCanvas(e){return this._measureReduce(e,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(e){if(!this.initContext())return this._quickMeasureWithoutCanvas(e);let t=this._context.measureText(e),{fontSize:n,lineHeight:r}=this.textSpec;return{width:t.width,height:r??n,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}quickMeasure(e){return this._measureReduce(e,this._quickMeasure.bind(this))}_quickMeasure(t){let n={width:0,height:0};for(let r=0;r<t.length;r++){let i=t[r],a=this._measureSpecialChar(i);N(a)&&e.NUMBERS_CHAR_SET.includes(i)&&(a=this._measureNumberChar()),N(a)&&[`F`,`W`].includes(wr(i))&&(a=this._measureFullSizeChar()),N(a)&&(a=this._measureLetterChar()),n.width+=a.width,n.height=Math.max(n.height,a.height),!N(a.fontBoundingBoxAscent)&&(n.fontBoundingBoxAscent=a.fontBoundingBoxAscent),!N(a.fontBoundingBoxDescent)&&(n.fontBoundingBoxDescent=a.fontBoundingBoxDescent)}return n}quickMeasureWithoutCanvas(e){return this._measureReduce(e,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(e){let t={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let r=0;r<e.length;r++){let i=e[r],a=[`F`,`W`].includes(wr(i))?1:.53;t.width+=a*n}return t.height=r??n,t}_measureReduce(e,t){let{fontSize:n,lineHeight:r}=this.textSpec,i={width:0,height:0};if(N(e))return i;if(I(e)){let a=e.filter(P).map((e=>e.toString()));return a.length===0?i:a.length===1?t(a[0]):{width:a.reduce(((e,n)=>Math.max(e,t(n).width)),0),height:a.length*((r??n)+1)+1}}return t(e.toString())}_measureNumberChar(){if(N(this._numberCharSize)){let t=this._standardMethod(e.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/e.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return N(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(e.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(N(this._letterCharSize)){let t=this._standardMethod(e.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/e.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(e){return P(this._specialCharSizeMap[e])?this._specialCharSizeMap[e]:this.specialCharSet.includes(e)?(this._specialCharSizeMap[e]=this._standardMethod(e),this._specialCharSizeMap[e]):null}release(){P(this._canvas)&&(this._canvas=null),P(this._context)&&(this._contextSaved&&=(this._context.restore(),!1),this._context=null)}},Or.ALPHABET_CHAR_SET=`abcdefghijklmnopqrstuvwxyz`,Or.NUMBERS_CHAR_SET=`0123456789`,Or.FULL_SIZE_CHAR=`字`})),Ar=t((()=>{})),jr=t((()=>{kr(),Ar(),Dr()})),Mr=t((()=>{Tr(),jr()})),Nr,Pr,Fr,Ir=t((()=>{Nr=(e,t)=>{let{x1:n,x2:r,y1:i,y2:a}=e,o=Math.abs(r-n),s=Math.abs(a-i),c=(n+r)/2,l=(i+a)/2,u=0,d=0;switch(t){case`top`:case`inside-top`:d=-.5;break;case`bottom`:case`inside-bottom`:d=.5;break;case`left`:case`inside-left`:u=-.5;break;case`right`:case`inside-right`:u=.5;break;case`top-right`:u=.5,d=-.5;break;case`top-left`:u=-.5,d=-.5;break;case`bottom-right`:u=.5,d=.5;break;case`bottom-left`:u=-.5,d=.5}return c+=u*o,l+=d*s,{x:c,y:l}},Pr=(e,t)=>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),Fr=(e,t)=>{let n=[{x:Math.cos(e.angle),y:Math.sin(e.angle)},{x:-Math.sin(e.angle),y:Math.cos(e.angle)},{x:Math.cos(t.angle),y:Math.sin(e.angle)},{x:-Math.sin(t.angle),y:Math.cos(e.angle)}];function r(e,t,n){let r=e.getRotatedCorners().map((e=>e.x*t+e.y*n));return{min:Math.min(...r),max:Math.max(...r)}}let i=0;for(let a of n){let n=r(e,a.x,a.y),o=r(t,a.x,a.y),s;s=n.max<o.min?o.min-n.max:o.max<n.min?n.min-o.max:0,i=Math.max(i,s)}return i}})),Lr=t((()=>{Kn(),yr(),br(),Sr(),Cr(),Mr(),Ir()}));function Rr(e,t,n){let{x1:r,y1:i,x2:a,y2:o}=t;return n.onlyTranslate()?(e!==t&&e.setValue(t.x1,t.y1,t.x2,t.y2),e.translate(n.e,n.f),t):(e.clear(),e.add(n.a*r+n.c*i+n.e,n.b*r+n.d*i+n.f),e.add(n.a*a+n.c*i+n.e,n.b*a+n.d*i+n.f),e.add(n.a*a+n.c*o+n.e,n.b*a+n.d*o+n.f),e.add(n.a*r+n.c*o+n.e,n.b*r+n.d*o+n.f),t)}var zr,Br,Vr,Hr=t((()=>{xn(),Lr(),zr=class e{constructor(e){e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}clone(){return new e(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2}setValue(e=0,t=0,n=0,r=0){return this.x1=e,this.y1=t,this.x2=n,this.y2=r,this}set(e=0,t=0,n=0,r=0){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),r<t?(this.y2=t,this.y1=r):(this.y1=t,this.y2=r),this}add(e=0,t=0){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this}expand(e=0){return I(e)?(this.y1-=e[0],this.x2+=e[1],this.y2+=e[2],this.x1-=e[3]):(this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(e=0,t=0){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}rotate(e=0,t=0,n=0){let r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])}scale(e=0,t=0,n=0,r=0){let i=this.scalePoints(e,t,n,r);return this.clear().add(i[0],i[1]).add(i[2],i[3])}union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this}intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this}encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2}alignsWith(e){return e&&(this.x1===e.x1||this.x2===e.x2||this.y1===e.y1||this.y2===e.y2)}intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)}contains(e=0,t=0){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)}containsPoint(e){return!(e.x<this.x1||e.x>this.x2||e.y<this.y1||e.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(e=0){return this.x1*=e,this.x2*=e,this}scaleY(e=0){return this.y1*=e,this.y2*=e,this}transformWithMatrix(e){return Rr(this,this,e),this}copy(e){return this.x1=e.x1,this.y1=e.y1,this.x2=e.x2,this.y2=e.y2,this}rotatedPoints(e,t,n){let{x1:r,y1:i,x2:a,y2:o}=this,s=Math.cos(e),c=Math.sin(e),l=t-t*s+n*c,u=n-t*c-n*s;return[s*r-c*i+l,c*r+s*i+u,s*r-c*o+l,c*r+s*o+u,s*a-c*i+l,c*a+s*i+u,s*a-c*o+l,c*a+s*o+u]}scalePoints(e,t,n,r){let{x1:i,y1:a,x2:o,y2:s}=this;return[e*i+(1-e)*n,t*a+(1-t)*r,e*o+(1-e)*n,t*s+(1-t)*r]}},Br=class extends zr{},Vr=class e extends zr{constructor(e,t=0){super(e),e&&(this.angle=e.angle??t)}intersects(e){return pr(this,e)}setValue(e=0,t=0,n=0,r=0,i=0){return super.setValue(e,t,n,r),this.angle=i,this}clone(){return new e(this)}getRotatedCorners(){let e={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[ur({x:this.x1,y:this.y1},this.angle,e),ur({x:this.x2,y:this.y1},this.angle,e),ur({x:this.x1,y:this.y2},this.angle,e),ur({x:this.x2,y:this.y2},this.angle,e)]}}}));function Ur(e,t,n,r,i,a,o,s){let c=t.a,l=t.b,u=t.c,d=t.d,f=t.e,p=t.f,m=In(o),h=zn(o),g,_;s?(g=s[0],_=s[1]):(g=n,_=r);let v=g-n,y=_-r,b=c*m+u*h,x=l*m+d*h,S=u*m-c*h,C=d*m-l*h;e.a=i*b,e.b=i*x,e.c=a*S,e.d=a*C,e.e=f+c*g+u*_-b*v-S*y,e.f=p+l*g+d*_-x*v-C*y}var Wr,Gr=t((()=>{nr(),Hn(),Wr=class e{constructor(e=1,t=0,n=0,r=1,i=0,a=0){this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a}equalToMatrix(e){return this.e===e.e&&this.f===e.f&&this.a===e.a&&this.d===e.d&&this.b===e.b&&this.c===e.c}equalTo(e,t,n,r,i,a){return this.e===i&&this.f===a&&this.a===e&&this.d===r&&this.b===t&&this.c===n}setValue(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){let t=this.a,n=this.b,r=this.c,i=this.d,a=this.e,o=this.f,s=new e,c=t*i-n*r;return s.a=i/c,s.b=-n/c,s.c=-r/c,s.d=t/c,s.e=(r*o-i*a)/c,s.f=-(t*o-n*a)/c,s}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.a*t+this.c*n,i=this.b*t+this.d*n,a=this.a*-n+this.c*t,o=this.b*-n+this.d*t;return this.a=r,this.b=i,this.c=a,this.d=o,this}rotateByCenter(e,t,n){let r=Math.cos(e),i=Math.sin(e),a=(1-r)*t+i*n,o=(1-r)*n-i*t,s=r*this.a-i*this.b,c=i*this.a+r*this.b,l=r*this.c-i*this.d,u=i*this.c+r*this.d,d=r*this.e-i*this.f+a,f=i*this.e+r*this.f+o;return this.a=s,this.b=c,this.c=l,this.d=u,this.e=d,this.f=f,this}scale(e,t){return this.a*=e,this.b*=e,this.c*=t,this.d*=t,this}setScale(e,t){return this.b=this.b/this.a*e,this.c=this.c/this.d*t,this.a=e,this.d=t,this}transform(e,t,n,r,i,a){return this.multiply(e,t,n,r,i,a),this}translate(e,t){return this.e+=this.a*e+this.c*t,this.f+=this.b*e+this.d*t,this}transpose(){let{a:e,b:t,c:n,d:r,e:i,f:a}=this;return this.a=t,this.b=e,this.c=r,this.d=n,this.e=a,this.f=i,this}multiply(e,t,n,r,i,a){let o=this.a,s=this.b,c=this.c,l=this.d,u=o*e+c*t,d=s*e+l*t,f=o*n+c*r,p=s*n+l*r,m=o*i+c*a+this.e,h=s*i+l*a+this.f;return this.a=u,this.b=d,this.c=f,this.d=p,this.e=m,this.f=h,this}interpolate(t,n){let r=new e;return r.a=this.a+(t.a-this.a)*n,r.b=this.b+(t.b-this.b)*n,r.c=this.c+(t.c-this.c)*n,r.d=this.d+(t.d-this.d)*n,r.e=this.e+(t.e-this.e)*n,r.f=this.f+(t.f-this.f)*n,r}transformPoint(e,t){let{a:n,b:r,c:i,d:a,e:o,f:s}=this,c=n*a-r*i,l=a/c,u=-r/c,d=-i/c,f=n/c,p=(i*s-a*o)/c,m=-(n*s-r*o)/c,{x:h,y:g}=e;t.x=h*l+g*d+p,t.y=h*u+g*f+m}onlyTranslate(e=1){return this.a===e&&this.b===0&&this.c===0&&this.d===e}clone(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){let e=this.a,t=this.b,n=this.c,r=this.d,i=e*r-t*n,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!==0||t!==0){let o=Math.sqrt(e*e+t*t);a.rotateDeg=t>0?Math.acos(e/o):-Math.acos(e/o),a.scaleX=o,a.scaleY=i/o,a.skewX=(e*n+t*r)/i,a.skewY=0}else if(n!==0||r!==0){let o=Math.sqrt(n*n+r*r);a.rotateDeg=Math.PI/2-(r>0?Math.acos(-n/o):-Math.acos(n/o)),a.scaleX=i/o,a.scaleY=o,a.skewX=0,a.skewY=(e*n+t*r)/i}return a.rotateDeg=Jn(a.rotateDeg),a}}})),Kr=t((()=>{Sn(),Gn(),Hr(),Gr()})),qr,Jr=t((()=>{qr=class{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(e,t){let{CLEAN_THRESHOLD:n=this.CLEAN_THRESHOLD,L_TIME:r=this.L_TIME,R_COUNT:i=this.R_COUNT}=t;if(e.size<n)return 0;let a=0,o=t=>{a++,e.delete(t)},s=Date.now();return e.forEach(((e,t)=>{if(e.timestamp.length<i)return o(t);let n=0;for(;s-e.timestamp[e.timestamp.length-1-n]<r&&(n++,!(n>=i)););if(n<i)return o(t);for(;s-e.timestamp[0]>r;)e.timestamp.shift()})),a}addLimitedTimestamp(e,t,n){let{R_TIMESTAMP_MAX_SIZE:r=this.R_TIMESTAMP_MAX_SIZE}=n;e.timestamp.length>r&&e.timestamp.shift(),e.timestamp.push(t)}clearTimeStamp(e,t){let{L_TIME:n=this.L_TIME}=t,r=Date.now();e.forEach((e=>{for(;r-e.timestamp[0]>n;)e.timestamp.shift()}))}clearItemTimestamp(e,t){let{L_TIME:n=this.L_TIME}=t,r=Date.now();for(;r-e.timestamp[0]>n;)e.timestamp.shift()}}}));function Yr(e,t,n){t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=0,s=0,c=0;return 0<=e&&e<60?(o=r,s=i,c=0):60<=e&&e<120?(o=i,s=r,c=0):120<=e&&e<180?(o=0,s=r,c=i):180<=e&&e<240?(o=0,s=i,c=r):240<=e&&e<300?(o=i,s=0,c=r):300<=e&&e<360&&(o=r,s=0,c=i),o=Math.round(255*(o+a)),s=Math.round(255*(s+a)),c=Math.round(255*(c+a)),{r:o,g:s,b:c}}var Xr=t((()=>{}));function Zr(e,t,n){e/=255,t/=255,n/=255;let r=Math.min(e,t,n),i=Math.max(e,t,n),a=i-r,o=0,s=0,c=0;return o=a===0?0:i===e?(t-n)/a%6:i===t?(n-e)/a+2:(e-t)/a+4,o=Math.round(60*o),o<0&&(o+=360),c=(i+r)/2,s=a===0?0:a/(1-Math.abs(2*c-1)),s=+(100*s).toFixed(1),c=+(100*c).toFixed(1),{h:o,s,l:c}}var Qr=t((()=>{}));function $r(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?`0`:``)+e.toString(16)}function ei(e){return L(e)?new li(e>>16,e>>8&255,255&e,1):I(e)?new li(e[0],e[1],e[2]):new li(255,255,255)}function ti(e){return L(e)?new li(e>>>24,e>>>16&255,e>>>8&255,255&e):I(e)?new li(e[0],e[1],e[2],e[3]):new li(255,255,255,1)}function ni(e){return e<.04045?.0773993808*e:(.9478672986*e+.0521327014)**2.4}function ri(e){return e<.0031308?12.92*e:1.055*e**.41666-.055}var ii,ai,oi,si,ci,li,ui=t((()=>{xn(),Xr(),Qr(),ii=/^#([0-9a-f]{3,8})$/,ai={transparent:4294967040},oi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},si=(e,t)=>{let n=ii.exec(e);if(t||n){let e=parseInt(n[1],16),t=n[1].length;return t===3?new li((e>>8&15)+((e>>8&15)<<4),(e>>4&15)+((e>>4&15)<<4),(15&e)+((15&e)<<4),1):t===6?ei(e):t===8?new li(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):null}},ci=class e{static Brighter(t,n=1){return n===1?t:new e(t).brighter(n).toRGBA()}static SetOpacity(t,n=1){return n===1?t:new e(t).setOpacity(n).toRGBA()}static getColorBrightness(t,n=`hsl`){let r=t instanceof e?t:new e(t);switch(n){case`hsv`:default:return r.getHSVBrightness();case`hsl`:return r.getHSLBrightness();case`lum`:return r.getLuminance();case`lum2`:return r.getLuminance2();case`lum3`:return r.getLuminance3();case`wcag`:return r.getLuminanceWCAG()}}static parseColorString(e){if(P(ai[e]))return ti(ai[e]);if(P(oi[e]))return ei(oi[e]);let t=`${e}`.trim().toLowerCase(),n=si(t);if(n!==void 0)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(t)){let e=t.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,``).split(`,`);return new li(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(t)){let e=t.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,``).split(`,`),n=Yr(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10));return new li(n.r,n.g,n.b,parseFloat(e[3]))}}constructor(t){let n=e.parseColorString(t);n?this.color=n:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new li(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(e){let{r:t,g:n,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(t*e))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*e))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*e))),this}add(e){let{r:t,g:n,b:r}=this.color;return this.color.r+=Math.min(255,t+e.color.r),this.color.g+=Math.min(255,n+e.color.g),this.color.b+=Math.min(255,r+e.color.b),this}sub(e){return this.color.r=Math.max(0,this.color.r-e.color.r),this.color.g=Math.max(0,this.color.g-e.color.g),this.color.b=Math.max(0,this.color.b-e.color.b),this}multiply(e){let{r:t,g:n,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(t*e.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*e.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*e.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(e,t,n){let r=this.color.opacity,i=Zr(this.color.r,this.color.g,this.color.b),a=Yr(N(e)?i.h:qt(e,0,360),N(t)?i.s:t>=0&&t<=1?100*t:t,N(n)?i.l:n<=1&&n>=0?100*n:n);return this.color=new li(a.r,a.g,a.b,r),this}setRGB(e,t,n){return!N(e)&&(this.color.r=e),!N(t)&&(this.color.g=t),!N(n)&&(this.color.b=n),this}setHex(e){let t=`${e}`.trim().toLowerCase();return si(t,!0)??this}setColorName(e){let t=oi[e.toLowerCase()];return t===void 0?console.warn(`THREE.Color: Unknown color `+e):this.setHex(t),this}setScalar(e){return this.color.r=e,this.color.g=e,this.color.b=e,this}setOpacity(e=1){return this.color.opacity=e,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){let e=this.color.r/255,t=this.color.g/255,n=this.color.b/255,r,i,a;return r=e<=.03928?e/12.92:((e+.055)/1.055)**2.4,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,.2126*r+.7152*i+.0722*a}clone(){return new e(this.color.toString())}copyGammaToLinear(e,t=2){return this.color.r=e.color.r**+t,this.color.g=e.color.g**+t,this.color.b=e.color.b**+t,this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.color.r=e.color.r**+n,this.color.g=e.color.g**+n,this.color.b=e.color.b**+n,this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.color.r=ni(e.color.r),this.color.g=ni(e.color.g),this.color.b=ni(e.color.b),this}copyLinearToSRGB(e){return this.color.r=ri(e.color.r),this.color.g=ri(e.color.g),this.color.b=ri(e.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}},li=class{constructor(e,t,n,r){this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.opacity=P(r)?isNaN(+r)?1:Math.max(0,Math.min(1,+r)):1}formatHex(){return`#${$r(this.r)+$r(this.g)+$r(this.b)+(this.opacity===1?``:$r(255*this.opacity))}`}formatRgb(){let e=this.opacity;return`${e===1?`rgb(`:`rgba(`}${this.r},${this.g},${this.b}${e===1?`)`:`,${e})`}`}formatHsl(){let e=this.opacity,{h:t,s:n,l:r}=Zr(this.r,this.g,this.b);return`${e===1?`hsl(`:`hsla(`}${t},${n}%,${r}%${e===1?`)`:`,${e})`}`}toString(){return this.formatHex()}}}));function di(e){let t=``,n=``,r=``,i=+(e[0]===`#`);for(let a=i;a<e.length;a++)e[a]!==`#`&&(a<i+2?t+=e[a]:a<i+4?n+=e[a]:a<i+6&&(r+=e[a]));return[parseInt(t,16),parseInt(n,16),parseInt(r,16)]}var fi=t((()=>{}));function pi(e,t,n){return Number((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}var mi=t((()=>{}));function hi(e,t){let n=e.r,r=t.r,i=e.g,a=t.g,o=e.b,s=t.b,c=e.opacity,l=t.opacity;return e=>{let t=Math.round(n*(1-e)+r*e),u=Math.round(i*(1-e)+a*e),d=Math.round(o*(1-e)+s*e);return new li(t,u,d,c*(1-e)+l*e)}}var gi=t((()=>{ui()})),_i=r({Color:()=>ci,DEFAULT_COLORS:()=>oi,RGB:()=>li,hexToRgb:()=>di,hslToRgb:()=>Yr,interpolateRgb:()=>hi,rgbToHex:()=>pi,rgbToHsl:()=>Zr}),vi=t((()=>{ui(),fi(),Xr(),mi(),Qr(),gi()})),yi=t((()=>{}));function bi(e){if(R(e))return[e,e,e,e];if(I(e)){let t=e.length;if(t===1){let t=e[0];return[t,t,t,t]}if(t===2){let[t,n]=e;return[t,n,t,n]}if(t===3){let[t,n,r]=e;return[t,n,r,n]}if(t===4)return e}if(F(e)){let{top:t=0,right:n=0,bottom:r=0,left:i=0}=e;return[t,n,r,i]}return[0,0,0,0]}var xi=t((()=>{Le(),je(),Se()})),Si=t((()=>{})),Ci=t((()=>{})),wi=t((()=>{Si(),Ci()}));function Ti(e,t=0,n=0){if(!e)return{width:t,height:n};let r;try{r=window==null?void 0:window.getComputedStyle}catch{r=()=>({})}let i=r(e);if(/^(\d*\.?\d+)(px)$/.exec(i.width)){let r=parseFloat(i.width)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)||e.clientWidth-1,a=parseFloat(i.height)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)||e.clientHeight-1;return{width:r<=0?t:r,height:a<=0?n:a}}return{width:t,height:n}}function Ei(e){let{x:t,y:n}=e.getBoundingClientRect();return{x:t,y:n}}var Di,Oi,ki=t((()=>{Di=(e=``)=>{let t={};return e.split(`;`).forEach((e=>{if(e){let n=e.split(`:`);if(n.length===2){let e=n[0].trim(),r=n[1].trim();e&&r&&(t[e]=r)}}})),t},Oi=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase()})),Ai=t((()=>{})),ji=t((()=>{})),Mi=t((()=>{})),Ni=t((()=>{})),Pi=t((()=>{Ai(),ji(),Ni(),Mi()})),Fi,Ii=t((()=>{Fi=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.locale_shortWeekdays=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],this.locale_periods=[`AM`,`PM`],this.locale_weekdays=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],this.locale_shortMonths=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],this.numberRe=/^\s*\d+/,this.pads={"-":``,_:` `,0:`0`},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],this.formatShortWeekday=e=>this.locale_shortWeekdays[e.getDay()],this.formatWeekday=e=>this.locale_weekdays[e.getDay()],this.formatShortMonth=e=>this.locale_shortMonths[e.getMonth()],this.formatMonth=e=>this.locale_months[e.getMonth()],this.formatDayOfMonth=(e,t)=>this.pad(e.getDate(),t,2),this.formatHour24=(e,t)=>this.pad(e.getHours(),t,2),this.formatHour12=(e,t)=>this.pad(e.getHours()%12||12,t,2),this.formatMilliseconds=(e,t)=>this.pad(e.getMilliseconds(),t,3),this.formatMonthNumber=(e,t)=>this.pad(e.getMonth()+1,t,2),this.formatMinutes=(e,t)=>this.pad(e.getMinutes(),t,2),this.formatPeriod=e=>this.locale_periods[+(e.getHours()>=12)],this.formatSeconds=(e,t)=>this.pad(e.getSeconds(),t,2),this.formatFullYear=(e,t)=>this.pad(e.getFullYear()%1e4,t,4),this.formatUTCShortWeekday=e=>this.locale_shortWeekdays[e.getUTCDay()],this.formatUTCWeekday=e=>this.locale_weekdays[e.getUTCDay()],this.formatUTCShortMonth=e=>this.locale_shortMonths[e.getUTCMonth()],this.formatUTCMonth=e=>this.locale_months[e.getUTCMonth()],this.formatUTCDayOfMonth=(e,t)=>this.pad(e.getUTCDate(),t,2),this.formatUTCHour24=(e,t)=>this.pad(e.getUTCHours(),t,2),this.formatUTCHour12=(e,t)=>this.pad(e.getUTCHours()%12||12,t,2),this.formatUTCMilliseconds=(e,t)=>this.pad(e.getUTCMilliseconds(),t,3),this.formatUTCMonthNumber=(e,t)=>this.pad(e.getUTCMonth()+1,t,2),this.formatUTCMinutes=(e,t)=>this.pad(e.getUTCMinutes(),t,2),this.formatUTCPeriod=e=>this.locale_periods[+(e.getUTCHours()>=12)],this.formatUTCSeconds=(e,t)=>this.pad(e.getUTCSeconds(),t,2),this.formatUTCFullYear=(e,t)=>this.pad(e.getUTCFullYear()%1e4,t,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(e,t,n)=>{let r=this.shortWeekdayRe.exec(t.slice(n));return r?(e.w=this.shortWeekdayLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseWeekday=(e,t,n)=>{let r=this.weekdayRe.exec(t.slice(n));return r?(e.w=this.weekdayLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseShortMonth=(e,t,n)=>{let r=this.shortMonthRe.exec(t.slice(n));return r?(e.m=this.shortMonthLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseMonth=(e,t,n)=>{let r=this.monthRe.exec(t.slice(n));return r?(e.m=this.monthLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseDayOfMonth=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1},this.parseHour24=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1},this.parseMilliseconds=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1},this.parseMonthNumber=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.m=r-1,n+r[0].length):-1},this.parseMinutes=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1},this.parsePeriod=(e,t,n)=>{let r=this.periodRe.exec(t.slice(n));return r?(e.p=this.periodLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseSeconds=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1},this.parseFullYear=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(e,t)=>this.newFormat(e,this.formats)(new Date(this.getFullTimeStamp(t))),this.timeUTCFormat=(e,t)=>this.newFormat(e,this.utcFormats)(new Date(this.getFullTimeStamp(t))),this.timeParse=(e,t)=>this.newParse(e,!1)(t+``),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(e){return e.replace(this.requoteRe,`\\$&`)}localDate(e){if(0<=e.y&&e.y<100){let t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}utcDate(e){if(0<=e.y&&e.y<100){let t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}newDate(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}formatRe(e){return RegExp(`^(?:`+e.map(this.requoteF).join(`|`)+`)`,`i`)}formatLookup(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}pad(e,t,n){let r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}parseSpecifier(e,t,n,r){let i=0,a=t.length,o=n.length,s,c;for(;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=this.parses[s in this.pads?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!==n.charCodeAt(r++))return-1}return r}newParse(e,t){let n=this;return function(r){let i=n.newDate(1900,void 0,1);return n.parseSpecifier(i,e,r+=``,0)===r.length?`Q`in i?new Date(i.Q):`s`in i?new Date(1e3*i.s+(`L`in i?i.L:0)):(t&&!(`Z`in i)&&(i.Z=0),`p`in i&&(i.H=i.H%12+12*i.p),i.m===void 0&&(i.m=`q`in i?i.q:0),`Z`in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,n.utcDate(i)):n.localDate(i)):null}}newFormat(e,t){let n=this;return function(r){let i=[],a=-1,o=0,s=e.length,c,l,u;for(r instanceof Date||(r=new Date(+r));++a<s;)e.charCodeAt(a)===37&&(i.push(e.slice(o,a)),(l=n.pads[c=e.charAt(++a)])?c=e.charAt(++a):l=c===`e`?` `:`0`,u=t[c],c=u(r,l),i.push(c),o=a+1);return i.push(e.slice(o,a)),i.join(``)}}getFullTimeStamp(e){let t=parseInt(e+``,10);return String(t).length===10?1e3*t:t}}})),Li=t((()=>{})),Ri=t((()=>{})),zi=t((()=>{Ri(),Li()})),Bi=t((()=>{})),Vi=t((()=>{})),Hi=t((()=>{})),Ui=t((()=>{Bi(),Vi(),Hi()})),Wi,H=t((()=>{Wi=n(me()),xn(),Kr(),Jr(),Hn(),nr(),vi(),Lr(),yi(),Ft(),xi(),wi(),ki(),Pi(),vi(),Ii(),zi(),Ui()})),Gi=(e,t)=>{let{callback:n}=t;return n&&(e=e.filter(n)),e};H();var Ki=function(e,...t){return Yi(et(e),...t)};function qi(e,t,n){let r=t[n];if(r===void 0)e[n]=null;else if(F(r)){F(e[n])||(e[n]={});for(let t in r)qi(e[n],r,t)}else e[n]=r}function Ji(e,t){if(F(t)&&e!==t)for(let n in t)qi(e,t,n)}function Yi(e,...t){e||={};let n=-1,r=t.length;for(;++n<r;)Ji(e,t[n]);return e}var Xi;(function(e){e.DSV=`dsv`,e.TREE=`tree`,e.GEO=`geo`,e.BYTE=`bytejson`,e.HEX=`hex`,e.GRAPH=`graph`,e.TABLE=`table`,e.GEO_GRATICULE=`geo-graticule`})(Xi||={});var Zi=(e,t)=>{let{fields:n,key:r,value:i,retains:a}=t,o=[];for(let t=0;t<e.length;t++)n.forEach((s=>{let c={};if(c[r]=s,c[i]=e[t][s],a)a.forEach((n=>{c[n]=e[t][n]}));else for(let r in e[t])n.indexOf(r)===-1&&(c[r]=e[t][r]);o.push(c)}));return o};H();var Qi=(e,t)=>{if(!t?.fields||e.length===0)return e;let n=t.fields,r=e[0],i={},a=[];for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){let o=n[t];if(o.sort&&(R(o.sortIndex)||(o.sortIndex=0),P(o.sortReverse)||(o.sortReverse=o.sort===`desc`)),!o.type){let n=r;t in r||(n=e.find((e=>t in e))??r),o.type=typeof n[t]==`number`?`linear`:`ordinal`}let s;if(typeof o.sortIndex==`number`&&(s={key:t,type:o.type,index:o.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===o.sortReverse},a.push(s)),o.domain?.length>0){if(o.type===`ordinal`){o._domainCache={},i[t]=o;let e={};o.domain.forEach(((t,n)=>{e[t]=n,o._domainCache[t]=n})),s&&(s.sortIndex=e,s.sortIndexCount=o.domain.length)}else o.domain.length>=2&&(i[t]=o)}}return Object.keys(i).length>0&&(e=e.filter((e=>{for(let t in i){let n=i[t];if(n.type===`ordinal`){if(!(e[t]in n._domainCache))return!1}else if(n.domain[0]>e[t]||n.domain[1]<e[t])return!1}return!0}))),a.sort(((e,t)=>e.index-t.index)),e.sort(((e,t)=>$i(e,t,a))),e};function $i(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=0;if(i.type===`ordinal`?(i.sortIndex[t[i.key]]===void 0&&(i.sortIndex[t[i.key]]=i.sortIndexCount++),i.sortIndex[e[i.key]]===void 0&&(i.sortIndex[e[i.key]]=i.sortIndexCount++),a=i.sortIndex[e[i.key]]-i.sortIndex[t[i.key]]):i.type===`linear`&&(a=e[i.key]-t[i.key]),i.sortReverse&&(a=-a),a!==0)return a}return 0}var ea={},ta={},na=34,ra=10,ia=13;function aa(e){return Function(`d`,`return {`+e.map(function(e,t){return JSON.stringify(e)+`: d[`+t+`] || ""`}).join(`,`)+`}`)}function oa(e,t){var n=aa(e);return function(r,i){return t(n(r),i,e)}}function sa(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var r in e)r in t||n.push(t[r]=r)}),n}function ca(e,t){var n=e+``,r=n.length;return r<t?Array(t-r+1).join(0)+n:n}function la(e){return e<0?`-`+ca(-e,6):e>9999?`+`+ca(e,6):ca(e,4)}function ua(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?`Invalid Date`:la(e.getUTCFullYear(),4)+`-`+ca(e.getUTCMonth()+1,2)+`-`+ca(e.getUTCDate(),2)+(i?`T`+ca(t,2)+`:`+ca(n,2)+`:`+ca(r,2)+`.`+ca(i,3)+`Z`:r?`T`+ca(t,2)+`:`+ca(n,2)+`:`+ca(r,2)+`Z`:n||t?`T`+ca(t,2)+`:`+ca(n,2)+`Z`:``)}function da(e){var t=RegExp(`["`+e+`
|
|
2
2
|
\r]`),n=e.charCodeAt(0);function r(e,t){var n,r,a=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?oa(e,t):aa(e)});return a.columns=r||[],a}function i(e,t){var r=[],i=e.length,a=0,o=0,s,c=i<=0,l=!1;e.charCodeAt(i-1)===ra&&--i,e.charCodeAt(i-1)===ia&&--i;function u(){if(c)return ta;if(l)return l=!1,ea;var t,r=a,o;if(e.charCodeAt(r)===na){for(;a++<i&&e.charCodeAt(a)!==na||e.charCodeAt(++a)===na;);return(t=a)>=i?c=!0:(o=e.charCodeAt(a++))===ra?l=!0:o===ia&&(l=!0,e.charCodeAt(a)===ra&&++a),e.slice(r+1,t-1).replace(/""/g,`"`)}for(;a<i;){if((o=e.charCodeAt(t=a++))===ra)l=!0;else if(o===ia)l=!0,e.charCodeAt(a)===ra&&++a;else if(o!==n)continue;return e.slice(r,t)}return c=!0,e.slice(r,i)}for(;(s=u())!==ta;){for(var d=[];s!==ea&&s!==ta;)d.push(s),s=u();t&&(d=t(d,o++))==null||r.push(d)}return r}function a(t,n){return t.map(function(t){return n.map(function(e){return u(t[e])}).join(e)})}function o(t,n){return n??=sa(t),[n.map(u).join(e)].concat(a(t,n)).join(`
|
|
3
3
|
`)}function s(e,t){return t??=sa(e),a(e,t).join(`
|
|
4
4
|
`)}function c(e){return e.map(l).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{l as n,u as r}from"./chunk-OB3PAWPO-CCBUsQEH.js";import{t as i}from"./jsx-runtime-BdxMnOeJ.js";import{i as a,m as o,t as s}from"./log-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{l as n,u as r}from"./chunk-OB3PAWPO-CCBUsQEH.js";import{t as i}from"./jsx-runtime-BdxMnOeJ.js";import{i as a,m as o,t as s}from"./log-Divm5wOC.js";import{c,d as l,f as u}from"./pendingActionsStore-Cnarb0K6.js";import{n as d,t as f}from"./WorkflowsSection-DVPLXuBj.js";import{a as p,i as m,m as h,n as g,p as _,r as v}from"./ToolCallMessage-iN0F9bXz.js";import{Vt as y}from"./lexicalToReact-C0mubAok.js";import{t as b}from"./createScopedStore-B9MoX0Yk.js";import{t as x}from"./runDetached-2gt4-pgN.js";import{l as S}from"./contextWindow-CP46e9Bl.js";import{t as C}from"./settings-header-button-D5V2Emxn.js";var w={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};w.node;var T=u(w),E=e(t(),1),D=b(`WorkflowsPageView`,()=>e=>({selectedRunId:null,selectedRun:null,selectedAgentId:null,setSelectedRunId:t=>e({selectedRunId:t}),setSelectedRun:t=>e({selectedRun:t}),setSelectedAgentId:t=>e({selectedAgentId:t}),clearSelection:()=>e({selectedRunId:null,selectedRun:null,selectedAgentId:null})})),O=[],k=b(`WorkflowAgentTranscript`,()=>e=>({loadState:`loading`,messages:O,error:null,reloadNonce:0,setLoaded:t=>e({loadState:`loaded`,messages:t}),setError:t=>e({loadState:`error`,error:t}),refresh:()=>e(e=>({loadState:`loading`,error:null,reloadNonce:e.reloadNonce+1}))})),A=e(i(),1);function j({runId:e,agentId:t,agentLabel:n,promptPreview:r,agentIsRunning:i=!1,onClose:a,getTranscript:s}){let c=k.useScopedStore(e=>e.loadState),u=k.useScopedStore(e=>e.messages),d=k.useScopedStore(e=>e.error),f=k.useScopedStore(e=>e.reloadNonce),h=k.useScopedStore(e=>e.setLoaded),g=k.useScopedStore(e=>e.setError),v=k.useScopedStore(e=>e.refresh);(0,E.useEffect)(()=>{let n=!1;return s(e,t).then(e=>{n||h(_(e))}).catch(o(e=>{n||g(e.message)})),()=>{n=!0}},[e,t,s,f,h,g]);let b=(0,E.useCallback)(()=>{v()},[v]);return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,"data-testid":`workflow-agent-transcript-panel`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border pb-2.5`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Back to run`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,A.jsx)(T,{className:`size-4`,"aria-hidden":!0})}),(0,A.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:n}),(0,A.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium tracking-wide text-muted-foreground`,children:`Transcript`}),i?(0,A.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium tracking-wide`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`inline-block size-1.5 animate-pulse rounded-full bg-emerald-500 dark:bg-emerald-400`}),(0,A.jsx)(`span`,{className:`text-emerald-500 dark:text-emerald-400`,children:`Running`})]}):null,(0,A.jsx)(`button`,{type:`button`,onClick:b,"aria-label":`Refresh transcript`,className:`ml-auto inline-flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,A.jsx)(y,{className:c===`loading`?`size-3.5 animate-spin`:`size-3.5`,"aria-hidden":!0})})]}),i?(0,A.jsx)(`p`,{className:`rounded-md border border-amber-500/20 bg-amber-500/5 px-2.5 py-1.5 text-xs text-amber-600 dark:text-amber-400`,children:`This agent is still running — the transcript may be incomplete. Refresh to update.`}):null,r?(0,A.jsxs)(`div`,{className:`rounded-md border border-border/50 bg-muted/40 px-2.5 py-1.5`,children:[(0,A.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Prompt (preview)`}),(0,A.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-muted-foreground/90`,children:r})]}):null,(0,A.jsx)(m,{value:null,children:(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,children:[c===`loading`?(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,A.jsx)(l,{className:`size-3 animate-spin`,"aria-label":`Loading`}),`Loading transcript…`]}):null,c===`error`?(0,A.jsx)(`div`,{className:`text-xs text-destructive`,children:d}):null,c===`loaded`&&u.length===0?(0,A.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No transcript recorded yet.`}):null,u.map(e=>(0,A.jsx)(p,{message:e,localPath:``},e.id))]})})]})}function M(e){return(0,A.jsx)(k.Provider,{init:void 0,children:(0,A.jsx)(j,{...e})})}function N({runs:e,getRunDetail:t,getAgentTranscript:n,onBackToChat:r}){let i=D.useScopedStore(e=>e.selectedRunId),u=D.useScopedStore(e=>e.selectedRun),p=D.useScopedStore(e=>e.selectedAgentId),m=D.useScopedStore(e=>e.setSelectedRunId),g=D.useScopedStore(e=>e.setSelectedRun),_=D.useScopedStore(e=>e.setSelectedAgentId),v=D.useScopedStore(e=>e.clearSelection),y=(0,E.useRef)(null),b=(0,E.useRef)(0),S=(0,E.useCallback)(n=>{y.current=e,m(n),_(null),g(`loading`);let r=++b.current,i=()=>b.current===r;t(n).then(e=>{i()&&g(e??`not-found`)},o(e=>{s.error(a,`workflows.getRun failed`,e),i()&&g(`failed`)}))},[t,e,m,_,g]),w=(0,E.useCallback)(()=>{v(),y.current=null},[v]);(0,E.useEffect)(()=>{if(i===null||e===y.current)return;let n=e.find(e=>e.runId===i);if(!n||n.status!==`running`)return;let r=!1,a=++b.current;return x(`workflows.getRun refresh`,t(i).then(e=>{r||b.current!==a||e===null||(p===null||e.agents.some(e=>e.agentId===p))&&g(e)})),()=>{r=!0}},[e,i,p,t,g]);let O=u!==`loading`&&u!==`not-found`&&u!==`failed`?u:null,k=p!==null&&O?O.agents.find(e=>e.agentId===p):void 0,j=i!==null,N;return N=u===`loading`?(0,A.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,A.jsx)(l,{className:`size-4 animate-spin`,"aria-label":`Loading`}),`Loading run…`]}):u===`failed`?(0,A.jsx)(F,{text:`Couldn't load this run. Select it again to retry.`}):u===`not-found`?(0,A.jsx)(F,{text:`Run not found or no longer available.`}):k&&O?(0,A.jsx)(M,{runId:O.runId,agentId:k.agentId,agentLabel:k.label,promptPreview:k.promptPreview,agentIsRunning:k.state===`running`||k.state===`progress`,onClose:()=>_(null),getTranscript:n},p??``):O?(0,A.jsx)(f,{run:O,title:O.workflowName??O.runId,onSelectAgent:e=>_(e)}):(0,A.jsx)(F,{text:`Select a run to view its phases and agents.`}),(0,A.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-4 py-3 md:px-6`,children:[(0,A.jsx)(h,{className:`size-5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,A.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:`Workflows`}),e.length>0?(0,A.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[e.length,` `,e.length===1?`run`:`runs`]}):null,r?(0,A.jsx)(C,{"aria-label":`Back to chat`,className:`ml-auto`,icon:(0,A.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),onClick:r,children:`Back to chat`}):null]}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,A.jsx)(`div`,{className:c(`w-full shrink-0 overflow-auto p-3 md:w-80 md:border-r md:border-border`,j&&`hidden md:block`),children:(0,A.jsx)(d,{runs:e,selectedRunId:i,onSelectRun:S})}),(0,A.jsxs)(`div`,{className:c(`min-w-0 flex-1 overflow-auto px-4 py-4 md:px-6`,!j&&`hidden md:block`),children:[j?(0,A.jsxs)(`button`,{type:`button`,onClick:w,"aria-label":`Back to runs`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground md:hidden`,children:[(0,A.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),`All runs`]}):null,N]})]})]})}function P(e){return(0,A.jsx)(D.Provider,{init:void 0,children:(0,A.jsx)(N,{...e})})}function F({text:e}){return(0,A.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-3 rounded-lg border border-dashed border-border px-8 py-10 text-center`,children:[(0,A.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,A.jsx)(h,{className:`size-5`,"aria-hidden":!0})}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e})]})})}function I({chatId:e}){let t=r(),i=n(),a=v(S(g(e??``))),o=(0,E.useCallback)(async n=>e?t.socket.command({type:`workflows.getRun`,chatId:e,runId:n}):null,[e,t.socket]),s=(0,E.useCallback)(async(n,r)=>e?t.socket.command({type:`workflows.getAgentTranscript`,chatId:e,runId:n,agentId:r}):[],[e,t.socket]),c=(0,E.useCallback)(()=>{e&&i(`/chat/${e}`)},[e,i]);return e?(0,A.jsx)(P,{runs:a,getRunDetail:o,getAgentTranscript:s,onBackToChat:c}):(0,A.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Open a chat to view its workflows.`})}export{I as WorkflowsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{i as r,m as i,t as a}from"./log-7NXJbErN.js";import{c as o,f as s,s as c}from"./pendingActionsStore-DDpYeRNm.js";import{H as l}from"./FilePreviewSheet-BnQeVNHq.js";import{t as u}from"./formatDuration-JKx5LBF4.js";import{c as d,i as f,n as p,r as m,u as h}from"./timer.adapter-C5oNrWbM.js";import{t as g}from"./createScopedStore-CZBfIcri.js";import{t as _}from"./runDetached-mjGecpjX.js";import{s as v}from"./contextWindow-Cpz1HmWo.js";import{l as y,s as b,t as x}from"./state-mark-x5ennY81.js";var S={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};S.node;var C=s(S),w=e(t(),1),T=g(`WorkflowsSectionDetail`,()=>e=>({selectedRun:null,selectedRunId:null,setSelectedRun:t=>e({selectedRun:t}),setSelectedRunId:t=>e({selectedRunId:t}),clearSelection:()=>e({selectedRun:null,selectedRunId:null})})),E=`Agents`;function D(e){return typeof e.phaseIndex==`number`&&e.phaseIndex>=1}function O(e,t){if(!t.some(D))return t.length===0?[]:[{key:`ungrouped`,phaseIndex:null,title:E,agents:t}];let n=new Map,r=[];for(let e of t)if(D(e)){let t=n.get(e.phaseIndex)??[];t.push(e),n.set(e.phaseIndex,t)}else r.push(e);let i=[];e.forEach((e,t)=>{let r=t+1;i.push({key:`phase-${r}`,phaseIndex:r,title:e.title,detail:e.detail,agents:n.get(r)??[]}),n.delete(r)});for(let e of[...n.keys()].sort((e,t)=>e-t)){let t=n.get(e);i.push({key:`phase-${e}`,phaseIndex:e,title:t[0]?.phaseTitle??`Phase ${e}`,agents:t})}return r.length>0&&i.push({key:`ungrouped`,phaseIndex:null,title:E,agents:r}),i}var k=e(n(),1);function A({runs:e,onSelectRun:t,selectedRunId:n}){return e.length===0?(0,k.jsx)(j,{}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,k.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,style:{fontVariantNumeric:`tabular-nums`},children:[e.length,` `,e.length===1?`run`:`runs`]})}),(0,k.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,k.jsx)(M,{run:e,selected:e.runId===n,onSelect:t},e.runId))})]})}function j(){return(0,k.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-4 rounded-lg border border-dashed border-border px-6 py-14 text-center`,"data-testid":`workflow-empty`,children:[(0,k.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,k.jsx)(C,{className:`size-5`,"aria-hidden":!0})}),(0,k.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`No workflow runs`}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Workflow runs will appear here when triggered.`})]})}function M(e){let{run:t,selected:n}=e,r=t.workflowName??t.runId,i=t.status===`running`,a=(0,w.useCallback)(()=>{e.onSelect(t.runId)},[e,t.runId]);return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-row:${t.runId}`,onClick:a,className:o(`flex w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted`,n&&`bg-muted`),children:[(0,k.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,(i||n)&&`font-medium`),children:r}),(0,k.jsx)(v,{status:t.status,pulse:!0})]}),(0,k.jsxs)(`span`,{className:`flex w-full items-center gap-3 text-xs text-muted-foreground`,children:[t.agentCount==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.agentCount,` `,t.agentCount===1?`agent`:`agents`]}),t.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.totalTokens.toLocaleString(),` tokens`]}),t.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:u(t.durationMs)})]})]})})}function N(e){return e===`running`||e===`progress`?`active`:e===`failed`||e===`error`?`destructive`:e===`killed`?`attention`:`muted`}function P(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}function F({run:e,failed:t}){return e?(0,k.jsx)(z,{run:e}):t?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load this run. Close and select it again to retry.`}):(0,k.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,k.jsx)(c,{}),`Loading…`]})}function I({run:e,failed:t=!1,open:n,onClose:r}){return(0,k.jsx)(p,{open:n,onOpenChange:e=>{e||r()},children:(0,k.jsxs)(f,{size:`lg`,"aria-describedby":void 0,children:[(0,k.jsx)(d,{children:(0,k.jsx)(h,{children:e?e.workflowName??e.runId:`Workflow run`})}),(0,k.jsx)(m,{children:(0,k.jsx)(F,{run:e,failed:t})})]})})}function L({label:e,text:t}){return(0,k.jsxs)(`div`,{className:`rounded border border-border/50 bg-muted/40 px-2 py-1`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-muted-foreground/90`,children:t})]})}function R({agent:e,onSelectAgent:t}){let n=N(e.state),r=n===`active`,i=!!(t&&e.agentId);return(0,k.jsxs)(`li`,{"data-testid":`workflow-agent:${e.agentId??e.index}`,className:`group flex items-start gap-2 rounded-md px-2 py-1.5 transition-colors hover:bg-muted/50`,children:[(0,k.jsx)(x,{tone:n,className:o(`mt-0.5`,b(n))}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,r&&`font-medium`),children:e.label}),e.model?(0,k.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground`,children:e.model}):null,i?(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-agent-transcript:${e.agentId}`,onClick:()=>t?.(e.agentId),className:`ml-auto inline-flex shrink-0 items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(l,{className:`size-3`,"aria-hidden":!0}),`Transcript`]}):null]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{className:o(`capitalize`,b(n)),children:e.state}),e.lastToolName?(0,k.jsxs)(`span`,{className:`truncate`,children:[`last: `,e.lastToolName]}):null,e.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,children:u(e.durationMs)}),e.tokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.tokens.toLocaleString(),` tok`]}),e.toolCalls==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.toolCalls,` calls`]})]}),e.lastToolSummary?(0,k.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,children:e.lastToolSummary}):null,e.promptPreview?(0,k.jsx)(L,{label:`Prompt`,text:e.promptPreview}):null,e.resultPreview?(0,k.jsx)(L,{label:`Result`,text:e.resultPreview}):null]})]})}function z({run:e,onSelectAgent:t,title:n}){let r=y(e.status),i=O(e.phases,e.agents);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n?(0,k.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:n}):null,(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(v,{status:e.status,pulse:!0}),e.durationMs==null?null:(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:u(e.durationMs)}),e.agentCount==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agentCount,` `,e.agentCount===1?`agent`:`agents`]}),e.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalTokens.toLocaleString(),` tokens`]}),e.totalToolCalls==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalToolCalls,` tool calls`]})]})]}),e.summary?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Summary`}),(0,k.jsx)(`p`,{className:`text-sm text-foreground whitespace-pre-wrap`,children:e.summary})]}):null,i.length>0?(0,k.jsx)(`section`,{className:`flex flex-col gap-4`,"data-testid":`workflow-progress-tree`,children:i.map(e=>(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.phaseIndex==null?null:(0,k.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground tabular-nums`,children:e.phaseIndex}),(0,k.jsx)(`h4`,{className:`text-xs font-semibold tracking-wide text-foreground`,children:e.title}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agents.length,` `,e.agents.length===1?`agent`:`agents`]})]}),e.detail?(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.detail}):null,e.agents.length>0?(0,k.jsx)(`ul`,{className:`ml-1.5 flex flex-col gap-0.5 border-l border-border pl-2.5`,children:e.agents.map(e=>(0,k.jsx)(R,{agent:e,onSelectAgent:t},e.agentId??e.index))}):(0,k.jsx)(`p`,{className:`ml-1.5 border-l border-border pl-2.5 text-xs italic text-muted-foreground/70`,children:`No agents yet`})]},e.key))}):null,e.result?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Result`}),(0,k.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:P(e.result)})]}):null,e.script?(0,k.jsxs)(`details`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium tracking-wide text-muted-foreground hover:text-foreground`,children:`Script`}),(0,k.jsx)(`pre`,{className:`mt-1.5 max-h-96 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:e.script})]}):null,e.error&&e.status!==`completed`?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:o(`text-xs font-medium tracking-wide`,b(r)),children:`Error`}),(0,k.jsx)(`p`,{className:`rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-sm text-destructive whitespace-pre-wrap`,children:e.error})]}):null]})}function B({runs:e,getRunDetail:t}){let n=T.useScopedStore(e=>e.selectedRun),o=T.useScopedStore(e=>e.selectedRunId),s=T.useScopedStore(e=>e.setSelectedRun),c=T.useScopedStore(e=>e.setSelectedRunId),l=T.useScopedStore(e=>e.clearSelection),u=n!==null,d=(0,w.useRef)(null),f=(0,w.useRef)(0),p=(0,w.useCallback)(n=>{d.current=e,c(n),s(`loading`);let o=++f.current,l=()=>f.current===o;t(n).then(e=>{l()&&s(e)},i(e=>{a.error(r,`workflows.getRun failed`,e),l()&&s(`failed`)}))},[t,e,s,c]),m=(0,w.useCallback)(()=>{l(),d.current=null},[l]);return(0,w.useEffect)(()=>{if(o===null||e===d.current)return;let n=e.find(e=>e.runId===o);if(!n||n.status!==`running`)return;let r=!1,i=++f.current;return _(`workflows.getRun refresh`,t(o).then(e=>{r||f.current!==i||e===null||s(e)})),()=>{r=!0}},[e,o,t,s]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(A,{runs:e,onSelectRun:p}),(0,k.jsx)(I,{run:n===`loading`||n===`failed`?null:n,failed:n===`failed`,open:u,onClose:m})]})}function V(e){return(0,k.jsx)(T.Provider,{init:void 0,children:(0,k.jsx)(B,{...e})})}export{C as i,A as n,V as r,z as t};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{i as r,m as i,t as a}from"./log-Divm5wOC.js";import{c as o,f as s,s as c}from"./pendingActionsStore-Cnarb0K6.js";import{W as l}from"./FilePreviewSheet-QX9IjaMc.js";import{t as u}from"./formatDuration-DosmZjMh.js";import{c as d,i as f,n as p,r as m,u as h}from"./timer.adapter-BUc1NRbm.js";import{t as g}from"./createScopedStore-B9MoX0Yk.js";import{t as _}from"./runDetached-2gt4-pgN.js";import{s as v}from"./contextWindow-CP46e9Bl.js";import{l as y,s as b,t as x}from"./state-mark-Foa-Y6ag.js";var S={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};S.node;var C=s(S),w=e(t(),1),T=g(`WorkflowsSectionDetail`,()=>e=>({selectedRun:null,selectedRunId:null,setSelectedRun:t=>e({selectedRun:t}),setSelectedRunId:t=>e({selectedRunId:t}),clearSelection:()=>e({selectedRun:null,selectedRunId:null})})),E=`Agents`;function D(e){return typeof e.phaseIndex==`number`&&e.phaseIndex>=1}function O(e,t){if(!t.some(D))return t.length===0?[]:[{key:`ungrouped`,phaseIndex:null,title:E,agents:t}];let n=new Map,r=[];for(let e of t)if(D(e)){let t=n.get(e.phaseIndex)??[];t.push(e),n.set(e.phaseIndex,t)}else r.push(e);let i=[];e.forEach((e,t)=>{let r=t+1;i.push({key:`phase-${r}`,phaseIndex:r,title:e.title,detail:e.detail,agents:n.get(r)??[]}),n.delete(r)});for(let e of[...n.keys()].sort((e,t)=>e-t)){let t=n.get(e);i.push({key:`phase-${e}`,phaseIndex:e,title:t[0]?.phaseTitle??`Phase ${e}`,agents:t})}return r.length>0&&i.push({key:`ungrouped`,phaseIndex:null,title:E,agents:r}),i}var k=e(n(),1);function A({runs:e,onSelectRun:t,selectedRunId:n}){return e.length===0?(0,k.jsx)(j,{}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,k.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,style:{fontVariantNumeric:`tabular-nums`},children:[e.length,` `,e.length===1?`run`:`runs`]})}),(0,k.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,k.jsx)(M,{run:e,selected:e.runId===n,onSelect:t},e.runId))})]})}function j(){return(0,k.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-4 rounded-lg border border-dashed border-border px-6 py-14 text-center`,"data-testid":`workflow-empty`,children:[(0,k.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,k.jsx)(C,{className:`size-5`,"aria-hidden":!0})}),(0,k.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`No workflow runs`}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Workflow runs will appear here when triggered.`})]})}function M(e){let{run:t,selected:n}=e,r=t.workflowName??t.runId,i=t.status===`running`,a=(0,w.useCallback)(()=>{e.onSelect(t.runId)},[e,t.runId]);return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-row:${t.runId}`,onClick:a,className:o(`flex w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted`,n&&`bg-muted`),children:[(0,k.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,(i||n)&&`font-medium`),children:r}),(0,k.jsx)(v,{status:t.status,pulse:!0})]}),(0,k.jsxs)(`span`,{className:`flex w-full items-center gap-3 text-xs text-muted-foreground`,children:[t.agentCount==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.agentCount,` `,t.agentCount===1?`agent`:`agents`]}),t.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.totalTokens.toLocaleString(),` tokens`]}),t.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:u(t.durationMs)})]})]})})}function N(e){return e===`running`||e===`progress`?`active`:e===`failed`||e===`error`?`destructive`:e===`killed`?`attention`:`muted`}function P(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}function F({run:e,failed:t}){return e?(0,k.jsx)(z,{run:e}):t?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load this run. Close and select it again to retry.`}):(0,k.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,k.jsx)(c,{}),`Loading…`]})}function I({run:e,failed:t=!1,open:n,onClose:r}){return(0,k.jsx)(p,{open:n,onOpenChange:e=>{e||r()},children:(0,k.jsxs)(f,{size:`lg`,"aria-describedby":void 0,children:[(0,k.jsx)(d,{children:(0,k.jsx)(h,{children:e?e.workflowName??e.runId:`Workflow run`})}),(0,k.jsx)(m,{children:(0,k.jsx)(F,{run:e,failed:t})})]})})}function L({label:e,text:t}){return(0,k.jsxs)(`div`,{className:`rounded border border-border/50 bg-muted/40 px-2 py-1`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-muted-foreground/90`,children:t})]})}function R({agent:e,onSelectAgent:t}){let n=N(e.state),r=n===`active`,i=!!(t&&e.agentId);return(0,k.jsxs)(`li`,{"data-testid":`workflow-agent:${e.agentId??e.index}`,className:`group flex items-start gap-2 rounded-md px-2 py-1.5 transition-colors hover:bg-muted/50`,children:[(0,k.jsx)(x,{tone:n,className:o(`mt-0.5`,b(n))}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,r&&`font-medium`),children:e.label}),e.model?(0,k.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground`,children:e.model}):null,i?(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-agent-transcript:${e.agentId}`,onClick:()=>t?.(e.agentId),className:`ml-auto inline-flex shrink-0 items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(l,{className:`size-3`,"aria-hidden":!0}),`Transcript`]}):null]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{className:o(`capitalize`,b(n)),children:e.state}),e.lastToolName?(0,k.jsxs)(`span`,{className:`truncate`,children:[`last: `,e.lastToolName]}):null,e.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,children:u(e.durationMs)}),e.tokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.tokens.toLocaleString(),` tok`]}),e.toolCalls==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.toolCalls,` calls`]})]}),e.lastToolSummary?(0,k.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,children:e.lastToolSummary}):null,e.promptPreview?(0,k.jsx)(L,{label:`Prompt`,text:e.promptPreview}):null,e.resultPreview?(0,k.jsx)(L,{label:`Result`,text:e.resultPreview}):null]})]})}function z({run:e,onSelectAgent:t,title:n}){let r=y(e.status),i=O(e.phases,e.agents);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n?(0,k.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:n}):null,(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(v,{status:e.status,pulse:!0}),e.durationMs==null?null:(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:u(e.durationMs)}),e.agentCount==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agentCount,` `,e.agentCount===1?`agent`:`agents`]}),e.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalTokens.toLocaleString(),` tokens`]}),e.totalToolCalls==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalToolCalls,` tool calls`]})]})]}),e.summary?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Summary`}),(0,k.jsx)(`p`,{className:`text-sm text-foreground whitespace-pre-wrap`,children:e.summary})]}):null,i.length>0?(0,k.jsx)(`section`,{className:`flex flex-col gap-4`,"data-testid":`workflow-progress-tree`,children:i.map(e=>(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.phaseIndex==null?null:(0,k.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground tabular-nums`,children:e.phaseIndex}),(0,k.jsx)(`h4`,{className:`text-xs font-semibold tracking-wide text-foreground`,children:e.title}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agents.length,` `,e.agents.length===1?`agent`:`agents`]})]}),e.detail?(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.detail}):null,e.agents.length>0?(0,k.jsx)(`ul`,{className:`ml-1.5 flex flex-col gap-0.5 border-l border-border pl-2.5`,children:e.agents.map(e=>(0,k.jsx)(R,{agent:e,onSelectAgent:t},e.agentId??e.index))}):(0,k.jsx)(`p`,{className:`ml-1.5 border-l border-border pl-2.5 text-xs italic text-muted-foreground/70`,children:`No agents yet`})]},e.key))}):null,e.result?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Result`}),(0,k.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:P(e.result)})]}):null,e.script?(0,k.jsxs)(`details`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium tracking-wide text-muted-foreground hover:text-foreground`,children:`Script`}),(0,k.jsx)(`pre`,{className:`mt-1.5 max-h-96 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:e.script})]}):null,e.error&&e.status!==`completed`?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:o(`text-xs font-medium tracking-wide`,b(r)),children:`Error`}),(0,k.jsx)(`p`,{className:`rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-sm text-destructive whitespace-pre-wrap`,children:e.error})]}):null]})}function B({runs:e,getRunDetail:t}){let n=T.useScopedStore(e=>e.selectedRun),o=T.useScopedStore(e=>e.selectedRunId),s=T.useScopedStore(e=>e.setSelectedRun),c=T.useScopedStore(e=>e.setSelectedRunId),l=T.useScopedStore(e=>e.clearSelection),u=n!==null,d=(0,w.useRef)(null),f=(0,w.useRef)(0),p=(0,w.useCallback)(n=>{d.current=e,c(n),s(`loading`);let o=++f.current,l=()=>f.current===o;t(n).then(e=>{l()&&s(e)},i(e=>{a.error(r,`workflows.getRun failed`,e),l()&&s(`failed`)}))},[t,e,s,c]),m=(0,w.useCallback)(()=>{l(),d.current=null},[l]);return(0,w.useEffect)(()=>{if(o===null||e===d.current)return;let n=e.find(e=>e.runId===o);if(!n||n.status!==`running`)return;let r=!1,i=++f.current;return _(`workflows.getRun refresh`,t(o).then(e=>{r||f.current!==i||e===null||s(e)})),()=>{r=!0}},[e,o,t,s]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(A,{runs:e,onSelectRun:p}),(0,k.jsx)(I,{run:n===`loading`||n===`failed`?null:n,failed:n===`failed`,open:u,onClose:m})]})}function V(e){return(0,k.jsx)(T.Provider,{init:void 0,children:(0,k.jsx)(B,{...e})})}export{C as i,A as n,V as r,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,H as t,I as n,k as r}from"./genui-
|
|
1
|
+
import{B as e,H as t,I as n,k as r}from"./genui-Bk-RFOJ9.js";var i=`Other`;function a(e,t){let n=t.map(t=>r(e.metrics[t])),[i]=n;return n.every(e=>e.format===i?.format&&e.currency===i?.currency)}function o(e,t,r,i){let a=e.dimensions?.[t];return a?.kind===`time`?n(i,r.grain??a.grain??`month`):i}function s(e,t){let n=[];for(let r of e){let e=r.dimensions[t];e!==void 0&&!n.includes(e)&&n.push(e)}return n}function c(e,t,n){let r=e.dimensions?.[t]?.order;return[...n].sort((e,t)=>{let n=r?r.indexOf(e):-1,i=r?r.indexOf(t):-1;return n===i?e.localeCompare(t,`en`,{numeric:!0}):n===-1?1:i===-1?-1:n-i})}function l(e,t,n,r){let i=new Map;for(let r of e){let e=r.dimensions[t]??``;i.set(e,(i.get(e)??0)+Math.abs(r.values[n]??0))}let a=[...i.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>e);return new Set(a.length>r+1?a.slice(0,r):a)}function u(n,i,a,c){let l=s(a.rows,n.dimension);return{kind:n.chart,xOrder:l,xLabels:Object.fromEntries(l.map(e=>[e,o(i,n.dimension,a,e)])),format:r(i.metrics[c]),valueLabel:t(c,i.metrics[c]),dimensionLabel:e(n.dimension,i.dimensions?.[n.dimension])}}function d(e,t,n){let[r]=e.metrics;if(!r)return{ok:!1,message:`A chart needs a metric`};if(!a(t,[...e.metrics,...e.secondaryMetric?[e.secondaryMetric]:[]]))return{ok:!1,message:`These metrics use different units, and a chart has one axis. Show them in two charts.`};switch(e.chart){case`waterfall`:return m(e,t,n,r);case`composition`:return h(e,t,n,r);case`combo`:return p(e,t,n,r);default:return f(e,t,n)}}function f(e,n,r){let[a=``]=e.metrics;if(e.chart===`stacked-bar`&&!e.series&&e.metrics.length<2)return{ok:!1,message:`A stacked bar needs a series dimension or at least two metrics to stack`};if(e.series&&e.metrics.length>1)return{ok:!1,message:`Split by a series dimension with one metric, or list several metrics without a series`};let o=u(e,n,r,a),d=[],f=[];if(e.series){let t=e.series,u=l(r.rows,t,a,7),p=c(n,t,[...u]),m=s(r.rows,t).some(e=>!u.has(e));p.forEach((e,t)=>f.push({id:e,label:e,role:`series`,slot:t})),m&&f.push({id:i,label:i,role:`series`,slot:p.length});let h=new Map;for(let n of r.rows){let r=n.dimensions[e.dimension],o=n.dimensions[t]??``,s=n.values[a];if(r===void 0||s==null)continue;let c=`${r}\u0001${u.has(o)?o:i}`;h.set(c,(h.get(c)??0)+s)}for(let[e,t]of h){let[n=``,r=``]=e.split(``);d.push({x:n,xLabel:o.xLabels[n]??n,series:r,value:t})}return{ok:!0,model:{...o,points:d,series:f}}}e.metrics.forEach((e,r)=>{f.push({id:e,label:t(e,n.metrics[e]),role:`series`,slot:r})}),r.comparison&&e.metrics.forEach(e=>{f.push({id:`${e}::compare`,label:`${t(e,n.metrics[e])} (${r.comparison?.label})`,role:`compare`,slot:null})});for(let t of r.rows){let n=t.dimensions[e.dimension];if(n!==void 0)for(let r of e.metrics){let e=t.values[r];e!=null&&d.push({x:n,xLabel:o.xLabels[n]??n,series:r,value:e});let i=t.compare?.[r];i!=null&&d.push({x:n,xLabel:o.xLabels[n]??n,series:`${r}::compare`,value:i})}}return{ok:!0,model:{...o,points:d,series:f}}}function p(e,n,r,i){if(!e.secondaryMetric)return{ok:!1,message:`A combo chart needs a secondaryMetric drawn as a line over the bars`};let a=e.secondaryMetric,o=u(e,n,r,i),s=[];for(let t of r.rows){let n=t.dimensions[e.dimension];if(n===void 0)continue;let r=t.values[i],c=t.values[a];r!=null&&s.push({x:n,xLabel:o.xLabels[n]??n,series:i,value:r}),c!=null&&s.push({x:n,xLabel:o.xLabels[n]??n,series:a,value:c})}return{ok:!0,model:{...o,points:s,series:[{id:i,label:t(i,n.metrics[i]),role:`series`,slot:0},{id:a,label:t(a,n.metrics[a]),role:`secondary`,slot:1}]}}}function m(e,t,n,r){if(e.series)return{ok:!1,message:`A waterfall shows one metric; drop the series dimension`};let i=u(e,t,n,r),a=[],o=0;for(let t of n.rows){let n=t.dimensions[e.dimension],s=t.values[r];if(n===void 0||s==null)continue;let c=o;o+=s,a.push({x:n,xLabel:i.xLabels[n]??n,series:s>=0?`increase`:`decrease`,value:s,start:c,end:o})}let s=e.totalLabel??`Total`;return a.push({x:s,xLabel:s,series:`total`,value:o,start:0,end:o}),{ok:!0,model:{...i,points:a,xOrder:[...a.map(e=>e.x)],xLabels:{...i.xLabels,[s]:s},series:[{id:`increase`,label:`Increase`,role:`increase`,slot:null},{id:`decrease`,label:`Decrease`,role:`decrease`,slot:null},{id:`total`,label:s,role:`total`,slot:null}]}}}function h(e,t,n,r){let a=u(e,t,n,r),o=n.rows.map(t=>({key:t.dimensions[e.dimension]??``,value:t.values[r]??0})).filter(e=>e.value!==0);if(o.some(e=>e.value<0))return{ok:!1,message:`A part-to-whole chart cannot show negative values; use a bar chart`};let s=[...o].sort((e,t)=>t.value-e.value),l=s.length>6?s.slice(0,5):s,d=s.slice(l.length).reduce((e,t)=>e+t.value,0),f=c(t,e.dimension,l.map(e=>e.key)),p=new Map(l.map(e=>[e.key,e.value])),m=f.map((e,t)=>({id:e,label:a.xLabels[e]??e,role:`series`,slot:t})),h=f.map(e=>({x:e,xLabel:a.xLabels[e]??e,series:e,value:p.get(e)??0}));return d>0&&(m.push({id:i,label:i,role:`series`,slot:f.length}),h.push({x:i,xLabel:i,series:i,value:d})),{ok:!0,model:{...a,points:h,series:m,xOrder:h.map(e=>e.x)}}}function g(e,t){if(!t||t.x===void 0)return null;let n=String(t.x);return!e.xOrder.includes(n)||e.kind===`waterfall`&&n===e.xOrder[e.xOrder.length-1]?null:{x:n,series:t.series===void 0?``:String(t.series)}}export{d as n,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./log-
|
|
1
|
+
import{d as e}from"./log-Divm5wOC.js";import{t}from"./timer.adapter-BUc1NRbm.js";import{t as n}from"./runDetached-2gt4-pgN.js";var r={blow:`/chat-sounds/Blow.mp3`,bottle:`/chat-sounds/Bottle.mp3`,frog:`/chat-sounds/Frog.mp3`,funk:`/chat-sounds/Funk.mp3`,glass:`/chat-sounds/Glass.mp3`,ping:`/chat-sounds/Ping.mp3`,pop:`/chat-sounds/Pop.mp3`,purr:`/chat-sounds/Purr.mp3`,tink:`/chat-sounds/Tink.mp3`};function i(t=e){return t.getVisibilityState()!==`visible`||!t.hasFocus()}function a(e){let t=new Audio(r[e]);return t.preload=`auto`,t.play()}async function o(e,r,i=t){if(r<=0)return;let o=Array.from({length:r},(t,r)=>new Promise(t=>{i.setTimeout(()=>{n(`chat sound`,a(e).finally(()=>t()))},r*90)}));await Promise.all(o)}function s(t,n=e){return t===`never`?!1:t===`always`||i(n)}export{s as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./pendingActionsStore-Cnarb0K6.js";var t={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-Cnarb0K6.js";var t={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};t.node;var n=e(t),r={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};r.node;var i=e(r),a={writeText(e){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API not available`)):navigator.clipboard.writeText(e)},readText(){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API not available`)):navigator.clipboard.readText()}};export{i as n,n as r,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./log-
|
|
1
|
+
import{c as e}from"./log-Divm5wOC.js";var t=[];function n(e,t){return`${e}:${t}`}var r=e()(e=>({boardsByOwner:{},viewByBoard:{},pageSizeByBoard:{},setBoards:(t,n)=>e(e=>({boardsByOwner:{...e.boardsByOwner,[t]:n}})),setBoardView:(t,n)=>e(e=>({viewByBoard:{...e.viewByBoard,[t]:n}})),growPage:t=>e(e=>{let n=e.viewByBoard[t];if(n&&!Object.values(n.cursors).some(e=>e!==null))return e;let r=e.pageSizeByBoard[t]??30;return{pageSizeByBoard:{...e.pageSizeByBoard,[t]:r+30}}}),clearBoardView:t=>e(e=>{if(!(t in e.viewByBoard))return e;let n={...e.viewByBoard};delete n[t];let r={...e.pageSizeByBoard};return delete r[t],{viewByBoard:n,pageSizeByBoard:r}})}));function i(e){return n=>n.boardsByOwner[e]??t}function a(e){return t=>t.viewByBoard[e]??null}function o(e){return t=>t.pageSizeByBoard[e]??30}var s={"muted-icon":`bg-muted-icon`,info:`bg-info`,success:`bg-success`,warning:`bg-warning`,destructive:`bg-destructive`};function c(e,t){return t!==null&&e>t}export{a,o as i,c as n,i as o,n as r,r as s,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{p as r}from"./log-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{p as r}from"./log-Divm5wOC.js";import{c as i,l as a,n as o}from"./state-mark-Foa-Y6ag.js";var s=e(t(),1),c=e=>Symbol.iterator in e,l=e=>`entries`in e,u=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},d=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function f(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:c(e)&&c(t)?l(e)&&l(t)?u(e,t):d(e,t):u({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function p(e){let t=s.useRef(void 0);return n=>{let r=e(n);return f(t.current,r)?t.current:t.current=r}}function m(e){if(e==null)return null;switch(typeof e){case`string`:case`boolean`:return e;case`number`:return Number.isFinite(e)?e:null}if(Array.isArray(e))return e.map(e=>m(e));if(r(e)){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=m(r));return t}return null}var h=e(n(),1);function g({tone:e,label:t}){return(0,h.jsx)(o,{tone:e,label:t})}function _({status:e}){return(0,h.jsx)(g,{tone:a(e),label:i(e)})}function v(e,t,n){let r=typeof e.maxTokens==`number`&&Number.isFinite(e.maxTokens)?e.maxTokens:null,i=r&&r>0?Math.min(100,e.usedTokens/r*100):null,a=r===null?null:Math.max(0,Math.round(r-e.usedTokens)),o=i===null?null:Math.max(0,100-i);return{...e,compactsAutomatically:e.compactsAutomatically||n,maxTokens:r??void 0,remainingTokens:a,usedPercentage:i,remainingPercentage:o,updatedAt:t}}function y(e){let t=e.some(e=>e.kind===`compact_boundary`||e.kind===`compact_summary`||e.kind===`context_cleared`);for(let n=e.length-1;n>=0;--n){let r=e[n];if(r&&!(r.kind!==`context_window_updated`||r.usage.usedTokens<=0))return v(r.usage,new Date(r.createdAt).toISOString(),t)}return null}function b(e,t){return!e||t===null||!Number.isFinite(t)||t<=0?e:v({...e,maxTokens:t},e.updatedAt,e.compactsAutomatically)}function x(e){return e===void 0||!Number.isFinite(e)||e<0?0:e}function S(e,t){let n=0,r=0,i=0,a=0;for(let t of e){if(t.kind!==`result`)continue;let e=t.usage;e&&(n+=x(e.inputTokens),r+=x(e.outputTokens),i+=x(e.cachedInputTokens)),a+=x(t.costUsd??e?.costUsd)}for(let e of t){let t=e.usage;t&&(n+=x(t.inputTokens),r+=x(t.outputTokens),i+=x(t.cachedInputTokens),a+=x(t.costUsd))}if(n===0&&r===0&&i===0&&a===0)return null;let o=n>0?i/n*100:null;return{inputTokens:n,outputTokens:r,cachedTokens:i,costUsd:a,cacheHitPercentage:o}}function C(e){return!Number.isFinite(e)||e<=0?`$0.00`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function w(e){return e==null||!Number.isFinite(e)?`0`:e<1e3?`${Math.round(e)}`:e<1e4?`${(e/1e3).toFixed(1).replace(/\.0$/,``)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,``)}m`}export{b as a,m as c,C as i,p as l,y as n,g as o,w as r,_ as s,S as t};
|