@axel669/zephyr 1.0.0-beta.0 → 1.0.0-dev.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.
Files changed (62) hide show
  1. package/LICENSE +21 -21
  2. package/compiler/build.js +13 -0
  3. package/compiler/parser.js +2973 -0
  4. package/compiler/rollup.js +28 -0
  5. package/compiler/transpiler.js +140 -0
  6. package/dist/zephyr-unstyled.js +555 -0
  7. package/dist/zephyr-unstyled.min.js +1 -0
  8. package/dist/zephyr.js +1946 -0
  9. package/dist/zephyr.min.js +47 -0
  10. package/package.json +50 -48
  11. package/readme.md +194 -19
  12. package/src/changed.svelte.js +0 -23
  13. package/src/component/adorn.svelte +0 -9
  14. package/src/component/alert.svelte +0 -32
  15. package/src/component/application.svelte +0 -17
  16. package/src/component/async-button.svelte +0 -53
  17. package/src/component/avatar.svelte +0 -15
  18. package/src/component/badge.svelte +0 -7
  19. package/src/component/button.svelte +0 -7
  20. package/src/component/chip.svelte +0 -10
  21. package/src/component/circle-spinner.svelte +0 -6
  22. package/src/component/confirm.svelte +0 -40
  23. package/src/component/control-label.svelte +0 -41
  24. package/src/component/data-table.svelte +0 -227
  25. package/src/component/details.svelte +0 -22
  26. package/src/component/dialog-element.svelte +0 -35
  27. package/src/component/dialog.svelte +0 -43
  28. package/src/component/drawer.svelte +0 -20
  29. package/src/component/flex.svelte +0 -7
  30. package/src/component/grid.svelte +0 -7
  31. package/src/component/hexagon-spinner.svelte +0 -6
  32. package/src/component/icon.svelte +0 -7
  33. package/src/component/link.svelte +0 -11
  34. package/src/component/modal.svelte +0 -32
  35. package/src/component/paper.svelte +0 -33
  36. package/src/component/popover.svelte +0 -19
  37. package/src/component/progress.svelte +0 -6
  38. package/src/component/prompt.svelte +0 -58
  39. package/src/component/route.svelte +0 -62
  40. package/src/component/routing.svelte.js +0 -63
  41. package/src/component/screen.svelte +0 -30
  42. package/src/component/select.svelte +0 -40
  43. package/src/component/suspend.svelte +0 -44
  44. package/src/component/table.svelte +0 -49
  45. package/src/component/tabs.svelte +0 -2
  46. package/src/component/text.svelte +0 -26
  47. package/src/component/title.svelte +0 -28
  48. package/src/component/titlebar.svelte +0 -23
  49. package/src/component/toast.svelte +0 -7
  50. package/src/component/toaster.svelte +0 -60
  51. package/src/component/toggle-label.svelte +0 -11
  52. package/src/component/tooltip.svelte +0 -11
  53. package/src/custom-macros.js +0 -11
  54. package/src/handler$.js +0 -20
  55. package/src/hash.js +0 -14
  56. package/src/index.js +0 -65
  57. package/src/internals.js +0 -12
  58. package/src/main.js +0 -47
  59. package/src/props.js +0 -24
  60. package/src/variant.js +0 -10
  61. package/src/wind.js +0 -4
  62. package/src/ws.js +0 -10
