Files
GenericAgent/frontends/desktop/dist/assets/Animation-DbFrgT1j.js
T
YI QI LIMandabraxas914 efb3bc6ad1 feat(desktop): compiled React Desktop 2.0 v0.2.1 renderer update (#787)
* fix(desktop): expose explicit backup capabilities

* fix(desktop): align titlebar controls with native metrics

* release(desktop): prepare portable v0.2.1

* build(desktop): rebuild compiled dist from source 4a67226

Rebuild the compiled-only React Desktop 2.0 renderer from abraxas914/GenericAgent
main @4a67226, carrying the v0.2.1 iterations that PR #784 was closed to await:
live turn-timer persistence across session switch, Mixin image-to-path fallback,
folder drag-drop, per-turn duration, and image-thumbnail repair.

- dist/**: regenerated 98 manifest assets + entry HTML
- build-provenance.json: sourceCommit -> 4a67226, manifest sha256 recomputed
- verify-compiled-dist.mjs: expectedSourceCommit -> 4a67226
- dist/README.md: provenance source commit updated
- desktop_bridge.py, test_bridge_origin_security.py: synced to 4a67226
- core (agentmain.py, llmcore*, src/**, public/**) remains zero-diff vs upstream

---------

Co-authored-by: abraxas914 <abraxas345589144233@outlook.com>
2026-08-30 14:21:51 +08:00

2 lines
8.8 KiB
JavaScript

import{g as q}from"./tauri-compat-D_GD_wMe.js";var x,P;function Q(){if(P)return x;P=1;var i=4,t=.001,e=1e-7,s=10,n=11,a=1/(n-1),c=typeof Float32Array=="function";function l(u,o){return 1-3*o+3*u}function g(u,o){return 3*o-6*u}function T(u){return 3*u}function r(u,o,f){return((l(o,f)*u+g(o,f))*u+T(o))*u}function h(u,o,f){return 3*l(o,f)*u*u+2*g(o,f)*u+T(o)}function C(u,o,f,p,y){var m,_,F=0;do _=o+(f-o)/2,m=r(_,p,y)-u,m>0?f=_:o=_;while(Math.abs(m)>e&&++F<s);return _}function b(u,o,f,p){for(var y=0;y<i;++y){var m=h(o,f,p);if(m===0)return o;var _=r(o,f,p)-u;o-=_/m}return o}function d(u){return u}return x=function(o,f,p,y){if(!(0<=o&&o<=1&&0<=p&&p<=1))throw new Error("bezier x values must be in [0, 1] range");if(o===f&&p===y)return d;for(var m=c?new Float32Array(n):new Array(n),_=0;_<n;++_)m[_]=r(_*a,o,p);function F(v){for(var S=0,j=1,R=n-1;j!==R&&m[j]<=v;++j)S+=a;--j;var U=(v-m[j])/(m[j+1]-m[j]),A=S+U*a,k=h(A,o,p);return k>=t?b(v,A,o,p):k===0?A:C(v,S,S+a,o,p)}return function(S){return S===0?0:S===1?1:r(F(S),f,y)}},x}var K=Q();const z=q(K);function B(i,t,e){return Math.min(Math.max(i,t),e)}function W(i){const t=/\(([^)]+)\)/.exec(i);return t?t[1].split(",").map(e=>parseFloat(e)):[]}function V(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5;const e=B(i,1,10),s=B(t,.1,2);return n=>n===0||n===1?n:-e*Math.pow(2,10*(n-1))*Math.sin((n-1-s/(Math.PI*2)*Math.asin(1/e))*(Math.PI*2)/s)}const N=(()=>{const i=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],t={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],V],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],(s,n)=>a=>1-V(s,n)(1-a)],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],(s,n)=>a=>a<.5?V(s,n)(a*2)/2:1-V(s,n)(a*-2+2)/2]},e={linear:[.25,.25,.75,.75]};for(const s of Object.keys(t))t[s].forEach((n,a)=>{e["ease"+s+i[a]]=n});return e})();function D(i){if(typeof i=="function")return i;!i||typeof i!="string"?i="linear":i=i.trim();let t=i.split("(")[0];const e=W(i);let s;return t==="cubic-bezier"||t==="cubicBezier"?z(...e.length?e:N.linear):((!t||typeof t!="string"||typeof t=="string"&&N[t]==null)&&(t="linear"),s=N[t],typeof s=="function"?s(...e):e.length?z(...e):z(...s))}class Z{constructor(){this._eventMap=new Map}on(t,e){return t&&typeof e=="function"&&(this._eventMap.has(t)||this._eventMap.set(t,[]),this._eventMap.get(t).push(e)),this}once(t,e){var s=this;if(t&&typeof e=="function"){const n=function(){e(...arguments),s.off(t,n)};this.on(t,n)}}off(t,e){if(t)if(typeof e=="function"){const s=this._eventMap.get(t);if(Array.isArray(s)&&s.length){let n=-1;for(;(n=s.findIndex(a=>a===e))>-1;)s.splice(n,1)}}else e==null&&this._eventMap.delete(t);return this}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this._eventMap.has(t)?(this._eventMap.get(t).forEach(a=>a(...s)),!0):!1}}function M(i){return!!(i&&typeof i=="object"&&(i.duration>0||typeof i.easing=="string"||typeof i.easing=="function"))}function H(i,t,e,s,n){for(const a of Object.keys(t)){const c=t[a],l=typeof c=="number"?c:c.val;if(!(typeof c=="object"&&c.done)){if(M(c)&&s&&n&&c.duration){if(c.duration+s<=n||l!==i[a])return!1}else if(typeof e[a]=="number"&&e[a]!==0)return!1;if(i[a]!==l)return!1}}return!0}function E(i){const t={};for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=typeof i[e]=="number"?i[e]:i[e].val);return t}const I=[0,0];function L(i,t,e,s,n,a,c){const l=-n*(t-s),g=-a*e,T=l+g,r=e+T*i,h=t+r*i;return Math.abs(r)<c&&Math.abs(h-s)<c?(I[0]=s,I[1]=0,I):(I[0]=h,I[1]=r,I)}function J(i){const t={},e=i&&Object.keys(i)||[];for(const s of e)t[s]=0;return t}const $={default:{tension:170,friction:26}},Y=Object.assign(Object.assign({},$.default),{precision:.01});function G(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(t)){const s=D(t.easing),n=typeof t.duration=="number"&&t.duration>0?t.duration:1e3;t=Object.assign(Object.assign({},t),{easing:s,duration:n})}let e=Object.assign(Object.assign(Object.assign({},Y),t),{done:!1});if(i&&typeof i=="object"&&"val"in i){if(M(i)){const s=D(i.easing),n=typeof i.duration=="number"&&i.duration>0?i.duration:parseInt(t.duration)||1e3;i=Object.assign(Object.assign({},i),{easing:s,duration:n})}e=Object.assign(Object.assign({},e),i)}else e=Object.assign(Object.assign({},e),{val:i});return e}const w=()=>Date.now(),O=1e3/60;class tt extends Z{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),this._props=Object.assign({},t),this._config=Object.assign({},e),this.initStates()}_wrapConfig(t,e){e=e&&typeof e=="object"?e:this._config;const s={};for(const n of Object.keys(t))s[n]=G(t[n],e);return s}initStates(t,e){t=t&&typeof t=="object"?t:this._props,e=e&&typeof e=="object"?e:this._config;const{from:s,to:n}=t;if(this._from={},s)for(const l of Object.keys(s))this._from[l]=typeof s[l]=="object"&&s[l].val?s[l].val:s[l];this._to=this._wrapConfig(n,e),this._delay=parseInt(e.delay)||0;const a=this._from&&E(this._from)||E(this._to),c=J(a);this._currentStyle=Object.assign({},a),this._currentVelocity=Object.assign({},c),this._lastIdealStyle=Object.assign({},a),this._lastIdealVelocity=Object.assign({},c),this.resetPlayStates(),this._frameCount=0,this._prevTime=0}animate(){this._timer==null&&(this._timer=requestAnimationFrame(t=>{const e=w();if(H(this._currentStyle,this._to,this._currentVelocity,this._startedTime||e,e)||this._ended||this._stopped){this._wasAnimating&&!this._ended&&!this._stopped&&(this._timer=setTimeout(()=>{clearTimeout(this._timer),this._timer=null,this._ended=!0,this.emit("rest",this.getCurrentStates())},O)),this.resetPlayStates();return}this._started||(this._started=!0,this.emit("start",this.getCurrentStates())),this._stopped=!1,this._paused=!1,this._wasAnimating=!0,this._startedTime===0&&(this._startedTime=e);const s=e,n=s-this._prevTime;this._prevTime=s,s-this._startedTime<this._delay&&(this._timer=null,this.animate());const a={},c={},l={},g={},T=this._to&&Object.keys(this._to)||[];for(const r of T){const h=this._to[r];this._accumulatedTime[r]=typeof this._accumulatedTime[r]!="number"?n:this._accumulatedTime[r]+n;const C=this._from[r]!=null&&typeof this._from[r]=="object"?this._from[r].val:this._from[r],b=h.val;if(typeof h=="number")l[r]=h,g[r]=0,a[r]=h,c[r]=0;else{let d=this._lastIdealStyle[r],u=this._lastIdealVelocity[r];if(M(this._config)||M(h)){const{easing:o,duration:f}=h;d=C+o((s-this._startedTime)/f)*(b-C),s>=this._startedTime+f&&(d=b,h.done=!0),a[r]=d,l[r]=d}else if(b!=null&&b===this._currentStyle[r])l[r]=b,g[r]=0,a[r]=b,c[r]=0;else{const o=(this._accumulatedTime[r]-Math.floor(this._accumulatedTime[r]/O)*O)/O,f=Math.floor(this._accumulatedTime[r]/O);for(let m=0;m<f;m++)[d,u]=L(O/1e3,d,u,h.val,h.tension,h.friction,h.precision);const[p,y]=L(O/1e3,d,u,h.val,h.tension,h.friction,h.precision);l[r]=d+(p-d)*o,g[r]=u+(y-u)*o,a[r]=d,c[r]=u,this._accumulatedTime[r]-=f*O}}}this._timer=null,this._currentStyle=Object.assign({},l),this._currentVelocity=Object.assign({},g),this._lastIdealStyle=Object.assign({},a),this._lastIdealVelocity=Object.assign({},c),this._destroyed||(this.emit("frame",this.getCurrentStates()),this.animate())}))}start(){this._prevTime=w(),this._startedTime=w(),this.animate()}end(){this._ended||(this._ended=!0,this._currentStyle=this.getFinalStates(),this.emit("frame",this.getFinalStates()),this.emit("rest",this.getFinalStates())),this.destroy()}pause(){this._paused||(this._pausedTime=w(),this._paused=!0,this.emit("pause",this.getCurrentStates()),this.destroy(),this._destroyed=!1)}resume(){if(this._started&&this._paused){const e=w()-this._pausedTime;this._paused=!1,this._startedTime+=e,this._prevTime+=e,this._pausedTime=0,this.emit("resume",this.getCurrentStates()),this.animate()}}stop(){this.destroy(),this._stopped||(this._stopped=!0,this.emit("stop",this.getInitialStates()),this.initStates())}destroy(){cancelAnimationFrame(this._timer),clearTimeout(this._timer),this._timer=null,this._destroyed=!0}resetPlayStates(){this._started=!1,this._stopped=!1,this._ended=!1,this._paused=!1,this._destroyed=!1,this._timer=null,this._wasAnimating=!1,this._accumulatedTime={},this._startedTime=0,this._pausedTime=0}reset(){this.destroy(),this.initStates()}reverse(){this.destroy();const t=Object.assign({},this._props),[e,s]=[t.to,t.from];t.from=e,t.to=s,this._props=Object.assign({},t),this.initStates()}getCurrentStates(){return Object.assign({},this._currentStyle)}getInitialStates(){return Object.assign({},E(this._props.from))}getFinalStates(){return Object.assign({},E(this._props.to))}}export{tt as A};