├── .gitignore ├── cjs-call.js ├── README.md ├── package.json └── dist ├── cjs-call.js └── chunk.MVS7IV5O.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /cjs-call.js: -------------------------------------------------------------------------------- 1 | const preact = require('preact') 2 | 3 | module.exports = preact.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | node build.js 3 | ``` 4 | 5 | See `dist/node_modules/preact/dist/preact.module.js` -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "esbuild": "^0.8.34", 4 | "preact": "^10.5.11" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /dist/cjs-call.js: -------------------------------------------------------------------------------- 1 | import { 2 | __commonJS, 3 | require_preact_module 4 | } from "./chunk.MVS7IV5O.js"; 5 | 6 | // cjs-call.js 7 | var require_cjs_call = __commonJS((exports, module) => { 8 | var preact = require_preact_module(); 9 | module.exports = preact.h; 10 | }); 11 | export default require_cjs_call(); 12 | -------------------------------------------------------------------------------- /dist/chunk.MVS7IV5O.js: -------------------------------------------------------------------------------- 1 | var __defProp = Object.defineProperty; 2 | var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); 3 | var __commonJS = (callback, module) => () => { 4 | if (!module) { 5 | module = {exports: {}}; 6 | callback(module.exports, module); 7 | } 8 | return module.exports; 9 | }; 10 | var __export = (target, all) => { 11 | __markAsModule(target); 12 | for (var name in all) 13 | __defProp(target, name, {get: all[name], enumerable: true}); 14 | }; 15 | 16 | // node_modules/preact/dist/preact.module.js 17 | var require_preact_module = __commonJS((exports) => { 18 | __export(exports, { 19 | Component: () => p, 20 | Fragment: () => y, 21 | cloneElement: () => S, 22 | createContext: () => q, 23 | createElement: () => a, 24 | createRef: () => h, 25 | h: () => a, 26 | hydrate: () => O, 27 | isValidElement: () => l, 28 | options: () => n, 29 | render: () => N, 30 | toChildArray: () => w 31 | }); 32 | var n; 33 | var l; 34 | var u; 35 | var i; 36 | var t; 37 | var r; 38 | var o = {}; 39 | var f = []; 40 | var e = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i; 41 | function c(n2, l2) { 42 | for (var u2 in l2) 43 | n2[u2] = l2[u2]; 44 | return n2; 45 | } 46 | function s(n2) { 47 | var l2 = n2.parentNode; 48 | l2 && l2.removeChild(n2); 49 | } 50 | function a(n2, l2, u2) { 51 | var i2, t2, r2, o2 = arguments, f2 = {}; 52 | for (r2 in l2) 53 | r2 == "key" ? i2 = l2[r2] : r2 == "ref" ? t2 = l2[r2] : f2[r2] = l2[r2]; 54 | if (arguments.length > 3) 55 | for (u2 = [u2], r2 = 3; r2 < arguments.length; r2++) 56 | u2.push(o2[r2]); 57 | if (u2 != null && (f2.children = u2), typeof n2 == "function" && n2.defaultProps != null) 58 | for (r2 in n2.defaultProps) 59 | f2[r2] === void 0 && (f2[r2] = n2.defaultProps[r2]); 60 | return v(n2, f2, i2, t2, null); 61 | } 62 | function v(l2, u2, i2, t2, r2) { 63 | var o2 = {type: l2, props: u2, key: i2, ref: t2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: r2 == null ? ++n.__v : r2}; 64 | return n.vnode != null && n.vnode(o2), o2; 65 | } 66 | function h() { 67 | return {current: null}; 68 | } 69 | function y(n2) { 70 | return n2.children; 71 | } 72 | function p(n2, l2) { 73 | this.props = n2, this.context = l2; 74 | } 75 | function d(n2, l2) { 76 | if (l2 == null) 77 | return n2.__ ? d(n2.__, n2.__.__k.indexOf(n2) + 1) : null; 78 | for (var u2; l2 < n2.__k.length; l2++) 79 | if ((u2 = n2.__k[l2]) != null && u2.__e != null) 80 | return u2.__e; 81 | return typeof n2.type == "function" ? d(n2) : null; 82 | } 83 | function _(n2) { 84 | var l2, u2; 85 | if ((n2 = n2.__) != null && n2.__c != null) { 86 | for (n2.__e = n2.__c.base = null, l2 = 0; l2 < n2.__k.length; l2++) 87 | if ((u2 = n2.__k[l2]) != null && u2.__e != null) { 88 | n2.__e = n2.__c.base = u2.__e; 89 | break; 90 | } 91 | return _(n2); 92 | } 93 | } 94 | function k(l2) { 95 | (!l2.__d && (l2.__d = true) && u.push(l2) && !m.__r++ || t !== n.debounceRendering) && ((t = n.debounceRendering) || i)(m); 96 | } 97 | function m() { 98 | for (var n2; m.__r = u.length; ) 99 | n2 = u.sort(function(n3, l2) { 100 | return n3.__v.__b - l2.__v.__b; 101 | }), u = [], n2.some(function(n3) { 102 | var l2, u2, i2, t2, r2, o2; 103 | n3.__d && (r2 = (t2 = (l2 = n3).__v).__e, (o2 = l2.__P) && (u2 = [], (i2 = c({}, t2)).__v = t2.__v + 1, T(o2, t2, i2, l2.__n, o2.ownerSVGElement !== void 0, t2.__h != null ? [r2] : null, u2, r2 == null ? d(t2) : r2, t2.__h), j(u2, t2), t2.__e != r2 && _(t2))); 104 | }); 105 | } 106 | function b(n2, l2, u2, i2, t2, r2, e2, c2, s2, a2) { 107 | var h2, p2, _2, k2, m2, b2, w2, A2 = i2 && i2.__k || f, P2 = A2.length; 108 | for (u2.__k = [], h2 = 0; h2 < l2.length; h2++) 109 | if ((k2 = u2.__k[h2] = (k2 = l2[h2]) == null || typeof k2 == "boolean" ? null : typeof k2 == "string" || typeof k2 == "number" ? v(null, k2, null, null, k2) : Array.isArray(k2) ? v(y, {children: k2}, null, null, null) : k2.__b > 0 ? v(k2.type, k2.props, k2.key, null, k2.__v) : k2) != null) { 110 | if (k2.__ = u2, k2.__b = u2.__b + 1, (_2 = A2[h2]) === null || _2 && k2.key == _2.key && k2.type === _2.type) 111 | A2[h2] = void 0; 112 | else 113 | for (p2 = 0; p2 < P2; p2++) { 114 | if ((_2 = A2[p2]) && k2.key == _2.key && k2.type === _2.type) { 115 | A2[p2] = void 0; 116 | break; 117 | } 118 | _2 = null; 119 | } 120 | T(n2, k2, _2 = _2 || o, t2, r2, e2, c2, s2, a2), m2 = k2.__e, (p2 = k2.ref) && _2.ref != p2 && (w2 || (w2 = []), _2.ref && w2.push(_2.ref, null, k2), w2.push(p2, k2.__c || m2, k2)), m2 != null ? (b2 == null && (b2 = m2), typeof k2.type == "function" && k2.__k != null && k2.__k === _2.__k ? k2.__d = s2 = g(k2, s2, n2) : s2 = x(n2, k2, _2, A2, m2, s2), a2 || u2.type !== "option" ? typeof u2.type == "function" && (u2.__d = s2) : n2.value = "") : s2 && _2.__e == s2 && s2.parentNode != n2 && (s2 = d(_2)); 121 | } 122 | for (u2.__e = b2, h2 = P2; h2--; ) 123 | A2[h2] != null && (typeof u2.type == "function" && A2[h2].__e != null && A2[h2].__e == u2.__d && (u2.__d = d(i2, h2 + 1)), L(A2[h2], A2[h2])); 124 | if (w2) 125 | for (h2 = 0; h2 < w2.length; h2++) 126 | I(w2[h2], w2[++h2], w2[++h2]); 127 | } 128 | function g(n2, l2, u2) { 129 | var i2, t2; 130 | for (i2 = 0; i2 < n2.__k.length; i2++) 131 | (t2 = n2.__k[i2]) && (t2.__ = n2, l2 = typeof t2.type == "function" ? g(t2, l2, u2) : x(u2, t2, t2, n2.__k, t2.__e, l2)); 132 | return l2; 133 | } 134 | function w(n2, l2) { 135 | return l2 = l2 || [], n2 == null || typeof n2 == "boolean" || (Array.isArray(n2) ? n2.some(function(n3) { 136 | w(n3, l2); 137 | }) : l2.push(n2)), l2; 138 | } 139 | function x(n2, l2, u2, i2, t2, r2) { 140 | var o2, f2, e2; 141 | if (l2.__d !== void 0) 142 | o2 = l2.__d, l2.__d = void 0; 143 | else if (u2 == null || t2 != r2 || t2.parentNode == null) 144 | n: 145 | if (r2 == null || r2.parentNode !== n2) 146 | n2.appendChild(t2), o2 = null; 147 | else { 148 | for (f2 = r2, e2 = 0; (f2 = f2.nextSibling) && e2 < i2.length; e2 += 2) 149 | if (f2 == t2) 150 | break n; 151 | n2.insertBefore(t2, r2), o2 = r2; 152 | } 153 | return o2 !== void 0 ? o2 : t2.nextSibling; 154 | } 155 | function A(n2, l2, u2, i2, t2) { 156 | var r2; 157 | for (r2 in u2) 158 | r2 === "children" || r2 === "key" || r2 in l2 || C(n2, r2, null, u2[r2], i2); 159 | for (r2 in l2) 160 | t2 && typeof l2[r2] != "function" || r2 === "children" || r2 === "key" || r2 === "value" || r2 === "checked" || u2[r2] === l2[r2] || C(n2, r2, l2[r2], u2[r2], i2); 161 | } 162 | function P(n2, l2, u2) { 163 | l2[0] === "-" ? n2.setProperty(l2, u2) : n2[l2] = u2 == null ? "" : typeof u2 != "number" || e.test(l2) ? u2 : u2 + "px"; 164 | } 165 | function C(n2, l2, u2, i2, t2) { 166 | var r2; 167 | n: 168 | if (l2 === "style") 169 | if (typeof u2 == "string") 170 | n2.style.cssText = u2; 171 | else { 172 | if (typeof i2 == "string" && (n2.style.cssText = i2 = ""), i2) 173 | for (l2 in i2) 174 | u2 && l2 in u2 || P(n2.style, l2, ""); 175 | if (u2) 176 | for (l2 in u2) 177 | i2 && u2[l2] === i2[l2] || P(n2.style, l2, u2[l2]); 178 | } 179 | else if (l2[0] === "o" && l2[1] === "n") 180 | r2 = l2 !== (l2 = l2.replace(/Capture$/, "")), l2 = l2.toLowerCase() in n2 ? l2.toLowerCase().slice(2) : l2.slice(2), n2.l || (n2.l = {}), n2.l[l2 + r2] = u2, u2 ? i2 || n2.addEventListener(l2, r2 ? H : $, r2) : n2.removeEventListener(l2, r2 ? H : $, r2); 181 | else if (l2 !== "dangerouslySetInnerHTML") { 182 | if (t2) 183 | l2 = l2.replace(/xlink[H:h]/, "h").replace(/sName$/, "s"); 184 | else if (l2 !== "href" && l2 !== "list" && l2 !== "form" && l2 !== "download" && l2 in n2) 185 | try { 186 | n2[l2] = u2 == null ? "" : u2; 187 | break n; 188 | } catch (n3) { 189 | } 190 | typeof u2 == "function" || (u2 != null && (u2 !== false || l2[0] === "a" && l2[1] === "r") ? n2.setAttribute(l2, u2) : n2.removeAttribute(l2)); 191 | } 192 | } 193 | function $(l2) { 194 | this.l[l2.type + false](n.event ? n.event(l2) : l2); 195 | } 196 | function H(l2) { 197 | this.l[l2.type + true](n.event ? n.event(l2) : l2); 198 | } 199 | function T(l2, u2, i2, t2, r2, o2, f2, e2, s2) { 200 | var a2, v2, h2, d2, _2, k2, m2, g2, w2, x2, A2, P2 = u2.type; 201 | if (u2.constructor !== void 0) 202 | return null; 203 | i2.__h != null && (s2 = i2.__h, e2 = u2.__e = i2.__e, u2.__h = null, o2 = [e2]), (a2 = n.__b) && a2(u2); 204 | try { 205 | n: 206 | if (typeof P2 == "function") { 207 | if (g2 = u2.props, w2 = (a2 = P2.contextType) && t2[a2.__c], x2 = a2 ? w2 ? w2.props.value : a2.__ : t2, i2.__c ? m2 = (v2 = u2.__c = i2.__c).__ = v2.__E : ("prototype" in P2 && P2.prototype.render ? u2.__c = v2 = new P2(g2, x2) : (u2.__c = v2 = new p(g2, x2), v2.constructor = P2, v2.render = M), w2 && w2.sub(v2), v2.props = g2, v2.state || (v2.state = {}), v2.context = x2, v2.__n = t2, h2 = v2.__d = true, v2.__h = []), v2.__s == null && (v2.__s = v2.state), P2.getDerivedStateFromProps != null && (v2.__s == v2.state && (v2.__s = c({}, v2.__s)), c(v2.__s, P2.getDerivedStateFromProps(g2, v2.__s))), d2 = v2.props, _2 = v2.state, h2) 208 | P2.getDerivedStateFromProps == null && v2.componentWillMount != null && v2.componentWillMount(), v2.componentDidMount != null && v2.__h.push(v2.componentDidMount); 209 | else { 210 | if (P2.getDerivedStateFromProps == null && g2 !== d2 && v2.componentWillReceiveProps != null && v2.componentWillReceiveProps(g2, x2), !v2.__e && v2.shouldComponentUpdate != null && v2.shouldComponentUpdate(g2, v2.__s, x2) === false || u2.__v === i2.__v) { 211 | v2.props = g2, v2.state = v2.__s, u2.__v !== i2.__v && (v2.__d = false), v2.__v = u2, u2.__e = i2.__e, u2.__k = i2.__k, v2.__h.length && f2.push(v2); 212 | break n; 213 | } 214 | v2.componentWillUpdate != null && v2.componentWillUpdate(g2, v2.__s, x2), v2.componentDidUpdate != null && v2.__h.push(function() { 215 | v2.componentDidUpdate(d2, _2, k2); 216 | }); 217 | } 218 | v2.context = x2, v2.props = g2, v2.state = v2.__s, (a2 = n.__r) && a2(u2), v2.__d = false, v2.__v = u2, v2.__P = l2, a2 = v2.render(v2.props, v2.state, v2.context), v2.state = v2.__s, v2.getChildContext != null && (t2 = c(c({}, t2), v2.getChildContext())), h2 || v2.getSnapshotBeforeUpdate == null || (k2 = v2.getSnapshotBeforeUpdate(d2, _2)), A2 = a2 != null && a2.type === y && a2.key == null ? a2.props.children : a2, b(l2, Array.isArray(A2) ? A2 : [A2], u2, i2, t2, r2, o2, f2, e2, s2), v2.base = u2.__e, u2.__h = null, v2.__h.length && f2.push(v2), m2 && (v2.__E = v2.__ = null), v2.__e = false; 219 | } else 220 | o2 == null && u2.__v === i2.__v ? (u2.__k = i2.__k, u2.__e = i2.__e) : u2.__e = z(i2.__e, u2, i2, t2, r2, o2, f2, s2); 221 | (a2 = n.diffed) && a2(u2); 222 | } catch (l3) { 223 | u2.__v = null, (s2 || o2 != null) && (u2.__e = e2, u2.__h = !!s2, o2[o2.indexOf(e2)] = null), n.__e(l3, u2, i2); 224 | } 225 | } 226 | function j(l2, u2) { 227 | n.__c && n.__c(u2, l2), l2.some(function(u3) { 228 | try { 229 | l2 = u3.__h, u3.__h = [], l2.some(function(n2) { 230 | n2.call(u3); 231 | }); 232 | } catch (l3) { 233 | n.__e(l3, u3.__v); 234 | } 235 | }); 236 | } 237 | function z(n2, l2, u2, i2, t2, r2, e2, c2) { 238 | var a2, v2, h2, y2, p2, d2 = u2.props, _2 = l2.props, k2 = l2.type; 239 | if (k2 === "svg" && (t2 = true), r2 != null) { 240 | for (a2 = 0; a2 < r2.length; a2++) 241 | if ((v2 = r2[a2]) != null && (n2 == v2 || v2.localName == k2)) { 242 | n2 = v2, r2[a2] = null; 243 | break; 244 | } 245 | } 246 | if (n2 == null) { 247 | if (k2 === null) 248 | return document.createTextNode(_2); 249 | n2 = t2 ? document.createElementNS("http://www.w3.org/2000/svg", k2) : document.createElement(k2, _2.is && _2), r2 = null, c2 = false; 250 | } 251 | if (k2 === null) 252 | d2 === _2 || c2 && n2.data === _2 || (n2.data = _2); 253 | else { 254 | if (r2 != null && (r2 = f.slice.call(n2.childNodes)), h2 = (d2 = u2.props || o).dangerouslySetInnerHTML, y2 = _2.dangerouslySetInnerHTML, !c2) { 255 | if (r2 != null) 256 | for (d2 = {}, p2 = 0; p2 < n2.attributes.length; p2++) 257 | d2[n2.attributes[p2].name] = n2.attributes[p2].value; 258 | (y2 || h2) && (y2 && (h2 && y2.__html == h2.__html || y2.__html === n2.innerHTML) || (n2.innerHTML = y2 && y2.__html || "")); 259 | } 260 | if (A(n2, _2, d2, t2, c2), y2) 261 | l2.__k = []; 262 | else if (a2 = l2.props.children, b(n2, Array.isArray(a2) ? a2 : [a2], l2, u2, i2, t2 && k2 !== "foreignObject", r2, e2, n2.firstChild, c2), r2 != null) 263 | for (a2 = r2.length; a2--; ) 264 | r2[a2] != null && s(r2[a2]); 265 | c2 || ("value" in _2 && (a2 = _2.value) !== void 0 && (a2 !== n2.value || k2 === "progress" && !a2) && C(n2, "value", a2, d2.value, false), "checked" in _2 && (a2 = _2.checked) !== void 0 && a2 !== n2.checked && C(n2, "checked", a2, d2.checked, false)); 266 | } 267 | return n2; 268 | } 269 | function I(l2, u2, i2) { 270 | try { 271 | typeof l2 == "function" ? l2(u2) : l2.current = u2; 272 | } catch (l3) { 273 | n.__e(l3, i2); 274 | } 275 | } 276 | function L(l2, u2, i2) { 277 | var t2, r2, o2; 278 | if (n.unmount && n.unmount(l2), (t2 = l2.ref) && (t2.current && t2.current !== l2.__e || I(t2, null, u2)), i2 || typeof l2.type == "function" || (i2 = (r2 = l2.__e) != null), l2.__e = l2.__d = void 0, (t2 = l2.__c) != null) { 279 | if (t2.componentWillUnmount) 280 | try { 281 | t2.componentWillUnmount(); 282 | } catch (l3) { 283 | n.__e(l3, u2); 284 | } 285 | t2.base = t2.__P = null; 286 | } 287 | if (t2 = l2.__k) 288 | for (o2 = 0; o2 < t2.length; o2++) 289 | t2[o2] && L(t2[o2], u2, i2); 290 | r2 != null && s(r2); 291 | } 292 | function M(n2, l2, u2) { 293 | return this.constructor(n2, u2); 294 | } 295 | function N(l2, u2, i2) { 296 | var t2, r2, e2; 297 | n.__ && n.__(l2, u2), r2 = (t2 = typeof i2 == "function") ? null : i2 && i2.__k || u2.__k, e2 = [], T(u2, l2 = (!t2 && i2 || u2).__k = a(y, null, [l2]), r2 || o, o, u2.ownerSVGElement !== void 0, !t2 && i2 ? [i2] : r2 ? null : u2.firstChild ? f.slice.call(u2.childNodes) : null, e2, !t2 && i2 ? i2 : r2 ? r2.__e : u2.firstChild, t2), j(e2, l2); 298 | } 299 | function O(n2, l2) { 300 | N(n2, l2, O); 301 | } 302 | function S(n2, l2, u2) { 303 | var i2, t2, r2, o2 = arguments, f2 = c({}, n2.props); 304 | for (r2 in l2) 305 | r2 == "key" ? i2 = l2[r2] : r2 == "ref" ? t2 = l2[r2] : f2[r2] = l2[r2]; 306 | if (arguments.length > 3) 307 | for (u2 = [u2], r2 = 3; r2 < arguments.length; r2++) 308 | u2.push(o2[r2]); 309 | return u2 != null && (f2.children = u2), v(n2.type, f2, i2 || n2.key, t2 || n2.ref, null); 310 | } 311 | function q(n2, l2) { 312 | var u2 = {__c: l2 = "__cC" + r++, __: n2, Consumer: function(n3, l3) { 313 | return n3.children(l3); 314 | }, Provider: function(n3) { 315 | var u3, i2; 316 | return this.getChildContext || (u3 = [], (i2 = {})[l2] = this, this.getChildContext = function() { 317 | return i2; 318 | }, this.shouldComponentUpdate = function(n4) { 319 | this.props.value !== n4.value && u3.some(k); 320 | }, this.sub = function(n4) { 321 | u3.push(n4); 322 | var l3 = n4.componentWillUnmount; 323 | n4.componentWillUnmount = function() { 324 | u3.splice(u3.indexOf(n4), 1), l3 && l3.call(n4); 325 | }; 326 | }), n3.children; 327 | }}; 328 | return u2.Provider.__ = u2.Consumer.contextType = u2; 329 | } 330 | n = {__e: function(n2, l2) { 331 | for (var u2, i2, t2; l2 = l2.__; ) 332 | if ((u2 = l2.__c) && !u2.__) 333 | try { 334 | if ((i2 = u2.constructor) && i2.getDerivedStateFromError != null && (u2.setState(i2.getDerivedStateFromError(n2)), t2 = u2.__d), u2.componentDidCatch != null && (u2.componentDidCatch(n2), t2 = u2.__d), t2) 335 | return u2.__E = u2; 336 | } catch (l3) { 337 | n2 = l3; 338 | } 339 | throw n2; 340 | }, __v: 0}, l = function(n2) { 341 | return n2 != null && n2.constructor === void 0; 342 | }, p.prototype.setState = function(n2, l2) { 343 | var u2; 344 | u2 = this.__s != null && this.__s !== this.state ? this.__s : this.__s = c({}, this.state), typeof n2 == "function" && (n2 = n2(c({}, u2), this.props)), n2 && c(u2, n2), n2 != null && this.__v && (l2 && this.__h.push(l2), k(this)); 345 | }, p.prototype.forceUpdate = function(n2) { 346 | this.__v && (this.__e = true, n2 && this.__h.push(n2), k(this)); 347 | }, p.prototype.render = y, u = [], i = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, m.__r = 0, r = 0; 348 | }); 349 | 350 | export { 351 | __commonJS, 352 | require_preact_module 353 | }; 354 | --------------------------------------------------------------------------------