package/dist/zephyr.js ADDED
@@ -0,0 +1,1946 @@
1
+ var n$1,l$3,u$3,i$3,r$3,o$3,e$2,f$3,c$3,a$3,s$3,h$3,p$3,v$3,y$3,d$3={},w$3=[],_$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g$3=Array.isArray;function m$3(n,l){for(var u in l)n[u]=l[u];return n}function b$2(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function k$3(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n$1.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return x$3(l,e,i,r,null)}function x$3(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u$3:o,__i:-1,__u:0};return null==o&&null!=l$3.vnode&&l$3.vnode(e),e}function S$1(n){return n.children}function C$3(n,l){this.props=n,this.context=l;}function $$2(n,l){if(null==l)return n.__?$$2(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?$$2(n):null}function I$2(n){if(n.__P&&n.__d){var u=n.__v,t=u.__e,i=[],r=[],o=m$3({},u);o.__v=u.__v+1,l$3.vnode&&l$3.vnode(o),q$4(n.__P,o,u,n.__n,n.__P.namespaceURI,32&u.__u?[t]:null,i,null==t?$$2(u):t,!!(32&u.__u),r),o.__v=u.__v,o.__.__k[o.__i]=o,D$3(i,o,r),u.__e=u.__=null,o.__e!=t&&P$3(o);}}function P$3(n){if(null!=(n=n.__)&&null!=n.__c)return n.__e=n.__c.base=null,n.__k.some(function(l){if(null!=l&&null!=l.__e)return n.__e=n.__c.base=l.__e}),P$3(n)}function A$3(n){(!n.__d&&(n.__d=true)&&i$3.push(n)&&!H$2.__r++||r$3!=l$3.debounceRendering)&&((r$3=l$3.debounceRendering)||o$3)(H$2);}function H$2(){try{for(var n,l=1;i$3.length;)i$3.length>l&&i$3.sort(e$2),n=i$3.shift(),l=i$3.length,I$2(n);}finally{i$3.length=H$2.__r=0;}}function L$1(n,l,u,t,i,r,o,e,f,c,a){var s,h,p,v,y,_,g,m=t&&t.__k||w$3,b=l.length;for(f=T$3(u,l,m,f,b),s=0;s<b;s++)null!=(p=u.__k[s])&&(h=-1!=p.__i&&m[p.__i]||d$3,p.__i=s,_=q$4(n,p,h,i,r,o,e,f,c,a),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&J$2(h.ref,null,p),a.push(p.ref,p.__c||v,p)),null==y&&null!=v&&(y=v),(g=!!(4&p.__u))||h.__k===p.__k?(f=j$3(p,f,n,g),g&&h.__e&&(h.__e=null)):"function"==typeof p.type&&void 0!==_?f=_:v&&(f=v.nextSibling),p.__u&=-7);return u.__e=y,f}function T$3(n,l,u,t,i){var r,o,e,f,c,a=u.length,s=a,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=n.__k[r]=x$3(null,o,null,null,null):g$3(o)?o=n.__k[r]=x$3(S$1,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=n.__k[r]=x$3(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[r]=o,f=r+h,o.__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=O$2(o,u,f,s))&&(s--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>a?h--:i<a&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(s)for(r=0;r<a;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=$$2(e)),K$2(e,e));return t}function j$3(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=j$3(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=$$2(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function F$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(g$3(n)?n.some(function(n){F$1(n,l);}):l.push(n)),l}function O$2(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],a=null!=c&&0==(2&c.__u);if(null===c&&null==e||a&&e==c.key&&f==c.type)return u;if(t>(a?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return -1}function z$3(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||_$1.test(l)?u:u+"px";}function N$2(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||z$3(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||z$3(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(s$3,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u[a$3]=t[a$3]:(u[a$3]=h$3,n.addEventListener(l,r?v$3:p$3,r)):n.removeEventListener(l,r?v$3:p$3,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function V$3(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u[c$3])u[c$3]=h$3++;else if(u[c$3]<t[a$3])return;return t(l$3.event?l$3.event(u):u)}}}function q$4(n,u,t,i,r,o,e,f,c,a){var s,h,p,v,y,d,_,k,x,M,$,I,P,A,H,T,j=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(s=l$3.__b)&&s(u);n:if("function"==typeof j){h=e.length;try{if(x=u.props,M=j.prototype&&j.prototype.render,$=(s=j.contextType)&&i[s.__c],I=s?$?$.props.value:s.__:i,t.__c?k=(p=u.__c=t.__c).__=p.__E:(M?u.__c=p=new j(x,I):(u.__c=p=new C$3(x,I),p.constructor=j,p.render=Q$1),$&&$.sub(p),p.state||(p.state={}),p.__n=i,v=p.__d=!0,p.__h=[],p._sb=[]),M&&null==p.__s&&(p.__s=p.state),M&&null!=j.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=m$3({},p.__s)),m$3(p.__s,j.getDerivedStateFromProps(x,p.__s))),y=p.props,d=p.state,p.__v=u,v)M&&null==j.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),M&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else {if(M&&null==j.getDerivedStateFromProps&&x!==y&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(x,I),u.__v==t.__v||!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(x,p.__s,I)){u.__v!=t.__v&&(p.props=x,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),w$3.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&e.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(x,p.__s,I),M&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(y,d,_);});}if(p.context=I,p.props=x,p.__P=n,p.__e=!1,P=l$3.__r,A=0,M)p.state=p.__s,p.__d=!1,P&&P(u),s=p.render(p.props,p.state,p.context),w$3.push.apply(p.__h,p._sb),p._sb=[];else do{p.__d=!1,P&&P(u),s=p.render(p.props,p.state,p.context),p.state=p.__s;}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(i=m$3(m$3({},i),p.getChildContext())),M&&!v&&null!=p.getSnapshotBeforeUpdate&&(_=p.getSnapshotBeforeUpdate(y,d)),H=null!=s&&s.type===S$1&&null==s.key?E$2(s.props.children):s,f=L$1(n,g$3(H)?H:[H],u,t,i,r,o,e,f,c,a),p.base=u.__e,u.__u&=-161,p.__h.length&&e.push(p),k&&(p.__E=p.__=null);}catch(n){if(e.length=h,u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;null!=o&&(o[o.indexOf(f)]=null),u.__e=f;}else {if(null!=o)for(T=o.length;T--;)b$2(o[T]);B$3(u);}else u.__e=t.__e,!u.__k&&t.__k&&(u.__k=t.__k),n.then||B$3(u);l$3.__e(n,u,t);}}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=G$1(t.__e,u,t,i,r,o,e,c,a);return (s=l$3.diffed)&&s(u),128&u.__u?void 0:f}function B$3(n){n&&(n.__c&&(n.__c.__e=true),n.__k&&n.__k.some(B$3));}function D$3(n,u,t){for(var i=0;i<t.length;i++)J$2(t[i],t[++i],t[++i]);l$3.__c&&l$3.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$3.__e(n,u.__v);}});}function E$2(n){return "object"!=typeof n||null==n||n.__b>0?n:g$3(n)?n.map(E$2):void 0!==n.constructor?null:m$3({},n)}function G$1(u,t,i,r,o,e,f,c,a){var s,h,p,v,y,w,_,m=i.props||d$3,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(s=0;s<e.length;s++)if((y=e[s])&&"setAttribute"in y==!!x&&(x?y.localName==x:3==y.nodeType)){u=y,e[s]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l$3.__m&&l$3.__m(t,e),c=false),e=null;}if(null==x)m===k||c&&u.data==k||(u.data=k);else {if(e="textarea"==x&&null!=k.defaultValue?null:e&&n$1.call(u.childNodes),!c&&null!=e)for(m={},s=0;s<u.attributes.length;s++)m[(y=u.attributes[s]).name]=y.value;for(s in m)y=m[s],"dangerouslySetInnerHTML"==s?p=y:"children"==s||s in k||"value"==s&&"defaultValue"in k||"checked"==s&&"defaultChecked"in k||N$2(u,s,null,y,o);for(s in k)y=k[s],"children"==s?v=y:"dangerouslySetInnerHTML"==s?h=y:"value"==s?w=y:"checked"==s?_=y:c&&"function"!=typeof y||m[s]===y||N$2(u,s,y,m[s],o);if(h)c||p&&(h.__html==p.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(p&&(u.innerHTML=""),L$1("template"==t.type?u.content:u,g$3(v)?v:[v],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&$$2(i,0),c,a),null!=e)for(s=e.length;s--;)b$2(e[s]);c&&"textarea"!=x||(s="value","progress"==x&&null==w?u.removeAttribute("value"):null!=w&&(w!==u[s]||"progress"==x&&!w||"option"==x&&w!=m[s])&&N$2(u,s,w,m[s],o),s="checked",null!=_&&_!=u[s]&&N$2(u,s,_,m[s],o));}return u}function J$2(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$3.__e(n,t);}}function K$2(n,u,t){var i,r;if(l$3.unmount&&l$3.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||J$2(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$3.__e(n,u);}i.base=i.__P=i.__n=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&K$2(i[r],u,t||"function"!=typeof n.type);t||b$2(n.__e),n.__c=n.__=n.__e=void 0;}function Q$1(n,l,u){return this.constructor(n,u)}function R$1(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l$3.__&&l$3.__(u,t),o=(r="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],q$4(t,u=(!r&&i||t).__k=k$3(S$1,null,[u]),o||d$3,d$3,t.namespaceURI,!r&&i?[i]:o?null:t.firstChild?n$1.call(t.childNodes):null,e,!r&&i?i:o?o.__e:t.firstChild,r,f),D$3(e,u,f),u.props.children=null;}function W$2(l,u,t){var i,r,o,e,f=m$3({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==o?i=u[o]:"ref"==o?r=u[o]:f[o]=void 0===u[o]&&null!=e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n$1.call(arguments,2):t),x$3(l.type,f,i||l.key,r||l.ref,null)}function X$1(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null;},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=true,A$3(n);});},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n);};}),n.children}return l.__c="__cC"+y$3++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n$1=w$3.slice,l$3={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u$3=0,C$3.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=m$3({},this.state),"function"==typeof n&&(n=n(m$3({},u),this.props)),n&&m$3(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),A$3(this));},C$3.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),A$3(this));},C$3.prototype.render=S$1,i$3=[],o$3="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$2=function(n,l){return n.__v.__b-l.__v.__b},H$2.__r=0,f$3=Math.random().toString(8),c$3="__d"+f$3,a$3="__a"+f$3,s$3=/(PointerCapture)$|Capture$/i,h$3=0,p$3=V$3(false),v$3=V$3(true),y$3=0;
2
+
3
+ var t$1,r$2,u$2,i$2,o$2=0,f$2=[],c$2=l$3,e$1=c$2.__b,a$2=c$2.__r,v$2=c$2.diffed,l$2=c$2.__c,m$2=c$2.unmount,p$2=c$2.__;function s$2(n,t){c$2.__h&&c$2.__h(r$2,n,o$2||t),o$2=0;var u=r$2.__H||(r$2.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d$2(n){return o$2=1,y$2(D$2,n)}function y$2(n,u,i){var o=s$2(t$1++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D$2(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$2,!r$2.__f)){var f=function(n,t,r){if(!o.__c.__H)return true;var u=false,i=o.__c.props!==n;if(o.__c.__H.__.some(function(n){if(n.__N){u=true;var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=true);}}),c){var f=c.call(this,n,t,r);return u?f||i:f}return !u||i};r$2.__f=true;var c=r$2.shouldComponentUpdate,e=r$2.componentWillUpdate;r$2.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r$2.shouldComponentUpdate=f;}return o.__N||o.__}function h$2(n,u){var i=s$2(t$1++,3);!c$2.__s&&C$2(i.__H,u)&&(i.__=n,i.u=u,r$2.__H.__h.push(i));}function T$2(n,r){var u=s$2(t$1++,7);return C$2(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q$3(n,t){return o$2=8,T$2(function(){return n},t)}function x$2(n){var u=r$2.context[n.__c],i=s$2(t$1++,9);return i.c=n,u?(null==i.__&&(i.__=true,u.sub(r$2)),u.props.value):n.__}function j$2(){for(var n;n=f$2.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(z$2),t.__h.some(B$2),t.__h=[];}catch(r){t.__h=[],c$2.__e(r,n.__v);}}}c$2.__b=function(n){r$2=null,e$1&&e$1(n);},c$2.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p$2&&p$2(n,t);},c$2.__r=function(n){a$2&&a$2(n),t$1=0;var i=(r$2=n.__c).__H;i&&(u$2===r$2?(i.__h=[],r$2.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(i.__h.length&&j$2(),t$1=0)),u$2=r$2;},c$2.diffed=function(n){v$2&&v$2(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f$2.push(t)&&i$2===c$2.requestAnimationFrame||((i$2=c$2.requestAnimationFrame)||w$2)(j$2)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0);})),u$2=r$2=null;},c$2.__c=function(n,t){t.some(function(n){try{n.__h.some(z$2),n.__h=n.__h.filter(function(n){return !n.__||B$2(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],c$2.__e(r,n.__v);}}),l$2&&l$2(n,t);},c$2.unmount=function(n){m$2&&m$2(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{z$2(n);}catch(n){t=n;}}),r.__H=void 0,t&&c$2.__e(t,r.__v));};var k$2="function"==typeof requestAnimationFrame;function w$2(n){var t,r=function(){clearTimeout(u),k$2&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k$2&&(t=requestAnimationFrame(r));}function z$2(n){var t=r$2,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$2=t;}function B$2(n){var t=r$2;n.__c=n.__(),r$2=t;}function C$2(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D$2(n,t){return "function"==typeof t?t(n):t}
4
+
5
+ function g$2(n,t){for(var e in t)n[e]=t[e];return n}function E$1(n,t){for(var e in n)if("__source"!==e&&!(e in t))return true;for(var r in t)if("__source"!==r&&n[r]!==t[r])return true;return false}function M$2(n,t){this.props=n,this.context=t;}function N$1(n,e){function r(n){var t=this.props.ref;return t!=n.ref&&t&&("function"==typeof t?t(null):t.current=null),e?!e(this.props,n)||t!=n.ref:E$1(this.props,n)}function u(e){return this.shouldComponentUpdate=r,k$3(n,e)}return u.displayName="Memo("+(n.displayName||n.name)+")",u.__f=u.prototype.isReactComponent=true,u.type=n,u}(M$2.prototype=new C$3).isPureReactComponent=true,M$2.prototype.shouldComponentUpdate=function(n,t){return E$1(this.props,n)||E$1(this.state,t)};var T$1=l$3.__b;l$3.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),T$1&&T$1(n);};var A$2="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function D$1(n){function t(t){var e=g$2({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=A$2,t.render=n,t.prototype.isReactComponent=t.__f=true,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var O$1=l$3.__e;l$3.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);O$1(n,t,e,r);};var U$1=l$3.unmount;function V$2(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g$2({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c.__e=true,n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return V$2(n,t,e)})),n}function W$1(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return W$1(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=true,n.__c.__P=e)),n}function P$2(){this.__u=0,this.o=null,this.__b=null;}function j$1(n){var t=n.__&&n.__.__c;return t&&t.__a&&t.__a(n)}function B$1(){this.i=null,this.l=null;}l$3.unmount=function(n){var t=n.__c;t&&(t.__z=true),t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),U$1&&U$1(n);},(P$2.prototype=new C$3).__c=function(n,t){var e=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(e);var u=j$1(r.__v),o=false,i=function(){o||r.__z||(o=true,e.__R=null,u?u(f):f());};e.__R=i;var l=e.__P;e.__P=null;var f=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=W$1(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=l,t.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},P$2.prototype.componentWillUnmount=function(){this.o=[];},P$2.prototype.render=function(n,e){var r=this.__v;if(!r.__m){for(var o=r;o.__;)o=o.__;o=o.__m||(o.__m=[0,0]),r.__m=[o[1]++,0];}if(this.__b){if(r.__k){var i=document.createElement("div"),l=r.__k[0].__c;r.__k[0]=V$2(this.__b,i,l.__O=l.__P);}this.__b=null;}var f=e.__a&&k$3(S$1,null,n.fallback);return f&&(f.__u&=-33),[k$3(S$1,null,e.__a?null:n.children),f]};var H$1=function(n,t,e){if(++e[1]===e[0]&&n.l.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.l.size))for(e=n.i;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.i=e=e[2];}};(B$1.prototype=new C$3).__a=function(n){var t=this,e=j$1(t.__v),r=t.l.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),H$1(t,n,r)):u();};e?e(o):o();}},B$1.prototype.render=function(n){this.i=null,this.l=new Map;var t=F$1(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.l.set(t[e],this.i=[1,0,this.i]);return n.children},B$1.prototype.componentDidUpdate=B$1.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(t,e){H$1(n,e,t);});};var q$2="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,G=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,J$1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,K$1=/[A-Z0-9]/g,Q="undefined"!=typeof document,X=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};C$3.prototype.isReactComponent=true,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(C$3.prototype,t,{configurable:true,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:true,writable:true,value:n});}});});var en=l$3.event;l$3.event=function(n){return en&&(n=en(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var un={configurable:true,get:function(){return this.class}},on=l$3.vnode;l$3.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={},o=-1==e.indexOf("-");for(var i in t){var l=t[i];if(!("value"===i&&"defaultValue"in t&&null==l||Q&&"children"===i&&"noscript"===e||"class"===i||"className"===i)){var f=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&true===l?l="":"translate"===f&&"no"===l?l=false:"o"===f[0]&&"n"===f[1]?"ondoubleclick"===f?i="ondblclick":"onchange"!==f||"input"!==e&&"textarea"!==e||X(t.type)?"onfocus"===f?i="onfocusin":"onblur"===f?i="onfocusout":J$1.test(i)&&(i=f):f=i="oninput":o&&G.test(i)?i=i.replace(K$1,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===f&&u[i=f]&&(i="oninputCapture"),u[i]=l;}}"select"==e&&(u.multiple&&Array.isArray(u.value)&&(u.value=F$1(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),null!=u.defaultValue&&(u.value=F$1(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;}))),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",un)):t.className&&(u.class=u.className=t.className),n.props=u;}(n),n.$$typeof=q$2,on&&on(n);};var ln=l$3.__r;l$3.__r=function(n){ln&&ln(n),n.__c;};var fn=l$3.diffed;l$3.diffed=function(n){fn&&fn(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value);};
6
+
7
+ var r$1="diffed",o$1="__c",i$1="__s",a$1="__c",c$1="__k",u$1="__d",s$1="__s",l$1=/[\s\n\\/='"\0<>]/,f$1=/^(xlink|xmlns|xml)([A-Z])/,p$1=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,h$1=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,d$1=new Set(["draggable","spellcheck"]);function v$1(e){ void 0!==e.__g?e.__g|=8:e[u$1]=true;}function m$1(e){ void 0!==e.__g?e.__g&=-9:e[u$1]=false;}function y$1(e){return void 0!==e.__g?!!(8&e.__g):true===e[u$1]}var _=/["&<]/;function g$1(e){if(0===e.length||false===_.test(e))return e;for(var t=0,n=0,r="",o="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=o,t=n+1;}return n!==t&&(r+=e.slice(t,n)),r}var b$1={},x$1=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","opacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),k$1=/[A-Z]/g;function w$1(e){var t="";for(var n in e){var r=e[n];if(null!=r&&""!==r){var o="-"==n[0]?n:b$1[n]||(b$1[n]=n.replace(k$1,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||x$1.has(o)||(i="px;"),t=t+o+":"+r+i;}}return t||void 0}function C$1(){this.__d=true;}function A$1(e,t){return {__v:e,context:t,props:e.props,setState:C$1,forceUpdate:C$1,__d:true,__h:new Array(0)}}var D,P$1,$$1,U,F={},M$1=[],W=Array.isArray,z$1=Object.assign,H="",N="\x3c!--$s--\x3e",q$1="\x3c!--/$s--\x3e";function B(e){return "string"==typeof e?N+e+q$1:W(e)?(e.unshift(N),e.push(q$1),e):e&&"function"==typeof e.then?e.then(B):N+e+q$1}function I$1(a,u,s){var l=l$3[i$1];l$3[i$1]=true,D=l$3.__b,P$1=l$3[r$1],$$1=l$3.__r,U=l$3.unmount;var f=k$3(S$1,null);f[c$1]=[a];try{var p=R(a,u||F,!1,void 0,f,!1,s);return W(p)?p.join(H):p}catch(e){if(e.then)throw new Error('Use "renderToStringAsync" for suspenseful rendering.');throw e}finally{l$3[o$1]&&l$3[o$1](a,M$1),l$3[i$1]=l,M$1.length=0;}}function O(e,t){var n,r=e.type,o=true;return e[a$1]?(o=false,(n=e[a$1]).state=n[s$1]):n=new r(e.props,t),e[a$1]=n,n.__v=e,n.props=e.props,n.context=t,v$1(n),null==n.state&&(n.state=F),null==n[s$1]&&(n[s$1]=n.state),r.getDerivedStateFromProps?n.state=z$1({},n.state,r.getDerivedStateFromProps(n.props,n.state)):o&&n.componentWillMount?(n.componentWillMount(),n.state=n[s$1]!==n.state?n[s$1]:n.state):!o&&n.componentWillUpdate&&n.componentWillUpdate(),$$1&&$$1(e),n.render(n.props,n.state,t)}function R(t,r,o,i,u,_,b){if(null==t||true===t||false===t||t===H)return H;var x=typeof t;if("object"!=x)return "function"==x?H:"string"==x?g$1(t):t+H;if(W(t)){var k,C=H;u[c$1]=t;for(var S=t.length,L=0;L<S;L++){var E=t[L];if(null!=E&&"boolean"!=typeof E){var j,T=R(E,r,o,i,u,_,b);"string"==typeof T?C+=T:(k||(k=new Array(S)),C&&k.push(C),C=H,W(T)?(j=k).push.apply(j,T):k.push(T));}}return k?(C&&k.push(C),k):C}if(void 0!==t.constructor)return H;t.__=u,D&&D(t);var Z=t.type,M=t.props;if("function"==typeof Z){var N,q,I,K=r;if(Z===S$1){if("tpl"in M){for(var G=H,Q=0;Q<M.tpl.length;Q++)if(G+=M.tpl[Q],M.exprs&&Q<M.exprs.length){var X=M.exprs[Q];if(null==X)continue;"object"!=typeof X||void 0!==X.constructor&&!W(X)?G+=X:G+=R(X,r,o,i,t,_,b);}return G}if("UNSTABLE_comment"in M)return "\x3c!--"+g$1(M.UNSTABLE_comment)+"--\x3e";q=M.children;}else {if(null!=(N=Z.contextType)){var Y=r[N.__c];K=Y?Y.props.value:N.__;}var ee=Z.prototype&&"function"==typeof Z.prototype.render;if(ee)q=/**#__NOINLINE__**/O(t,K),I=t[a$1];else {t[a$1]=I=/**#__NOINLINE__**/A$1(t,K);for(var te=0;y$1(I)&&te++<25;){m$1(I),$$1&&$$1(t);try{q=Z.call(I,M,K);}catch(e){throw e}}v$1(I);}if(null!=I.getChildContext&&(r=z$1({},r,I.getChildContext())),ee&&l$3.errorBoundaries&&(Z.getDerivedStateFromError||I.componentDidCatch)){q=null!=q&&q.type===S$1&&null==q.key&&null==q.props.tpl?q.props.children:q;try{return R(q,r,o,i,t,_,!1)}catch(e){return Z.getDerivedStateFromError&&(I[s$1]=Z.getDerivedStateFromError(e)),I.componentDidCatch&&I.componentDidCatch(e,F),y$1(I)?(q=O(t,r),null!=(I=t[a$1]).getChildContext&&(r=z$1({},r,I.getChildContext())),R(q=null!=q&&q.type===S$1&&null==q.key&&null==q.props.tpl?q.props.children:q,r,o,i,t,_,b)):H}finally{P$1&&P$1(t),U&&U(t);}}}q=null!=q&&q.type===S$1&&null==q.key&&null==q.props.tpl?q.props.children:q;try{var ne=R(q,r,o,i,t,_,b);return P$1&&P$1(t),l$3.unmount&&l$3.unmount(t),t._suspended?B(ne):ne}catch(n){if(b&&b.onError){var re=function e(n){return b.onError(n,t,function(t,n){try{return R(t,r,o,i,n,_,b)}catch(t){return e(t)}})}(n);if(void 0!==re)return re;var oe=l$3.__e;return oe&&oe(n,t),H}throw n;}}var ie,ae="<"+Z,ce=H;for(var ue in M){var se=M[ue];if("function"!=typeof(se=J(se)?se.value:se)||"class"===ue||"className"===ue){switch(ue){case "children":ie=se;continue;case "key":case "ref":case "__self":case "__source":continue;case "htmlFor":if("for"in M)continue;ue="for";break;case "className":if("class"in M)continue;ue="class";break;case "defaultChecked":ue="checked";break;case "defaultSelected":ue="selected";break;case "defaultValue":case "value":switch(ue="value",Z){case "textarea":ie=se;continue;case "select":i=se;continue;case "option":i!=se||"selected"in M||(ae+=" selected");}break;case "dangerouslySetInnerHTML":ce=se&&se.__html;continue;case "style":"object"==typeof se&&(se=w$1(se));break;case "acceptCharset":ue="accept-charset";break;case "httpEquiv":ue="http-equiv";break;default:if(l$1.test(ue))continue;f$1.test(ue)?ue=ue.replace(f$1,"$1:$2").toLowerCase():"-"!==ue[4]&&!d$1.has(ue)||null==se?o?h$1.test(ue)&&(ue="panose1"===ue?"panose-1":ue.replace(/([A-Z])/g,"-$1").toLowerCase()):p$1.test(ue)&&(ue=ue.toLowerCase()):se+=H;}null!=se&&false!==se&&(ae=true===se||se===H?ae+" "+ue:ae+" "+ue+'="'+("string"==typeof se?g$1(se):se+H)+'"');}}if(l$1.test(Z))throw new Error(Z+" is not a valid HTML tag name in "+ae+">");if(ce||("string"==typeof ie?ce=g$1(ie):null!=ie&&false!==ie&&true!==ie&&(ce=R(ie,r,"svg"===Z||"foreignObject"!==Z&&o,i,t,_,b))),P$1&&P$1(t),U&&U(t),!ce&&V$1.has(Z))return ae+"/>";var le="</"+Z+">",fe=ae+">";return W(ce)?[fe].concat(ce,[le]):"string"!=typeof ce?[fe,ce,le]:fe+ce+le}var V$1=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),K=I$1;function J(e){return null!==e&&"object"==typeof e&&"function"==typeof e.peek&&"value"in e}
8
+
9
+ /* eslint @typescript-eslint/no-explicit-any: off */
10
+ // symbols
11
+ const GET_ORIGINAL_SYMBOL = Symbol();
12
+ // get object prototype
13
+ const getProto = Object.getPrototypeOf;
14
+ const objectsToTrack = new WeakMap();
15
+ // check if obj is a plain object or an array
16
+ const isObjectToTrack = (obj) => obj &&
17
+ (objectsToTrack.has(obj)
18
+ ? objectsToTrack.get(obj)
19
+ : getProto(obj) === Object.prototype || getProto(obj) === Array.prototype);
20
+ /**
21
+ * Unwrap proxy to get the original object.
22
+ *
23
+ * Used to retrieve the original object used to create the proxy instance with `createProxy`.
24
+ *
25
+ * @param {Proxy<object>} obj - The proxy wrapper of the originial object.
26
+ * @returns {object | null} - Return either the unwrapped object if exists.
27
+ *
28
+ * @example
29
+ * import { createProxy, getUntracked } from 'proxy-compare';
30
+ *
31
+ * const original = { a: "1", c: "2", d: { e: "3" } };
32
+ * const affected = new WeakMap();
33
+ *
34
+ * const proxy = createProxy(original, affected);
35
+ * const originalFromProxy = getUntracked(proxy)
36
+ *
37
+ * Object.is(original, originalFromProxy) // true
38
+ * isChanged(original, originalFromProxy, affected) // false
39
+ */
40
+ const getUntracked = (obj) => {
41
+ if (isObjectToTrack(obj)) {
42
+ return obj[GET_ORIGINAL_SYMBOL] || null;
43
+ }
44
+ return null;
45
+ };
46
+ /**
47
+ * Mark object to be tracked.
48
+ *
49
+ * This function marks an object that will be passed into `createProxy`
50
+ * as marked to track or not. By default only Array and Object are marked to track,
51
+ * so this is useful for example to mark a class instance to track or to mark a object
52
+ * to be untracked when creating your proxy.
53
+ *
54
+ * @param obj - Object to mark as tracked or not.
55
+ * @param mark - Boolean indicating whether you want to track this object or not.
56
+ * @returns - No return.
57
+ *
58
+ * @example
59
+ * import { createProxy, markToTrack, isChanged } from 'proxy-compare';
60
+ *
61
+ * const nested = { e: "3" }
62
+ *
63
+ * markToTrack(nested, false)
64
+ *
65
+ * const original = { a: "1", c: "2", d: nested };
66
+ * const affected = new WeakMap();
67
+ *
68
+ * const proxy = createProxy(original, affected);
69
+ *
70
+ * proxy.d.e
71
+ *
72
+ * isChanged(original, { d: { e: "3" } }, affected) // true
73
+ */
74
+ const markToTrack = (obj, mark = true) => {
75
+ objectsToTrack.set(obj, mark);
76
+ };
77
+
78
+ const isObject = (x) => typeof x === "object" && x !== null;
79
+ const canProxyDefault = (x) => isObject(x) && !refSet.has(x) && (Array.isArray(x) || !(Symbol.iterator in x)) && !(x instanceof WeakMap) && !(x instanceof WeakSet) && !(x instanceof Error) && !(x instanceof Number) && !(x instanceof Date) && !(x instanceof String) && !(x instanceof RegExp) && !(x instanceof ArrayBuffer) && !(x instanceof Promise);
80
+ const createSnapshotDefault = (target, version) => {
81
+ const cache = snapCache.get(target);
82
+ if ((cache == null ? void 0 : cache[0]) === version) {
83
+ return cache[1];
84
+ }
85
+ const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target));
86
+ markToTrack(snap, true);
87
+ snapCache.set(target, [version, snap]);
88
+ Reflect.ownKeys(target).forEach((key) => {
89
+ if (Object.getOwnPropertyDescriptor(snap, key)) {
90
+ return;
91
+ }
92
+ const value = Reflect.get(target, key);
93
+ const { enumerable } = Reflect.getOwnPropertyDescriptor(
94
+ target,
95
+ key
96
+ );
97
+ const desc = {
98
+ value,
99
+ enumerable,
100
+ // This is intentional to avoid copying with proxy-compare.
101
+ // It's still non-writable, so it avoids assigning a value.
102
+ configurable: true
103
+ };
104
+ if (refSet.has(value)) {
105
+ markToTrack(value, false);
106
+ } else if (proxyStateMap.has(value)) {
107
+ const [target2, ensureVersion] = proxyStateMap.get(
108
+ value
109
+ );
110
+ desc.value = createSnapshotDefault(target2, ensureVersion());
111
+ }
112
+ Object.defineProperty(snap, key, desc);
113
+ });
114
+ return snap;
115
+ };
116
+ const createHandlerDefault = (isInitializing, addPropListener, removePropListener, notifyUpdate) => ({
117
+ deleteProperty(target, prop) {
118
+ Reflect.get(target, prop);
119
+ removePropListener(prop);
120
+ const deleted = Reflect.deleteProperty(target, prop);
121
+ if (deleted) {
122
+ notifyUpdate(void 0 );
123
+ }
124
+ return deleted;
125
+ },
126
+ set(target, prop, value, receiver) {
127
+ const hasPrevValue = !isInitializing() && Reflect.has(target, prop);
128
+ const prevValue = Reflect.get(target, prop, receiver);
129
+ if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) {
130
+ return true;
131
+ }
132
+ removePropListener(prop);
133
+ if (isObject(value)) {
134
+ value = getUntracked(value) || value;
135
+ }
136
+ const nextValue = !proxyStateMap.has(value) && canProxy(value) ? proxy(value) : value;
137
+ addPropListener(prop, nextValue);
138
+ Reflect.set(target, prop, nextValue, receiver);
139
+ notifyUpdate(void 0 );
140
+ return true;
141
+ }
142
+ });
143
+ const proxyStateMap = /* @__PURE__ */ new WeakMap();
144
+ const refSet = /* @__PURE__ */ new WeakSet();
145
+ const snapCache = /* @__PURE__ */ new WeakMap();
146
+ const versionHolder = [1];
147
+ const proxyCache = /* @__PURE__ */ new WeakMap();
148
+ let objectIs = Object.is;
149
+ let newProxy = (target, handler) => new Proxy(target, handler);
150
+ let canProxy = canProxyDefault;
151
+ let createSnapshot = createSnapshotDefault;
152
+ let createHandler = createHandlerDefault;
153
+ function proxy(baseObject = {}) {
154
+ if (!isObject(baseObject)) {
155
+ throw new Error("object required");
156
+ }
157
+ const found = proxyCache.get(baseObject);
158
+ if (found) {
159
+ return found;
160
+ }
161
+ let version = versionHolder[0];
162
+ const listeners = /* @__PURE__ */ new Set();
163
+ const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => {
164
+ if (version !== nextVersion) {
165
+ checkVersion = version = nextVersion;
166
+ listeners.forEach((listener) => listener(op, nextVersion));
167
+ }
168
+ };
169
+ let checkVersion = version;
170
+ const ensureVersion = (nextCheckVersion = versionHolder[0]) => {
171
+ if (checkVersion !== nextCheckVersion) {
172
+ checkVersion = nextCheckVersion;
173
+ propProxyStates.forEach(([propProxyState]) => {
174
+ const propVersion = propProxyState[1](nextCheckVersion);
175
+ if (propVersion > version) {
176
+ version = propVersion;
177
+ }
178
+ });
179
+ }
180
+ return version;
181
+ };
182
+ const createPropListener = (prop) => (op, nextVersion) => {
183
+ let newOp;
184
+ if (op) {
185
+ newOp = [...op];
186
+ newOp[1] = [prop, ...newOp[1]];
187
+ }
188
+ notifyUpdate(newOp, nextVersion);
189
+ };
190
+ const propProxyStates = /* @__PURE__ */ new Map();
191
+ const addPropListener = (prop, propValue) => {
192
+ const propProxyState = !refSet.has(propValue) && proxyStateMap.get(propValue);
193
+ if (propProxyState) {
194
+ if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && propProxyStates.has(prop)) {
195
+ throw new Error("prop listener already exists");
196
+ }
197
+ if (listeners.size) {
198
+ const remove = propProxyState[2](createPropListener(prop));
199
+ propProxyStates.set(prop, [propProxyState, remove]);
200
+ } else {
201
+ propProxyStates.set(prop, [propProxyState]);
202
+ }
203
+ }
204
+ };
205
+ const removePropListener = (prop) => {
206
+ var _a;
207
+ const entry = propProxyStates.get(prop);
208
+ if (entry) {
209
+ propProxyStates.delete(prop);
210
+ (_a = entry[1]) == null ? void 0 : _a.call(entry);
211
+ }
212
+ };
213
+ const addListener = (listener) => {
214
+ listeners.add(listener);
215
+ if (listeners.size === 1) {
216
+ propProxyStates.forEach(([propProxyState, prevRemove], prop) => {
217
+ if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && prevRemove) {
218
+ throw new Error("remove already exists");
219
+ }
220
+ const remove = propProxyState[2](createPropListener(prop));
221
+ propProxyStates.set(prop, [propProxyState, remove]);
222
+ });
223
+ }
224
+ const removeListener = () => {
225
+ listeners.delete(listener);
226
+ if (listeners.size === 0) {
227
+ propProxyStates.forEach(([propProxyState, remove], prop) => {
228
+ if (remove) {
229
+ remove();
230
+ propProxyStates.set(prop, [propProxyState]);
231
+ }
232
+ });
233
+ }
234
+ };
235
+ return removeListener;
236
+ };
237
+ let initializing = true;
238
+ const handler = createHandler(
239
+ () => initializing,
240
+ addPropListener,
241
+ removePropListener,
242
+ notifyUpdate
243
+ );
244
+ const proxyObject = newProxy(baseObject, handler);
245
+ proxyCache.set(baseObject, proxyObject);
246
+ const proxyState = [baseObject, ensureVersion, addListener];
247
+ proxyStateMap.set(proxyObject, proxyState);
248
+ Reflect.ownKeys(baseObject).forEach((key) => {
249
+ const desc = Object.getOwnPropertyDescriptor(
250
+ baseObject,
251
+ key
252
+ );
253
+ if ("value" in desc && desc.writable) {
254
+ proxyObject[key] = baseObject[key];
255
+ }
256
+ });
257
+ initializing = false;
258
+ return proxyObject;
259
+ }
260
+ function getVersion(proxyObject) {
261
+ const proxyState = proxyStateMap.get(proxyObject);
262
+ return proxyState == null ? void 0 : proxyState[1]();
263
+ }
264
+ function subscribe(proxyObject, callback, notifyInSync) {
265
+ const proxyState = proxyStateMap.get(proxyObject);
266
+ if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !proxyState) {
267
+ console.warn("Please use proxy object");
268
+ }
269
+ let promise;
270
+ const ops = [];
271
+ const addListener = proxyState[2];
272
+ let isListenerActive = false;
273
+ const listener = (op) => {
274
+ if (op) {
275
+ ops.push(op);
276
+ }
277
+ if (notifyInSync) {
278
+ callback(ops.splice(0));
279
+ return;
280
+ }
281
+ if (!promise) {
282
+ promise = Promise.resolve().then(() => {
283
+ promise = void 0;
284
+ if (isListenerActive) {
285
+ callback(ops.splice(0));
286
+ }
287
+ });
288
+ }
289
+ };
290
+ const removeListener = addListener(listener);
291
+ isListenerActive = true;
292
+ return () => {
293
+ isListenerActive = false;
294
+ removeListener();
295
+ };
296
+ }
297
+ function snapshot(proxyObject) {
298
+ const proxyState = proxyStateMap.get(proxyObject);
299
+ if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !proxyState) {
300
+ console.warn("Please use proxy object");
301
+ }
302
+ const [target, ensureVersion] = proxyState;
303
+ return createSnapshot(target, ensureVersion());
304
+ }
305
+ function ref$1(obj) {
306
+ refSet.add(obj);
307
+ return obj;
308
+ }
309
+
310
+ const eventNames = {
311
+ "details.open": "toggle",
312
+ "input.value": "input",
313
+ "input.checked": "input",
314
+ "select.value": "change",
315
+ "select.selectedIndex": "change",
316
+ };
317
+ const boolProps = ["checked", "sticky-header"];
318
+
319
+ const tagGetValue = {
320
+ details: (element) => element.open,
321
+ input: (element) => {
322
+ if (element.type === "checkbox") {
323
+ return element.checked
324
+ }
325
+ if (element.type === "number") {
326
+ if (isNaN(element.valueAsNumber) === true) {
327
+ return null
328
+ }
329
+ return element.valueAsNumber
330
+ }
331
+ if (element.type === "date") {
332
+ return element.valueAsDate
333
+ }
334
+ return element.value
335
+ }
336
+ };
337
+ const registerInputValue = (tag, getter) => {
338
+ const name = tag.toLowerCase();
339
+ if (tagGetValue[name] !== undefined) {
340
+ return
341
+ }
342
+ tagGetValue[tag.toLowerCase()] = getter;
343
+ };
344
+
345
+ var options = /*#__PURE__*/Object.freeze({
346
+ __proto__: null,
347
+ boolProps: boolProps,
348
+ eventNames: eventNames,
349
+ registerInputValue: registerInputValue,
350
+ tagGetValue: tagGetValue
351
+ });
352
+
353
+ const propMods = [
354
+ (comp, props) => {
355
+ if (typeof comp === "string") {
356
+ return props
357
+ }
358
+
359
+ const { slot, ...rest } = props;
360
+ const filtered = {
361
+ slot: slot ?? {}
362
+ };
363
+ Object.keys(rest).forEach(
364
+ (key) => {
365
+ const value = props[key];
366
+ if (key.startsWith("slot:") === true) {
367
+ filtered.slot[key.slice(5)] = value;
368
+ return
369
+ }
370
+ filtered[key] = value;
371
+ }
372
+ );
373
+ return filtered
374
+ },
375
+ (comp, props) => {
376
+ if (typeof comp !== "string") {
377
+ return props
378
+ }
379
+ const filtered = {};
380
+ Object.keys(props).forEach(
381
+ (key) => {
382
+ const value = props[key];
383
+ if (key === "slot") {
384
+ return
385
+ }
386
+ if (key.startsWith("$$") === true) {
387
+ const prop = key.slice(2);
388
+ const target = `${comp.toLowerCase()}.${prop}`;
389
+ const evtname = eventNames[target] ?? "input";
390
+ filtered[prop] = value.value;
391
+ filtered[`on${evtname}`] = value.update;
392
+ return
393
+ }
394
+ if (key.startsWith("$") === true) {
395
+ return
396
+ }
397
+ // if prop is a boolean then pass the bool value, even if false
398
+ if (boolProps.includes(key) === true) {
399
+ filtered[key] = (value === true);
400
+ return
401
+ }
402
+ if (value === false || value === null) {
403
+ return
404
+ }
405
+ filtered[key] = (value === true) ? "" : value;
406
+ }
407
+ );
408
+ return filtered
409
+ },
410
+ // allow ws prop across entire codebase, convert at last minute
411
+ (component, props) => {
412
+ if (typeof component !== "string") {
413
+ return props
414
+ }
415
+ if (props.ws === undefined) {
416
+ return props
417
+ }
418
+ const { ws, ...rest } = props;
419
+ return { "data-ws": ws, ...rest }
420
+ },
421
+ ];
422
+ const modProps = (comp, props) => {
423
+ let modifiedProps = props;
424
+ for (const mod of propMods) {
425
+ modifiedProps = mod(comp, modifiedProps);
426
+ }
427
+ return modifiedProps
428
+ };
429
+
430
+ const diffChildren = (prev, next) => {
431
+ const nxt = next.children;
432
+ const prv = prev.children;
433
+ if (nxt.length !== prv.length) {
434
+ return true
435
+ }
436
+ const difIndex = nxt.findIndex(
437
+ (item, index) => prv[index] !== item
438
+ );
439
+ return difIndex !== -1
440
+ };
441
+
442
+ const versionCache = new WeakMap();
443
+ const valtimemo = (prev, next) => {
444
+ const prevVersion = versionCache.get(prev);
445
+ const nextVersion = Math.max(
446
+ ...Object.values(next).map(
447
+ value => getVersion(value) ?? 0
448
+ )
449
+ );
450
+ versionCache.set(next, nextVersion);
451
+ if (prevVersion !== nextVersion) {
452
+ return false
453
+ }
454
+
455
+ const keys = [...Object.keys(prev), ...Object.keys(next)];
456
+ for (const key of keys) {
457
+ if (key === "children" && diffChildren(prev, next) === true) {
458
+ return false
459
+ }
460
+ if (prev[key] !== next[key]) {
461
+ return false
462
+ }
463
+ }
464
+ return true
465
+ };
466
+
467
+ const cache$1 = new WeakMap();
468
+ const memod = (component) => {
469
+ if (typeof component === "string") {
470
+ return component
471
+ }
472
+ if (component.noMemo === true) {
473
+ return component
474
+ }
475
+ if (cache$1.has(component) === true) {
476
+ return cache$1.get(component)
477
+ }
478
+ cache$1.set(
479
+ component,
480
+ N$1(component, valtimemo)
481
+ );
482
+ return cache$1.get(component)
483
+ };
484
+ const normalizeChildren = (props, children) => {
485
+ const source = (children.length > 0) ? children : props.children;
486
+ const list =
487
+ [source]
488
+ .flat(Number.POSITIVE_INFINITY)
489
+ .filter(
490
+ item => (
491
+ item !== null
492
+ && item !== false
493
+ && item !== undefined
494
+ )
495
+ );
496
+ return {
497
+ ...props,
498
+ children: list,
499
+ }
500
+ };
501
+ const Element = (comp, props, ...children) => {
502
+ if (comp === undefined || comp === null) {
503
+ return null
504
+ }
505
+
506
+ return k$3(
507
+ memod(comp),
508
+ modProps(
509
+ comp,
510
+ normalizeChildren(props, children)
511
+ )
512
+ )
513
+ };
514
+
515
+ const randName = () => {
516
+ const rand = Math.floor(Math.random() * 1679615).toString(36);
517
+ return `${Date.now().toString(36)}${rand}`
518
+ };
519
+ const randKey = () => {
520
+ const rand = Math.floor(Math.random() * 4294967296).toString(36);
521
+ return `${Date.now().toString(36)}:${rand}`
522
+ };
523
+
524
+ const ref = (obj) => {
525
+ if (obj === null || obj === undefined) {
526
+ return null
527
+ }
528
+ return ref$1(obj)
529
+ };
530
+
531
+ const getInputValue = (element) => {
532
+ const tag = element.tagName?.toLowerCase?.() ?? null;
533
+ const getValue = tagGetValue[tag];
534
+ return getValue?.(element) ?? element.value
535
+ };
536
+
537
+ const __eachAlt = (list, alt) =>
538
+ (list.length > 0) ? list : alt();
539
+
540
+ const SubSlot = (props) => props.children;
541
+ const Slot = (props) => {
542
+ const { "*render": render, ...pass } = props;
543
+ if (render === null || render === undefined) {
544
+ return null
545
+ }
546
+ if (typeof render === "string") {
547
+ return render
548
+ }
549
+ return Element(
550
+ SubSlot,
551
+ { children: render(pass) }
552
+ )
553
+ };
554
+
555
+ // import { updateFuncs } from "./merge-tools.js"
556
+
557
+ const sharedState = (proxy) => {
558
+ const [value, set] = d$2(
559
+ Date.now() + Math.random()
560
+ );
561
+ h$2(
562
+ () => subscribe(
563
+ proxy,
564
+ () => set(
565
+ Date.now() + Math.random()
566
+ )
567
+ ),
568
+ []
569
+ );
570
+ return proxy
571
+ };
572
+
573
+ const localState = (baseValue) => {
574
+ const [localProxy, cleanup] = T$2(
575
+ () => {
576
+ const state =
577
+ (typeof baseValue === "function")
578
+ ? proxy(
579
+ baseValue()
580
+ )
581
+ : proxy(baseValue);
582
+ // updateFuncs(state)
583
+ const cleanup = subscribe(
584
+ state,
585
+ () => set(
586
+ Date.now() + Math.random()
587
+ )
588
+ );
589
+ return [state, cleanup]
590
+ },
591
+ []
592
+ );
593
+ const [value, set] = d$2(
594
+ Date.now() + Math.random()
595
+ );
596
+ h$2(
597
+ () => {
598
+ return () => cleanup()
599
+ },
600
+ []
601
+ );
602
+ return localProxy
603
+ };
604
+
605
+ const lock = (value) => {
606
+ if (typeof value === "function") {
607
+ return q$3(value, [])
608
+ }
609
+ const [lockedValue] = d$2(value);
610
+ return lockedValue
611
+ };
612
+
613
+ const calc = (f, changes = []) =>
614
+ T$2(f, changes);
615
+
616
+ const style$1 = document.createElement("style");
617
+ style$1.setAttribute("data-name", "zephyr-animations");
618
+ document.head.append(style$1);
619
+
620
+ const animation = (config) => {
621
+ const keyframes = [];
622
+ for (const [frame, styles] of Object.entries(config)) {
623
+ const entries = Object.entries(styles).map(
624
+ (entry) => `${entry[0]}: ${entry[1]};`
625
+ );
626
+ keyframes.push(`${frame} { ${entries.join("")} }`);
627
+ }
628
+ const name = `keyframes-${randName()}`;
629
+ style$1.sheet.insertRule(`@keyframes ${name} { ${keyframes.join(" ")} }`);
630
+ style$1.sheet.insertRule(`@keyframes ${name}-r { ${keyframes.join(" ")} }`);
631
+ return (duration, ease = "linear") =>
632
+ (suffix) => `${name}${suffix} ${duration}ms ${ease}`
633
+ };
634
+ const fade = animation({
635
+ "0%": {
636
+ opacity: 0
637
+ },
638
+ "100%": {
639
+ opacity: 1
640
+ },
641
+ });
642
+ const drop = animation({
643
+ "0%": {
644
+ scale: 1.4
645
+ },
646
+ "100%": {
647
+ scale: 1
648
+ },
649
+ });
650
+ const pop = animation({
651
+ "0%": {
652
+ scale: 0.6
653
+ },
654
+ "100%": {
655
+ scale: 1
656
+ },
657
+ });
658
+ const slideTop = animation({
659
+ "0%": {
660
+ translate: "0 -50px"
661
+ },
662
+ "100%": {
663
+ translate: "0 0px"
664
+ },
665
+ });
666
+ const slideBottom = animation({
667
+ "0%": {
668
+ translate: "0 50px"
669
+ },
670
+ "100%": {
671
+ translate: "0 0px"
672
+ },
673
+ });
674
+ const visible = animation({
675
+ "0%": {
676
+ visibility: "hidden",
677
+ },
678
+ "100%": {
679
+ visibility: "visible",
680
+ },
681
+ });
682
+ const spinCW = animation({
683
+ "0%": {
684
+ rotate: "0deg",
685
+ },
686
+ "100%": {
687
+ rotate: "360deg",
688
+ },
689
+ });
690
+ const slideLeft = animation({
691
+ "0%": {
692
+ translate: "-100% 0"
693
+ },
694
+ "100%": {
695
+ translate: "0% 0"
696
+ },
697
+ });
698
+
699
+ const register = (keyed, child, pos, local) => {
700
+ if (keyed.has(child.key) === true) {
701
+ const item = keyed.get(child.key);
702
+ item.child = child;
703
+ item.active = (item.phase === "none") ? child : item.active;
704
+ return item
705
+ }
706
+ const enter = [child.props.$enter ?? child.props.$animate].flat();
707
+ const exit = [child.props.$exit ?? child.props.$animate].flat();
708
+ const item = {
709
+ pos,
710
+ child,
711
+ phase: "enter",
712
+ anims: {
713
+ enter: enter.map(anim => `${anim("")} 0s 1 normal forwards`).join(", "),
714
+ enterCount: enter.length,
715
+ exit: exit.map(anim => `${anim("-r")} 0s 1 reverse forwards`).join(", "),
716
+ exitCount: exit.length,
717
+ },
718
+ clone(style, events) {
719
+ const baseStyle = child.props?.style ?? "";
720
+ return W$2(
721
+ child,
722
+ {
723
+ ...child.props,
724
+ style: `${baseStyle};animation: ${style};`,
725
+ ...events,
726
+ }
727
+ )
728
+ },
729
+ };
730
+ let count = 0;
731
+ item.active = item.clone(
732
+ item.anims.enter,
733
+ {
734
+ "onanimationend": () => {
735
+ count += 1;
736
+ if (count < item.anims.enterCount) {
737
+ return
738
+ }
739
+ item.phase = "none";
740
+ item.active = item.clone("none", {});
741
+ local.update = Math.random();
742
+ }
743
+ }
744
+ );
745
+ keyed.set(child.key, item);
746
+ return item
747
+ };
748
+ const Transitions = (props) => {
749
+ const { children, enter, exit = enter, anim } = props;
750
+ const keyed = lock(new Map());
751
+ const local = localState({
752
+ update: null
753
+ });
754
+
755
+ const display = [];
756
+ const current = children.map(
757
+ (child, pos) => {
758
+ const item = register(keyed, child, pos, local);
759
+ display.push(
760
+ item.active
761
+ );
762
+ return child.key
763
+ }
764
+ );
765
+ keyed.keys().forEach(
766
+ key => {
767
+ if (current.includes(key) === true) {
768
+ return
769
+ }
770
+ const item = keyed.get(key);
771
+ if (item.phase === "exit") {
772
+ display.splice(item.pos, 0, item.active);
773
+ return
774
+ }
775
+ let count = 0;
776
+ item.phase = "exit";
777
+ item.active = item.clone(
778
+ item.anims.exit,
779
+ {
780
+ "onanimationend": () => {
781
+ count += 1;
782
+ if (count < item.anims.exitCount) {
783
+ return
784
+ }
785
+ keyed.delete(key);
786
+ local.update = Math.random();
787
+ }
788
+ }
789
+ );
790
+ display.splice(item.pos, 0, item.active);
791
+ }
792
+ );
793
+
794
+ return display
795
+ };
796
+
797
+ const e=Symbol("no match"),t=(t,r)=>{const o=r=>{const o=r.length;return ()=>r===t.substr(N,o)?(N+=o,r):e},a=r=>()=>{const o=t.charAt(N);return false!==r.test(o)?(N+=1,o):e};let s=null;const i=o("@"),n=o(":"),l=a(/[^;]/),c=o(";"),d=o("*"),p=a(/[a-z0-9_\-]/i),h=o("!"),u=a(/[^{]/),g=o("{"),f=o("}"),b=a(/[a-zA-Z0-9\.\-_#\^\$\/]/),m=o("#"),x=a(/[^;#]/),v=a(/[\s]/m),w=()=>{const t=N;let r=null,o=null;return (r=P())===e||(o=z())===e?(N=t,e):[r,o]},y=()=>{const r=N;let o=null,a=null;return (o=m())===e||(a=(()=>{const r=N,o=N;for(;x()!==e;);return N-o==0?e:t.slice(r,N)})())===e?(N=r,e):[o,a]},k=()=>{s="rules";let t=N,r=null;const o=[];let a=null;for(;(a=w())!==e;)o.push(a);if(r=o,P()===e)return N=t,e;return r.map((e=>e[1]))},z=()=>{let t=null;return (t=$())!==e||(t=A())!==e||(t=L())!==e||(t=E())!==e?t:e},$=()=>{s="rule$0";let t=N,r=null;if((r=S())===e)return N=t,e;return r},A=()=>{s="rule$1";let t=N,r=null;if((r=q())===e)return N=t,e;return r},L=()=>{s="rule$2";let t=N,r=null;if((r=C())===e)return N=t,e;return r},E=()=>{s="rule$3";let t=N,r=null;if((r=T())===e)return N=t,e;return r},S=()=>{s="variable";let r=N,o=null,a=null;if(i()===e)return N=r,e;if((o=M())===e)return N=r,e;if(n()===e)return N=r,e;if(P()===e)return N=r,e;if((a=(()=>{const r=N,o=N;for(;l()!==e;);return N-o==0?e:t.slice(r,N)})())===e)return N=r,e;if(c()===e)return N=r,e;return ((e,t)=>({type:"var",name:e,value:t}))(o,a)},q=()=>{s="css";let r=N,o=null,a=null;if(d()===e)return N=r,e;if((o=M())===e)return N=r,e;if(n()===e)return N=r,e;if(P()===e)return N=r,e;if((a=(()=>{const r=N,o=N;for(;l()!==e;);return N-o==0?e:t.slice(r,N)})())===e)return N=r,e;if(c()===e)return N=r,e;return ((e,t)=>({type:"css",name:e,value:t}))(o,a)},M=()=>{s="cssName";let r=N,o=null;if((o=(()=>{const r=N,o=N;for(;p()!==e;);return N-o==0?e:t.slice(r,N)})())===e)return N=r,e;return o},C=()=>{s="subrule";let r=N,o=null,a=null;if(h()===e)return N=r,e;if(P()===e)return N=r,e;if((o=(()=>{const r=N,o=N;for(;u()!==e;);return N-o==0?e:t.slice(r,N)})())===e)return N=r,e;if(g()===e)return N=r,e;if((a=k())===e)return N=r,e;if(f()===e)return N=r,e;var i;return i=a,{type:"alt",selector:o.trim(),rules:i}},T=()=>{s="macro";let r=N,o=null,a=null;if((o=(()=>{const r=N,o=N;for(;b()!==e;);return N-o==0?e:t.slice(r,N)})())===e)return N=r,e;const i=(()=>{const t=N;let r=null,o=null,a=null;return (r=n())===e||(o=P())===e||(a=I())===e?(N=t,e):[r,o,a]})();if(a=i===e?null:i,c()===e)return N=r,e;return ((e,t)=>({type:"macro",name:e,value:t?.[2]}))(o,a)},I=()=>{let t=null;return (t=V())!==e||(t=j())!==e?t:e},V=()=>{s="macroValue$0";let t=null;const r=[];let o=null;for(;(o=y())!==e;)r.push(o);if(0===r.length)return e;t=r;return (e=>{const t=e.map((e=>e[1].trim()));return t.arg=t.join(" "),t})(t)},j=()=>{s="macroValue$1";let r=N,o=null;if((o=(()=>{const r=N,o=N;for(;l()!==e;);return N-o==0?e:t.slice(r,N)})())===e)return N=r,e;return (e=>{const t=[e.trim()];return t.arg=e,t})(o)},P=()=>{for(s="_";v()!==e;);};let N=0;const H=(()=>{s="$";let t=N,r=null;if((r=k())===e)return N=t,e;return r})();return N!==t.length?(console.log("last",s),console.log("@",N),console.log(t.slice(N-10,N+10)),new Error("End of input not found")):H},r=document.createElement("style");r.setAttribute("data-name","windstorm-generated"),r.innerHTML="@layer ws.custom ws.user ws.element;",document.head.append(r);const o=(e,...r)=>{const o=String.raw(e,...r);return a(t(o),{"&":[]},"&")},a=(e,t,r)=>{for(const o of e)i(o,t,r);return t},s=e=>e.replace(/@([a-zA-Z0-9\-_]+)/g,((e,t)=>`var(--${t})`)),i=(e,t,r)=>{if("var"===e.type)return void t[r].push(`--${e.name}: ${s(e.value)};`);if("css"===e.type)return void t[r].push(`${e.name}: ${s(e.value)};`);if("macro"===e.type){const o=n[e.name];if(void 0===o)return void console.warn(`no macro for "${e.name}"`);for(const[a,i]of Object.entries(o)){const o=a.replace("&",r);t[o]=t[o]??[],t[o].push(...i.map((t=>s(t.replace(/%(arg|\d+)/g,((t,r)=>e.value?.[r]??""))))));}return}const o=e.selector.replaceAll("&",r);t[o]=[...t[o]??[]],a(e.rules,t,o);},n={},l=e=>void 0!==n[e]?()=>{}:(t,...r)=>n[e]=o(t,...r),c=e=>Object.entries(e).reduce(((e,[t,r])=>{if(true===t.startsWith("|")){const o=t.lastIndexOf("|"),a=[`@media (${t.slice(1,o)}) {`,`${`&${t.slice(o+1)}`} {`,...r,"}","}"].join("\n");return e.push(a),e}return e.push(`${t} {\n${r.join("\n")}\n}`),e}),[]),d=(e,t="ws.custom")=>(a,...s)=>{const i=o(a,...s);e.startsWith("@");const n=c(i).map((t=>t.replaceAll("&",e))),l=`@layer ${t} { ${n.join("\n")} }`;r.sheet.insertRule(l);};const p={origin:"https://wind-cdn.axel669.net",...window.wsConfig,version:"1.0.0-beta.9",iconVersion:"3.34.0"},h={},u=async(e,t)=>{const r=h[t],o=`ws-icon-${t}`;if(void 0!==r){if(await r.loaded,"loaded"!==r.status||null===e)return;return void e.style.setProperty("--icon-font",o)}const a=new FontFace(o,`url(${p.origin}/icon/${t}.woff?v${p.iconVersion})`);h[t]=a;try{await a.load();}catch(e){console.error(e);}document.fonts.add(a),u(e,t);},g=e=>{if(void 0===e.tagName)return;const t=e.dataset.icon??null;null!==t&&u(e,t);},f={childList(e){0!==e.addedNodes.length&&e.addedNodes.forEach((e=>{if(void 0===e.tagName)return;[e,...e.querySelectorAll("*")].forEach(g);}));},attributes(e){g(e.target);}};new MutationObserver((e=>e.forEach((e=>f[e.type](e))))).observe(document.body,{subtree:true,attributes:true,childList:true,attributeFilter:["data-icon"]});const b=(...e)=>{for(const t of e)u(null,t);};l("appr")`*apperance:%arg; *-webkit-appearance:%arg;`,l("area")`*grid-area:%arg;`,l("b")`*border:%arg;`,l("b.b")`*border-bottom:%arg;`,l("b.b.c")`*border-bottom-color:%arg;`,l("b.b.s")`*border-bottom-style:%arg;`,l("b.b.w")`*border-bottom-width:%arg;`,l("b.c")`*border-color:%arg;`,l("b.l")`*border-left:%arg;`,l("b.l.c")`*border-left-color:%arg;`,l("b.l.s")`*border-left-style:%arg;`,l("b.l.w")`*border-left-width:%arg;`,l("b.r")`*border-right:%arg;`,l("b.r.c")`*border-right-color:%arg;`,l("b.r.s")`*border-right-style:%arg;`,l("b.r.w")`*border-right-width:%arg;`,l("b.s")`*border-style:%arg;`,l("b.t")`*border-top:%arg;`,l("b.t.c")`*border-top-color:%arg;`,l("b.t.s")`*border-top-style:%arg;`,l("b.t.w")`*border-top-width:%arg;`,l("b.w")`*border-width:%arg;`,l("b.x")`*border-left:%arg; *border-right:%arg;`,l("b.x.c")`*border-left-color:%arg; *border-right-color:%arg;`,l("b.x.s")`*border-left-style:%arg; *border-right-style:%arg;`,l("b.x.w")`*border-left-width:%arg; *border-right-width:%arg;`,l("b.y")`*border-top:%arg; *border-bottom:%arg;`,l("b.y.c")`*border-top-color:%arg; *border-bottom-color:%arg;`,l("b.y.s")`*border-top-style:%arg; *border-bottom-style:%arg;`,l("b.y.w")`*border-top-width:%arg; *border-bottom-width:%arg;`,l("bg")`*background:%arg;`,l("bg.att")`*background-attachment:%arg;`,l("bg.c")`*background-color:%arg;`,l("bg.img")`*background-image:%arg;`,l("bg.pos")`*background-position:%arg;`,l("bg.rep")`*background-repeat:%arg;`,l("bg.sz")`*background-size:%arg;`,l("c")`*color:%arg;`,l("col")`*grid-column:%arg;`,l("cur")`*cursor:%arg;`,l("disp")`*display:%arg;`,l("fl.basis")`*flex-basis:%arg;`,l("fl.cross")`*align-items:%arg;`,l("fl.dir")`*flex-direction:%arg;`,l("fl.flow")`*flex-flow:%arg;`,l("fl.grow")`*flex-grow:%arg;`,l("fl.main")`*justify-content:%arg;`,l("fl.shrink")`*flex-shrink:%arg;`,l("fl.size")`*flex:%arg;`,l("fl.wr")`*flex-wrap:%arg;`,l("font")`*font-family:%arg;`,l("gap")`*gap:%arg;`,l("gap.col")`*column-gap:%arg;`,l("gap.row")`*row-gap:%arg;`,l("gr.areas")`*grid-template-areas:%arg;`,l("gr.cols")`*grid-template-columns:%arg;`,l("gr.cols.a")`*grid-auto-columns:%arg;`,l("gr.flow")`*grid-auto-flow:%arg;`,l("gr.rows")`*grid-template-rows:%arg;`,l("gr.rows.a")`*grid-auto-rows:%arg;`,l("h")`*height:%arg;`,l("h.max")`*max-height:%arg;`,l("h.min")`*min-height:%arg;`,l("inset")`*top:%arg; *left:%arg; *bottom:%arg; *right:%arg;`,l("inset.x")`*left:%arg; *right:%arg;`,l("inset.y")`*top:%arg; *bottom:%arg;`,l("m")`*margin:%arg;`,l("m.b")`*margin-bottom:%arg;`,l("m.l")`*margin-left:%arg;`,l("m.r")`*margin-right:%arg;`,l("m.t")`*margin-top:%arg;`,l("m.x")`*margin-left:%arg; *margin-right:%arg;`,l("m.y")`*margin-bottom:%arg; *margin-top:%arg;`,l("o")`*opacity:%arg;`,l("outln")`*outline:%arg;`,l("over")`*overflow:%arg;`,l("over.x")`*overflow-x:%arg;`,l("over.y")`*overflow-y:%arg;`,l("p")`*padding:%arg;`,l("p.b")`*padding-bottom:%arg;`,l("p.l")`*padding-left:%arg;`,l("p.r")`*padding-right:%arg;`,l("p.t")`*padding-top:%arg;`,l("p.x")`*padding-left:%arg; *padding-right:%arg;`,l("p.y")`*padding-top:%arg; *padding-bottom:%arg;`,l("pos")`*position:%arg;`,l("pos.abs")`*position:absolute;`,l("pos.fix")`*position:fixed;`,l("pos.rel")`*position:relative;`,l("pos.stick")`*position:sticky;`,l("r")`*border-radius:%arg;`,l("r.b")`*border-bottom-left-radius:%arg; *border-bottom-right-radius:%arg;`,l("r.bl")`*border-bottom-left-radius:%arg;`,l("r.br")`*border-bottom-right-radius:%arg;`,l("r.l")`*border-top-left-radius:%arg; *border-bottom-left-radius:%arg;`,l("r.r")`*border-top-right-radius:%arg; *border-bottom-right-radius:%arg;`,l("r.t")`*border-top-left-radius:%arg; *border-top-right-radius:%arg;`,l("r.tl")`*border-top-left-radius:%arg;`,l("r.tr")`*border-top-right-radius:%arg;`,l("row")`*grid-row:%arg;`,l("sel")`*user-select:%arg;`,l("self.cross")`*align-self:%arg;`,l("self.main")`*justify-self:%arg;`,l("sh.box")`*box-shadow:%arg;`,l("sh.text")`*text-shadow:%arg;`,l("t.a")`*text-align:%arg;`,l("t.br")`*word-break:%arg;`,l("t.c")`*color:%arg;`,l("t.deco")`*text-decoration:%arg;`,l("t.lh")`*line-height:%arg;`,l("t.over")`*text-overflow:%arg;`,l("t.st")`*font-style:%arg;`,l("t.sz")`*font-size:%arg;`,l("t.tf")`*text-transform:%arg;`,l("t.var")`*font-variant:%arg;`,l("t.wrap")`*word-wrap:%arg;`,l("t.ws")`*white-space:%arg;`,l("t.wt")`*font-weight:%arg;`,l("tf")`*transform:%arg;`,l("tf.o")`*transform-origin:%arg;`,l("tf.p")`*perspective:%arg;`,l("tr")`*transition:%arg;`,l("v.a")`*vertical-align:%arg;`,l("vis")`*visibility:%arg;`,l("w")`*width:%arg;`,l("w.max")`*max-width:%arg;`,l("w.min")`*min-width:%arg;`,l("x")`*left:%arg;`,l("-x")`*right:%arg;`,l("y")`*top:%arg;`,l("-y")`*bottom:%arg;`,l("z")`*z-index:%arg;`,l("fl.cn")`fl.cross:center; fl.main:center;`,l("fl.cn.cross")`fl.cross:center;`,l("fl.cn.main")`fl.main:center;`,l("flex")`disp:flex; fl.dir:%arg;`,l("grid")`disp:grid; gr.flow:%arg;`,l("hide")`disp:none;`,l("invis")`vis:hidden;`,l("sticky")`pos:sticky; y:0px; z:+1;`,l("adorn")`disp:flex; fl.cn; p:4px;`,l("pad.compact")`p:0px 4px;`,l("var.outln")`b.w:1px;`,l("var.fill")` @text-color:@c2; @fill-color:@c1; @active:@c2; b.c:transparent; `,l("fill.reset")` @text-color:initial; @fill-color:initial; `,l("var.lined")`b.w:0px; b.b.w:@border-size; r.b:0px;`,l("gr.cols-fit")`*grid-template-columns:repeat(auto-fit, minmax(%arg));`,l("gr.cols-fill")`*grid-template-columns:repeat(auto-fill, minmax(%arg));`,l("text.subtitle")`t.sz:@text-size-subtitle; flex; fl.main:center; p:0px 8px;`,l("text.title")`t.sz:@text-size-title; flex; fl.main:center; p:4px 8px;`,l("raise")`sh.box:0px calc(%arg * 1px + 2px) calc(%arg * 1px + 1px) -1px @shadow-color; z:+%arg;`,l("raised")`raise:1;`,l("scrollable")`over:auto;`,l("#animate")` @modal-transition:visibility @anim-time linear; @dialog-transition:opacity @anim-time ease; @popover-transition:opacity @anim-time ease; @drawer-transition:transform @anim-time ease; `,l("#no-animate")` @modal-transition:none; @dialog-transition:none; @popover-transition:none; @drawer-transition:none; `,l("#no-select-animate")` @select-cancel:none; `,l("layout.base")` over:hidden; disp:grid; ! body > & { pos:absolute; x:0px; y:0px; w:100%; h:100%; } ! :where(&) > * { area:content; } `,l("layout.3x3-center")` layout.base; @width:auto; @height:auto; disp:grid; gr.cols:[left-start top-start bottom-start] 1fr [left-end content-start] @width [content-end right-start] 1fr [right-end top-end bottom-end] ; gr.rows:[top-start left-start right-start] 1fr [top-end content-start] @height [content-end bottom-start] 1fr [bottom-end left-end right-end] ; `,l("layout.3row-center")` @height:auto; layout.base; disp:grid; gr.cols.a:1fr; gr.rows:1fr @height 1fr; gr.areas:"top" "content" "bottom"; `,l("layout.3col-center")` @width:auto; layout.base; disp:grid; gr.cols:1fr @width 1fr; gr.rows.a:1fr; gr.areas:"left content right"; `,l("layout.3row-controls")` layout.base; disp:grid; gr.cols.a:1fr; gr.rows:min-content 1fr min-content; gr.areas:"header" "content" "footer"; `,l("layout.3col-controls")` layout.base; disp:grid; gr.cols:min-content 1fr min-content; gr.rows.a:1fr; gr.areas:"menu content action"; `,l("layout.2col-sidebar")` layout.base; @col-a:1fr; @col-b:2fr; disp:grid; gr.cols:@col-a @col-b; gr.rows.a:1fr; gr.areas:"sidebar content"; `;const m=e=>Object.entries(e).reduce(((e,t)=>{const[r,o]=t;return null==o||false===o?e:true===o?(e.push(`${r};`),e):"object"==typeof o?(e.push(`${r} { ${m(o)} }`),e):(e.push(`${r}: ${o};`),e)}),[]).join(" "),x=(e,t="ws.user")=>d(e,t),v=p.version,w={get mobile(){return matchMedia("(hover: none)")}};d("*")` *box-sizing:border-box; *-webkit-tap-highlight-color:transparent; *border-width:0px; *border-style:solid; *outline-color:hsl(@mono, @layer-text); `,d("html, body")` *padding:0px; *margin:0px; *width:100%; *height:100%; *-webkit-tap-highlight-color:transparent; *-webkit-font-smoothing:antialiased; `,d("@font-face",null)` *font-family:Tektur; *font-display:swap; *src:url(${p.origin}/font/tektur.woff2?v${p.version}) format("woff2") ; `,d("@font-face",null)` *font-family:Roboto; *font-display:swap; *src:url(${p.origin}/font/roboto.woff2?v${p.version}) format("woff2") ; `;const y=Math.ceil(screen.height*devicePixelRatio*10)%10>=5;l("#theme.base")` font:@font; @sub-pixel-offset:${y?1:0}px; @z-info:5; @z-cover:25; @z-notif:50; @z-layer:100; @base-radius:4px; @anim-time:250ms; @short-anim-time:150ms; @text-size-normal:15px; @text-size-title:calc(@text-size-normal * 2); @text-size-header:calc(@text-size-normal * 1.5); @text-size-subtitle:calc(@text-size-normal * 0.9); @text-size-info:calc(@text-size-normal * 0.75); @color:@mono; @page-text-color:hsl(@color, @layer-text); bg.c:hsl(@color, @layer-bg); t.c:@page-text-color; t.sz:@text-size-normal; `,l("#theme.tron")` #theme.base; @font:Tektur; @mono:0, 0%; @primary:184, 80%; @accent:160, 80%; @info:208, 80%; @success:130, 80%; @warning:58, 80%; @error:4, 80%; @layer-bg:10%; @layer-surface:5%; @layer-element:60%; @layer-container:10%; @layer-border:25%; @layer-text:95%; @layer-fill:5%; @shadow-color:hsla(0, 0%, 69%, 0.25); @modal-color:hsla(0, 0%, 0%, 0.05); *color-scheme:dark; `,l("#theme.dark")` #theme.base; @font:Roboto; @mono:0, 0%; @primary:184, 80%; @accent:160, 80%; @info:208, 80%; @success:130, 80%; @warning:58, 80%; @error:4, 80%; @layer-bg:20%; @layer-surface:10%; @layer-element:50%; @layer-container:15%; @layer-border:30%; @layer-text:90%; @layer-fill:10%; @shadow-color:hsla(0, 0%, 69%, 0.25); @modal-color:hsla(0, 0%, 0%, 0.05); *color-scheme:dark; `,l("#theme.light")` #theme.base; @font:Roboto; @mono:0, 0%; @primary:184, 70%; @accent:160, 85%; @info:208, 85%; @success:130, 90%; @warning:58, 85%; @error:4, 80%; @layer-bg:85%; @layer-surface:95%; @layer-element:37.5%; @layer-container:90%; @layer-border:80%; @layer-text:10%; @layer-fill:95%; @shadow-color:hsla(0, 0%, 20%, 0.25); @modal-color:hsla(0, 0%, 0%, 0.05); `;var k=(e,...t)=>{const r=String.raw(e,...t),o=document.createElement("template");return o.innerHTML=r,()=>o.content.cloneNode(true)};d("ws-circle-spinner, ws-hexagon-spinner")` @size:100px; w:@size; h:@size; disp:inline-block; `;const z=k` <style> :host { --color:var(--primary); --core-color:hsl(var(--color), var(--layer-element)); --alt-color:hsl(var(--color), var(--layer-border)); --size:200px; } svg { width:var(--size); height:var(--size); } @keyframes turn { 0% { transform:rotate(0deg); } 100% { transform:rotate(360deg); } } circle { animation-name:turn; animation-duration:calc(1000ms * var(--n)); animation-iteration-count:infinite; animation-timing-function:ease; stroke:var(--c); stroke-width:6; fill:none; animation-direction:var(--anim); } </style> <svg viewbox="-50 -50 100 100"> <circle style="--c:var(--core-color);--o:1; --anim:forward; --n:2.5;" cx=0 cy=0 r=45 stroke-dasharray="45 45"></circle> <circle style="--c:var(--alt-color);--o:0.5; --anim:reverse; --n:2;" cx=0 cy=0 r=35 stroke-dasharray="35 35"></circle> <circle style="--c:var(--core-color);--o:0.75; --anim:forward; --n:3.5;" cx=0 cy=0 r=25 stroke-dasharray="25 25"></circle> </svg> `;customElements.define("ws-circle-spinner",class extends HTMLElement{constructor(){super();this.attachShadow({mode:"closed"}).appendChild(z());}});const $=k` <style> :host { --color:var(--primary); --core-color:hsl(var(--color), var(--layer-element)); --alt-color:hsl(var(--color), var(--layer-border)); --size:200px; } svg { width:var(--size); height:var(--size); } circle { stroke-width:0; fill:var(--c); offset-path:path("M 0 -45 L 39 -22.5 L 39 22.5 L 0 45 L -39 22.5 L -39 -22.5 L 0 -45"); animation-name:mover; animation-duration:3000ms; animation-iteration-count:infinite; animation-timing-function:linear; } @keyframes mover { 0% { offset-distance:0%; } 100% { offset-distance:100%; } } @keyframes trail { 0% { stroke-dashoffset:0; } 100% { stroke-dashoffset:var(--len); } } path { animation-name:trail; animation-duration:3000ms; animation-iteration-count:infinite; animation-timing-function:linear; stroke:var(--c); stroke-width:6; fill:none; animation-direction:var(--anim); } </style> <svg viewbox="-50 -50 100 100"> <path d="M 0 -36 L 31 -18 L 31 18 L 0 36 L -31 18 L -31 -18 L 0 -36 Z" style="--c:var(--alt-color); --len:216;" stroke-dasharray="36 36" /> <path d="M 0 -22.5 L 19.5 -11.25 L 19.5 11.25 L 0 22.5 L -19.5 11.25 L -19.5 -11.25 L 0 -22.5 Z" style="--c:var(--core-color); --anim:reverse; --len:135;" stroke-dasharray="22.5 22.5" /> <circle r="3" style="--c:var(--core-color); animation-delay:-250ms;"/> <circle r="3" style="--c:var(--core-color); animation-delay:-1250ms;" /> <circle r="3" style="--c:var(--core-color); animation-delay:-2250ms;" /> </svg> `;customElements.define("ws-hexagon-spinner",class extends HTMLElement{constructor(){super();this.attachShadow({mode:"closed"}).appendChild($());}});var A=(e,t,r)=>` @l1:${e}; @l2:${t}; @l3:${r}; @c1:hsl(@color, @l1); @c2:hsl(@color, @l2); @c3:hsl(@color, @l3); @fill:var(--fill-color, transparent); @text:var(--text-color, @c1); @border:var(--border-color, @c3); @active:@text; `;d("ws-avatar")` @color:@mono; @size:36px; ${A("@layer-element","@layer-fill")} disp:inline-flex; over:hidden; r:500px; fl.cross:center; fl.main:center; w:@size; h:@size; bg.c:@fill; t.c:@text; v.a:text-bottom; ! & > img { w:100%; } ! & > object { w:100%; h:100%; disp:flex; fl.cross:center; fl.main:center; } `,d("ws-badge")` @color:@primary; ${A("@layer-element","@layer-fill")} pos:relative; disp:inline-grid; over:visible; ! &::after { pos:absolute; *content:attr(ws-text); -x:-10px; y:0px; tf:translateY(-50%); bg.c:@c1; *pointer-events:none; r:20px; p:4px; w.min:20px; h:20px; *box-sizing:border-box; t.a:center; t.sz:@text-size-subtitle; t.c:@c2; t.lh:14px; z:@z-info; t.wt:600; } `;var L=' over:hidden; pos:relative; cur:pointer; ! &::after { *content:""; pos:absolute; y:0px; x:0px; -y:0px; -x:0px; *pointer-events:none; o:0; bg.c:@active; tr:opacity @anim-time linear; } ! &:where(:not(:disabled)):active::after { tr:none; o:0.3; } ',E=' over:hidden; pos:relative; ! |hover:hover| { ! &::before { *content:""; pos:absolute; y:0px; x:0px; -y:0px; -x:0px; *pointer-events:none; o:0; bg.c:@active; } ! &:where(:not(:disabled)):hover::before { tr:none; o:0.1; } } ';d(":where(button[data-ws], a[data-ws][button], label[data-ws][button])")` @color:@primary; ${A("@layer-element","@layer-fill","@layer-border")} pos:relative; b:0px solid @border; font:@font; t.c:@text; bg.c:@fill; r:@base-radius; cur:pointer; p:8px 16px; over:hidden; *user-select:none; disp:inline-flex; fl.cross:center; fl.main:center; t.deco:none; t.wt:500; ! &:disabled { cur:default; *filter:saturate(30%) brightness(0.7); } ${E} ${L} `,d("ws-chip")` @color:@mono; ${A("@layer-element","@layer-fill","@layer-border")} disp:inline-flex; fl.cross:center; fl.main:center; r:100px; p:4px 12px; *user-select:none; v.a:text-bottom; t.c:@text-color; bg:@fill-color; b:1px solid @border; ! &[clickable] { cur:pointer; ${L} } `,d("label[control][data-ws]")` @color:@primary; @active:@mono; pos:relative; disp:inline-grid; gr.areas:"label label label" "start control end" "extra extra extra"; gr.rows:minmax(0px, min-content) auto minmax(0px, min-content); gr.cols:minmax(0px, min-content) auto minmax(0px, min-content); *user-select:none; over:hidden; b:0px solid hsl(@color, @layer-border); bg.c:hsl(@active, @layer-container); r:@base-radius; ! &:focus-within { @active:@color; } ! &:has(:not(button):disabled) { *filter:saturate(50%) brightness(0.7); } ! & > :is(input, select, ws-select, textarea) { area:control; b.w:0px; @color:inherit; ! &:focus { outln:none; } } ! & > :where(input, textarea) { t.c:hsl(@mono, @layer-text); font:@font; h.min:28px; w:100%; h:100%; p:4px; bg.c:transparent; w.min:16px; } ! & > :where(input[type="file"]) { pos:relative; p:0px; ! &::file-selector-button { font:@font; h:100%; m:0px; m.r:4px; p:4px; t.c:hsl(@color, @layer-element); bg.c:transparent; b.w:0px; t.deco:underline; } } ! & > [label-text] { area:label; p:4px; disp:flex; fl.dir:column; fl.cross:start; t.c:hsl(@color, @layer-element); t.ws:nowrap; t.sz:@text-size-normal; } `,b("caret-right-filled"),d(":where(details[data-ws])")` @color:@primary; @padding:8px; ${A("@layer-element","@layer-fill")} b:0px solid @c3; p:0px @padding; r:4px; over:hidden; ! &:open { p.b:@padding; } ! & > summary { t.c:@c1; pos:relative; p:4px; p.l:24px; m.x:calc(-1 * @padding); cur:pointer; *user-select:none; ! &::before { pos:absolute; x:0px; y:50%; -y:0px; w:1em; disp:flex; fl.cross:center; fl.main:center; font:ws-icon-caret-right-filled; *speak:none; t.st:normal; t.wt:400; t.var:normal; t.tf:none; *content:"caret-right-filled"; tf:translateY(-50%); tr:transform 100ms linear; w:24px; h:24px; t.lh:24px; t.sz:18px; } ! &::marker, &::-webkit-details-marker { *content:""; disp:none; } } ! &:open > summary::before { tf:translateY(-50%) rotate(90deg); } `,d("ws-dialog")` pos:absolute; x:50%; y:50%; tf:translate(-50%, -50%); tr:var(--dialog-transition, none); o:0; ! [open] > & { o:unset; } ! [inline-desktop] > & { pos:relative; } `,d("ws-drawer")` pos:absolute; x:0px; y:0px; -y:0px; disp:grid; tr:var(--drawer-transition, none); tf:translateX(-100%); ! [open] > & { tf:unset; } `,d("ws-flex")` flex:column; gap:8px; p:8px; over:hidden; ! & > * { fl.shrink:0; } `,d("ws-grid")` disp:grid; over:hidden; gap:8px; p:8px; gr.rows.a:min-content; `,d("ws-icon")` disp:var(--icon-font, none); t.lh:1; ! &::before { disp:inline-block; font:@icon-font; *-webkit-font-smoothing:antialiased; *-moz-osx-font-smoothing:grayscale; *content:attr(data-icon); m.t:2px; } `,d("a[data-ws]:not([button])")` @color:@primary; t.c:hsl(@color, @layer-element); ! &:visited, &:hover { t.c:hsl(@color, @layer-element); } ! &[disabled] { *pointer-events:none; *filter:saturation(30%) brightness(0.7); } `;const S=k` <style> :host { position:fixed; top:0px; left:0px; width:100vw; height:100vh; background-color:var(--modal-color); z-index:var(--z-cover); transition:var(--modal-transition, none); backdrop-filter:blur(2px); } ws-modal-overlay { position:absolute; inset:0px; } ws-modal-overlay:focus { outline:none; } :host(:not([open])) { visibility:hidden; } :host([clear]) { background-color:transparent; } @media (hover:hover) { :host([inline-desktop]) { position:relative; width:unset; height:unset; display:grid; grid-template-columns:1fr; grid-template-rows:1fr; z-index:unset; } :host([inline-desktop]) ws-modal-overlay { display:none; } } </style> <ws-modal-overlay> </ws-modal-overlay> <slot></slot> `;customElements.define("ws-modal",class extends HTMLElement{#e=null;constructor(){super(),this.#e=this.attachShadow({mode:"closed",delegatesFocus:true}),this.#e.append(S());}connectedCallback(){window.addEventListener("keydown",(e=>{ true!==(false===this.open||"Escape"!==e.key||true===this.persistent)&&this.hide();}));this.#e.querySelector("ws-modal-overlay").addEventListener("click",(e=>{ true!==this.persistent&&this.hide();}));}get open(){return this.hasAttribute("open")}set open(e){if(false===e){if(false===this.open)return;return this.removeAttribute("open"),void this.dispatchEvent(new Event("close"))}this.setAttribute("open","");}get persistent(){return this.hasAttribute("persistent")}set persistent(e){ false!==e?this.setAttribute("persistent",""):this.removeAttribute("persistent");}get managed(){return this.hasAttribute("managed")}set managed(e){ false!==e?this.setAttribute("managed",""):this.removeAttribute("managed");}show(){this.open=true;}hide(e){ true!==this.managed||true===e?this.open=false:this.dispatchEvent(new Event("close"));}});const q=k` <style> ws-popover-position { transition:var(--popover-transition, none); opacity:0; } [open] ws-popover-position { opacity:unset; } </style> <slot></slot> <ws-modal> <ws-popover-position> <slot name="popover"></slot> </ws-popover-position> </ws-modal> `;customElements.define("ws-popover",class extends HTMLElement{static observedAttributes=["open","persistent"];#e=null;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:"closed",delegatesFocus:true}),this.#e.append(q()),this.#t=this.#e.querySelector("ws-modal");}connectedCallback(){this.#t.addEventListener("close",(()=>{this.hide(),this.dispatchEvent(new Event("close"));})),false!==this.open&&(this.#t.open=this.open,this.setVars());}attributeChangedCallback(e,t,r){null!==r?(this.#t[e]=true,"open"===e&&this.setVars()):this.#t[e]=false;}setVars(){const e=(this.sizeTarget??this).getBoundingClientRect();this.style.setProperty("--x",`${e.x}px`),this.style.setProperty("--y",`${e.y}px`),this.style.setProperty("--w",`${e.width}px`),this.style.setProperty("--h",`${e.height}px`);}get open(){return this.hasAttribute("open")}set open(e){this.#t.open=e,false!==e?this.setAttribute("open",""):this.removeAttribute("open");}get persistent(){return this.hasAttribute("persistent")}set persistent(e){this.#t.persistent=e,false!==e?this.setAttribute("persistent",""):this.removeAttribute("persistent");}show(){this.open=true,this.focus();}hide(){this.open=false;}});const M=k` <style> @keyframes busy-load { from { transform:translateX(-100%); } to { transform:translateX(400%); } } :host { display:block; height:8px; border-radius:var(--base-radius); background-color:hsl(var(--mono), var(--layer-border)); position:relative; overflow:hidden; --color:var(--mono); } div::before, div::after { content:""; position:absolute; top:0px; left:0px; height:100%; --range:calc(var(--max, 1) - var(--min, 0)); --bar-width:calc(100% * var(--value, 0) / var(--range)); --buffer-width:calc(100% * var(--buffer, 0) / var(--range)); } div::before { background-color:hsl(var(--color), var(--layer-element)); } div::after { opacity:0.3; background-color:hsl(var(--color), var(--layer-element)); } :host(:not([busy])) div::before { width:var(--bar-width); } :host(:not([busy])) div::after { width:var(--buffer-width); } :host([busy]) div::before { width:25%; animation-name:busy-load; animation-iteration-count:infinite; animation-duration:2s; } </style> <div></div> `;customElements.define("ws-progress",class extends HTMLElement{static observedAttributes=["min","max","value","buffer"];#r=null;constructor(){super();const e=this.attachShadow({mode:"closed"});e.append(M()),this.#r=e.querySelector("div");}get value(){return parseFloat(this.getAttribute("value")??"0")}get buffer(){return parseFloat(this.getAttribute("buffer")??"0")}get min(){return parseFloat(this.getAttribute("min")??"0")}get max(){return parseFloat(this.getAttribute("max")??"1")}get busy(){return this.hasAttribute("busy")}set value(e){ false===e&&this.removeAttribute("value"),this.setAttribute("value",e?.toString()??"");}set buffer(e){ false===e&&this.removeAttribute("buffer"),this.setAttribute("buffer",e?.toString()??"");}set min(e){ false===e&&this.removeAttribute("min"),this.setAttribute("min",e?.toString()??"");}set max(e){ false===e&&this.removeAttribute("max"),this.setAttribute("max",e?.toString()??"");}set busy(e){ false===e&&this.removeAttribute("busy"),this.setAttribute("busy",e);}#o(e,t){this.#r.style.setProperty(`--${e}`,this.getAttribute(e)||t);}connectedCallback(){this.#o("value","0"),this.#o("buffer","0"),this.#o("min","0"),this.#o("max","1");}attributeChangedCallback(e,t,r){this.#o(e,r);}});const C="caret-down-filled";b(C),d("ws-option")` ${A("@layer-element","@layer-fill")} disp:block; p:8px; *pointer-events:auto; t.c:@text-color-normal; w.min:fit-content; ! &[selected] { bg.c:@c1; t.c:@c2; } ! & * { *pointer-events:none; } ${E} ${L} `,d("ws-optgroup")` grid; gr.cols:16px 1fr; *pointer-events:none; ! &::before { *content:attr(label); disp:block; p:8px; col:1 / -1; bg.c:hsl(@color, @layer-container); } ! & > * { col:2; } `;const T=k` <style> :host { --color:var(--mono); --modal-color:transparent; --max-height:250px; --c1:hsl(var(--color), var(--layer-border)); --c2:hsl(var(--color), var(--layer-surface)); display:inline-grid; grid-template-rows:1fr 0px; user-select:none; cursor:default; position:relative; border:1px solid var(--c1); border-radius:var(--base-radius); padding:4px; --modal-transition:var(--select-cancel, visibility var(--anim-time) linear); --popover-transition:var(--select-cancel, opacity var(--anim-time) ease-out); --select-transition:var(--select-cancel, transform var(--anim-time) ease-out); } slot[name=options] { display:block; overflow:visible; } ws-options { box-sizing:border-box; border:1px solid var(--c1); border-radius:var(--base-radius); color:hsl(var(--mono), var(--layer-text)); display:grid; position:absolute; max-height:var(--max-height); overflow:auto; background-color:var(--c2); grid-template-columns:1fr; border-radius:var(--base-radius); box-shadow:0px 2px 4px var(--shadow-color); transform:translateY(10px); transition:var(--select-transition); --sign:sign(var(--y) - 100vh + var(--opt-h)); --pos:calc( var(--y) - calc( max(var(--sign), 0)* (var(--opt-h) - var(--h)) ) ); top:var(--pos); left:var(--x); width:var(--w); transform-origin:top center; } :host([open]) ws-options { transform:translateY(0); } value-display { display:grid; user-select:none; grid-template-columns:1fr min-content; height:100%; } value-display:focus { outline:none; } ws-sel-caret { display:flex; align-items:center; justify-content:center; padding:4px; padding-right:0px; width:24px; } ws-sel-caret::before { display:block; font-family:ws-icon-${C}; content:attr(data-icon); } slot[name="selected"] { display:none; } slot[name="display"] { display:flex; align-items:center; } :host(:focus:not(:disabled)) { outline-style:auto; outline-width:1px; } :host(:disabled) { filter:saturate(50%) brightness(0.8); } </style> <value-display tabindex="0"> <slot name="selected"> <ws-selected>No Selection</ws-selected> </slot> <slot name="display"></slot> <ws-sel-caret data-icon="${C}"></ws-sel-caret> </value-display> <ws-popover> <slot slot="popover" name="options"> <ws-options> <slot></slot> </ws-options> </slot> </ws-popover> `,I="ws-option";customElements.define("ws-select",class extends HTMLElement{static formAssociated=true;#a=null;#s=-1;#i=null;#n=null;#l=null;#c=null;#e=null;#d=null;#p(){return [...this.querySelectorAll(I)]}#h(e){const t=Array.from(e,(e=>[...e.addedNodes])).flat();if(false===t.some((e=>e.tagName?.toLowerCase()===I)))return;const r=t.findLast((e=>e.tagName?.toLowerCase()===I&&true===e.hasAttribute("selected")))??this.#i,o=this.#p();for(const e of o)e.removeAttribute("selected");this.selectedIndex=o.indexOf(r),this.updatePreview();}constructor(){super(),this.#e=this.attachShadow({mode:"closed",delegatesFocus:true}),this.#e.append(T()),this.#c=this.#e.querySelector("slot[name=selected]"),this.#l=this.#e.querySelector("ws-popover"),this.#d=this.#e.querySelector("value-display"),this.#l.sizeTarget=this,this.removeAttribute("open"),this.display=document.createElement("ws-display"),this.display.slot="display";}connectedCallback(){this.insertBefore(this.display,this.firstChild),this.updatePreview(),this.tabIndex=this.getAttribute("tabindex")??"0";const e=new MutationObserver(this.#h.bind(this));e.observe(this,{childList:true,subtree:true}),this.#n=e,this.role="combobox",this.addEventListener("click",(()=>{this.open(),this.#d.focus();}),{passive:true}),this.#l.addEventListener("close",(()=>this.close())),this.#l.addEventListener("pointerdown",(e=>e.preventDefault())),this.#l.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();})),this.#e.querySelector("slot[name='options']").addEventListener("pointerdown",(e=>e.preventDefault())),this.#e.querySelector("slot[name='options']").addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=e.target.tagName?.toLowerCase();"ws-option"===t&&(this.selectedIndex=this.#p().indexOf(e.target),this.close(),this.dispatchEvent(new Event("change",{bubbles:true})),this.dispatchEvent(new Event("input",{bubbles:true})));}));}disconnectedCallback(){this.#n.disconnect();}get value(){return this.#a}set value(e){if(this.#a=e,null===e)return void(this.selectedIndex=-1);const t=this.#p(),r=t.find((t=>t.value===e||t.getAttribute("value")===e));this.selectedIndex=t.indexOf(r);}get selectedIndex(){return this.#s}set selectedIndex(e){this.#i?.removeAttribute("selected");const t=this.#p(),r=Math.min(e,t.length);this.#i=t[r]??null,this.#s=r,this.#i?.setAttribute("selected",""),this.#a=this.#i?.value??this.#i?.getAttribute("value")??this.#a,this.updatePreview();}updatePreview(){const e=this.querySelector("[slot=selected]")??this.#c;this.display.innerHTML=e.innerHTML,this.display.querySelector("ws-selected").innerHTML=this.#i?.getAttribute("preview")??this.#i?.innerHTML??this.getAttribute("blank")??"No Selection";}toggle(){null!==this.getAttribute("open")?this.close():this.open();}open(){this.setAttribute("open","");const e=this.querySelector("ws-options")??this.#e.querySelector("ws-options"),t=e.getBoundingClientRect();e.style.setProperty("--opt-h",`${t.height}px`),e.style.setProperty("--opt-w",`${t.width}px`),this.#l.show(),e.scrollTop=0,this.#i?.scrollIntoView();}close(){this.removeAttribute("open"),this.#l.hide();}__childValueMatch(e){const t=this.#p().indexOf(e);this.selectedIndex=t;}}),d("ws-surface")` @color:@mono; ${A("@layer-surface","@layer-border")} r:@base-radius; over:hidden; bg.c:@c1; b.c:@c2; disp:grid; gr.cols:1fr; gr.rows:1fr; `,d("table[data-ws]")` @color:@primary; *border-collapse:separate; *border-spacing:0px; b.s:solid; b.c:hsl(@color, @layer-border); b.b.w:1px; ! & th { bg.c:hsl(@color, @layer-container); } ! & :is(th, td:not(:empty)) { b.s:solid; b.c:hsl(@color, @layer-border); b.b.w:1px; p:4px; } ! & tbody tr:last-child :is(td, th) { b.b.w:0px; } ! &[sticky-header] thead { pos.stick; y:0px; z:+2; } ! &[sticky-header] th:first-child { pos.stick; z:+1; x:0px; -x:0px; } `,d("ws-text")` ! &[title] { t.sz:@text-size-title; disp:flex; fl.dir:column; p:0px 8px; fl.cross:start; fl.main:center; } ! &[header] { t.sz:@text-size-header; disp:flex; fl.dir:column; p:0px 8px; fl.cross:start; fl.main:center; } ! &[subtitle] { disp:inline-block; t.sz:@text-size-subtitle; p:0px 8px; } ! &[info] { disp:inline-block; t.sz:@text-size-info; } `,d("ws-tabs")` @color:@primary; ${A("@layer-element","@layer-fill","@layer-border")} disp:grid; gr.cols.a:1fr; gr.rows.a:1fr; gr.flow:column; *user-select:none; gap:4px; `,d("label[tab]")` @fill:transparent; @text:@c1; @active:@c1; bg.c:@fill; t.c:@text; grid; gr.cols:1fr; gr.rows:min-content 2px; gr.areas:"content" "border"; pos:relative; ! & > input[type="radio"] { hide; } ! & > :where(*) { area:content; flex; fl.cn; p:8px; } ! &::before { *content:""; pos:absolute; -y:0px; x:0px; w:100%; h:2px; area:border; } ! &:has(input[type="radio"]:checked) { @fill:var(--fill-color, transparent); @text:var(--text-color, @c1); @active:unset; ! &::before { bg.c:@c1; } } ${L} `,d("ws-titlebar")` @border-size:2px; @color:@primary; @text-color:initial; @fill-color:initial; ${A("@layer-element","@layer-fill","@layer-border")} layout.3col-controls; h.min:52px; *user-select:none; pos:relative; p:0px 2px; t.c:@text; bg.c:@fill; b.y:@border-size solid @border; `,d("ws-toast")` @color:@primary; t.c:@page-text-color; bg.c:hsl(@color, @layer-surface); pos:relative; disp:inline-grid; gr.cols:auto 1fr auto; gr.areas:"start content end"; r:@base-radius; *user-select:none; b:2px solid hsl(@color, @layer-element); h.min:32px; z:+0; ! & > :where(*) { area:content; } ! &::before, &::after { *content:""; w.min:20px; bg.c:hsl(@color, @layer-element); z:-1; } ! &::before { area:start; } ! &::after { area:end; } ! & > [notif-text] { disp:flex; fl.dir:column; fl.main:center; p:4px; } ! & > :not([notif-text]) { t.c:hsl(@mono, @layer-fill); @color:inherit; var.fill; } `,d("ws-toaster")` pos:fixed; z:var(--z-notif); disp:grid; gr.cols:fr; p:0px; gap:8px; h:min-content; w:280px; ! &[pos^="top-"] { y:20px; } ! &[pos^="center-"] { y:50%; tf:translateY(-50%); } ! &[pos^="bottom-"] { -y:20px; } ! &[pos$="-left"] { x:20px; } ! &[pos$="-center"] { x:50%; tf:translateX(-50%); } ! &[pos$="-right"] { -x:20px; } `,b("square-dashed","square-check-filled","circle","circle-check-filled","circle-filled");const V=' @color:var(--toggle-color, @primary); @size:20px; @core-color:hsl(@color, @layer-element); pos:relative; w:@size; h:@size; appr:none; m:0px; t.c:@core-color; v.a:middle; ! &::after { *content:""; pos:absolute; t.sz:calc(@size - 2px); *speak:none; t.st:normal; t.wt:400; t.var:normal; t.tf:none; y:50%; x:50%; w:@size; h:@size; tf:translate(-50%, -50%); disp:flex; fl.cross:center; fl.main:center; over:hidden; } ';d(":where(input[data-ws][type=checkbox]:not([switch]))")` ${V} ! &::after { font:ws-icon-square-dashed; *content:"square-dashed"; } ! &:checked::after { font:ws-icon-square-check-filled; *content:"square-check-filled"; } `,d(":where(input[data-ws][type=radio])")` ${V} ! &::after { font:ws-icon-circle; *content:"circle"; } ! &:checked::after { font:ws-icon-circle-check-filled; *content:"circle-check-filled"; } `,d(":where(input[data-ws][type=checkbox][switch])")` @color:@primary; @size:20px; @anim-time:100ms; appr:none; m:0px; pos:relative; w:calc(@size * 2); h:@size; v.a:middle; ! &::before { *content:""; pos:absolute; inset:calc(@size / 4); b:1px solid @color; r:calc(@size / 2); bg.c:hsl(@color, @layer-element); o:0.5; tr:background-color @anim-time linear; } ! &::after { *content:""; pos:absolute; w:@size; h:@size; y:0px; x:0px; tr:left @anim-time linear, background-color @anim-time linear; bg.c:hsl(@mono, @layer-element); r:@size; } ! &:checked::after { x:@size; bg.c:hsl(@color, @layer-element); } `,d("label[data-ws][toggle]")` @color:@primary; @active:@mono; pos:relative; *user-select:none; over:hidden; b:0px solid hsl(@color, @layer-border); bg.c:hsl(@active, @layer-container); r:@base-radius; p:4px; disp:flex; fl.main:space-between; ! &:focus-within { @active:@color; } ! & > input { @color:inherit; ! &:focus { outln:none; } } ! &:has(:not(button):disabled) { *filter:saturate(50%) brightness(0.7); } `,d("ws-tooltip")` @color:@mono; pos.rel; disp:inline-grid; ! &[pos]:hover::before { *content:attr(text); pos.abs; p:4px; bg.c:hsl(@color, @layer-container); b:1px solid hsl(@color, @layer-border); t.ws:nowrap; r:4px; z:+1; } ! &[pos="top"]:hover::before { -y:calc(100% + 8px); x:50%; tf:translateX(-50%); } ! &[pos="bottom"]:hover::before { y:calc(100% + 8px); x:50%; tf:translateX(-50%); } ! &[pos="left"]:hover::before { -x:calc(100% + 8px); y:50%; tf:translateY(-50%); } ! &[pos="right"]:hover::before { x:calc(100% + 8px); y:50%; tf:translateY(-50%); } `;const j={},P=e=>{const t=(e=>{if(""===e||null===e||"true"===e)return;const t=c(o({raw:[e]})),a=(e=>{let t=5381;for(let r=0;r<e.length;r+=1)t=33*t^e.charCodeAt(r);return t.toString(36)})(t.join("\n"));if(j[a]=(j[a]??0)+1,j[a]>1)return a;const s=t.map((e=>e.replaceAll("&",`[data-wsid="${a}"]`)));return r.sheet.insertRule(`@layer ws.element { ${s.join("\n")} }`,r.sheet.cssRules.length),a})(e.dataset?.ws?.trim()??"");void 0!==t?e.dataset.wsid=t:delete e.dataset?.wsid;};new MutationObserver((e=>{const t=new Set(Array.from(e,(e=>[e.target,...Array.from(e.addedNodes,(e=>[e,...e.querySelectorAll?.("*")||[]]))])).flat(3));for(const e of t)P(e);})).observe(document.body,{subtree:true,attributes:true,childList:true,attributeFilter:["data-ws"]});for(const e of document.querySelectorAll("*"))P(e);
798
+
799
+ var wsEsm = /*#__PURE__*/Object.freeze({
800
+ __proto__: null,
801
+ component: x,
802
+ macro: l,
803
+ pageis: w,
804
+ preloadIcons: b,
805
+ version: v,
806
+ x: m
807
+ });
808
+
809
+ const empty = () => ({});
810
+ const style = (Base, addProps = empty) =>
811
+ (parts, ...values) => {
812
+ const wsProp = Base.wsPass ?? "ws";
813
+ const name = randName();
814
+ l(name)(parts, ...values);
815
+ const wrapper = D$1(
816
+ (props, ref) => {
817
+ const addedProps = addProps?.(props) ?? {};
818
+ const { [wsProp]: ws, ...rest } = { ...props, ...addedProps };
819
+ const newWS = `${name}; ${ws ?? ""}`.trim();
820
+ return Element(
821
+ Base,
822
+ { [wsProp]: newWS, ref, ...rest }
823
+ )
824
+ }
825
+ );
826
+ Object.defineProperty(
827
+ wrapper,
828
+ "name",
829
+ { value: `Wrapped(${Base.name ?? Base})` }
830
+ );
831
+ return wrapper
832
+ };
833
+
834
+ const Adorn = style("ze-adorn")`
835
+ adorn;
836
+ `;
837
+
838
+ const Modal = (props) =>
839
+ Element("ws-modal", { ...props });
840
+
841
+ const none = Symbol("dialog none");
842
+ const Dialog = (props) => {
843
+ const { persistent, dialog, onclose, dialogWS, ...rest } = props;
844
+
845
+ return Element(
846
+ Modal,
847
+ {
848
+ open: true,
849
+ managed: true,
850
+ persistent: persistent,
851
+ onclose: onclose,
852
+ },
853
+ Element(
854
+ "ws-dialog",
855
+ { ws: dialogWS },
856
+ Element(Slot, {
857
+ "*render": dialog,
858
+ ...rest,
859
+ }),
860
+ ),
861
+ )
862
+ };
863
+ Dialog.none = none;
864
+
865
+ const state$1 = proxy({
866
+ stack: [],
867
+ });
868
+ const DialogStack = (props) => {
869
+ const { stack } = sharedState(state$1);
870
+
871
+ const dialogs = stack.map((item) =>
872
+ Element(Dialog, { ...item }),
873
+ );
874
+
875
+ return Element(Transitions, {}, dialogs)
876
+ };
877
+
878
+ Dialog.show = (opts) =>
879
+ new Promise((resolve) => {
880
+ if (state$1.stack.length > 3) {
881
+ return
882
+ }
883
+ const { dialog, ...options } = opts;
884
+ const key = randKey();
885
+
886
+ const close = (value) => {
887
+ state$1.stack = state$1.stack.filter(
888
+ (dialog) => dialog.key !== key,
889
+ );
890
+ resolve(value);
891
+ };
892
+
893
+ state$1.stack.push(
894
+ ref({
895
+ $animate: [fade(100), pop(100)],
896
+ ...options,
897
+ onclose: (e) => {
898
+ close(Dialog.none);
899
+ options.onclose?.(e);
900
+ },
901
+ close,
902
+ dialog,
903
+ key,
904
+ }),
905
+ );
906
+ });
907
+
908
+ const Flex = (props) =>
909
+ Element("ws-flex", { ...props });
910
+
911
+ const Grid = (props) =>
912
+ Element("ws-grid", { ...props });
913
+
914
+ const base = "disp: grid; gr.areas: 'content'; layout.base;";
915
+ const Surface = (props) => {
916
+ const { children, slot, layout = null, ws = "", ...rest } = props;
917
+ const layoutWS = layout === null ? base : `layout.${layout};`;
918
+
919
+ return Element(
920
+ "ws-surface",
921
+ { ...rest, ws: `${layoutWS} ${ws}` },
922
+ children,
923
+ Object.entries(slot)?.map((slotItem) => [
924
+ Element(
925
+ "ze-surface-slot",
926
+ { ws: `grid; area: ${slotItem[0]};` },
927
+ Element(Slot, {
928
+ "*render": slotItem[1],
929
+ }),
930
+ ),
931
+ ]) ?? [],
932
+ )
933
+ };
934
+ const Card = (props) =>
935
+ Element(Surface, {
936
+ "ze-card": true,
937
+ ...props,
938
+ layout: "3row-controls",
939
+ });
940
+
941
+ const Button = (props) => {
942
+ const { ws = "", ...rest } = props;
943
+ return Element("button", { ws: ws, ...rest })
944
+ };
945
+
946
+ const Icon = (props) => {
947
+ const { name, ...rest } = props;
948
+
949
+ return Element("ws-icon", {
950
+ "data-icon": name,
951
+ ...rest,
952
+ })
953
+ };
954
+
955
+ const Toast = (props) => {
956
+ const { children, dismiss, ...rest } = props;
957
+
958
+ return Element(
959
+ "ws-toast",
960
+ { ...rest },
961
+ Element(
962
+ "div",
963
+ { ws: "grid;", "notif-text": true },
964
+ children,
965
+ ),
966
+ Element(
967
+ Button,
968
+ { ws: "area: end;", onclick: dismiss },
969
+ Element(Icon, { name: "x" }),
970
+ ),
971
+ )
972
+ };
973
+
974
+ const state = proxy({
975
+ topLeft: [],
976
+ centerLeft: [],
977
+ bottomLeft: [],
978
+ topRight: [],
979
+ centerRight: [],
980
+ bottomRight: [],
981
+ topCenter: [],
982
+ bottomCenter: [],
983
+ });
984
+ const stackList = [
985
+ ["topLeft", "top-left"],
986
+ ["centerLeft", "center-left"],
987
+ ["bottomLeft", "bottom-left"],
988
+ ["topRight", "top-right"],
989
+ ["centerRight", "center-right"],
990
+ ["bottomRight", "bottom-right"],
991
+ ["topCenter", "top-center"],
992
+ ["bottomCenter", "bottom-center"],
993
+ ];
994
+ const Toaster = (props) => {
995
+ const stacks = sharedState(state);
996
+
997
+ const toasters = stackList.map((pair) => {
998
+ const [key, pos] = pair;
999
+ const stack = stacks[key];
1000
+ const toasts = stack.map((toastInfo) => {
1001
+ const { key, content, ...props } = toastInfo;
1002
+ return Element(
1003
+ Toast,
1004
+ { key: key, ...props },
1005
+ content,
1006
+ )
1007
+ });
1008
+ return Element(
1009
+ "ws-toaster",
1010
+ { pos: pos, key: key },
1011
+ Element(Transitions, {}, toasts),
1012
+ )
1013
+ });
1014
+ return Element("ze-toasters", {}, toasters)
1015
+ };
1016
+
1017
+ const skipEvent = Symbol("toaster timeout");
1018
+ Toaster.show = (opts) => {
1019
+ const { pos, timeout = 5000, ...options } = opts;
1020
+ const key = randKey();
1021
+
1022
+ const dismiss = (skip) => {
1023
+ clearTimeout(timer);
1024
+ state[pos] = state[pos].filter((toast) => toast.key !== key);
1025
+ if (skip === skipEvent) {
1026
+ return
1027
+ }
1028
+ options.ondismiss?.();
1029
+ };
1030
+ const timer = setTimeout(() => dismiss(skipEvent), timeout);
1031
+
1032
+ state[pos].push(
1033
+ ref({
1034
+ $animate: [fade(100)],
1035
+ ...options,
1036
+ dismiss,
1037
+ key,
1038
+ }),
1039
+ );
1040
+ };
1041
+
1042
+ const App = (props) => {
1043
+ const { ws = "", layout = null, theme, children } = props;
1044
+
1045
+ document.body.dataset.ws = `#theme.${theme}; ${ws}`;
1046
+
1047
+ return Element(
1048
+ S$1,
1049
+ {},
1050
+ Element(
1051
+ Surface,
1052
+ {
1053
+ layout: layout,
1054
+ ws: "r: 0px;",
1055
+ "data-app-surface": true,
1056
+ },
1057
+ children,
1058
+ ),
1059
+ Element(DialogStack, {}),
1060
+ Element(Toaster, {}),
1061
+ )
1062
+ };
1063
+
1064
+ const CircleSpinner = (props) =>
1065
+ Element("ws-circle-spinner", { ...props });
1066
+
1067
+ const ControlLabel = (props) => {
1068
+ const { ws = "", labelWS, slot, children, ...rest } = props;
1069
+
1070
+ return Element(
1071
+ "label",
1072
+ { control: true, ws: ws, ...rest },
1073
+ slot.label
1074
+ ? [
1075
+ Element(
1076
+ "ws-text",
1077
+ { "label-text": true, ws: labelWS },
1078
+ Element(Slot, {
1079
+ "*render": slot.label,
1080
+ }),
1081
+ ),
1082
+ ]
1083
+ : [],
1084
+ children,
1085
+ slot.start
1086
+ ? [
1087
+ Element(
1088
+ "ze-input-start",
1089
+ { ws: "area: start; grid;" },
1090
+ Element(Slot, {
1091
+ "*render": slot.start,
1092
+ }),
1093
+ ),
1094
+ ]
1095
+ : [],
1096
+ slot.end
1097
+ ? [
1098
+ Element(
1099
+ "ze-input-end",
1100
+ { ws: "area: end; grid;" },
1101
+ Element(Slot, {
1102
+ "*render": slot.end,
1103
+ }),
1104
+ ),
1105
+ ]
1106
+ : [],
1107
+ slot.extra
1108
+ ? [
1109
+ Element(
1110
+ "ze-input-extra",
1111
+ { ws: "area: extra; grid;" },
1112
+ Element(Slot, {
1113
+ "*render": slot.extra,
1114
+ }),
1115
+ ),
1116
+ ]
1117
+ : [],
1118
+ )
1119
+ };
1120
+
1121
+ const Wrapper = style("ze-data-table")`
1122
+ pos.rel;
1123
+ grid;
1124
+ gr.cols: 1fr;
1125
+ gr.rows: 1fr min-content;
1126
+ p: 0px;
1127
+ h: 100%;
1128
+ w: 100%;
1129
+ h.max: 100%;
1130
+ w.max: 100%;
1131
+
1132
+ ! & :where(thead, tbody) {
1133
+ w: "100%";
1134
+ }
1135
+ ! & thead > tr {
1136
+ h: @header;
1137
+ z: +5;
1138
+ pos.rel: true;
1139
+ }
1140
+ ! & tbody > tr {
1141
+ h: @row;
1142
+ }
1143
+ `;
1144
+ const Scroller = style("ze-data-scroller")`
1145
+ pos.rel;
1146
+ over: auto;
1147
+ ! &::before {
1148
+ *content: "";
1149
+ pos.abs;
1150
+ w: 1px;
1151
+ h: 1px;
1152
+ y: calc(@h - 1px);
1153
+ }
1154
+ `;
1155
+ const FakeScroll = style("ze-fake-scroll")`
1156
+ disp: block;
1157
+ w: 100%;
1158
+ h: @h;
1159
+ pos.stick;
1160
+ y: 0px;
1161
+ over: hidden;
1162
+ `;
1163
+ const FooterArea = style("ze-data-footer")`
1164
+ pos: rel;
1165
+ grid;
1166
+ `;
1167
+ const FakeBody = style("tbody")`
1168
+ tf: translateY(@p);
1169
+ `;
1170
+ const itemRange = (info) => {
1171
+ const { scrollPos, scrollMax, rowSize, length, containerHeight } =
1172
+ info;
1173
+ if (scrollMax === null) {
1174
+ return [0, 0]
1175
+ }
1176
+ const displayed = Math.ceil(containerHeight / rowSize) - 1;
1177
+ const itemPos = Math.floor(
1178
+ (scrollPos / scrollMax) * (length - displayed),
1179
+ );
1180
+ return [itemPos - 1, itemPos + displayed + 1, displayed + 2]
1181
+ };
1182
+ const emptyRow = Symbol("empty row");
1183
+ const nullRow = Symbol("null row");
1184
+
1185
+ const sliceData = (data, range) => {
1186
+ const displayed = data.slice(Math.max(range[0], 0), range[1]);
1187
+ if (range[0] === -1) {
1188
+ return [emptyRow, ...displayed]
1189
+ }
1190
+ if (displayed.length < range[2]) {
1191
+ return [
1192
+ ...displayed,
1193
+ ...Array.from(
1194
+ { length: range[2] - displayed.length },
1195
+ () => nullRow,
1196
+ ),
1197
+ ]
1198
+ }
1199
+ return displayed
1200
+ };
1201
+
1202
+ const Header$1 = (props) => {
1203
+ const { keys } = props;
1204
+ return Element(
1205
+ "tr",
1206
+ {},
1207
+ keys?.map((key) => [Element("th", {}, key)]) ?? [],
1208
+ )
1209
+ };
1210
+ const Row$1 = (props) => {
1211
+ const { item, keys } = props;
1212
+ return Element(
1213
+ "tr",
1214
+ {},
1215
+ keys?.map((key) => [Element("td", {}, item[key])])
1216
+ ?? [],
1217
+ )
1218
+ };
1219
+
1220
+ const Footer = (props) => {
1221
+ const { show } = props;
1222
+ return Element(
1223
+ "div",
1224
+ { ws: "flex; fl.cn; h.min: 32px; gap: 4px;" },
1225
+ Element(
1226
+ "div",
1227
+ {},
1228
+ `Showing: ${show.start} - ${show.end} of ${show.total}`,
1229
+ ),
1230
+ )
1231
+ };
1232
+
1233
+ const DataTable = (props) => {
1234
+ const {
1235
+ rowSize = 30,
1236
+ headerSize = rowSize,
1237
+ slot,
1238
+ ws,
1239
+ tableWS = "",
1240
+ data,
1241
+ } = props;
1242
+
1243
+ const local = localState({
1244
+ scrollPos: 0,
1245
+ scrollMax: null,
1246
+ containerHeight: null,
1247
+ container: null,
1248
+ scrollWidth: 0,
1249
+ });
1250
+ const scrollHandler = (evt) => {
1251
+ local.scrollPos = local.container.scrollTop;
1252
+ };
1253
+
1254
+ const keys = calc(() => Object.keys(data?.[0] ?? {}), [data]);
1255
+ const itemsHeight = rowSize * data.length;
1256
+ const tableHeight = itemsHeight + headerSize;
1257
+
1258
+ const scrollWS = `@h: ${tableHeight}px; @header: ${headerSize}px; @row: ${rowSize}px;`;
1259
+
1260
+ const range = calc(
1261
+ () =>
1262
+ itemRange({
1263
+ scrollPos: local.scrollPos,
1264
+ scrollMax: local.scrollMax,
1265
+ containerHeight: local.containerHeight,
1266
+ rowSize,
1267
+ length: data.length,
1268
+ }),
1269
+ [
1270
+ local.scrollPos,
1271
+ local.scrollMax,
1272
+ local.containerHeight,
1273
+ rowSize,
1274
+ data.length,
1275
+ ],
1276
+ );
1277
+
1278
+ h$2(() => {
1279
+ local.containerHeight = local.container.clientHeight;
1280
+ local.scrollMax =
1281
+ local.container.scrollHeight - local.containerHeight;
1282
+ local.container.addEventListener("scroll", scrollHandler, {
1283
+ passive: true,
1284
+ });
1285
+ const observer = new ResizeObserver(() => {
1286
+ local.containerHeight = local.container.clientHeight;
1287
+ local.scrollMax =
1288
+ local.container.scrollHeight - local.containerHeight;
1289
+ local.scrollWidth = local.container.scrollWidth;
1290
+ });
1291
+ observer.observe(local.container);
1292
+ return () => observer.unobserve(local.container)
1293
+ }, []);
1294
+
1295
+ const displayed = range[2];
1296
+ const displayedRows = calc(
1297
+ () => sliceData(data, range),
1298
+ [data, range],
1299
+ );
1300
+ const show = calc(
1301
+ () => ({
1302
+ start: Math.max(1, range[0] + 2),
1303
+ end: Math.min(data.length, range[1] - 1),
1304
+ total: data.length,
1305
+ }),
1306
+ [range, data.length],
1307
+ );
1308
+ (data.length - displayed) * rowSize;
1309
+
1310
+ const itemOffset = range[0] * rowSize - local.scrollPos;
1311
+
1312
+ const TableRow = slot.row ?? Row$1;
1313
+ const TableHeader = slot.header ?? Header$1;
1314
+ const TableFooter = slot.footer ?? Footer;
1315
+
1316
+ return Element(
1317
+ Wrapper,
1318
+ { ws: ws },
1319
+ Element(
1320
+ Scroller,
1321
+ {
1322
+ ref: lock(
1323
+ (node) => (local.container = ref(node)),
1324
+ ),
1325
+ ws: scrollWS,
1326
+ },
1327
+ Element(
1328
+ FakeScroll,
1329
+ { ws: `@h: ${local.containerHeight}px;` },
1330
+ Element(
1331
+ "table",
1332
+ {
1333
+ ws: `w: 100%; *table-layout: fixed; ${tableWS}`,
1334
+ },
1335
+ Element(
1336
+ "thead",
1337
+ {},
1338
+ data?.length > 0
1339
+ ? [
1340
+ Element(TableHeader, {
1341
+ keys: keys,
1342
+ }),
1343
+ ]
1344
+ : [
1345
+ Element(
1346
+ "tr",
1347
+ {},
1348
+ Element(
1349
+ "td",
1350
+ {},
1351
+ "N/A",
1352
+ ),
1353
+ ),
1354
+ ],
1355
+ ),
1356
+ Element(
1357
+ FakeBody,
1358
+ { style: `--p: ${itemOffset}px;` },
1359
+ __eachAlt(
1360
+ displayedRows?.map((item, index) => [
1361
+ Element(TableRow, {
1362
+ item: item,
1363
+ keys: keys,
1364
+ key: index,
1365
+ }),
1366
+ ]) ?? [],
1367
+ () => [
1368
+ Element(
1369
+ "tr",
1370
+ {},
1371
+ Element(
1372
+ "td",
1373
+ {},
1374
+ "No Items",
1375
+ ),
1376
+ ),
1377
+ ],
1378
+ ),
1379
+ ),
1380
+ ),
1381
+ ),
1382
+ ),
1383
+ Element(
1384
+ FooterArea,
1385
+ {},
1386
+ Element(TableFooter, {
1387
+ show: show,
1388
+ displayedRows: displayedRows,
1389
+ }),
1390
+ ),
1391
+ )
1392
+ };
1393
+
1394
+ const Details = (props) => {
1395
+ const { summaryWS, children, slot, ws = "", ...rest } = props;
1396
+
1397
+ return Element(
1398
+ "details",
1399
+ { ws: ws, ...rest },
1400
+ Element(
1401
+ "summary",
1402
+ { ws: summaryWS },
1403
+ Element(Slot, {
1404
+ "*render": slot.label,
1405
+ }),
1406
+ ),
1407
+ children,
1408
+ )
1409
+ };
1410
+
1411
+ const Text = (props) => {
1412
+ const { size = null, notif, ...rest } = props;
1413
+ const sizeProp = size === null ? {} : { [size]: "" };
1414
+ const processed = {
1415
+ ...rest,
1416
+ ...sizeProp,
1417
+ "notif-text": notif === true ? "" : undefined,
1418
+ };
1419
+
1420
+ return Element("ws-text", { ...processed })
1421
+ };
1422
+
1423
+ const Titlebar = (props) => {
1424
+ const { ws, children, slot, ...rest } = props;
1425
+
1426
+ return Element(
1427
+ "ws-titlebar",
1428
+ { ws: ws, ...rest },
1429
+ slot.menu !== undefined
1430
+ ? [
1431
+ Element(
1432
+ "ze-menu",
1433
+ { ws: "flex; area: menu;" },
1434
+ Element(Slot, {
1435
+ "*render": slot.menu,
1436
+ }),
1437
+ ),
1438
+ ]
1439
+ : [],
1440
+ children,
1441
+ slot.action !== undefined
1442
+ ? [
1443
+ Element(
1444
+ "ze-action",
1445
+ { ws: "flex; area: action;" },
1446
+ Element(Slot, {
1447
+ "*render": slot.action,
1448
+ }),
1449
+ ),
1450
+ ]
1451
+ : [],
1452
+ )
1453
+ };
1454
+
1455
+ const ws = "raised; var.outln; @color: @info; layout.3row-controls;";
1456
+
1457
+ const Alert = (props) => {
1458
+ const {
1459
+ close,
1460
+ message,
1461
+ title = "Alert",
1462
+ ok = "Ok",
1463
+ style,
1464
+ onanimationend,
1465
+ } = props;
1466
+
1467
+ const done = () => close(true);
1468
+
1469
+ return Element(
1470
+ Surface,
1471
+ {
1472
+ layout: "3row-controls",
1473
+ ws: ws,
1474
+ style: style,
1475
+ onanimationend: onanimationend,
1476
+ "slot:header": () => [
1477
+ Element(
1478
+ Titlebar,
1479
+ { ws: "@color: @info;" },
1480
+ Element(Text, { title: true }, title),
1481
+ ),
1482
+ ],
1483
+ "slot:footer": () => [
1484
+ Element(
1485
+ Grid,
1486
+ { ws: "p: 4px;" },
1487
+ Element(
1488
+ Button,
1489
+ { onclick: done, ws: "@color: @success;" },
1490
+ ok,
1491
+ ),
1492
+ ),
1493
+ ],
1494
+ },
1495
+ Element(
1496
+ Flex,
1497
+ {},
1498
+ Element(Slot, { "*render": message }),
1499
+ ),
1500
+ )
1501
+ };
1502
+
1503
+ const Confirm = (props) => {
1504
+ const {
1505
+ close,
1506
+ message,
1507
+ title = "Confirm",
1508
+ ok = "Ok",
1509
+ cancel = "Cancel",
1510
+ style,
1511
+ onanimationend,
1512
+ } = props;
1513
+
1514
+ const done = () => close(true);
1515
+ const canc = () => close(false);
1516
+
1517
+ return Element(
1518
+ Surface,
1519
+ {
1520
+ layout: "3row-controls",
1521
+ ws: ws,
1522
+ style: style,
1523
+ onanimationend: onanimationend,
1524
+ "slot:header": () => [
1525
+ Element(
1526
+ Titlebar,
1527
+ { ws: "@color: @info;" },
1528
+ Element(Text, { title: true }, title),
1529
+ ),
1530
+ ],
1531
+ "slot:footer": () => [
1532
+ Element(
1533
+ Grid,
1534
+ { ws: "p: 4px; gr.cols: 1fr 1fr;" },
1535
+ Element(
1536
+ Button,
1537
+ { onclick: canc, ws: "@color: @error;" },
1538
+ cancel,
1539
+ ),
1540
+ Element(
1541
+ Button,
1542
+ { onclick: done, ws: "@color: @success;" },
1543
+ ok,
1544
+ ),
1545
+ ),
1546
+ ],
1547
+ },
1548
+ Element(S$1, {}, message),
1549
+ )
1550
+ };
1551
+
1552
+ const Prompt = (props) => {
1553
+ const {
1554
+ close,
1555
+ message,
1556
+ placeholder = "",
1557
+ title = "Prompt",
1558
+ ok = "Ok",
1559
+ cancel = "Cancel",
1560
+ style,
1561
+ onanimationend,
1562
+ } = props;
1563
+
1564
+ const local = localState({
1565
+ text: "",
1566
+ input: null,
1567
+ });
1568
+
1569
+ const done = () => close(local.text);
1570
+ const canc = () => close(false);
1571
+ const onsubmit = (e) => {
1572
+ e.preventDefault();
1573
+ done(local.text);
1574
+ };
1575
+
1576
+ h$2(() => {
1577
+ local.input.focus();
1578
+ }, []);
1579
+
1580
+ return Element(Surface, {
1581
+ layout: "3row-controls",
1582
+ ws: ws,
1583
+ style: style,
1584
+ onanimationend: onanimationend,
1585
+ "slot:header": () => [
1586
+ Element(
1587
+ Titlebar,
1588
+ { ws: "@color: @info;" },
1589
+ Element(Text, { title: true }, title),
1590
+ ),
1591
+ ],
1592
+ "slot:content": () => [
1593
+ Element(
1594
+ "form",
1595
+ { onsubmit: onsubmit },
1596
+ Element(
1597
+ Flex,
1598
+ {},
1599
+ Element(
1600
+ ControlLabel,
1601
+ { label: message, ws: "var.lined; r: 0px;" },
1602
+ Element("input", {
1603
+ type: "text",
1604
+ placeholder: placeholder,
1605
+ $$value: {
1606
+ value: local.text,
1607
+ update: (e) =>
1608
+ (local.text =
1609
+ getInputValue(
1610
+ e.target,
1611
+ )),
1612
+ },
1613
+ ref: lock(
1614
+ (node) =>
1615
+ (local.input =
1616
+ ref(node)),
1617
+ ),
1618
+ }),
1619
+ ),
1620
+ ),
1621
+ ),
1622
+ ],
1623
+ "slot:footer": () => [
1624
+ Element(
1625
+ Grid,
1626
+ { ws: "p: 4px; gr.cols: 1fr 1fr;" },
1627
+ Element(
1628
+ Button,
1629
+ { onclick: canc, ws: "@color: @error;" },
1630
+ cancel,
1631
+ ),
1632
+ Element(
1633
+ Button,
1634
+ { onclick: done, ws: "@color: @success;" },
1635
+ ok,
1636
+ ),
1637
+ ),
1638
+ ],
1639
+ })
1640
+ };
1641
+
1642
+ eventNames["ws-modal.open"] = "close";
1643
+ registerInputValue("ws-modal", () => false);
1644
+
1645
+ const $animate = [fade(175), slideLeft(175)];
1646
+ const DrawerDisplay = (props) => {
1647
+ const { "inline-desktop": inline, key, onclose, ...rest } = props;
1648
+
1649
+ return Element(
1650
+ Modal,
1651
+ {
1652
+ "inline-desktop": inline,
1653
+ key: key,
1654
+ open: true,
1655
+ managed: true,
1656
+ onclose: onclose,
1657
+ },
1658
+ Element("ws-drawer", { ...rest }),
1659
+ )
1660
+ };
1661
+
1662
+ const Drawer = (props) => {
1663
+ const { open, $$open, onclose, ...rest } = props;
1664
+ const key = calc(() => randKey());
1665
+ const show = open === true || $$open?.value === true;
1666
+ const close = $$open?.update ?? onclose;
1667
+
1668
+ return Element(
1669
+ Transitions,
1670
+ {},
1671
+ show === true
1672
+ ? [
1673
+ Element(DrawerDisplay, {
1674
+ key: key,
1675
+ $animate: $animate,
1676
+ ...rest,
1677
+ onclose: close,
1678
+ }),
1679
+ ]
1680
+ : [],
1681
+ )
1682
+ };
1683
+
1684
+ const HexSpinner = (props) =>
1685
+ Element("ws-hexagon-spinner", { ...props });
1686
+
1687
+ const Link = (props) => {
1688
+ const { ws = "", ...rest } = props;
1689
+ return Element("a", { ws: ws, ...rest })
1690
+ };
1691
+
1692
+ const Popover = (props) => {
1693
+ const { content, overlay, ws = "", ...rest } = props;
1694
+
1695
+ const local = localState({
1696
+ popover: null,
1697
+ });
1698
+ const show = () => local.popover.show();
1699
+ const hide = () => local.popover.hide();
1700
+
1701
+ return Element(
1702
+ "ws-popover",
1703
+ {
1704
+ ws: ws,
1705
+ ...rest,
1706
+ ref: lock(
1707
+ (node) => (local.popover = ref(node)),
1708
+ ),
1709
+ },
1710
+ Element(Slot, {
1711
+ "*render": content,
1712
+ show: show,
1713
+ }),
1714
+ Element(
1715
+ "ze-popover-overlay",
1716
+ { slot: "popover" },
1717
+ Element(Slot, {
1718
+ "*render": overlay,
1719
+ hide: hide,
1720
+ }),
1721
+ ),
1722
+ )
1723
+ };
1724
+
1725
+ const Progress = (props) =>
1726
+ Element("ws-progress", { ...props });
1727
+
1728
+ const Option = (props) =>
1729
+ Element("ws-option", { ...props });
1730
+ const Optgroup = (props) =>
1731
+ Element("ws-optgroup", { ...props });
1732
+
1733
+ const optionList = (items) =>
1734
+ items.map((item) => {
1735
+ if (item.group !== undefined) {
1736
+ return Element(
1737
+ Optgroup,
1738
+ { label: item.group },
1739
+ optionList(item.items),
1740
+ )
1741
+ }
1742
+ return Element(
1743
+ Option,
1744
+ { value: item.value },
1745
+ item.label,
1746
+ )
1747
+ });
1748
+
1749
+ const Select = (props) => {
1750
+ let { options, children, selected, ...rest } = props;
1751
+
1752
+ const items = calc(() => {
1753
+ if (Array.isArray(options) === true) {
1754
+ return optionList(options)
1755
+ }
1756
+ return children
1757
+ }, [children, options]);
1758
+ const selectedItem = calc(() => {
1759
+ if (selected !== undefined) {
1760
+ const Selected = selected;
1761
+ return Element(
1762
+ "div",
1763
+ { slot: "selected" },
1764
+ Element(Selected, {}),
1765
+ )
1766
+ }
1767
+ return null
1768
+ }, [selected]);
1769
+
1770
+ return Element(
1771
+ "ws-select",
1772
+ { ...rest },
1773
+ selectedItem,
1774
+ items,
1775
+ )
1776
+ };
1777
+
1778
+ const diff = (a = null, b = null) => {
1779
+ if (a === null || b === null) {
1780
+ return true
1781
+ }
1782
+ const akeys = Object.keys(a);
1783
+ const bkeys = Object.keys(b);
1784
+
1785
+ const missingKeys =
1786
+ akeys.find((k) => bkeys.includes(k) === false)
1787
+ || bkeys.find((k) => akeys.includes(k) === false);
1788
+ if (missingKeys !== undefined) {
1789
+ return true
1790
+ }
1791
+ for (const k of akeys) {
1792
+ if (b[k] !== a[k]) {
1793
+ return true
1794
+ }
1795
+ }
1796
+ for (const k of bkeys) {
1797
+ if (b[k] !== a[k]) {
1798
+ return true
1799
+ }
1800
+ }
1801
+ return false
1802
+ };
1803
+
1804
+ const pdiff = (local, props) => {
1805
+ const current = Object.keys(props).reduce((c, key) => {
1806
+ const isPromise = props[key] instanceof Promise;
1807
+ if (isPromise === false) {
1808
+ return c
1809
+ }
1810
+ c[key] = props[key];
1811
+ return c
1812
+ }, {});
1813
+ if (diff(local.prev, current) === false) {
1814
+ return
1815
+ }
1816
+ const keys = Object.keys(current);
1817
+ const next = Promise.all(
1818
+ keys.map(async (key) => [key, await current[key]]),
1819
+ );
1820
+ next.keep = true;
1821
+ next.then((pairs) => {
1822
+ if (next.keep === false) {
1823
+ return
1824
+ }
1825
+ local.resolved = ref(Object.fromEntries(pairs));
1826
+ });
1827
+ local.promise.keep = false;
1828
+ local.promise = ref(next);
1829
+ local.resolved = null;
1830
+ local.prev = current;
1831
+ };
1832
+
1833
+ const cache = new Map();
1834
+ const suspend = (Target) => {
1835
+ if (cache.has(Target) === true) {
1836
+ return cache.get(Target)
1837
+ }
1838
+ const suspended = (props) => {
1839
+ const local = localState({
1840
+ promise: {},
1841
+ prev: {},
1842
+ resolved: null,
1843
+ });
1844
+
1845
+ pdiff(local, props);
1846
+
1847
+ if (local.resolved !== null) {
1848
+ return Element(Target, {
1849
+ ...props,
1850
+ ...local.resolved,
1851
+ })
1852
+ }
1853
+
1854
+ const Loading = local.loading ?? null;
1855
+ if (Loading === null) {
1856
+ return Element("div", {}, "Loading")
1857
+ }
1858
+ return Element(Loading, {})
1859
+ };
1860
+ cache.set(Target, suspended);
1861
+ return suspended
1862
+ };
1863
+
1864
+ const Header = (props) => {
1865
+ const { keys } = props;
1866
+ return Element(
1867
+ "tr",
1868
+ {},
1869
+ keys?.map((key) => [Element("th", {}, key)]) ?? [],
1870
+ )
1871
+ };
1872
+ const Row = (props) => {
1873
+ const { item, keys } = props;
1874
+ return Element(
1875
+ "tr",
1876
+ {},
1877
+ keys?.map((key) => [Element("td", {}, item[key])])
1878
+ ?? [],
1879
+ )
1880
+ };
1881
+
1882
+ const Table = (props) => {
1883
+ const { data, slot, sticky, ws = "", ...rest } = props;
1884
+ const { header = Header, row = Row } = slot;
1885
+
1886
+ const keys = calc(() => Object.keys(data?.[0] ?? {}), [data]);
1887
+
1888
+ return Element(
1889
+ "table",
1890
+ { ws: ws, "stick-header": sticky === true, ...rest },
1891
+ Element(
1892
+ "thead",
1893
+ {},
1894
+ data?.length > 0
1895
+ ? [
1896
+ Element(Slot, {
1897
+ "*render": header,
1898
+ keys: keys,
1899
+ }),
1900
+ ]
1901
+ : [
1902
+ Element(
1903
+ "tr",
1904
+ {},
1905
+ Element("th", {}, "N/A"),
1906
+ ),
1907
+ ],
1908
+ ),
1909
+ Element(
1910
+ "tbody",
1911
+ {},
1912
+ __eachAlt(
1913
+ data?.map((item, rowNum) => [
1914
+ Element(Slot, {
1915
+ "*render": row,
1916
+ item: item,
1917
+ keys: keys,
1918
+ rowNum: rowNum,
1919
+ }),
1920
+ ]) ?? [],
1921
+ () => [
1922
+ Element(
1923
+ "tr",
1924
+ {},
1925
+ Element("td", {}, "No Items"),
1926
+ ),
1927
+ ],
1928
+ ),
1929
+ ),
1930
+ )
1931
+ };
1932
+
1933
+ const ToggleLabel = (props) => {
1934
+ const { ws = "", children, ...rest } = props;
1935
+
1936
+ return Element(
1937
+ "label",
1938
+ { toggle: true, ws: ws, ...rest },
1939
+ children,
1940
+ )
1941
+ };
1942
+
1943
+ const Tooltip = (props) =>
1944
+ Element("ws-tooltip", { ...props });
1945
+
1946
+ export { Adorn, Alert, App, Button, Card, CircleSpinner, Confirm, ControlLabel, DataTable, Details, Dialog, DialogStack, Drawer, Element, Flex, S$1 as Fragment, Grid, HexSpinner, Icon, Link, Modal, Optgroup, Option, Popover, Progress, Prompt, Select, Slot, Surface, Table, Text, Titlebar, Toast, Toaster, ToggleLabel, Tooltip, Transitions, __eachAlt, animation, calc, W$2 as cloneElement, X$1 as createContext, drop, fade, getInputValue, getVersion, localState, lock, N$1 as memo, options, pop, l$3 as preactOptions, proxy, randKey, randName, ref, R$1 as renderApp, K as renderString, sharedState, slideBottom, slideLeft, slideTop, snapshot, spinCW, style, subscribe, suspend, x$2 as useContext, h$2 as useEffect, T$2 as useMemo, d$2 as useState, visible, wsEsm as wind };