/** * Preact, vendored as SOURCE TEXT. * * The screen engine evaluates a real Preact inside a QuickJS WebAssembly VM * (see ./boot.ts). A VM cannot `import` — it evaluates strings — and this * module has to work in a browser bundle as well as in Node, so the runtime * cannot be read off disk either. So Preact's own prebuilt UMD files ride here * verbatim, as string constants: no network, no bundler asset, no `fs`. * * THE PIN. `preact` is pinned EXACTLY in packages/apps/package.json, and these * strings are a copy of that exact tarball. Two consequences: * - Bumping the pin without regenerating this file changes nothing at * runtime — the pin is documentation and the provenance of these bytes, * not the code path. Regenerate in the same commit as any bump. * - The engine reads one of Preact's MANGLED internals — `__k`, a vnode's * committed children — because the bytes it reads it out of are frozen * right here. See the emitter in ./vm-program.ts. * * Regenerate (from the repo root, after `pnpm install`): * node -e 'const{readFileSync,writeFileSync}=require("fs");const p=require.resolve("preact/package.json").replace(/package\.json$/,"");const v=require("preact/package.json").version;const s=f=>readFileSync(p+f,"utf8").replace(/\n?\/\/# sourceMappingURL=.*\n?$/,"\n");const f="packages/apps/src/contract/genui/component/preact-source.ts";const t=readFileSync(f,"utf8");writeFileSync(f,t.replace(/(PREACT_VERSION = )"[^"]*"/,`$1"${v}"`).replace(/(PREACT_SOURCE = )"(?:[^"\\]|\\.)*"/,`$1${JSON.stringify(s("dist/preact.umd.js"))}`).replace(/(PREACT_HOOKS_SOURCE = )"(?:[^"\\]|\\.)*"/,`$1${JSON.stringify(s("hooks/dist/hooks.umd.js"))}`).replace(/(PREACT_JSX_RUNTIME_SOURCE = )"(?:[^"\\]|\\.)*"/,`$1${JSON.stringify(s("jsx-runtime/dist/jsxRuntime.umd.js"))}`))' * * Each string is one UMD build with its trailing sourceMappingURL comment * removed (the map is not shipped, and a dangling reference inside the VM is * noise). Every build takes the global branch of its UMD prelude inside the * VM — no `module`, no `define` — so they publish `globalThis.preact`, * `globalThis.preactHooks` and `globalThis.jsxRuntime`. */ /** The pinned Preact these strings were copied from. */ export declare const PREACT_VERSION = "10.24.3"; /** `preact` — dist/preact.umd.js, 11512 bytes, publishes `globalThis.preact`. */ export declare const PREACT_SOURCE = "!function(n,l){\"object\"==typeof exports&&\"undefined\"!=typeof module?l(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],l):l((n||self).preact={})}(this,function(n){var l,t,u,i,o,e,r,f,c,s,h,a,p=65536,v=1<<17,d={},y=[],w=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function g(n,l){for(var t in l)n[t]=l[t];return n}function b(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function m(n,t,u){var i,o,e,r={};for(e in t)\"key\"==e?i=t[e]:\"ref\"==e?o=t[e]:r[e]=t[e];if(arguments.length>2&&(r.children=arguments.length>3?l.call(arguments,2):u),\"function\"==typeof n&&null!=n.defaultProps)for(e in n.defaultProps)void 0===r[e]&&(r[e]=n.defaultProps[e]);return k(n,r,i,o,null)}function k(n,l,i,o,e){var r={type:n,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==e?++u:e,__i:-1,__u:0};return null==e&&null!=t.vnode&&t.vnode(r),r}function x(n){return n.children}function S(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var t;ll&&o.sort(f));T.__r=0}function $(n,l,t,u,i,o,e,r,f,c,s){var h,a,v,w,_,g=u&&u.__k||y,b=l.length;for(t.__d=f,I(t,l,g),f=t.__d,h=0;h0?k(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(r=i.__i=L(i,t,e,s))&&(s--,(o=t[r])&&(o.__u|=v)),null==o||null===o.__v?(-1==r&&h--,\"function\"!=typeof i.type&&(i.__u|=p)):r!==e&&(r==e-1?h--:r==e+1?h++:(r>e?h--:h++,i.__u|=p))):i=n.__k[u]=null;if(s)for(u=0;u(null!=f&&0==(f.__u&v)?1:0))for(;e>=0||r=0){if((f=l[e])&&0==(f.__u&v)&&i==f.key&&o===f.type)return e;e--}if(r2&&(f.children=arguments.length>3?l.call(arguments,2):u),k(n.type,f,i||n.key,o||n.ref,null)},n.createContext=function(n,l){var t={__c:l=\"__cC\"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.forEach(function(n){n.__e=!0,P(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t},n.createElement=m,n.createRef=function(){return{current:null}},n.h=m,n.hydrate=function n(l,t){D(l,t,n)},n.isValidElement=i,n.options=t,n.render=D,n.toChildArray=function n(l,t){return t=t||[],null==l||\"boolean\"==typeof l||(_(l)?l.some(function(l){n(l,t)}):t.push(l)),t}});\n"; /** `preact/hooks` — dist/hooks.umd.js, 3844 bytes, publishes `globalThis.preactHooks`. */ export declare const PREACT_HOOKS_SOURCE = "!function(n,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports,require(\"preact\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"preact\"],t):t((n||self).preactHooks={},n.preact)}(this,function(n,t){var u,r,i,o,f=0,c=[],e=t.options,a=e.__b,v=e.__r,l=e.diffed,d=e.__c,s=e.unmount,p=e.__;function h(n,t){e.__h&&e.__h(r,n,f||t),f=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function y(n){return f=1,m(j,n)}function m(n,t,i){var o=h(u++,2);if(o.t=n,!o.__c&&(o.__=[i?i(t):j(void 0,t),function(n){var t=o.__N?o.__N[0]:o.__[0],u=o.t(t,n);t!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,u){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter(function(n){return!!n.__c});if(r.every(function(n){return!n.__N}))return!c||c.call(this,n,t,u);var i=!1;return r.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,u))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,u){if(this.__e){var r=c;c=void 0,f(n,t,u),c=r}e&&e.call(this,n,t,u)},r.shouldComponentUpdate=f}return o.__N||o.__}function T(n,t){var i=h(u++,4);!e.__s&&g(i.__H,t)&&(i.__=n,i.i=t,r.__h.push(i))}function _(n,t){var r=h(u++,7);return g(r.__H,t)&&(r.__=n(),r.__H=t,r.__h=n),r.__}function b(){for(var n;n=c.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(A),n.__H.__h.forEach(F),n.__H.__h=[]}catch(t){n.__H.__h=[],e.__e(t,n.__v)}}e.__b=function(n){r=null,a&&a(n)},e.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t)},e.__r=function(n){v&&v(n),u=0;var t=(r=n.__c).__H;t&&(i===r?(t.__h=[],r.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(A),t.__h.forEach(F),t.__h=[],u=0)),i=r},e.diffed=function(n){l&&l(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&o===e.requestAnimationFrame||((o=e.requestAnimationFrame)||x)(b)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),i=r=null},e.__c=function(n,t){t.some(function(n){try{n.__h.forEach(A),n.__h=n.__h.filter(function(n){return!n.__||F(n)})}catch(u){t.some(function(n){n.__h&&(n.__h=[])}),t=[],e.__e(u,n.__v)}}),d&&d(n,t)},e.unmount=function(n){s&&s(n);var t,u=n.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{A(n)}catch(n){t=n}}),u.__H=void 0,t&&e.__e(t,u.__v))};var q=\"function\"==typeof requestAnimationFrame;function x(n){var t,u=function(){clearTimeout(r),q&&cancelAnimationFrame(t),setTimeout(n)},r=setTimeout(u,100);q&&(t=requestAnimationFrame(u))}function A(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function F(n){var t=r;n.__c=n.__(),r=t}function g(n,t){return!n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function j(n,t){return\"function\"==typeof t?t(n):t}n.useCallback=function(n,t){return f=8,_(function(){return n},t)},n.useContext=function(n){var t=r.context[n.__c],i=h(u++,9);return i.c=n,t?(null==i.__&&(i.__=!0,t.sub(r)),t.props.value):n.__},n.useDebugValue=function(n,t){e.useDebugValue&&e.useDebugValue(t?t(n):n)},n.useEffect=function(n,t){var i=h(u++,3);!e.__s&&g(i.__H,t)&&(i.__=n,i.i=t,r.__H.__h.push(i))},n.useErrorBoundary=function(n){var t=h(u++,10),i=y();return t.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,u){t.__&&t.__(n,u),i[1](n)}),[i[0],function(){i[1](void 0)}]},n.useId=function(){var n=h(u++,11);if(!n.__){for(var t=r.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var i=t.__m||(t.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__},n.useImperativeHandle=function(n,t,u){f=6,T(function(){return\"function\"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==u?u:u.concat(n))},n.useLayoutEffect=T,n.useMemo=_,n.useReducer=m,n.useRef=function(n){return f=5,_(function(){return{current:n}},[])},n.useState=y});\n"; /** `preact/jsx-runtime` — dist/jsxRuntime.umd.js, 1920 bytes, publishes `globalThis.jsxRuntime`. */ export declare const PREACT_JSX_RUNTIME_SOURCE = "!function(e,r){\"object\"==typeof exports&&\"undefined\"!=typeof module?r(exports,require(\"preact\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"preact\"],r):r((e||self).jsxRuntime={},e.preact)}(this,function(e,r){var n=/[\"&<]/;function t(e){if(0===e.length||!1===n.test(e))return e;for(var r=0,t=0,o=\"\",f=\"\";t