preact-render-to-string
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],t):t((e||self).preactRenderToString={},e.preact)}(this,function(e,t){var n=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,r=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,o=/[\s\n\\/='"\0<>]/,i=/^xlink:?./,s=/["&<]/;function a(e){if(!1===s.test(e+=""))return e;for(var t=0,n=0,r="",o="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";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 l=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},f=function(e,t,n){return String(e).length>(t||40)||!n&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},u={},p=/([A-Z])/g;function c(e){var t="";for(var r in e){var o=e[r];null!=o&&""!==o&&(t&&(t+=" "),t+="-"==r[0]?r:u[r]||(u[r]=r.replace(p,"-$1").toLowerCase()),t="number"==typeof o&&!1===n.test(r)?t+": "+o+"px;":t+": "+o+";")}return t||void 0}function _(e,t){return Array.isArray(t)?t.reduce(_,e):null!=t&&!1!==t&&e.push(t),e}function d(){this.__d=!0}function v(e,t){return{__v:e,context:t,props:e.props,setState:d,forceUpdate:d,__d:!0,__h:[]}}function g(e,t){var n=e.contextType,r=n&&t[n.__c];return null!=n?r?r.props.value:n.__:t}var h=[];function y(e,n,s,u,p,d){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return a(e);var m=s.pretty,b=m&&"string"==typeof m?m:"\t";if(Array.isArray(e)){for(var x="",k=0;k<e.length;k++)m&&k>0&&(x+="\n"),x+=y(e[k],n,s,u,p,d);return x}var S,w=e.type,C=e.props,O=!1;if("function"==typeof w){if(O=!0,!s.shallow||!u&&!1!==s.renderRootComponent){if(w===t.Fragment){var j=[];return _(j,e.props.children),y(j,n,s,!1!==s.shallowHighOrder,p,d)}var A,F=e.__c=v(e,n);t.options.__b&&t.options.__b(e);var T=t.options.__r;if(w.prototype&&"function"==typeof w.prototype.render){var H=g(w,n);(F=e.__c=new w(C,H)).__v=e,F._dirty=F.__d=!0,F.props=C,null==F.state&&(F.state={}),null==F._nextState&&null==F.__s&&(F._nextState=F.__s=F.state),F.context=H,w.getDerivedStateFromProps?F.state=Object.assign({},F.state,w.getDerivedStateFromProps(F.props,F.state)):F.componentWillMount&&(F.componentWillMount(),F.state=F._nextState!==F.state?F._nextState:F.__s!==F.state?F.__s:F.state),T&&T(e),A=F.render(F.props,F.state,F.context)}else for(var M=g(w,n),L=0;F.__d&&L++<25;)F.__d=!1,T&&T(e),A=w.call(e.__c,C,M);return F.getChildContext&&(n=Object.assign({},n,F.getChildContext())),t.options.diffed&&t.options.diffed(e),y(A,n,s,!1!==s.shallowHighOrder,p,d)}w=(S=w).displayName||S!==Function&&S.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var n=-1,r=h.length;r--;)if(h[r]===e){n=r;break}n<0&&(n=h.push(e)-1),t="UnnamedComponent"+n}return t}(S)}var E,$,D="<"+w;if(C){var N=Object.keys(C);s&&!0===s.sortAttributes&&N.sort();for(var P=0;P<N.length;P++){var R=N[P],W=C[R];if("children"!==R){if(!o.test(R)&&(s&&s.allAttributes||"key"!==R&&"ref"!==R&&"__self"!==R&&"__source"!==R)){if("defaultValue"===R)R="value";else if("defaultChecked"===R)R="checked";else if("defaultSelected"===R)R="selected";else if("className"===R){if(void 0!==C.class)continue;R="class"}else p&&i.test(R)&&(R=R.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===R){if(C.for)continue;R="for"}"style"===R&&W&&"object"==typeof W&&(W=c(W)),"a"===R[0]&&"r"===R[1]&&"boolean"==typeof W&&(W=String(W));var q=s.attributeHook&&s.attributeHook(R,W,n,s,O);if(q||""===q)D+=q;else if("dangerouslySetInnerHTML"===R)$=W&&W.__html;else if("textarea"===w&&"value"===R)E=W;else if((W||0===W||""===W)&&"function"!=typeof W){if(!(!0!==W&&""!==W||(W=R,s&&s.xml))){D=D+" "+R;continue}if("value"===R){if("select"===w){d=W;continue}"option"===w&&d==W&&void 0===C.selected&&(D+=" selected")}D=D+" "+R+'="'+a(W)+'"'}}}else E=W}}if(m){var I=D.replace(/\n\s*/," ");I===D||~I.indexOf("\n")?m&&~D.indexOf("\n")&&(D+="\n"):D=I}if(D+=">",o.test(w))throw new Error(w+" is not a valid HTML tag name in "+D);var U,V=r.test(w)||s.voidElements&&s.voidElements.test(w),z=[];if($)m&&f($)&&($="\n"+b+l($,b)),D+=$;else if(null!=E&&_(U=[],E).length){for(var Z=m&&~D.indexOf("\n"),B=!1,G=0;G<U.length;G++){var J=U[G];if(null!=J&&!1!==J){var K=y(J,n,s,!0,"svg"===w||"foreignObject"!==w&&p,d);if(m&&!Z&&f(K)&&(Z=!0),K)if(m){var Q=K.length>0&&"<"!=K[0];B&&Q?z[z.length-1]+=K:z.push(K),B=Q}else z.push(K)}}if(m&&Z)for(var X=z.length;X--;)z[X]="\n"+b+l(z[X],b)}if(z.length||$)D+=z.join("");else if(s&&s.xml)return D.substring(0,D.length-1)+" />";return!V||U||$?(m&&~D.indexOf("\n")&&(D+="\n"),D=D+"</"+w+">"):D=D.replace(/>$/," />"),D}var m={shallow:!0};k.render=k;var b=function(e,t){return k(e,t,m)},x=[];function k(e,n,r){n=n||{};var o=t.options.__s;t.options.__s=!0;var i,s=t.h(t.Fragment,null);return s.__k=[e],i=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?y(e,n,r):j(e,n,!1,void 0,s),t.options.__c&&t.options.__c(e,x),t.options.__s=o,x.length=0,i}function S(e,t){return"className"===e?"class":"htmlFor"===e?"for":"defaultValue"===e?"value":"defaultChecked"===e?"checked":"defaultSelected"===e?"selected":t&&i.test(e)?e.toLowerCase().replace(/^xlink:?/,"xlink:"):e}function w(e,t){return"style"===e&&null!=t&&"object"==typeof t?c(t):"a"===e[0]&&"r"===e[1]&&"boolean"==typeof t?String(t):t}var C=Array.isArray,O=Object.assign;function j(e,n,i,s,l){if(null==e||!0===e||!1===e||""===e)return"";if("object"!=typeof e)return a(e);if(C(e)){var f="";l.__k=e;for(var u=0;u<e.length;u++)f+=j(e[u],n,i,s,l);return f}e.__=l,t.options.__b&&t.options.__b(e);var p=e.type,c=e.props;if("function"==typeof p){var _;if(p===t.Fragment)_=c.children;else{_=p.prototype&&"function"==typeof p.prototype.render?function(e,n){var r=e.type,o=g(r,n),i=new r(e.props,o);e.__c=i,i.__v=e,i.__d=!0,i.props=e.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var s=t.options.__r;return s&&s(e),i.render(i.props,i.state,i.context)}(e,n):function(e,n){var r,o=v(e,n),i=g(e.type,n);e.__c=o;for(var s=t.options.__r,a=0;o.__d&&a++<25;)o.__d=!1,s&&s(e),r=e.type.call(o,e.props,i);return r}(e,n);var d=e.__c;d.getChildContext&&(n=O({},n,d.getChildContext()))}var h=j(_,n,i,s,e);return t.options.diffed&&t.options.diffed(e),e.__=void 0,t.options.unmount&&t.options.unmount(e),h}var y,m,b="<";if(b+=p,c)for(var x in y=c.children,c){var k=c[x];if(!("key"===x||"ref"===x||"__self"===x||"__source"===x||"children"===x||"className"===x&&"class"in c||"htmlFor"===x&&"for"in c||o.test(x)))if(k=w(x=S(x,i),k),"dangerouslySetInnerHTML"===x)m=k&&k.__html;else if("textarea"===p&&"value"===x)y=k;else if((k||0===k||""===k)&&"function"!=typeof k){if(!0===k||""===k){k=x,b=b+" "+x;continue}if("value"===x){if("select"===p){s=k;continue}"option"!==p||s!=k||"selected"in c||(b+=" selected")}b=b+" "+x+'="'+a(k)+'"'}}var A=b;if(b+=">",o.test(p))throw new Error(p+" is not a valid HTML tag name in "+b);var F="",T=!1;if(m)F+=m,T=!0;else if("string"==typeof y)F+=a(y),T=!0;else if(C(y)){e.__k=y;for(var H=0;H<y.length;H++){var M=y[H];if(null!=M&&!1!==M){var L=j(M,n,"svg"===p||"foreignObject"!==p&&i,s,e);L&&(F+=L,T=!0)}}}else if(null!=y&&!1!==y&&!0!==y){e.__k=[y];var E=j(y,n,"svg"===p||"foreignObject"!==p&&i,s,e);E&&(F+=E,T=!0)}if(t.options.diffed&&t.options.diffed(e),e.__=void 0,t.options.unmount&&t.options.unmount(e),T)b+=F;else if(r.test(p))return A+" />";return b+"</"+p+">"}k.shallowRender=b,e.default=k,e.render=k,e.renderToStaticMarkup=k,e.renderToString=k,e.shallowRender=b}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],t):t((e||self).preactRenderToString={},e.preact)}(this,function(e,t){var n=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,r=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,o=/[\s\n\\/='"\0<>]/,i=/^xlink:?./,s=/["&<]/;function a(e){if(!1===s.test(e+=""))return e;for(var t=0,n=0,r="",o="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";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 l=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},f=function(e,t,n){return String(e).length>(t||40)||!n&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},u={},c=/([A-Z])/g;function p(e){var t="";for(var r in e){var o=e[r];null!=o&&""!==o&&(t&&(t+=" "),t+="-"==r[0]?r:u[r]||(u[r]=r.replace(c,"-$1").toLowerCase()),t="number"==typeof o&&!1===n.test(r)?t+": "+o+"px;":t+": "+o+";")}return t||void 0}function _(e,t){return Array.isArray(t)?t.reduce(_,e):null!=t&&!1!==t&&e.push(t),e}function d(){this.__d=!0}function v(e,t){return{__v:e,context:t,props:e.props,setState:d,forceUpdate:d,__d:!0,__h:[]}}function g(e,t){var n=e.contextType,r=n&&t[n.__c];return null!=n?r?r.props.value:n.__:t}var h=[];function y(e,n,s,u,c,d){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":a(e);var m=s.pretty,b=m&&"string"==typeof m?m:"\t";if(Array.isArray(e)){for(var x="",k=0;k<e.length;k++)m&&k>0&&(x+="\n"),x+=y(e[k],n,s,u,c,d);return x}if(void 0!==e.constructor)return"";var S,w=e.type,C=e.props,O=!1;if("function"==typeof w){if(O=!0,!s.shallow||!u&&!1!==s.renderRootComponent){if(w===t.Fragment){var j=[];return _(j,e.props.children),y(j,n,s,!1!==s.shallowHighOrder,c,d)}var F,A=e.__c=v(e,n);t.options.__b&&t.options.__b(e);var T=t.options.__r;if(w.prototype&&"function"==typeof w.prototype.render){var H=g(w,n);(A=e.__c=new w(C,H)).__v=e,A._dirty=A.__d=!0,A.props=C,null==A.state&&(A.state={}),null==A._nextState&&null==A.__s&&(A._nextState=A.__s=A.state),A.context=H,w.getDerivedStateFromProps?A.state=Object.assign({},A.state,w.getDerivedStateFromProps(A.props,A.state)):A.componentWillMount&&(A.componentWillMount(),A.state=A._nextState!==A.state?A._nextState:A.__s!==A.state?A.__s:A.state),T&&T(e),F=A.render(A.props,A.state,A.context)}else for(var M=g(w,n),L=0;A.__d&&L++<25;)A.__d=!1,T&&T(e),F=w.call(e.__c,C,M);return A.getChildContext&&(n=Object.assign({},n,A.getChildContext())),t.options.diffed&&t.options.diffed(e),y(F,n,s,!1!==s.shallowHighOrder,c,d)}w=(S=w).displayName||S!==Function&&S.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var n=-1,r=h.length;r--;)if(h[r]===e){n=r;break}n<0&&(n=h.push(e)-1),t="UnnamedComponent"+n}return t}(S)}var E,$,D="<"+w;if(C){var N=Object.keys(C);s&&!0===s.sortAttributes&&N.sort();for(var P=0;P<N.length;P++){var R=N[P],W=C[R];if("children"!==R){if(!o.test(R)&&(s&&s.allAttributes||"key"!==R&&"ref"!==R&&"__self"!==R&&"__source"!==R)){if("defaultValue"===R)R="value";else if("defaultChecked"===R)R="checked";else if("defaultSelected"===R)R="selected";else if("className"===R){if(void 0!==C.class)continue;R="class"}else c&&i.test(R)&&(R=R.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===R){if(C.for)continue;R="for"}"style"===R&&W&&"object"==typeof W&&(W=p(W)),"a"===R[0]&&"r"===R[1]&&"boolean"==typeof W&&(W=String(W));var q=s.attributeHook&&s.attributeHook(R,W,n,s,O);if(q||""===q)D+=q;else if("dangerouslySetInnerHTML"===R)$=W&&W.__html;else if("textarea"===w&&"value"===R)E=W;else if((W||0===W||""===W)&&"function"!=typeof W){if(!(!0!==W&&""!==W||(W=R,s&&s.xml))){D=D+" "+R;continue}if("value"===R){if("select"===w){d=W;continue}"option"===w&&d==W&&void 0===C.selected&&(D+=" selected")}D=D+" "+R+'="'+a(W)+'"'}}}else E=W}}if(m){var I=D.replace(/\n\s*/," ");I===D||~I.indexOf("\n")?m&&~D.indexOf("\n")&&(D+="\n"):D=I}if(D+=">",o.test(w))throw new Error(w+" is not a valid HTML tag name in "+D);var U,V=r.test(w)||s.voidElements&&s.voidElements.test(w),z=[];if($)m&&f($)&&($="\n"+b+l($,b)),D+=$;else if(null!=E&&_(U=[],E).length){for(var Z=m&&~D.indexOf("\n"),B=!1,G=0;G<U.length;G++){var J=U[G];if(null!=J&&!1!==J){var K=y(J,n,s,!0,"svg"===w||"foreignObject"!==w&&c,d);if(m&&!Z&&f(K)&&(Z=!0),K)if(m){var Q=K.length>0&&"<"!=K[0];B&&Q?z[z.length-1]+=K:z.push(K),B=Q}else z.push(K)}}if(m&&Z)for(var X=z.length;X--;)z[X]="\n"+b+l(z[X],b)}if(z.length||$)D+=z.join("");else if(s&&s.xml)return D.substring(0,D.length-1)+" />";return!V||U||$?(m&&~D.indexOf("\n")&&(D+="\n"),D=D+"</"+w+">"):D=D.replace(/>$/," />"),D}var m={shallow:!0};k.render=k;var b=function(e,t){return k(e,t,m)},x=[];function k(e,n,r){n=n||{};var o=t.options.__s;t.options.__s=!0;var i,s=t.h(t.Fragment,null);return s.__k=[e],i=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?y(e,n,r):j(e,n,!1,void 0,s),t.options.__c&&t.options.__c(e,x),t.options.__s=o,x.length=0,i}function S(e,t){return"className"===e?"class":"htmlFor"===e?"for":"defaultValue"===e?"value":"defaultChecked"===e?"checked":"defaultSelected"===e?"selected":t&&i.test(e)?e.toLowerCase().replace(/^xlink:?/,"xlink:"):e}function w(e,t){return"style"===e&&null!=t&&"object"==typeof t?p(t):"a"===e[0]&&"r"===e[1]&&"boolean"==typeof t?String(t):t}var C=Array.isArray,O=Object.assign;function j(e,n,i,s,l){if(null==e||!0===e||!1===e||""===e)return"";if("object"!=typeof e)return"function"==typeof e?"":a(e);if(C(e)){var f="";l.__k=e;for(var u=0;u<e.length;u++)f+=j(e[u],n,i,s,l);return f}if(void 0!==e.constructor)return"";e.__=l,t.options.__b&&t.options.__b(e);var c=e.type,p=e.props;if("function"==typeof c){var _;if(c===t.Fragment)_=p.children;else{_=c.prototype&&"function"==typeof c.prototype.render?function(e,n){var r=e.type,o=g(r,n),i=new r(e.props,o);e.__c=i,i.__v=e,i.__d=!0,i.props=e.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var s=t.options.__r;return s&&s(e),i.render(i.props,i.state,i.context)}(e,n):function(e,n){var r,o=v(e,n),i=g(e.type,n);e.__c=o;for(var s=t.options.__r,a=0;o.__d&&a++<25;)o.__d=!1,s&&s(e),r=e.type.call(o,e.props,i);return r}(e,n);var d=e.__c;d.getChildContext&&(n=O({},n,d.getChildContext()))}var h=j(_=null!=_&&_.type===t.Fragment&&null==_.key?_.props.children:_,n,i,s,e);return t.options.diffed&&t.options.diffed(e),e.__=void 0,t.options.unmount&&t.options.unmount(e),h}var y,m,b="<";if(b+=c,p)for(var x in y=p.children,p){var k=p[x];if(!("key"===x||"ref"===x||"__self"===x||"__source"===x||"children"===x||"className"===x&&"class"in p||"htmlFor"===x&&"for"in p||o.test(x)))if(k=w(x=S(x,i),k),"dangerouslySetInnerHTML"===x)m=k&&k.__html;else if("textarea"===c&&"value"===x)y=k;else if((k||0===k||""===k)&&"function"!=typeof k){if(!0===k||""===k){k=x,b=b+" "+x;continue}if("value"===x){if("select"===c){s=k;continue}"option"!==c||s!=k||"selected"in p||(b+=" selected")}b=b+" "+x+'="'+a(k)+'"'}}var F=b;if(b+=">",o.test(c))throw new Error(c+" is not a valid HTML tag name in "+b);var A="",T=!1;if(m)A+=m,T=!0;else if("string"==typeof y)A+=a(y),T=!0;else if(C(y)){e.__k=y;for(var H=0;H<y.length;H++){var M=y[H];if(null!=M&&!1!==M){var L=j(M,n,"svg"===c||"foreignObject"!==c&&i,s,e);L&&(A+=L,T=!0)}}}else if(null!=y&&!1!==y&&!0!==y){e.__k=[y];var E=j(y,n,"svg"===c||"foreignObject"!==c&&i,s,e);E&&(A+=E,T=!0)}if(t.options.diffed&&t.options.diffed(e),e.__=void 0,t.options.unmount&&t.options.unmount(e),T)b+=A;else if(r.test(c))return F+" />";return b+"</"+c+">"}k.shallowRender=b,e.default=k,e.render=k,e.renderToStaticMarkup=k,e.renderToString=k,e.shallowRender=b}); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { VNode } from 'preact'; |
@@ -1,2 +0,2 @@ | ||
import{Fragment as e,options as t,h as r}from"preact";var n=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\s\n\\/='"\0<>]/,a=/^xlink:?./,l=/["&<]/;function s(e){if(!1===l.test(e+=""))return e;for(var t=0,r=0,n="",o="";r<e.length;r++){switch(e.charCodeAt(r)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}r!==t&&(n+=e.slice(t,r)),n+=o,t=r+1}return r!==t&&(n+=e.slice(t,r)),n}var f=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},u=function(e,t,r){return String(e).length>(t||40)||!r&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},c={},_=/([A-Z])/g;function p(e){var t="";for(var r in e){var o=e[r];null!=o&&""!==o&&(t&&(t+=" "),t+="-"==r[0]?r:c[r]||(c[r]=r.replace(_,"-$1").toLowerCase()),t="number"==typeof o&&!1===n.test(r)?t+": "+o+"px;":t+": "+o+";")}return t||void 0}function d(e,t){return Array.isArray(t)?t.reduce(d,e):null!=t&&!1!==t&&e.push(t),e}function v(){this.__d=!0}function h(e,t){return{__v:e,context:t,props:e.props,setState:v,forceUpdate:v,__d:!0,__h:[]}}function g(e,t){var r=e.contextType,n=r&&t[r.__c];return null!=r?n?n.props.value:r.__:t}var y=[];function m(r,n,l,c,_,v){if(null==r||"boolean"==typeof r)return"";if("object"!=typeof r)return s(r);var b=l.pretty,x=b&&"string"==typeof b?b:"\t";if(Array.isArray(r)){for(var k="",S=0;S<r.length;S++)b&&S>0&&(k+="\n"),k+=m(r[S],n,l,c,_,v);return k}var w,C=r.type,O=r.props,j=!1;if("function"==typeof C){if(j=!0,!l.shallow||!c&&!1!==l.renderRootComponent){if(C===e){var A=[];return d(A,r.props.children),m(A,n,l,!1!==l.shallowHighOrder,_,v)}var F,H=r.__c=h(r,n);t.__b&&t.__b(r);var M=t.__r;if(C.prototype&&"function"==typeof C.prototype.render){var L=g(C,n);(H=r.__c=new C(O,L)).__v=r,H._dirty=H.__d=!0,H.props=O,null==H.state&&(H.state={}),null==H._nextState&&null==H.__s&&(H._nextState=H.__s=H.state),H.context=L,C.getDerivedStateFromProps?H.state=Object.assign({},H.state,C.getDerivedStateFromProps(H.props,H.state)):H.componentWillMount&&(H.componentWillMount(),H.state=H._nextState!==H.state?H._nextState:H.__s!==H.state?H.__s:H.state),M&&M(r),F=H.render(H.props,H.state,H.context)}else for(var T=g(C,n),E=0;H.__d&&E++<25;)H.__d=!1,M&&M(r),F=C.call(r.__c,O,T);return H.getChildContext&&(n=Object.assign({},n,H.getChildContext())),t.diffed&&t.diffed(r),m(F,n,l,!1!==l.shallowHighOrder,_,v)}C=(w=C).displayName||w!==Function&&w.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var r=-1,n=y.length;n--;)if(y[n]===e){r=n;break}r<0&&(r=y.push(e)-1),t="UnnamedComponent"+r}return t}(w)}var $,D,N="<"+C;if(O){var P=Object.keys(O);l&&!0===l.sortAttributes&&P.sort();for(var W=0;W<P.length;W++){var I=P[W],R=O[I];if("children"!==I){if(!i.test(I)&&(l&&l.allAttributes||"key"!==I&&"ref"!==I&&"__self"!==I&&"__source"!==I)){if("defaultValue"===I)I="value";else if("defaultChecked"===I)I="checked";else if("defaultSelected"===I)I="selected";else if("className"===I){if(void 0!==O.class)continue;I="class"}else _&&a.test(I)&&(I=I.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===I){if(O.for)continue;I="for"}"style"===I&&R&&"object"==typeof R&&(R=p(R)),"a"===I[0]&&"r"===I[1]&&"boolean"==typeof R&&(R=String(R));var U=l.attributeHook&&l.attributeHook(I,R,n,l,j);if(U||""===U)N+=U;else if("dangerouslySetInnerHTML"===I)D=R&&R.__html;else if("textarea"===C&&"value"===I)$=R;else if((R||0===R||""===R)&&"function"!=typeof R){if(!(!0!==R&&""!==R||(R=I,l&&l.xml))){N=N+" "+I;continue}if("value"===I){if("select"===C){v=R;continue}"option"===C&&v==R&&void 0===O.selected&&(N+=" selected")}N=N+" "+I+'="'+s(R)+'"'}}}else $=R}}if(b){var V=N.replace(/\n\s*/," ");V===N||~V.indexOf("\n")?b&&~N.indexOf("\n")&&(N+="\n"):N=V}if(N+=">",i.test(C))throw new Error(C+" is not a valid HTML tag name in "+N);var q,z=o.test(C)||l.voidElements&&l.voidElements.test(C),Z=[];if(D)b&&u(D)&&(D="\n"+x+f(D,x)),N+=D;else if(null!=$&&d(q=[],$).length){for(var B=b&&~N.indexOf("\n"),G=!1,J=0;J<q.length;J++){var K=q[J];if(null!=K&&!1!==K){var Q=m(K,n,l,!0,"svg"===C||"foreignObject"!==C&&_,v);if(b&&!B&&u(Q)&&(B=!0),Q)if(b){var X=Q.length>0&&"<"!=Q[0];G&&X?Z[Z.length-1]+=Q:Z.push(Q),G=X}else Z.push(Q)}}if(b&&B)for(var Y=Z.length;Y--;)Z[Y]="\n"+x+f(Z[Y],x)}if(Z.length||D)N+=Z.join("");else if(l&&l.xml)return N.substring(0,N.length-1)+" />";return!z||q||D?(b&&~N.indexOf("\n")&&(N+="\n"),N=N+"</"+C+">"):N=N.replace(/>$/," />"),N}var b={shallow:!0};S.render=S;var x=function(e,t){return S(e,t,b)},k=[];function S(n,o,i){o=o||{};var a=t.__s;t.__s=!0;var l,s=r(e,null);return s.__k=[n],l=i&&(i.pretty||i.voidElements||i.sortAttributes||i.shallow||i.allAttributes||i.xml||i.attributeHook)?m(n,o,i):A(n,o,!1,void 0,s),t.__c&&t.__c(n,k),t.__s=a,k.length=0,l}function w(e,t){return"className"===e?"class":"htmlFor"===e?"for":"defaultValue"===e?"value":"defaultChecked"===e?"checked":"defaultSelected"===e?"selected":t&&a.test(e)?e.toLowerCase().replace(/^xlink:?/,"xlink:"):e}function C(e,t){return"style"===e&&null!=t&&"object"==typeof t?p(t):"a"===e[0]&&"r"===e[1]&&"boolean"==typeof t?String(t):t}var O=Array.isArray,j=Object.assign;function A(r,n,a,l,f){if(null==r||!0===r||!1===r||""===r)return"";if("object"!=typeof r)return s(r);if(O(r)){var u="";f.__k=r;for(var c=0;c<r.length;c++)u+=A(r[c],n,a,l,f);return u}r.__=f,t.__b&&t.__b(r);var _=r.type,p=r.props;if("function"==typeof _){var d;if(_===e)d=p.children;else{d=_.prototype&&"function"==typeof _.prototype.render?function(e,r){var n=e.type,o=g(n,r),i=new n(e.props,o);e.__c=i,i.__v=e,i.__d=!0,i.props=e.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,n.getDerivedStateFromProps?i.state=j({},i.state,n.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=t.__r;return a&&a(e),i.render(i.props,i.state,i.context)}(r,n):function(e,r){var n,o=h(e,r),i=g(e.type,r);e.__c=o;for(var a=t.__r,l=0;o.__d&&l++<25;)o.__d=!1,a&&a(e),n=e.type.call(o,e.props,i);return n}(r,n);var v=r.__c;v.getChildContext&&(n=j({},n,v.getChildContext()))}var y=A(d,n,a,l,r);return t.diffed&&t.diffed(r),r.__=void 0,t.unmount&&t.unmount(r),y}var m,b,x="<";if(x+=_,p)for(var k in m=p.children,p){var S=p[k];if(!("key"===k||"ref"===k||"__self"===k||"__source"===k||"children"===k||"className"===k&&"class"in p||"htmlFor"===k&&"for"in p||i.test(k)))if(S=C(k=w(k,a),S),"dangerouslySetInnerHTML"===k)b=S&&S.__html;else if("textarea"===_&&"value"===k)m=S;else if((S||0===S||""===S)&&"function"!=typeof S){if(!0===S||""===S){S=k,x=x+" "+k;continue}if("value"===k){if("select"===_){l=S;continue}"option"!==_||l!=S||"selected"in p||(x+=" selected")}x=x+" "+k+'="'+s(S)+'"'}}var F=x;if(x+=">",i.test(_))throw new Error(_+" is not a valid HTML tag name in "+x);var H="",M=!1;if(b)H+=b,M=!0;else if("string"==typeof m)H+=s(m),M=!0;else if(O(m)){r.__k=m;for(var L=0;L<m.length;L++){var T=m[L];if(null!=T&&!1!==T){var E=A(T,n,"svg"===_||"foreignObject"!==_&&a,l,r);E&&(H+=E,M=!0)}}}else if(null!=m&&!1!==m&&!0!==m){r.__k=[m];var $=A(m,n,"svg"===_||"foreignObject"!==_&&a,l,r);$&&(H+=$,M=!0)}if(t.diffed&&t.diffed(r),r.__=void 0,t.unmount&&t.unmount(r),M)x+=H;else if(o.test(_))return F+" />";return x+"</"+_+">"}S.shallowRender=x;export default S;export{S as render,S as renderToStaticMarkup,S as renderToString,x as shallowRender}; | ||
import{Fragment as e,options as t,h as r}from"preact";var n=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\s\n\\/='"\0<>]/,a=/^xlink:?./,l=/["&<]/;function s(e){if(!1===l.test(e+=""))return e;for(var t=0,r=0,n="",o="";r<e.length;r++){switch(e.charCodeAt(r)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}r!==t&&(n+=e.slice(t,r)),n+=o,t=r+1}return r!==t&&(n+=e.slice(t,r)),n}var f=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},u=function(e,t,r){return String(e).length>(t||40)||!r&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},c={},_=/([A-Z])/g;function p(e){var t="";for(var r in e){var o=e[r];null!=o&&""!==o&&(t&&(t+=" "),t+="-"==r[0]?r:c[r]||(c[r]=r.replace(_,"-$1").toLowerCase()),t="number"==typeof o&&!1===n.test(r)?t+": "+o+"px;":t+": "+o+";")}return t||void 0}function d(e,t){return Array.isArray(t)?t.reduce(d,e):null!=t&&!1!==t&&e.push(t),e}function v(){this.__d=!0}function h(e,t){return{__v:e,context:t,props:e.props,setState:v,forceUpdate:v,__d:!0,__h:[]}}function g(e,t){var r=e.contextType,n=r&&t[r.__c];return null!=r?n?n.props.value:r.__:t}var y=[];function m(r,n,l,c,_,v){if(null==r||"boolean"==typeof r)return"";if("object"!=typeof r)return"function"==typeof r?"":s(r);var b=l.pretty,x=b&&"string"==typeof b?b:"\t";if(Array.isArray(r)){for(var k="",S=0;S<r.length;S++)b&&S>0&&(k+="\n"),k+=m(r[S],n,l,c,_,v);return k}if(void 0!==r.constructor)return"";var w,C=r.type,O=r.props,j=!1;if("function"==typeof C){if(j=!0,!l.shallow||!c&&!1!==l.renderRootComponent){if(C===e){var A=[];return d(A,r.props.children),m(A,n,l,!1!==l.shallowHighOrder,_,v)}var F,H=r.__c=h(r,n);t.__b&&t.__b(r);var M=t.__r;if(C.prototype&&"function"==typeof C.prototype.render){var L=g(C,n);(H=r.__c=new C(O,L)).__v=r,H._dirty=H.__d=!0,H.props=O,null==H.state&&(H.state={}),null==H._nextState&&null==H.__s&&(H._nextState=H.__s=H.state),H.context=L,C.getDerivedStateFromProps?H.state=Object.assign({},H.state,C.getDerivedStateFromProps(H.props,H.state)):H.componentWillMount&&(H.componentWillMount(),H.state=H._nextState!==H.state?H._nextState:H.__s!==H.state?H.__s:H.state),M&&M(r),F=H.render(H.props,H.state,H.context)}else for(var T=g(C,n),E=0;H.__d&&E++<25;)H.__d=!1,M&&M(r),F=C.call(r.__c,O,T);return H.getChildContext&&(n=Object.assign({},n,H.getChildContext())),t.diffed&&t.diffed(r),m(F,n,l,!1!==l.shallowHighOrder,_,v)}C=(w=C).displayName||w!==Function&&w.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var r=-1,n=y.length;n--;)if(y[n]===e){r=n;break}r<0&&(r=y.push(e)-1),t="UnnamedComponent"+r}return t}(w)}var $,D,N="<"+C;if(O){var P=Object.keys(O);l&&!0===l.sortAttributes&&P.sort();for(var W=0;W<P.length;W++){var I=P[W],R=O[I];if("children"!==I){if(!i.test(I)&&(l&&l.allAttributes||"key"!==I&&"ref"!==I&&"__self"!==I&&"__source"!==I)){if("defaultValue"===I)I="value";else if("defaultChecked"===I)I="checked";else if("defaultSelected"===I)I="selected";else if("className"===I){if(void 0!==O.class)continue;I="class"}else _&&a.test(I)&&(I=I.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===I){if(O.for)continue;I="for"}"style"===I&&R&&"object"==typeof R&&(R=p(R)),"a"===I[0]&&"r"===I[1]&&"boolean"==typeof R&&(R=String(R));var U=l.attributeHook&&l.attributeHook(I,R,n,l,j);if(U||""===U)N+=U;else if("dangerouslySetInnerHTML"===I)D=R&&R.__html;else if("textarea"===C&&"value"===I)$=R;else if((R||0===R||""===R)&&"function"!=typeof R){if(!(!0!==R&&""!==R||(R=I,l&&l.xml))){N=N+" "+I;continue}if("value"===I){if("select"===C){v=R;continue}"option"===C&&v==R&&void 0===O.selected&&(N+=" selected")}N=N+" "+I+'="'+s(R)+'"'}}}else $=R}}if(b){var V=N.replace(/\n\s*/," ");V===N||~V.indexOf("\n")?b&&~N.indexOf("\n")&&(N+="\n"):N=V}if(N+=">",i.test(C))throw new Error(C+" is not a valid HTML tag name in "+N);var q,z=o.test(C)||l.voidElements&&l.voidElements.test(C),Z=[];if(D)b&&u(D)&&(D="\n"+x+f(D,x)),N+=D;else if(null!=$&&d(q=[],$).length){for(var B=b&&~N.indexOf("\n"),G=!1,J=0;J<q.length;J++){var K=q[J];if(null!=K&&!1!==K){var Q=m(K,n,l,!0,"svg"===C||"foreignObject"!==C&&_,v);if(b&&!B&&u(Q)&&(B=!0),Q)if(b){var X=Q.length>0&&"<"!=Q[0];G&&X?Z[Z.length-1]+=Q:Z.push(Q),G=X}else Z.push(Q)}}if(b&&B)for(var Y=Z.length;Y--;)Z[Y]="\n"+x+f(Z[Y],x)}if(Z.length||D)N+=Z.join("");else if(l&&l.xml)return N.substring(0,N.length-1)+" />";return!z||q||D?(b&&~N.indexOf("\n")&&(N+="\n"),N=N+"</"+C+">"):N=N.replace(/>$/," />"),N}var b={shallow:!0};S.render=S;var x=function(e,t){return S(e,t,b)},k=[];function S(n,o,i){o=o||{};var a=t.__s;t.__s=!0;var l,s=r(e,null);return s.__k=[n],l=i&&(i.pretty||i.voidElements||i.sortAttributes||i.shallow||i.allAttributes||i.xml||i.attributeHook)?m(n,o,i):A(n,o,!1,void 0,s),t.__c&&t.__c(n,k),t.__s=a,k.length=0,l}function w(e,t){return"className"===e?"class":"htmlFor"===e?"for":"defaultValue"===e?"value":"defaultChecked"===e?"checked":"defaultSelected"===e?"selected":t&&a.test(e)?e.toLowerCase().replace(/^xlink:?/,"xlink:"):e}function C(e,t){return"style"===e&&null!=t&&"object"==typeof t?p(t):"a"===e[0]&&"r"===e[1]&&"boolean"==typeof t?String(t):t}var O=Array.isArray,j=Object.assign;function A(r,n,a,l,f){if(null==r||!0===r||!1===r||""===r)return"";if("object"!=typeof r)return"function"==typeof r?"":s(r);if(O(r)){var u="";f.__k=r;for(var c=0;c<r.length;c++)u+=A(r[c],n,a,l,f);return u}if(void 0!==r.constructor)return"";r.__=f,t.__b&&t.__b(r);var _=r.type,p=r.props;if("function"==typeof _){var d;if(_===e)d=p.children;else{d=_.prototype&&"function"==typeof _.prototype.render?function(e,r){var n=e.type,o=g(n,r),i=new n(e.props,o);e.__c=i,i.__v=e,i.__d=!0,i.props=e.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,n.getDerivedStateFromProps?i.state=j({},i.state,n.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=t.__r;return a&&a(e),i.render(i.props,i.state,i.context)}(r,n):function(e,r){var n,o=h(e,r),i=g(e.type,r);e.__c=o;for(var a=t.__r,l=0;o.__d&&l++<25;)o.__d=!1,a&&a(e),n=e.type.call(o,e.props,i);return n}(r,n);var v=r.__c;v.getChildContext&&(n=j({},n,v.getChildContext()))}var y=A(d=null!=d&&d.type===e&&null==d.key?d.props.children:d,n,a,l,r);return t.diffed&&t.diffed(r),r.__=void 0,t.unmount&&t.unmount(r),y}var m,b,x="<";if(x+=_,p)for(var k in m=p.children,p){var S=p[k];if(!("key"===k||"ref"===k||"__self"===k||"__source"===k||"children"===k||"className"===k&&"class"in p||"htmlFor"===k&&"for"in p||i.test(k)))if(S=C(k=w(k,a),S),"dangerouslySetInnerHTML"===k)b=S&&S.__html;else if("textarea"===_&&"value"===k)m=S;else if((S||0===S||""===S)&&"function"!=typeof S){if(!0===S||""===S){S=k,x=x+" "+k;continue}if("value"===k){if("select"===_){l=S;continue}"option"!==_||l!=S||"selected"in p||(x+=" selected")}x=x+" "+k+'="'+s(S)+'"'}}var F=x;if(x+=">",i.test(_))throw new Error(_+" is not a valid HTML tag name in "+x);var H="",M=!1;if(b)H+=b,M=!0;else if("string"==typeof m)H+=s(m),M=!0;else if(O(m)){r.__k=m;for(var L=0;L<m.length;L++){var T=m[L];if(null!=T&&!1!==T){var E=A(T,n,"svg"===_||"foreignObject"!==_&&a,l,r);E&&(H+=E,M=!0)}}}else if(null!=m&&!1!==m&&!0!==m){r.__k=[m];var $=A(m,n,"svg"===_||"foreignObject"!==_&&a,l,r);$&&(H+=$,M=!0)}if(t.diffed&&t.diffed(r),r.__=void 0,t.unmount&&t.unmount(r),M)x+=H;else if(o.test(_))return F+" />";return x+"</"+_+">"}S.shallowRender=x;export default S;export{S as render,S as renderToStaticMarkup,S as renderToString,x as shallowRender}; | ||
//# sourceMappingURL=index.module.js.map |
@@ -1,2 +0,2 @@ | ||
var t;t=function(t,e){if("function"!=typeof Symbol){var n=0;Symbol=function(t){return"@@"+t+ ++n},Symbol.for=function(t){return"@@"+t}}var r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\s\n\\/='"\0<>]/,a=/^xlink:?./,u=/["&<]/;function s(t){if(!1===u.test(t+=""))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}var l=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},f=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},c={},p=/([A-Z])/g;function d(t){var e="";for(var n in t){var o=t[n];null!=o&&""!==o&&(e&&(e+=" "),e+="-"==n[0]?n:c[n]||(c[n]=n.replace(p,"-$1").toLowerCase()),e="number"==typeof o&&!1===r.test(n)?e+": "+o+"px;":e+": "+o+";")}return e||void 0}function v(t,e){return Array.isArray(e)?e.reduce(v,t):null!=e&&!1!==e&&t.push(e),t}function _(){this.__d=!0}function y(t,e){return{__v:t,context:e,props:t.props,setState:_,forceUpdate:_,__d:!0,__h:[]}}function g(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var b=[];function m(t,n,r,u,c,p){if(null==t||"boolean"==typeof t)return"";if("object"!=typeof t)return s(t);var _=r.pretty,h=_&&"string"==typeof _?_:"\t";if(Array.isArray(t)){for(var j="",x=0;x<t.length;x++)_&&x>0&&(j+="\n"),j+=m(t[x],n,r,u,c,p);return j}var S,k=t.type,A=t.props,O=!1;if("function"==typeof k){if(O=!0,!r.shallow||!u&&!1!==r.renderRootComponent){if(k===e.Fragment){var w=[];return v(w,t.props.children),m(w,n,r,!1!==r.shallowHighOrder,c,p)}var F,C=t.__c=y(t,n);e.options.__b&&e.options.__b(t);var E=e.options.__r;if(k.prototype&&"function"==typeof k.prototype.render){var M=g(k,n);(C=t.__c=new k(A,M)).__v=t,C._dirty=C.__d=!0,C.props=A,null==C.state&&(C.state={}),null==C._nextState&&null==C.__s&&(C._nextState=C.__s=C.state),C.context=M,k.getDerivedStateFromProps?C.state=Object.assign({},C.state,k.getDerivedStateFromProps(C.props,C.state)):C.componentWillMount&&(C.componentWillMount(),C.state=C._nextState!==C.state?C._nextState:C.__s!==C.state?C.__s:C.state),E&&E(t),F=C.render(C.props,C.state,C.context)}else for(var H=g(k,n),N=0;C.__d&&N++<25;)C.__d=!1,E&&E(t),F=k.call(t.__c,A,H);return C.getChildContext&&(n=Object.assign({},n,C.getChildContext())),e.options.diffed&&e.options.diffed(t),m(F,n,r,!1!==r.shallowHighOrder,c,p)}k=(S=k).displayName||S!==Function&&S.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=b.length;r--;)if(b[r]===t){n=r;break}n<0&&(n=b.push(t)-1),e="UnnamedComponent"+n}return e}(S)}var D,I,L="<"+k;if(A){var W=Object.keys(A);r&&!0===r.sortAttributes&&W.sort();for(var $=0;$<W.length;$++){var P=W[$],T=A[P];if("children"!==P){if(!i.test(P)&&(r&&r.allAttributes||"key"!==P&&"ref"!==P&&"__self"!==P&&"__source"!==P)){if("defaultValue"===P)P="value";else if("defaultChecked"===P)P="checked";else if("defaultSelected"===P)P="selected";else if("className"===P){if(void 0!==A.class)continue;P="class"}else c&&a.test(P)&&(P=P.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===P){if(A.for)continue;P="for"}"style"===P&&T&&"object"==typeof T&&(T=d(T)),"a"===P[0]&&"r"===P[1]&&"boolean"==typeof T&&(T=String(T));var U=r.attributeHook&&r.attributeHook(P,T,n,r,O);if(U||""===U)L+=U;else if("dangerouslySetInnerHTML"===P)I=T&&T.__html;else if("textarea"===k&&"value"===P)D=T;else if((T||0===T||""===T)&&"function"!=typeof T){if(!(!0!==T&&""!==T||(T=P,r&&r.xml))){L=L+" "+P;continue}if("value"===P){if("select"===k){p=T;continue}"option"===k&&p==T&&void 0===A.selected&&(L+=" selected")}L=L+" "+P+'="'+s(T)+'"'}}}else D=T}}if(_){var R=L.replace(/\n\s*/," ");R===L||~R.indexOf("\n")?_&&~L.indexOf("\n")&&(L+="\n"):L=R}if(L+=">",i.test(k))throw new Error(k+" is not a valid HTML tag name in "+L);var J,V=o.test(k)||r.voidElements&&r.voidElements.test(k),q=[];if(I)_&&f(I)&&(I="\n"+h+l(I,h)),L+=I;else if(null!=D&&v(J=[],D).length){for(var z=_&&~L.indexOf("\n"),B=!1,G=0;G<J.length;G++){var Z=J[G];if(null!=Z&&!1!==Z){var K=m(Z,n,r,!0,"svg"===k||"foreignObject"!==k&&c,p);if(_&&!z&&f(K)&&(z=!0),K)if(_){var Q=K.length>0&&"<"!=K[0];B&&Q?q[q.length-1]+=K:q.push(K),B=Q}else q.push(K)}}if(_&&z)for(var X=q.length;X--;)q[X]="\n"+h+l(q[X],h)}if(q.length||I)L+=q.join("");else if(r&&r.xml)return L.substring(0,L.length-1)+" />";return!V||J||I?(_&&~L.indexOf("\n")&&(L+="\n"),L=L+"</"+k+">"):L=L.replace(/>$/," />"),L}var h={shallow:!0};x.render=x;var j=[];function x(t,n,r){n=n||{};var o=e.options.__s;e.options.__s=!0;var i,a=e.h(e.Fragment,null);return a.__k=[t],i=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?m(t,n,r):w(t,n,!1,void 0,a),e.options.__c&&e.options.__c(t,j),e.options.__s=o,j.length=0,i}function S(t,e){return"className"===t?"class":"htmlFor"===t?"for":"defaultValue"===t?"value":"defaultChecked"===t?"checked":"defaultSelected"===t?"selected":e&&a.test(t)?t.toLowerCase().replace(/^xlink:?/,"xlink:"):t}function k(t,e){return"style"===t&&null!=e&&"object"==typeof e?d(e):"a"===t[0]&&"r"===t[1]&&"boolean"==typeof e?String(e):e}var A=Array.isArray,O=Object.assign;function w(t,n,r,a,u){if(null==t||!0===t||!1===t||""===t)return"";if("object"!=typeof t)return s(t);if(A(t)){var l="";u.__k=t;for(var f=0;f<t.length;f++)l+=w(t[f],n,r,a,u);return l}t.__=u,e.options.__b&&e.options.__b(t);var c=t.type,p=t.props;if("function"==typeof c){var d;if(c===e.Fragment)d=p.children;else{d=c.prototype&&"function"==typeof c.prototype.render?function(t,n){var r=t.type,o=g(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=e.options.__r;return a&&a(t),i.render(i.props,i.state,i.context)}(t,n):function(t,n){var r,o=y(t,n),i=g(t.type,n);t.__c=o;for(var a=e.options.__r,u=0;o.__d&&u++<25;)o.__d=!1,a&&a(t),r=t.type.call(o,t.props,i);return r}(t,n);var v=t.__c;v.getChildContext&&(n=O({},n,v.getChildContext()))}var _=w(d,n,r,a,t);return e.options.diffed&&e.options.diffed(t),t.__=void 0,e.options.unmount&&e.options.unmount(t),_}var b,m,h="<";if(h+=c,p)for(var j in b=p.children,p){var x=p[j];if(!("key"===j||"ref"===j||"__self"===j||"__source"===j||"children"===j||"className"===j&&"class"in p||"htmlFor"===j&&"for"in p||i.test(j)))if(x=k(j=S(j,r),x),"dangerouslySetInnerHTML"===j)m=x&&x.__html;else if("textarea"===c&&"value"===j)b=x;else if((x||0===x||""===x)&&"function"!=typeof x){if(!0===x||""===x){x=j,h=h+" "+j;continue}if("value"===j){if("select"===c){a=x;continue}"option"!==c||a!=x||"selected"in p||(h+=" selected")}h=h+" "+j+'="'+s(x)+'"'}}var F=h;if(h+=">",i.test(c))throw new Error(c+" is not a valid HTML tag name in "+h);var C="",E=!1;if(m)C+=m,E=!0;else if("string"==typeof b)C+=s(b),E=!0;else if(A(b)){t.__k=b;for(var M=0;M<b.length;M++){var H=b[M];if(null!=H&&!1!==H){var N=w(H,n,"svg"===c||"foreignObject"!==c&&r,a,t);N&&(C+=N,E=!0)}}}else if(null!=b&&!1!==b&&!0!==b){t.__k=[b];var D=w(b,n,"svg"===c||"foreignObject"!==c&&r,a,t);D&&(C+=D,E=!0)}if(e.options.diffed&&e.options.diffed(t),t.__=void 0,e.options.unmount&&e.options.unmount(t),E)h+=C;else if(o.test(c))return F+" />";return h+"</"+c+">"}x.shallowRender=function(t,e){return x(t,e,h)};var F=/(\\|\"|\')/g,C=Object.prototype.toString,E=Date.prototype.toISOString,M=Error.prototype.toString,H=RegExp.prototype.toString,N=Symbol.prototype.toString,D=/^Symbol\((.*)\)(.*)$/,I=/\n/gi,L=Object.getOwnPropertySymbols||function(t){return[]};function W(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function $(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function P(t){return N.call(t).replace(D,"Symbol($1)")}function T(t){return"["+M.call(t)+"]"}function U(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";var e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace(F,"\\$1")}(t)+'"';if("function"===e)return $(t);if("symbol"===e)return P(t);var n=C.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?$(t,min):"[object Symbol]"===n?P(t):"[object Date]"===n?E.call(t):"[object Error]"===n?T(t):"[object RegExp]"===n?H.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":W(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&T(t)}function R(t,e,n,r,o,i,a,u,s,l){var f="";if(t.length){f+=o;for(var c=n+e,p=0;p<t.length;p++)f+=c+q(t[p],e,c,r,o,i,a,u,s,l),p<t.length-1&&(f+=","+r);f+=o+n}return"["+f+"]"}function J(t,e,n,r,o,i,a,u,s,l){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);var f=++u>a;if(!f&&t.toJSON&&"function"==typeof t.toJSON)return q(t.toJSON(),e,n,r,o,i,a,u,s,l);var c=C.call(t);return"[object Arguments]"===c?f?"[Arguments]":function(t,e,n,r,o,i,a,u,s,l){return(l?"":"Arguments ")+R(t,e,n,r,o,i,a,u,s,l)}(t,e,n,r,o,i,a,u,s,l):W(c)?f?"[Array]":function(t,e,n,r,o,i,a,u,s,l){return(l?"":t.constructor.name+" ")+R(t,e,n,r,o,i,a,u,s,l)}(t,e,n,r,o,i,a,u,s,l):"[object Map]"===c?f?"[Map]":function(t,e,n,r,o,i,a,u,s,l){var f="Map {",c=t.entries(),p=c.next();if(!p.done){f+=o;for(var d=n+e;!p.done;)f+=d+q(p.value[0],e,d,r,o,i,a,u,s,l)+" => "+q(p.value[1],e,d,r,o,i,a,u,s,l),(p=c.next()).done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,a,u,s,l):"[object Set]"===c?f?"[Set]":function(t,e,n,r,o,i,a,u,s,l){var f="Set {",c=t.entries(),p=c.next();if(!p.done){f+=o;for(var d=n+e;!p.done;)f+=d+q(p.value[1],e,d,r,o,i,a,u,s,l),(p=c.next()).done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,a,u,s,l):"object"==typeof t?f?"[Object]":function(t,e,n,r,o,i,a,u,s,l){var f=(l?"":t.constructor?t.constructor.name+" ":"Object ")+"{",c=Object.keys(t).sort(),p=L(t);if(p.length&&(c=c.filter(function(t){return!("symbol"==typeof t||"[object Symbol]"===C.call(t))}).concat(p)),c.length){f+=o;for(var d=n+e,v=0;v<c.length;v++){var _=c[v];f+=d+q(_,e,d,r,o,i,a,u,s,l)+": "+q(t[_],e,d,r,o,i,a,u,s,l),v<c.length-1&&(f+=","+r)}f+=o+n}return f+"}"}(t,e,n,r,o,i,a,u,s,l):void 0}function V(t,e,n,r,o,i,a,u,s,l){for(var f,c=!1,p=0;p<s.length;p++)if((f=s[p]).test(t)){c=!0;break}return!!c&&f.print(t,function(t){return q(t,e,n,r,o,i,a,u,s,l)},function(t){var r=n+e;return r+t.replace(I,"\n"+r)},{edgeSpacing:o,spacing:r})}function q(t,e,n,r,o,i,a,u,s,l){return U(t)||V(t,e,n,r,o,i,a,u,s,l)||J(t,e,n,r,o,i,a,u,s,l)}var z={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function B(t){return new Array(t+1).join(" ")}var G={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t,e,n){return x(t,G.context,G.opts)}},Z={plugins:[G]},K={attributeHook:function(t,e,n,r,o){var i=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===i&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";var a="string"==typeof r.pretty?r.pretty:"\t";return"string"!==i?("function"!==i||r.functionNames?(G.context=n,G.opts=r,~(e=function(t,e){var n,r;e?(function(t){if(Object.keys(t).forEach(function(t){if(!z.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){var e={};return Object.keys(z).forEach(function(n){return e[n]=t.hasOwnProperty(n)?t[n]:z[n]}),e.min&&(e.indent=0),e}(e)):e=z;var o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){var a=V(t,n=B(e.indent),"",o,i,r=[],e.maxDepth,0,e.plugins,e.min);if(a)return a}return U(t)||(n||(n=B(e.indent)),r||(r=[]),J(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,Z)).indexOf("\n")&&(e=l("\n"+e,a)+"\n")):e="Function",l("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+s(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function Q(t,e,n,r){return x(t,e,n=Object.assign({},K,n||{}))}t.default=Q,t.render=Q},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],t):t(self.preactRenderToString={},(void 0).preact); | ||
var t;t=function(t,e){if("function"!=typeof Symbol){var n=0;Symbol=function(t){return"@@"+t+ ++n},Symbol.for=function(t){return"@@"+t}}var r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\s\n\\/='"\0<>]/,a=/^xlink:?./,u=/["&<]/;function s(t){if(!1===u.test(t+=""))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}var f=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},l=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},c={},p=/([A-Z])/g;function d(t){var e="";for(var n in t){var o=t[n];null!=o&&""!==o&&(e&&(e+=" "),e+="-"==n[0]?n:c[n]||(c[n]=n.replace(p,"-$1").toLowerCase()),e="number"==typeof o&&!1===r.test(n)?e+": "+o+"px;":e+": "+o+";")}return e||void 0}function v(t,e){return Array.isArray(e)?e.reduce(v,t):null!=e&&!1!==e&&t.push(e),t}function _(){this.__d=!0}function y(t,e){return{__v:t,context:e,props:t.props,setState:_,forceUpdate:_,__d:!0,__h:[]}}function g(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var m=[];function b(t,n,r,u,c,p){if(null==t||"boolean"==typeof t)return"";if("object"!=typeof t)return"function"==typeof t?"":s(t);var _=r.pretty,h=_&&"string"==typeof _?_:"\t";if(Array.isArray(t)){for(var j="",x=0;x<t.length;x++)_&&x>0&&(j+="\n"),j+=b(t[x],n,r,u,c,p);return j}if(void 0!==t.constructor)return"";var S,k=t.type,A=t.props,O=!1;if("function"==typeof k){if(O=!0,!r.shallow||!u&&!1!==r.renderRootComponent){if(k===e.Fragment){var w=[];return v(w,t.props.children),b(w,n,r,!1!==r.shallowHighOrder,c,p)}var F,C=t.__c=y(t,n);e.options.__b&&e.options.__b(t);var E=e.options.__r;if(k.prototype&&"function"==typeof k.prototype.render){var M=g(k,n);(C=t.__c=new k(A,M)).__v=t,C._dirty=C.__d=!0,C.props=A,null==C.state&&(C.state={}),null==C._nextState&&null==C.__s&&(C._nextState=C.__s=C.state),C.context=M,k.getDerivedStateFromProps?C.state=Object.assign({},C.state,k.getDerivedStateFromProps(C.props,C.state)):C.componentWillMount&&(C.componentWillMount(),C.state=C._nextState!==C.state?C._nextState:C.__s!==C.state?C.__s:C.state),E&&E(t),F=C.render(C.props,C.state,C.context)}else for(var H=g(k,n),N=0;C.__d&&N++<25;)C.__d=!1,E&&E(t),F=k.call(t.__c,A,H);return C.getChildContext&&(n=Object.assign({},n,C.getChildContext())),e.options.diffed&&e.options.diffed(t),b(F,n,r,!1!==r.shallowHighOrder,c,p)}k=(S=k).displayName||S!==Function&&S.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=m.length;r--;)if(m[r]===t){n=r;break}n<0&&(n=m.push(t)-1),e="UnnamedComponent"+n}return e}(S)}var D,I,L="<"+k;if(A){var W=Object.keys(A);r&&!0===r.sortAttributes&&W.sort();for(var $=0;$<W.length;$++){var P=W[$],T=A[P];if("children"!==P){if(!i.test(P)&&(r&&r.allAttributes||"key"!==P&&"ref"!==P&&"__self"!==P&&"__source"!==P)){if("defaultValue"===P)P="value";else if("defaultChecked"===P)P="checked";else if("defaultSelected"===P)P="selected";else if("className"===P){if(void 0!==A.class)continue;P="class"}else c&&a.test(P)&&(P=P.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===P){if(A.for)continue;P="for"}"style"===P&&T&&"object"==typeof T&&(T=d(T)),"a"===P[0]&&"r"===P[1]&&"boolean"==typeof T&&(T=String(T));var U=r.attributeHook&&r.attributeHook(P,T,n,r,O);if(U||""===U)L+=U;else if("dangerouslySetInnerHTML"===P)I=T&&T.__html;else if("textarea"===k&&"value"===P)D=T;else if((T||0===T||""===T)&&"function"!=typeof T){if(!(!0!==T&&""!==T||(T=P,r&&r.xml))){L=L+" "+P;continue}if("value"===P){if("select"===k){p=T;continue}"option"===k&&p==T&&void 0===A.selected&&(L+=" selected")}L=L+" "+P+'="'+s(T)+'"'}}}else D=T}}if(_){var R=L.replace(/\n\s*/," ");R===L||~R.indexOf("\n")?_&&~L.indexOf("\n")&&(L+="\n"):L=R}if(L+=">",i.test(k))throw new Error(k+" is not a valid HTML tag name in "+L);var J,V=o.test(k)||r.voidElements&&r.voidElements.test(k),q=[];if(I)_&&l(I)&&(I="\n"+h+f(I,h)),L+=I;else if(null!=D&&v(J=[],D).length){for(var z=_&&~L.indexOf("\n"),B=!1,G=0;G<J.length;G++){var Z=J[G];if(null!=Z&&!1!==Z){var K=b(Z,n,r,!0,"svg"===k||"foreignObject"!==k&&c,p);if(_&&!z&&l(K)&&(z=!0),K)if(_){var Q=K.length>0&&"<"!=K[0];B&&Q?q[q.length-1]+=K:q.push(K),B=Q}else q.push(K)}}if(_&&z)for(var X=q.length;X--;)q[X]="\n"+h+f(q[X],h)}if(q.length||I)L+=q.join("");else if(r&&r.xml)return L.substring(0,L.length-1)+" />";return!V||J||I?(_&&~L.indexOf("\n")&&(L+="\n"),L=L+"</"+k+">"):L=L.replace(/>$/," />"),L}var h={shallow:!0};x.render=x;var j=[];function x(t,n,r){n=n||{};var o=e.options.__s;e.options.__s=!0;var i,a=e.h(e.Fragment,null);return a.__k=[t],i=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?b(t,n,r):w(t,n,!1,void 0,a),e.options.__c&&e.options.__c(t,j),e.options.__s=o,j.length=0,i}function S(t,e){return"className"===t?"class":"htmlFor"===t?"for":"defaultValue"===t?"value":"defaultChecked"===t?"checked":"defaultSelected"===t?"selected":e&&a.test(t)?t.toLowerCase().replace(/^xlink:?/,"xlink:"):t}function k(t,e){return"style"===t&&null!=e&&"object"==typeof e?d(e):"a"===t[0]&&"r"===t[1]&&"boolean"==typeof e?String(e):e}var A=Array.isArray,O=Object.assign;function w(t,n,r,a,u){if(null==t||!0===t||!1===t||""===t)return"";if("object"!=typeof t)return"function"==typeof t?"":s(t);if(A(t)){var f="";u.__k=t;for(var l=0;l<t.length;l++)f+=w(t[l],n,r,a,u);return f}if(void 0!==t.constructor)return"";t.__=u,e.options.__b&&e.options.__b(t);var c=t.type,p=t.props;if("function"==typeof c){var d;if(c===e.Fragment)d=p.children;else{d=c.prototype&&"function"==typeof c.prototype.render?function(t,n){var r=t.type,o=g(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=e.options.__r;return a&&a(t),i.render(i.props,i.state,i.context)}(t,n):function(t,n){var r,o=y(t,n),i=g(t.type,n);t.__c=o;for(var a=e.options.__r,u=0;o.__d&&u++<25;)o.__d=!1,a&&a(t),r=t.type.call(o,t.props,i);return r}(t,n);var v=t.__c;v.getChildContext&&(n=O({},n,v.getChildContext()))}var _=w(d=null!=d&&d.type===e.Fragment&&null==d.key?d.props.children:d,n,r,a,t);return e.options.diffed&&e.options.diffed(t),t.__=void 0,e.options.unmount&&e.options.unmount(t),_}var m,b,h="<";if(h+=c,p)for(var j in m=p.children,p){var x=p[j];if(!("key"===j||"ref"===j||"__self"===j||"__source"===j||"children"===j||"className"===j&&"class"in p||"htmlFor"===j&&"for"in p||i.test(j)))if(x=k(j=S(j,r),x),"dangerouslySetInnerHTML"===j)b=x&&x.__html;else if("textarea"===c&&"value"===j)m=x;else if((x||0===x||""===x)&&"function"!=typeof x){if(!0===x||""===x){x=j,h=h+" "+j;continue}if("value"===j){if("select"===c){a=x;continue}"option"!==c||a!=x||"selected"in p||(h+=" selected")}h=h+" "+j+'="'+s(x)+'"'}}var F=h;if(h+=">",i.test(c))throw new Error(c+" is not a valid HTML tag name in "+h);var C="",E=!1;if(b)C+=b,E=!0;else if("string"==typeof m)C+=s(m),E=!0;else if(A(m)){t.__k=m;for(var M=0;M<m.length;M++){var H=m[M];if(null!=H&&!1!==H){var N=w(H,n,"svg"===c||"foreignObject"!==c&&r,a,t);N&&(C+=N,E=!0)}}}else if(null!=m&&!1!==m&&!0!==m){t.__k=[m];var D=w(m,n,"svg"===c||"foreignObject"!==c&&r,a,t);D&&(C+=D,E=!0)}if(e.options.diffed&&e.options.diffed(t),t.__=void 0,e.options.unmount&&e.options.unmount(t),E)h+=C;else if(o.test(c))return F+" />";return h+"</"+c+">"}x.shallowRender=function(t,e){return x(t,e,h)};var F=/(\\|\"|\')/g,C=Object.prototype.toString,E=Date.prototype.toISOString,M=Error.prototype.toString,H=RegExp.prototype.toString,N=Symbol.prototype.toString,D=/^Symbol\((.*)\)(.*)$/,I=/\n/gi,L=Object.getOwnPropertySymbols||function(t){return[]};function W(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function $(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function P(t){return N.call(t).replace(D,"Symbol($1)")}function T(t){return"["+M.call(t)+"]"}function U(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";var e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace(F,"\\$1")}(t)+'"';if("function"===e)return $(t);if("symbol"===e)return P(t);var n=C.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?$(t,min):"[object Symbol]"===n?P(t):"[object Date]"===n?E.call(t):"[object Error]"===n?T(t):"[object RegExp]"===n?H.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":W(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&T(t)}function R(t,e,n,r,o,i,a,u,s,f){var l="";if(t.length){l+=o;for(var c=n+e,p=0;p<t.length;p++)l+=c+q(t[p],e,c,r,o,i,a,u,s,f),p<t.length-1&&(l+=","+r);l+=o+n}return"["+l+"]"}function J(t,e,n,r,o,i,a,u,s,f){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);var l=++u>a;if(!l&&t.toJSON&&"function"==typeof t.toJSON)return q(t.toJSON(),e,n,r,o,i,a,u,s,f);var c=C.call(t);return"[object Arguments]"===c?l?"[Arguments]":function(t,e,n,r,o,i,a,u,s,f){return(f?"":"Arguments ")+R(t,e,n,r,o,i,a,u,s,f)}(t,e,n,r,o,i,a,u,s,f):W(c)?l?"[Array]":function(t,e,n,r,o,i,a,u,s,f){return(f?"":t.constructor.name+" ")+R(t,e,n,r,o,i,a,u,s,f)}(t,e,n,r,o,i,a,u,s,f):"[object Map]"===c?l?"[Map]":function(t,e,n,r,o,i,a,u,s,f){var l="Map {",c=t.entries(),p=c.next();if(!p.done){l+=o;for(var d=n+e;!p.done;)l+=d+q(p.value[0],e,d,r,o,i,a,u,s,f)+" => "+q(p.value[1],e,d,r,o,i,a,u,s,f),(p=c.next()).done||(l+=","+r);l+=o+n}return l+"}"}(t,e,n,r,o,i,a,u,s,f):"[object Set]"===c?l?"[Set]":function(t,e,n,r,o,i,a,u,s,f){var l="Set {",c=t.entries(),p=c.next();if(!p.done){l+=o;for(var d=n+e;!p.done;)l+=d+q(p.value[1],e,d,r,o,i,a,u,s,f),(p=c.next()).done||(l+=","+r);l+=o+n}return l+"}"}(t,e,n,r,o,i,a,u,s,f):"object"==typeof t?l?"[Object]":function(t,e,n,r,o,i,a,u,s,f){var l=(f?"":t.constructor?t.constructor.name+" ":"Object ")+"{",c=Object.keys(t).sort(),p=L(t);if(p.length&&(c=c.filter(function(t){return!("symbol"==typeof t||"[object Symbol]"===C.call(t))}).concat(p)),c.length){l+=o;for(var d=n+e,v=0;v<c.length;v++){var _=c[v];l+=d+q(_,e,d,r,o,i,a,u,s,f)+": "+q(t[_],e,d,r,o,i,a,u,s,f),v<c.length-1&&(l+=","+r)}l+=o+n}return l+"}"}(t,e,n,r,o,i,a,u,s,f):void 0}function V(t,e,n,r,o,i,a,u,s,f){for(var l,c=!1,p=0;p<s.length;p++)if((l=s[p]).test(t)){c=!0;break}return!!c&&l.print(t,function(t){return q(t,e,n,r,o,i,a,u,s,f)},function(t){var r=n+e;return r+t.replace(I,"\n"+r)},{edgeSpacing:o,spacing:r})}function q(t,e,n,r,o,i,a,u,s,f){return U(t)||V(t,e,n,r,o,i,a,u,s,f)||J(t,e,n,r,o,i,a,u,s,f)}var z={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function B(t){return new Array(t+1).join(" ")}var G={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t,e,n){return x(t,G.context,G.opts)}},Z={plugins:[G]},K={attributeHook:function(t,e,n,r,o){var i=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===i&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";var a="string"==typeof r.pretty?r.pretty:"\t";return"string"!==i?("function"!==i||r.functionNames?(G.context=n,G.opts=r,~(e=function(t,e){var n,r;e?(function(t){if(Object.keys(t).forEach(function(t){if(!z.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){var e={};return Object.keys(z).forEach(function(n){return e[n]=t.hasOwnProperty(n)?t[n]:z[n]}),e.min&&(e.indent=0),e}(e)):e=z;var o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){var a=V(t,n=B(e.indent),"",o,i,r=[],e.maxDepth,0,e.plugins,e.min);if(a)return a}return U(t)||(n||(n=B(e.indent)),r||(r=[]),J(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,Z)).indexOf("\n")&&(e=f("\n"+e,a)+"\n")):e="Function",f("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+s(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function Q(t,e,n,r){return x(t,e,n=Object.assign({},K,n||{}))}t.default=Q,t.render=Q},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],t):t(self.preactRenderToString={},(void 0).preact); | ||
//# sourceMappingURL=jsx.js.map |
@@ -0,0 +0,0 @@ import { VNode } from 'preact'; |
@@ -1,2 +0,2 @@ | ||
import{Fragment as t,options as e,h as n}from"preact";if("function"!=typeof Symbol){let t=0;Symbol=function(e){return`@@${e}${++t}`},Symbol.for=t=>`@@${t}`}const r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\s\n\\/='"\0<>]/,l=/^xlink:?./,s=/["&<]/;function c(t){if(!1===s.test(t+=""))return t;let e=0,n=0,r="",o="";for(;n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}let u=(t,e)=>String(t).replace(/(\n+)/g,"$1"+(e||"\t")),f=(t,e,n)=>String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<");const a={},p=/([A-Z])/g;function d(t){let e="";for(let n in t){let o=t[n];null!=o&&""!==o&&(e&&(e+=" "),e+="-"==n[0]?n:a[n]||(a[n]=n.replace(p,"-$1").toLowerCase()),e="number"==typeof o&&!1===r.test(n)?e+": "+o+"px;":e+": "+o+";")}return e||void 0}function _(t,e){return Array.isArray(e)?e.reduce(_,t):null!=e&&!1!==e&&t.push(e),t}function y(){this.__d=!0}function g(t,e){return{__v:t,context:e,props:t.props,setState:y,forceUpdate:y,__d:!0,__h:[]}}function b(t,e){let n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}const m=[];function h(n,r,s,a,p,y){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return c(n);let j=s.pretty,x=j&&"string"==typeof j?j:"\t";if(Array.isArray(n)){let t="";for(let e=0;e<n.length;e++)j&&e>0&&(t+="\n"),t+=h(n[e],r,s,a,p,y);return t}let S=n.type,k=n.props,v=!1;if("function"==typeof S){if(v=!0,!s.shallow||!a&&!1!==s.renderRootComponent){if(S===t){const t=[];return _(t,n.props.children),h(t,r,s,!1!==s.shallowHighOrder,p,y)}{let t,o=n.__c=g(n,r);e.__b&&e.__b(n);let i=e.__r;if(S.prototype&&"function"==typeof S.prototype.render){let e=b(S,r);o=n.__c=new S(k,e),o.__v=n,o._dirty=o.__d=!0,o.props=k,null==o.state&&(o.state={}),null==o._nextState&&null==o.__s&&(o._nextState=o.__s=o.state),o.context=e,S.getDerivedStateFromProps?o.state=Object.assign({},o.state,S.getDerivedStateFromProps(o.props,o.state)):o.componentWillMount&&(o.componentWillMount(),o.state=o._nextState!==o.state?o._nextState:o.__s!==o.state?o.__s:o.state),i&&i(n),t=o.render(o.props,o.state,o.context)}else{let e=b(S,r),l=0;for(;o.__d&&l++<25;)o.__d=!1,i&&i(n),t=S.call(n.__c,k,e)}return o.getChildContext&&(r=Object.assign({},r,o.getChildContext())),e.diffed&&e.diffed(n),h(t,r,s,!1!==s.shallowHighOrder,p,y)}}S=(A=S).displayName||A!==Function&&A.name||function(t){let e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){let n=-1;for(let e=m.length;e--;)if(m[e]===t){n=e;break}n<0&&(n=m.push(t)-1),e=`UnnamedComponent${n}`}return e}(A)}var A;let O,w,$="<"+S;if(k){let t=Object.keys(k);s&&!0===s.sortAttributes&&t.sort();for(let e=0;e<t.length;e++){let n=t[e],o=k[n];if("children"===n){O=o;continue}if(i.test(n))continue;if(!(s&&s.allAttributes||"key"!==n&&"ref"!==n&&"__self"!==n&&"__source"!==n))continue;if("defaultValue"===n)n="value";else if("defaultChecked"===n)n="checked";else if("defaultSelected"===n)n="selected";else if("className"===n){if(void 0!==k.class)continue;n="class"}else p&&l.test(n)&&(n=n.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===n){if(k.for)continue;n="for"}"style"===n&&o&&"object"==typeof o&&(o=d(o)),"a"===n[0]&&"r"===n[1]&&"boolean"==typeof o&&(o=String(o));let u=s.attributeHook&&s.attributeHook(n,o,r,s,v);if(u||""===u)$+=u;else if("dangerouslySetInnerHTML"===n)w=o&&o.__html;else if("textarea"===S&&"value"===n)O=o;else if((o||0===o||""===o)&&"function"!=typeof o){if(!(!0!==o&&""!==o||(o=n,s&&s.xml))){$=$+" "+n;continue}if("value"===n){if("select"===S){y=o;continue}"option"===S&&y==o&&void 0===k.selected&&($+=" selected")}$+=` ${n}="${c(o)}"`}}}if(j){let t=$.replace(/\n\s*/," ");t===$||~t.indexOf("\n")?j&&~$.indexOf("\n")&&($+="\n"):$=t}if($+=">",i.test(S))throw new Error(`${S} is not a valid HTML tag name in ${$}`);let F,C=o.test(S)||s.voidElements&&s.voidElements.test(S),E=[];if(w)j&&f(w)&&(w="\n"+x+u(w,x)),$+=w;else if(null!=O&&_(F=[],O).length){let t=j&&~$.indexOf("\n"),e=!1;for(let n=0;n<F.length;n++){let o=F[n];if(null!=o&&!1!==o){let n=h(o,r,s,!0,"svg"===S||"foreignObject"!==S&&p,y);if(j&&!t&&f(n)&&(t=!0),n)if(j){let t=n.length>0&&"<"!=n[0];e&&t?E[E.length-1]+=n:E.push(n),e=t}else E.push(n)}}if(j&&t)for(let t=E.length;t--;)E[t]="\n"+x+u(E[t],x)}if(E.length||w)$+=E.join("");else if(s&&s.xml)return $.substring(0,$.length-1)+" />";return!C||F||w?(j&&~$.indexOf("\n")&&($+="\n"),$+=`</${S}>`):$=$.replace(/>$/," />"),$}const j={shallow:!0};S.render=S;const x=[];function S(r,o,i){o=o||{};const l=e.__s;e.__s=!0;const s=n(t,null);let c;return s.__k=[r],c=i&&(i.pretty||i.voidElements||i.sortAttributes||i.shallow||i.allAttributes||i.xml||i.attributeHook)?h(r,o,i):w(r,o,!1,void 0,s),e.__c&&e.__c(r,x),e.__s=l,x.length=0,c}function k(t,e){return"className"===t?"class":"htmlFor"===t?"for":"defaultValue"===t?"value":"defaultChecked"===t?"checked":"defaultSelected"===t?"selected":e&&l.test(t)?t.toLowerCase().replace(/^xlink:?/,"xlink:"):t}function v(t,e){return"style"===t&&null!=e&&"object"==typeof e?d(e):"a"===t[0]&&"r"===t[1]&&"boolean"==typeof e?String(e):e}const A=Array.isArray,O=Object.assign;function w(n,r,l,s,u){if(null==n||!0===n||!1===n||""===n)return"";if("object"!=typeof n)return c(n);if(A(n)){let t="";u.__k=n;for(let e=0;e<n.length;e++)t+=w(n[e],r,l,s,u);return t}n.__=u,e.__b&&e.__b(n);let f=n.type,a=n.props;if("function"==typeof f){let o;if(f===t)o=a.children;else{o=f.prototype&&"function"==typeof f.prototype.render?function(t,n){let r=t.type,o=b(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);let l=e.__r;return l&&l(t),i.render(i.props,i.state,i.context)}(n,r):function(t,n){let r,o=g(t,n),i=b(t.type,n);t.__c=o;let l=e.__r,s=0;for(;o.__d&&s++<25;)o.__d=!1,l&&l(t),r=t.type.call(o,t.props,i);return r}(n,r);let t=n.__c;t.getChildContext&&(r=O({},r,t.getChildContext()))}const i=w(o,r,l,s,n);return e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),i}let p,d,_="<";if(_+=f,a){p=a.children;for(let t in a){let e=a[t];if(!("key"===t||"ref"===t||"__self"===t||"__source"===t||"children"===t||"className"===t&&"class"in a||"htmlFor"===t&&"for"in a||i.test(t)))if(t=k(t,l),e=v(t,e),"dangerouslySetInnerHTML"===t)d=e&&e.__html;else if("textarea"===f&&"value"===t)p=e;else if((e||0===e||""===e)&&"function"!=typeof e){if(!0===e||""===e){e=t,_=_+" "+t;continue}if("value"===t){if("select"===f){s=e;continue}"option"!==f||s!=e||"selected"in a||(_+=" selected")}_=_+" "+t+'="'+c(e)+'"'}}}let y=_;if(_+=">",i.test(f))throw new Error(`${f} is not a valid HTML tag name in ${_}`);let m="",h=!1;if(d)m+=d,h=!0;else if("string"==typeof p)m+=c(p),h=!0;else if(A(p)){n.__k=p;for(let t=0;t<p.length;t++){let e=p[t];if(null!=e&&!1!==e){let t=w(e,r,"svg"===f||"foreignObject"!==f&&l,s,n);t&&(m+=t,h=!0)}}}else if(null!=p&&!1!==p&&!0!==p){n.__k=[p];let t=w(p,r,"svg"===f||"foreignObject"!==f&&l,s,n);t&&(m+=t,h=!0)}if(e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),h)_+=m;else if(o.test(f))return y+" />";return _+"</"+f+">"}S.shallowRender=(t,e)=>S(t,e,j);const $=/(\\|\"|\')/g,F=Object.prototype.toString,C=Date.prototype.toISOString,E=Error.prototype.toString,M=RegExp.prototype.toString,H=Symbol.prototype.toString,N=/^Symbol\((.*)\)(.*)$/,D=/\n/gi,I=Object.getOwnPropertySymbols||(t=>[]);function L(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function W(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function P(t){return H.call(t).replace(N,"Symbol($1)")}function T(t){return"["+E.call(t)+"]"}function U(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace($,"\\$1")}(t)+'"';if("function"===e)return W(t);if("symbol"===e)return P(t);const n=F.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?W(t,min):"[object Symbol]"===n?P(t):"[object Date]"===n?C.call(t):"[object Error]"===n?T(t):"[object RegExp]"===n?M.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":L(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&T(t)}function R(t,e,n,r,o,i,l,s,c,u){let f="";if(t.length){f+=o;const a=n+e;for(let n=0;n<t.length;n++)f+=a+q(t[n],e,a,r,o,i,l,s,c,u),n<t.length-1&&(f+=","+r);f+=o+n}return"["+f+"]"}function J(t,e,n,r,o,i,l,s,c,u){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const f=++s>l;if(!f&&t.toJSON&&"function"==typeof t.toJSON)return q(t.toJSON(),e,n,r,o,i,l,s,c,u);const a=F.call(t);return"[object Arguments]"===a?f?"[Arguments]":function(t,e,n,r,o,i,l,s,c,u){return(u?"":"Arguments ")+R(t,e,n,r,o,i,l,s,c,u)}(t,e,n,r,o,i,l,s,c,u):L(a)?f?"[Array]":function(t,e,n,r,o,i,l,s,c,u){return(u?"":t.constructor.name+" ")+R(t,e,n,r,o,i,l,s,c,u)}(t,e,n,r,o,i,l,s,c,u):"[object Map]"===a?f?"[Map]":function(t,e,n,r,o,i,l,s,c,u){let f="Map {";const a=t.entries();let p=a.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+q(p.value[0],e,t,r,o,i,l,s,c,u)+" => "+q(p.value[1],e,t,r,o,i,l,s,c,u),p=a.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,l,s,c,u):"[object Set]"===a?f?"[Set]":function(t,e,n,r,o,i,l,s,c,u){let f="Set {";const a=t.entries();let p=a.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+q(p.value[1],e,t,r,o,i,l,s,c,u),p=a.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,l,s,c,u):"object"==typeof t?f?"[Object]":function(t,e,n,r,o,i,l,s,c,u){let f=(u?"":t.constructor?t.constructor.name+" ":"Object ")+"{",a=Object.keys(t).sort();const p=I(t);if(p.length&&(a=a.filter(t=>!("symbol"==typeof t||"[object Symbol]"===F.call(t))).concat(p)),a.length){f+=o;const p=n+e;for(let n=0;n<a.length;n++){const d=a[n];f+=p+q(d,e,p,r,o,i,l,s,c,u)+": "+q(t[d],e,p,r,o,i,l,s,c,u),n<a.length-1&&(f+=","+r)}f+=o+n}return f+"}"}(t,e,n,r,o,i,l,s,c,u):void 0}function V(t,e,n,r,o,i,l,s,c,u){let f,a=!1;for(let e=0;e<c.length;e++)if(f=c[e],f.test(t)){a=!0;break}return!!a&&f.print(t,function(t){return q(t,e,n,r,o,i,l,s,c,u)},function(t){const r=n+e;return r+t.replace(D,"\n"+r)},{edgeSpacing:o,spacing:r})}function q(t,e,n,r,o,i,l,s,c,u){return U(t)||V(t,e,n,r,o,i,l,s,c,u)||J(t,e,n,r,o,i,l,s,c,u)}const z={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function B(t){return new Array(t+1).join(" ")}let G={test:t=>t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t,print:(t,e,n)=>S(t,G.context,G.opts)},Z={plugins:[G]},K={attributeHook:function(t,e,n,r,o){let i=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===i&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";let l="string"==typeof r.pretty?r.pretty:"\t";return"string"!==i?("function"!==i||r.functionNames?(G.context=n,G.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!z.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(z).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:z[n]),e.min&&(e.indent=0),e}(e)):e=z;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=B(e.indent),r=[];var l=V(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(l)return l}return U(t)||(n||(n=B(e.indent)),r||(r=[]),J(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,Z)).indexOf("\n")&&(e=`${u("\n"+e,l)}\n`)):e="Function",u(`\n${t}={${e}}`,l)):`\n${l}${t}="${c(e)}"`},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function Q(t,e,n,r){return S(t,e,n=Object.assign({},K,n||{}))}export default Q;export{Q as render}; | ||
import{Fragment as t,options as e,h as n}from"preact";if("function"!=typeof Symbol){let t=0;Symbol=function(e){return`@@${e}${++t}`},Symbol.for=t=>`@@${t}`}const r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\s\n\\/='"\0<>]/,l=/^xlink:?./,c=/["&<]/;function s(t){if(!1===c.test(t+=""))return t;let e=0,n=0,r="",o="";for(;n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}let u=(t,e)=>String(t).replace(/(\n+)/g,"$1"+(e||"\t")),f=(t,e,n)=>String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<");const a={},p=/([A-Z])/g;function d(t){let e="";for(let n in t){let o=t[n];null!=o&&""!==o&&(e&&(e+=" "),e+="-"==n[0]?n:a[n]||(a[n]=n.replace(p,"-$1").toLowerCase()),e="number"==typeof o&&!1===r.test(n)?e+": "+o+"px;":e+": "+o+";")}return e||void 0}function _(t,e){return Array.isArray(e)?e.reduce(_,t):null!=e&&!1!==e&&t.push(e),t}function y(){this.__d=!0}function g(t,e){return{__v:t,context:e,props:t.props,setState:y,forceUpdate:y,__d:!0,__h:[]}}function b(t,e){let n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}const m=[];function h(n,r,c,a,p,y){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return"function"==typeof n?"":s(n);let j=c.pretty,x=j&&"string"==typeof j?j:"\t";if(Array.isArray(n)){let t="";for(let e=0;e<n.length;e++)j&&e>0&&(t+="\n"),t+=h(n[e],r,c,a,p,y);return t}if(void 0!==n.constructor)return"";let S=n.type,v=n.props,k=!1;if("function"==typeof S){if(k=!0,!c.shallow||!a&&!1!==c.renderRootComponent){if(S===t){const t=[];return _(t,n.props.children),h(t,r,c,!1!==c.shallowHighOrder,p,y)}{let t,o=n.__c=g(n,r);e.__b&&e.__b(n);let i=e.__r;if(S.prototype&&"function"==typeof S.prototype.render){let e=b(S,r);o=n.__c=new S(v,e),o.__v=n,o._dirty=o.__d=!0,o.props=v,null==o.state&&(o.state={}),null==o._nextState&&null==o.__s&&(o._nextState=o.__s=o.state),o.context=e,S.getDerivedStateFromProps?o.state=Object.assign({},o.state,S.getDerivedStateFromProps(o.props,o.state)):o.componentWillMount&&(o.componentWillMount(),o.state=o._nextState!==o.state?o._nextState:o.__s!==o.state?o.__s:o.state),i&&i(n),t=o.render(o.props,o.state,o.context)}else{let e=b(S,r),l=0;for(;o.__d&&l++<25;)o.__d=!1,i&&i(n),t=S.call(n.__c,v,e)}return o.getChildContext&&(r=Object.assign({},r,o.getChildContext())),e.diffed&&e.diffed(n),h(t,r,c,!1!==c.shallowHighOrder,p,y)}}S=(A=S).displayName||A!==Function&&A.name||function(t){let e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){let n=-1;for(let e=m.length;e--;)if(m[e]===t){n=e;break}n<0&&(n=m.push(t)-1),e=`UnnamedComponent${n}`}return e}(A)}var A;let O,w,$="<"+S;if(v){let t=Object.keys(v);c&&!0===c.sortAttributes&&t.sort();for(let e=0;e<t.length;e++){let n=t[e],o=v[n];if("children"===n){O=o;continue}if(i.test(n))continue;if(!(c&&c.allAttributes||"key"!==n&&"ref"!==n&&"__self"!==n&&"__source"!==n))continue;if("defaultValue"===n)n="value";else if("defaultChecked"===n)n="checked";else if("defaultSelected"===n)n="selected";else if("className"===n){if(void 0!==v.class)continue;n="class"}else p&&l.test(n)&&(n=n.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===n){if(v.for)continue;n="for"}"style"===n&&o&&"object"==typeof o&&(o=d(o)),"a"===n[0]&&"r"===n[1]&&"boolean"==typeof o&&(o=String(o));let u=c.attributeHook&&c.attributeHook(n,o,r,c,k);if(u||""===u)$+=u;else if("dangerouslySetInnerHTML"===n)w=o&&o.__html;else if("textarea"===S&&"value"===n)O=o;else if((o||0===o||""===o)&&"function"!=typeof o){if(!(!0!==o&&""!==o||(o=n,c&&c.xml))){$=$+" "+n;continue}if("value"===n){if("select"===S){y=o;continue}"option"===S&&y==o&&void 0===v.selected&&($+=" selected")}$+=` ${n}="${s(o)}"`}}}if(j){let t=$.replace(/\n\s*/," ");t===$||~t.indexOf("\n")?j&&~$.indexOf("\n")&&($+="\n"):$=t}if($+=">",i.test(S))throw new Error(`${S} is not a valid HTML tag name in ${$}`);let F,C=o.test(S)||c.voidElements&&c.voidElements.test(S),E=[];if(w)j&&f(w)&&(w="\n"+x+u(w,x)),$+=w;else if(null!=O&&_(F=[],O).length){let t=j&&~$.indexOf("\n"),e=!1;for(let n=0;n<F.length;n++){let o=F[n];if(null!=o&&!1!==o){let n=h(o,r,c,!0,"svg"===S||"foreignObject"!==S&&p,y);if(j&&!t&&f(n)&&(t=!0),n)if(j){let t=n.length>0&&"<"!=n[0];e&&t?E[E.length-1]+=n:E.push(n),e=t}else E.push(n)}}if(j&&t)for(let t=E.length;t--;)E[t]="\n"+x+u(E[t],x)}if(E.length||w)$+=E.join("");else if(c&&c.xml)return $.substring(0,$.length-1)+" />";return!C||F||w?(j&&~$.indexOf("\n")&&($+="\n"),$+=`</${S}>`):$=$.replace(/>$/," />"),$}const j={shallow:!0};S.render=S;const x=[];function S(r,o,i){o=o||{};const l=e.__s;e.__s=!0;const c=n(t,null);let s;return c.__k=[r],s=i&&(i.pretty||i.voidElements||i.sortAttributes||i.shallow||i.allAttributes||i.xml||i.attributeHook)?h(r,o,i):w(r,o,!1,void 0,c),e.__c&&e.__c(r,x),e.__s=l,x.length=0,s}function v(t,e){return"className"===t?"class":"htmlFor"===t?"for":"defaultValue"===t?"value":"defaultChecked"===t?"checked":"defaultSelected"===t?"selected":e&&l.test(t)?t.toLowerCase().replace(/^xlink:?/,"xlink:"):t}function k(t,e){return"style"===t&&null!=e&&"object"==typeof e?d(e):"a"===t[0]&&"r"===t[1]&&"boolean"==typeof e?String(e):e}const A=Array.isArray,O=Object.assign;function w(n,r,l,c,u){if(null==n||!0===n||!1===n||""===n)return"";if("object"!=typeof n)return"function"==typeof n?"":s(n);if(A(n)){let t="";u.__k=n;for(let e=0;e<n.length;e++)t+=w(n[e],r,l,c,u);return t}if(void 0!==n.constructor)return"";n.__=u,e.__b&&e.__b(n);let f=n.type,a=n.props;if("function"==typeof f){let o;if(f===t)o=a.children;else{o=f.prototype&&"function"==typeof f.prototype.render?function(t,n){let r=t.type,o=b(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);let l=e.__r;return l&&l(t),i.render(i.props,i.state,i.context)}(n,r):function(t,n){let r,o=g(t,n),i=b(t.type,n);t.__c=o;let l=e.__r,c=0;for(;o.__d&&c++<25;)o.__d=!1,l&&l(t),r=t.type.call(o,t.props,i);return r}(n,r);let t=n.__c;t.getChildContext&&(r=O({},r,t.getChildContext()))}o=null!=o&&o.type===t&&null==o.key?o.props.children:o;const i=w(o,r,l,c,n);return e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),i}let p,d,_="<";if(_+=f,a){p=a.children;for(let t in a){let e=a[t];if(!("key"===t||"ref"===t||"__self"===t||"__source"===t||"children"===t||"className"===t&&"class"in a||"htmlFor"===t&&"for"in a||i.test(t)))if(t=v(t,l),e=k(t,e),"dangerouslySetInnerHTML"===t)d=e&&e.__html;else if("textarea"===f&&"value"===t)p=e;else if((e||0===e||""===e)&&"function"!=typeof e){if(!0===e||""===e){e=t,_=_+" "+t;continue}if("value"===t){if("select"===f){c=e;continue}"option"!==f||c!=e||"selected"in a||(_+=" selected")}_=_+" "+t+'="'+s(e)+'"'}}}let y=_;if(_+=">",i.test(f))throw new Error(`${f} is not a valid HTML tag name in ${_}`);let m="",h=!1;if(d)m+=d,h=!0;else if("string"==typeof p)m+=s(p),h=!0;else if(A(p)){n.__k=p;for(let t=0;t<p.length;t++){let e=p[t];if(null!=e&&!1!==e){let t=w(e,r,"svg"===f||"foreignObject"!==f&&l,c,n);t&&(m+=t,h=!0)}}}else if(null!=p&&!1!==p&&!0!==p){n.__k=[p];let t=w(p,r,"svg"===f||"foreignObject"!==f&&l,c,n);t&&(m+=t,h=!0)}if(e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),h)_+=m;else if(o.test(f))return y+" />";return _+"</"+f+">"}S.shallowRender=(t,e)=>S(t,e,j);const $=/(\\|\"|\')/g,F=Object.prototype.toString,C=Date.prototype.toISOString,E=Error.prototype.toString,M=RegExp.prototype.toString,H=Symbol.prototype.toString,N=/^Symbol\((.*)\)(.*)$/,D=/\n/gi,I=Object.getOwnPropertySymbols||(t=>[]);function L(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function W(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function P(t){return H.call(t).replace(N,"Symbol($1)")}function T(t){return"["+E.call(t)+"]"}function U(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace($,"\\$1")}(t)+'"';if("function"===e)return W(t);if("symbol"===e)return P(t);const n=F.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?W(t,min):"[object Symbol]"===n?P(t):"[object Date]"===n?C.call(t):"[object Error]"===n?T(t):"[object RegExp]"===n?M.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":L(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&T(t)}function R(t,e,n,r,o,i,l,c,s,u){let f="";if(t.length){f+=o;const a=n+e;for(let n=0;n<t.length;n++)f+=a+q(t[n],e,a,r,o,i,l,c,s,u),n<t.length-1&&(f+=","+r);f+=o+n}return"["+f+"]"}function J(t,e,n,r,o,i,l,c,s,u){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const f=++c>l;if(!f&&t.toJSON&&"function"==typeof t.toJSON)return q(t.toJSON(),e,n,r,o,i,l,c,s,u);const a=F.call(t);return"[object Arguments]"===a?f?"[Arguments]":function(t,e,n,r,o,i,l,c,s,u){return(u?"":"Arguments ")+R(t,e,n,r,o,i,l,c,s,u)}(t,e,n,r,o,i,l,c,s,u):L(a)?f?"[Array]":function(t,e,n,r,o,i,l,c,s,u){return(u?"":t.constructor.name+" ")+R(t,e,n,r,o,i,l,c,s,u)}(t,e,n,r,o,i,l,c,s,u):"[object Map]"===a?f?"[Map]":function(t,e,n,r,o,i,l,c,s,u){let f="Map {";const a=t.entries();let p=a.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+q(p.value[0],e,t,r,o,i,l,c,s,u)+" => "+q(p.value[1],e,t,r,o,i,l,c,s,u),p=a.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,l,c,s,u):"[object Set]"===a?f?"[Set]":function(t,e,n,r,o,i,l,c,s,u){let f="Set {";const a=t.entries();let p=a.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+q(p.value[1],e,t,r,o,i,l,c,s,u),p=a.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,l,c,s,u):"object"==typeof t?f?"[Object]":function(t,e,n,r,o,i,l,c,s,u){let f=(u?"":t.constructor?t.constructor.name+" ":"Object ")+"{",a=Object.keys(t).sort();const p=I(t);if(p.length&&(a=a.filter(t=>!("symbol"==typeof t||"[object Symbol]"===F.call(t))).concat(p)),a.length){f+=o;const p=n+e;for(let n=0;n<a.length;n++){const d=a[n];f+=p+q(d,e,p,r,o,i,l,c,s,u)+": "+q(t[d],e,p,r,o,i,l,c,s,u),n<a.length-1&&(f+=","+r)}f+=o+n}return f+"}"}(t,e,n,r,o,i,l,c,s,u):void 0}function V(t,e,n,r,o,i,l,c,s,u){let f,a=!1;for(let e=0;e<s.length;e++)if(f=s[e],f.test(t)){a=!0;break}return!!a&&f.print(t,function(t){return q(t,e,n,r,o,i,l,c,s,u)},function(t){const r=n+e;return r+t.replace(D,"\n"+r)},{edgeSpacing:o,spacing:r})}function q(t,e,n,r,o,i,l,c,s,u){return U(t)||V(t,e,n,r,o,i,l,c,s,u)||J(t,e,n,r,o,i,l,c,s,u)}const z={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function B(t){return new Array(t+1).join(" ")}let G={test:t=>t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t,print:(t,e,n)=>S(t,G.context,G.opts)},Z={plugins:[G]},K={attributeHook:function(t,e,n,r,o){let i=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===i&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";let l="string"==typeof r.pretty?r.pretty:"\t";return"string"!==i?("function"!==i||r.functionNames?(G.context=n,G.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!z.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(z).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:z[n]),e.min&&(e.indent=0),e}(e)):e=z;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=B(e.indent),r=[];var l=V(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(l)return l}return U(t)||(n||(n=B(e.indent)),r||(r=[]),J(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,Z)).indexOf("\n")&&(e=`${u("\n"+e,l)}\n`)):e="Function",u(`\n${t}={${e}}`,l)):`\n${l}${t}="${s(e)}"`},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function Q(t,e,n,r){return S(t,e,n=Object.assign({},K,n||{}))}export default Q;export{Q as render}; | ||
//# sourceMappingURL=jsx.modern.js.map |
@@ -1,2 +0,2 @@ | ||
import{Fragment as t,options as e,h as n}from"preact";if("function"!=typeof Symbol){var r=0;Symbol=function(t){return"@@"+t+ ++r},Symbol.for=function(t){return"@@"+t}}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,i=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,a=/[\s\n\\/='"\0<>]/,l=/^xlink:?./,c=/["&<]/;function s(t){if(!1===c.test(t+=""))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}var u=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},f=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},p={},d=/([A-Z])/g;function _(t){var e="";for(var n in t){var r=t[n];null!=r&&""!==r&&(e&&(e+=" "),e+="-"==n[0]?n:p[n]||(p[n]=n.replace(d,"-$1").toLowerCase()),e="number"==typeof r&&!1===o.test(n)?e+": "+r+"px;":e+": "+r+";")}return e||void 0}function y(t,e){return Array.isArray(e)?e.reduce(y,t):null!=e&&!1!==e&&t.push(e),t}function v(){this.__d=!0}function g(t,e){return{__v:t,context:e,props:t.props,setState:v,forceUpdate:v,__d:!0,__h:[]}}function b(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var m=[];function h(n,r,o,c,p,d){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return s(n);var v=o.pretty,j=v&&"string"==typeof v?v:"\t";if(Array.isArray(n)){for(var x="",S=0;S<n.length;S++)v&&S>0&&(x+="\n"),x+=h(n[S],r,o,c,p,d);return x}var k,A=n.type,O=n.props,w=!1;if("function"==typeof A){if(w=!0,!o.shallow||!c&&!1!==o.renderRootComponent){if(A===t){var F=[];return y(F,n.props.children),h(F,r,o,!1!==o.shallowHighOrder,p,d)}var C,E=n.__c=g(n,r);e.__b&&e.__b(n);var M=e.__r;if(A.prototype&&"function"==typeof A.prototype.render){var H=b(A,r);(E=n.__c=new A(O,H)).__v=n,E._dirty=E.__d=!0,E.props=O,null==E.state&&(E.state={}),null==E._nextState&&null==E.__s&&(E._nextState=E.__s=E.state),E.context=H,A.getDerivedStateFromProps?E.state=Object.assign({},E.state,A.getDerivedStateFromProps(E.props,E.state)):E.componentWillMount&&(E.componentWillMount(),E.state=E._nextState!==E.state?E._nextState:E.__s!==E.state?E.__s:E.state),M&&M(n),C=E.render(E.props,E.state,E.context)}else for(var N=b(A,r),D=0;E.__d&&D++<25;)E.__d=!1,M&&M(n),C=A.call(n.__c,O,N);return E.getChildContext&&(r=Object.assign({},r,E.getChildContext())),e.diffed&&e.diffed(n),h(C,r,o,!1!==o.shallowHighOrder,p,d)}A=(k=A).displayName||k!==Function&&k.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=m.length;r--;)if(m[r]===t){n=r;break}n<0&&(n=m.push(t)-1),e="UnnamedComponent"+n}return e}(k)}var I,L,W="<"+A;if(O){var $=Object.keys(O);o&&!0===o.sortAttributes&&$.sort();for(var P=0;P<$.length;P++){var T=$[P],U=O[T];if("children"!==T){if(!a.test(T)&&(o&&o.allAttributes||"key"!==T&&"ref"!==T&&"__self"!==T&&"__source"!==T)){if("defaultValue"===T)T="value";else if("defaultChecked"===T)T="checked";else if("defaultSelected"===T)T="selected";else if("className"===T){if(void 0!==O.class)continue;T="class"}else p&&l.test(T)&&(T=T.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===T){if(O.for)continue;T="for"}"style"===T&&U&&"object"==typeof U&&(U=_(U)),"a"===T[0]&&"r"===T[1]&&"boolean"==typeof U&&(U=String(U));var R=o.attributeHook&&o.attributeHook(T,U,r,o,w);if(R||""===R)W+=R;else if("dangerouslySetInnerHTML"===T)L=U&&U.__html;else if("textarea"===A&&"value"===T)I=U;else if((U||0===U||""===U)&&"function"!=typeof U){if(!(!0!==U&&""!==U||(U=T,o&&o.xml))){W=W+" "+T;continue}if("value"===T){if("select"===A){d=U;continue}"option"===A&&d==U&&void 0===O.selected&&(W+=" selected")}W=W+" "+T+'="'+s(U)+'"'}}}else I=U}}if(v){var J=W.replace(/\n\s*/," ");J===W||~J.indexOf("\n")?v&&~W.indexOf("\n")&&(W+="\n"):W=J}if(W+=">",a.test(A))throw new Error(A+" is not a valid HTML tag name in "+W);var V,q=i.test(A)||o.voidElements&&o.voidElements.test(A),z=[];if(L)v&&f(L)&&(L="\n"+j+u(L,j)),W+=L;else if(null!=I&&y(V=[],I).length){for(var B=v&&~W.indexOf("\n"),G=!1,Z=0;Z<V.length;Z++){var K=V[Z];if(null!=K&&!1!==K){var Q=h(K,r,o,!0,"svg"===A||"foreignObject"!==A&&p,d);if(v&&!B&&f(Q)&&(B=!0),Q)if(v){var X=Q.length>0&&"<"!=Q[0];G&&X?z[z.length-1]+=Q:z.push(Q),G=X}else z.push(Q)}}if(v&&B)for(var Y=z.length;Y--;)z[Y]="\n"+j+u(z[Y],j)}if(z.length||L)W+=z.join("");else if(o&&o.xml)return W.substring(0,W.length-1)+" />";return!q||V||L?(v&&~W.indexOf("\n")&&(W+="\n"),W=W+"</"+A+">"):W=W.replace(/>$/," />"),W}var j={shallow:!0};S.render=S;var x=[];function S(r,o,i){o=o||{};var a=e.__s;e.__s=!0;var l,c=n(t,null);return c.__k=[r],l=i&&(i.pretty||i.voidElements||i.sortAttributes||i.shallow||i.allAttributes||i.xml||i.attributeHook)?h(r,o,i):F(r,o,!1,void 0,c),e.__c&&e.__c(r,x),e.__s=a,x.length=0,l}function k(t,e){return"className"===t?"class":"htmlFor"===t?"for":"defaultValue"===t?"value":"defaultChecked"===t?"checked":"defaultSelected"===t?"selected":e&&l.test(t)?t.toLowerCase().replace(/^xlink:?/,"xlink:"):t}function A(t,e){return"style"===t&&null!=e&&"object"==typeof e?_(e):"a"===t[0]&&"r"===t[1]&&"boolean"==typeof e?String(e):e}var O=Array.isArray,w=Object.assign;function F(n,r,o,l,c){if(null==n||!0===n||!1===n||""===n)return"";if("object"!=typeof n)return s(n);if(O(n)){var u="";c.__k=n;for(var f=0;f<n.length;f++)u+=F(n[f],r,o,l,c);return u}n.__=c,e.__b&&e.__b(n);var p=n.type,d=n.props;if("function"==typeof p){var _;if(p===t)_=d.children;else{_=p.prototype&&"function"==typeof p.prototype.render?function(t,n){var r=t.type,o=b(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=w({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=e.__r;return a&&a(t),i.render(i.props,i.state,i.context)}(n,r):function(t,n){var r,o=g(t,n),i=b(t.type,n);t.__c=o;for(var a=e.__r,l=0;o.__d&&l++<25;)o.__d=!1,a&&a(t),r=t.type.call(o,t.props,i);return r}(n,r);var y=n.__c;y.getChildContext&&(r=w({},r,y.getChildContext()))}var v=F(_,r,o,l,n);return e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),v}var m,h,j="<";if(j+=p,d)for(var x in m=d.children,d){var S=d[x];if(!("key"===x||"ref"===x||"__self"===x||"__source"===x||"children"===x||"className"===x&&"class"in d||"htmlFor"===x&&"for"in d||a.test(x)))if(S=A(x=k(x,o),S),"dangerouslySetInnerHTML"===x)h=S&&S.__html;else if("textarea"===p&&"value"===x)m=S;else if((S||0===S||""===S)&&"function"!=typeof S){if(!0===S||""===S){S=x,j=j+" "+x;continue}if("value"===x){if("select"===p){l=S;continue}"option"!==p||l!=S||"selected"in d||(j+=" selected")}j=j+" "+x+'="'+s(S)+'"'}}var C=j;if(j+=">",a.test(p))throw new Error(p+" is not a valid HTML tag name in "+j);var E="",M=!1;if(h)E+=h,M=!0;else if("string"==typeof m)E+=s(m),M=!0;else if(O(m)){n.__k=m;for(var H=0;H<m.length;H++){var N=m[H];if(null!=N&&!1!==N){var D=F(N,r,"svg"===p||"foreignObject"!==p&&o,l,n);D&&(E+=D,M=!0)}}}else if(null!=m&&!1!==m&&!0!==m){n.__k=[m];var I=F(m,r,"svg"===p||"foreignObject"!==p&&o,l,n);I&&(E+=I,M=!0)}if(e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),M)j+=E;else if(i.test(p))return C+" />";return j+"</"+p+">"}S.shallowRender=function(t,e){return S(t,e,j)};const C=/(\\|\"|\')/g,E=Object.prototype.toString,M=Date.prototype.toISOString,H=Error.prototype.toString,N=RegExp.prototype.toString,D=Symbol.prototype.toString,I=/^Symbol\((.*)\)(.*)$/,L=/\n/gi,W=Object.getOwnPropertySymbols||(t=>[]);function $(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function P(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function T(t){return D.call(t).replace(I,"Symbol($1)")}function U(t){return"["+H.call(t)+"]"}function R(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace(C,"\\$1")}(t)+'"';if("function"===e)return P(t);if("symbol"===e)return T(t);const n=E.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?P(t,min):"[object Symbol]"===n?T(t):"[object Date]"===n?M.call(t):"[object Error]"===n?U(t):"[object RegExp]"===n?N.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":$(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&U(t)}function J(t,e,n,r,o,i,a,l,c,s){let u="";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+z(t[n],e,f,r,o,i,a,l,c,s),n<t.length-1&&(u+=","+r);u+=o+n}return"["+u+"]"}function V(t,e,n,r,o,i,a,l,c,s){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const u=++l>a;if(!u&&t.toJSON&&"function"==typeof t.toJSON)return z(t.toJSON(),e,n,r,o,i,a,l,c,s);const f=E.call(t);return"[object Arguments]"===f?u?"[Arguments]":function(t,e,n,r,o,i,a,l,c,s){return(s?"":"Arguments ")+J(t,e,n,r,o,i,a,l,c,s)}(t,e,n,r,o,i,a,l,c,s):$(f)?u?"[Array]":function(t,e,n,r,o,i,a,l,c,s){return(s?"":t.constructor.name+" ")+J(t,e,n,r,o,i,a,l,c,s)}(t,e,n,r,o,i,a,l,c,s):"[object Map]"===f?u?"[Map]":function(t,e,n,r,o,i,a,l,c,s){let u="Map {";const f=t.entries();let p=f.next();if(!p.done){u+=o;const t=n+e;for(;!p.done;)u+=t+z(p.value[0],e,t,r,o,i,a,l,c,s)+" => "+z(p.value[1],e,t,r,o,i,a,l,c,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}(t,e,n,r,o,i,a,l,c,s):"[object Set]"===f?u?"[Set]":function(t,e,n,r,o,i,a,l,c,s){let u="Set {";const f=t.entries();let p=f.next();if(!p.done){u+=o;const t=n+e;for(;!p.done;)u+=t+z(p.value[1],e,t,r,o,i,a,l,c,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}(t,e,n,r,o,i,a,l,c,s):"object"==typeof t?u?"[Object]":function(t,e,n,r,o,i,a,l,c,s){let u=(s?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort();const p=W(t);if(p.length&&(f=f.filter(t=>!("symbol"==typeof t||"[object Symbol]"===E.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const d=f[n];u+=p+z(d,e,p,r,o,i,a,l,c,s)+": "+z(t[d],e,p,r,o,i,a,l,c,s),n<f.length-1&&(u+=","+r)}u+=o+n}return u+"}"}(t,e,n,r,o,i,a,l,c,s):void 0}function q(t,e,n,r,o,i,a,l,c,s){let u,f=!1;for(let e=0;e<c.length;e++)if(u=c[e],u.test(t)){f=!0;break}return!!f&&u.print(t,function(t){return z(t,e,n,r,o,i,a,l,c,s)},function(t){const r=n+e;return r+t.replace(L,"\n"+r)},{edgeSpacing:o,spacing:r})}function z(t,e,n,r,o,i,a,l,c,s){return R(t)||q(t,e,n,r,o,i,a,l,c,s)||V(t,e,n,r,o,i,a,l,c,s)}const B={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function G(t){return new Array(t+1).join(" ")}var Z={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t,e,n){return S(t,Z.context,Z.opts)}},K={plugins:[Z]},Q={attributeHook:function(t,e,n,r,o){var i=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===i&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";var a="string"==typeof r.pretty?r.pretty:"\t";return"string"!==i?("function"!==i||r.functionNames?(Z.context=n,Z.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!B.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(B).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:B[n]),e.min&&(e.indent=0),e}(e)):e=B;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=G(e.indent),r=[];var a=q(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return R(t)||(n||(n=G(e.indent)),r||(r=[]),V(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,K)).indexOf("\n")&&(e=u("\n"+e,a)+"\n")):e="Function",u("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+s(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function X(t,e,n,r){return S(t,e,n=Object.assign({},Q,n||{}))}export default X;export{X as render}; | ||
import{Fragment as t,options as e,h as n}from"preact";if("function"!=typeof Symbol){var r=0;Symbol=function(t){return"@@"+t+ ++r},Symbol.for=function(t){return"@@"+t}}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,i=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,a=/[\s\n\\/='"\0<>]/,l=/^xlink:?./,c=/["&<]/;function u(t){if(!1===c.test(t+=""))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}var s=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},f=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},p={},d=/([A-Z])/g;function _(t){var e="";for(var n in t){var r=t[n];null!=r&&""!==r&&(e&&(e+=" "),e+="-"==n[0]?n:p[n]||(p[n]=n.replace(d,"-$1").toLowerCase()),e="number"==typeof r&&!1===o.test(n)?e+": "+r+"px;":e+": "+r+";")}return e||void 0}function y(t,e){return Array.isArray(e)?e.reduce(y,t):null!=e&&!1!==e&&t.push(e),t}function v(){this.__d=!0}function g(t,e){return{__v:t,context:e,props:t.props,setState:v,forceUpdate:v,__d:!0,__h:[]}}function b(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var m=[];function h(n,r,o,c,p,d){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return"function"==typeof n?"":u(n);var v=o.pretty,j=v&&"string"==typeof v?v:"\t";if(Array.isArray(n)){for(var x="",S=0;S<n.length;S++)v&&S>0&&(x+="\n"),x+=h(n[S],r,o,c,p,d);return x}if(void 0!==n.constructor)return"";var k,A=n.type,O=n.props,w=!1;if("function"==typeof A){if(w=!0,!o.shallow||!c&&!1!==o.renderRootComponent){if(A===t){var F=[];return y(F,n.props.children),h(F,r,o,!1!==o.shallowHighOrder,p,d)}var C,E=n.__c=g(n,r);e.__b&&e.__b(n);var M=e.__r;if(A.prototype&&"function"==typeof A.prototype.render){var H=b(A,r);(E=n.__c=new A(O,H)).__v=n,E._dirty=E.__d=!0,E.props=O,null==E.state&&(E.state={}),null==E._nextState&&null==E.__s&&(E._nextState=E.__s=E.state),E.context=H,A.getDerivedStateFromProps?E.state=Object.assign({},E.state,A.getDerivedStateFromProps(E.props,E.state)):E.componentWillMount&&(E.componentWillMount(),E.state=E._nextState!==E.state?E._nextState:E.__s!==E.state?E.__s:E.state),M&&M(n),C=E.render(E.props,E.state,E.context)}else for(var N=b(A,r),D=0;E.__d&&D++<25;)E.__d=!1,M&&M(n),C=A.call(n.__c,O,N);return E.getChildContext&&(r=Object.assign({},r,E.getChildContext())),e.diffed&&e.diffed(n),h(C,r,o,!1!==o.shallowHighOrder,p,d)}A=(k=A).displayName||k!==Function&&k.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=m.length;r--;)if(m[r]===t){n=r;break}n<0&&(n=m.push(t)-1),e="UnnamedComponent"+n}return e}(k)}var I,L,W="<"+A;if(O){var $=Object.keys(O);o&&!0===o.sortAttributes&&$.sort();for(var P=0;P<$.length;P++){var T=$[P],U=O[T];if("children"!==T){if(!a.test(T)&&(o&&o.allAttributes||"key"!==T&&"ref"!==T&&"__self"!==T&&"__source"!==T)){if("defaultValue"===T)T="value";else if("defaultChecked"===T)T="checked";else if("defaultSelected"===T)T="selected";else if("className"===T){if(void 0!==O.class)continue;T="class"}else p&&l.test(T)&&(T=T.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===T){if(O.for)continue;T="for"}"style"===T&&U&&"object"==typeof U&&(U=_(U)),"a"===T[0]&&"r"===T[1]&&"boolean"==typeof U&&(U=String(U));var R=o.attributeHook&&o.attributeHook(T,U,r,o,w);if(R||""===R)W+=R;else if("dangerouslySetInnerHTML"===T)L=U&&U.__html;else if("textarea"===A&&"value"===T)I=U;else if((U||0===U||""===U)&&"function"!=typeof U){if(!(!0!==U&&""!==U||(U=T,o&&o.xml))){W=W+" "+T;continue}if("value"===T){if("select"===A){d=U;continue}"option"===A&&d==U&&void 0===O.selected&&(W+=" selected")}W=W+" "+T+'="'+u(U)+'"'}}}else I=U}}if(v){var J=W.replace(/\n\s*/," ");J===W||~J.indexOf("\n")?v&&~W.indexOf("\n")&&(W+="\n"):W=J}if(W+=">",a.test(A))throw new Error(A+" is not a valid HTML tag name in "+W);var V,q=i.test(A)||o.voidElements&&o.voidElements.test(A),z=[];if(L)v&&f(L)&&(L="\n"+j+s(L,j)),W+=L;else if(null!=I&&y(V=[],I).length){for(var B=v&&~W.indexOf("\n"),G=!1,Z=0;Z<V.length;Z++){var K=V[Z];if(null!=K&&!1!==K){var Q=h(K,r,o,!0,"svg"===A||"foreignObject"!==A&&p,d);if(v&&!B&&f(Q)&&(B=!0),Q)if(v){var X=Q.length>0&&"<"!=Q[0];G&&X?z[z.length-1]+=Q:z.push(Q),G=X}else z.push(Q)}}if(v&&B)for(var Y=z.length;Y--;)z[Y]="\n"+j+s(z[Y],j)}if(z.length||L)W+=z.join("");else if(o&&o.xml)return W.substring(0,W.length-1)+" />";return!q||V||L?(v&&~W.indexOf("\n")&&(W+="\n"),W=W+"</"+A+">"):W=W.replace(/>$/," />"),W}var j={shallow:!0};S.render=S;var x=[];function S(r,o,i){o=o||{};var a=e.__s;e.__s=!0;var l,c=n(t,null);return c.__k=[r],l=i&&(i.pretty||i.voidElements||i.sortAttributes||i.shallow||i.allAttributes||i.xml||i.attributeHook)?h(r,o,i):F(r,o,!1,void 0,c),e.__c&&e.__c(r,x),e.__s=a,x.length=0,l}function k(t,e){return"className"===t?"class":"htmlFor"===t?"for":"defaultValue"===t?"value":"defaultChecked"===t?"checked":"defaultSelected"===t?"selected":e&&l.test(t)?t.toLowerCase().replace(/^xlink:?/,"xlink:"):t}function A(t,e){return"style"===t&&null!=e&&"object"==typeof e?_(e):"a"===t[0]&&"r"===t[1]&&"boolean"==typeof e?String(e):e}var O=Array.isArray,w=Object.assign;function F(n,r,o,l,c){if(null==n||!0===n||!1===n||""===n)return"";if("object"!=typeof n)return"function"==typeof n?"":u(n);if(O(n)){var s="";c.__k=n;for(var f=0;f<n.length;f++)s+=F(n[f],r,o,l,c);return s}if(void 0!==n.constructor)return"";n.__=c,e.__b&&e.__b(n);var p=n.type,d=n.props;if("function"==typeof p){var _;if(p===t)_=d.children;else{_=p.prototype&&"function"==typeof p.prototype.render?function(t,n){var r=t.type,o=b(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=w({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=e.__r;return a&&a(t),i.render(i.props,i.state,i.context)}(n,r):function(t,n){var r,o=g(t,n),i=b(t.type,n);t.__c=o;for(var a=e.__r,l=0;o.__d&&l++<25;)o.__d=!1,a&&a(t),r=t.type.call(o,t.props,i);return r}(n,r);var y=n.__c;y.getChildContext&&(r=w({},r,y.getChildContext()))}var v=F(_=null!=_&&_.type===t&&null==_.key?_.props.children:_,r,o,l,n);return e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),v}var m,h,j="<";if(j+=p,d)for(var x in m=d.children,d){var S=d[x];if(!("key"===x||"ref"===x||"__self"===x||"__source"===x||"children"===x||"className"===x&&"class"in d||"htmlFor"===x&&"for"in d||a.test(x)))if(S=A(x=k(x,o),S),"dangerouslySetInnerHTML"===x)h=S&&S.__html;else if("textarea"===p&&"value"===x)m=S;else if((S||0===S||""===S)&&"function"!=typeof S){if(!0===S||""===S){S=x,j=j+" "+x;continue}if("value"===x){if("select"===p){l=S;continue}"option"!==p||l!=S||"selected"in d||(j+=" selected")}j=j+" "+x+'="'+u(S)+'"'}}var C=j;if(j+=">",a.test(p))throw new Error(p+" is not a valid HTML tag name in "+j);var E="",M=!1;if(h)E+=h,M=!0;else if("string"==typeof m)E+=u(m),M=!0;else if(O(m)){n.__k=m;for(var H=0;H<m.length;H++){var N=m[H];if(null!=N&&!1!==N){var D=F(N,r,"svg"===p||"foreignObject"!==p&&o,l,n);D&&(E+=D,M=!0)}}}else if(null!=m&&!1!==m&&!0!==m){n.__k=[m];var I=F(m,r,"svg"===p||"foreignObject"!==p&&o,l,n);I&&(E+=I,M=!0)}if(e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),M)j+=E;else if(i.test(p))return C+" />";return j+"</"+p+">"}S.shallowRender=function(t,e){return S(t,e,j)};const C=/(\\|\"|\')/g,E=Object.prototype.toString,M=Date.prototype.toISOString,H=Error.prototype.toString,N=RegExp.prototype.toString,D=Symbol.prototype.toString,I=/^Symbol\((.*)\)(.*)$/,L=/\n/gi,W=Object.getOwnPropertySymbols||(t=>[]);function $(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function P(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function T(t){return D.call(t).replace(I,"Symbol($1)")}function U(t){return"["+H.call(t)+"]"}function R(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace(C,"\\$1")}(t)+'"';if("function"===e)return P(t);if("symbol"===e)return T(t);const n=E.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?P(t,min):"[object Symbol]"===n?T(t):"[object Date]"===n?M.call(t):"[object Error]"===n?U(t):"[object RegExp]"===n?N.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":$(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&U(t)}function J(t,e,n,r,o,i,a,l,c,u){let s="";if(t.length){s+=o;const f=n+e;for(let n=0;n<t.length;n++)s+=f+z(t[n],e,f,r,o,i,a,l,c,u),n<t.length-1&&(s+=","+r);s+=o+n}return"["+s+"]"}function V(t,e,n,r,o,i,a,l,c,u){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const s=++l>a;if(!s&&t.toJSON&&"function"==typeof t.toJSON)return z(t.toJSON(),e,n,r,o,i,a,l,c,u);const f=E.call(t);return"[object Arguments]"===f?s?"[Arguments]":function(t,e,n,r,o,i,a,l,c,u){return(u?"":"Arguments ")+J(t,e,n,r,o,i,a,l,c,u)}(t,e,n,r,o,i,a,l,c,u):$(f)?s?"[Array]":function(t,e,n,r,o,i,a,l,c,u){return(u?"":t.constructor.name+" ")+J(t,e,n,r,o,i,a,l,c,u)}(t,e,n,r,o,i,a,l,c,u):"[object Map]"===f?s?"[Map]":function(t,e,n,r,o,i,a,l,c,u){let s="Map {";const f=t.entries();let p=f.next();if(!p.done){s+=o;const t=n+e;for(;!p.done;)s+=t+z(p.value[0],e,t,r,o,i,a,l,c,u)+" => "+z(p.value[1],e,t,r,o,i,a,l,c,u),p=f.next(),p.done||(s+=","+r);s+=o+n}return s+"}"}(t,e,n,r,o,i,a,l,c,u):"[object Set]"===f?s?"[Set]":function(t,e,n,r,o,i,a,l,c,u){let s="Set {";const f=t.entries();let p=f.next();if(!p.done){s+=o;const t=n+e;for(;!p.done;)s+=t+z(p.value[1],e,t,r,o,i,a,l,c,u),p=f.next(),p.done||(s+=","+r);s+=o+n}return s+"}"}(t,e,n,r,o,i,a,l,c,u):"object"==typeof t?s?"[Object]":function(t,e,n,r,o,i,a,l,c,u){let s=(u?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort();const p=W(t);if(p.length&&(f=f.filter(t=>!("symbol"==typeof t||"[object Symbol]"===E.call(t))).concat(p)),f.length){s+=o;const p=n+e;for(let n=0;n<f.length;n++){const d=f[n];s+=p+z(d,e,p,r,o,i,a,l,c,u)+": "+z(t[d],e,p,r,o,i,a,l,c,u),n<f.length-1&&(s+=","+r)}s+=o+n}return s+"}"}(t,e,n,r,o,i,a,l,c,u):void 0}function q(t,e,n,r,o,i,a,l,c,u){let s,f=!1;for(let e=0;e<c.length;e++)if(s=c[e],s.test(t)){f=!0;break}return!!f&&s.print(t,function(t){return z(t,e,n,r,o,i,a,l,c,u)},function(t){const r=n+e;return r+t.replace(L,"\n"+r)},{edgeSpacing:o,spacing:r})}function z(t,e,n,r,o,i,a,l,c,u){return R(t)||q(t,e,n,r,o,i,a,l,c,u)||V(t,e,n,r,o,i,a,l,c,u)}const B={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function G(t){return new Array(t+1).join(" ")}var Z={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t,e,n){return S(t,Z.context,Z.opts)}},K={plugins:[Z]},Q={attributeHook:function(t,e,n,r,o){var i=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===i&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";var a="string"==typeof r.pretty?r.pretty:"\t";return"string"!==i?("function"!==i||r.functionNames?(Z.context=n,Z.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!B.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(B).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:B[n]),e.min&&(e.indent=0),e}(e)):e=B;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=G(e.indent),r=[];var a=q(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return R(t)||(n||(n=G(e.indent)),r||(r=[]),V(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,K)).indexOf("\n")&&(e=s("\n"+e,a)+"\n")):e="Function",s("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+u(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function X(t,e,n,r){return S(t,e,n=Object.assign({},Q,n||{}))}export default X;export{X as render}; | ||
//# sourceMappingURL=jsx.module.js.map |
module.exports = require('./dist/jsx'); // eslint-disable-line |
{ | ||
"name": "preact-render-to-string", | ||
"amdName": "preactRenderToString", | ||
"version": "5.2.4", | ||
"version": "5.2.5", | ||
"description": "Render JSX to an HTML string, with support for Preact components.", | ||
@@ -118,3 +118,3 @@ "main": "dist/index.js", | ||
"mocha": "^8.2.1", | ||
"preact": "^10.5.7", | ||
"preact": "^10.11.1", | ||
"prettier": "^2.2.1", | ||
@@ -121,0 +121,0 @@ "sinon": "^9.2.2", |
@@ -0,0 +0,0 @@ # preact-render-to-string |
@@ -0,0 +0,0 @@ // Options hooks |
@@ -0,0 +0,0 @@ import { VNode } from 'preact'; |
@@ -198,2 +198,3 @@ import { | ||
if (typeof vnode !== 'object') { | ||
if (typeof vnode === 'function') return ''; | ||
return encodeEntities(vnode); | ||
@@ -214,2 +215,5 @@ } | ||
// VNodes have {constructor:undefined} to prevent JSON injection: | ||
if (vnode.constructor !== undefined) return ''; | ||
vnode[PARENT] = parent; | ||
@@ -240,2 +244,8 @@ if (options[DIFF]) options[DIFF](vnode); | ||
// When a component returns a Fragment node we flatten it in core, so we | ||
// need to mirror that logic here too | ||
let isTopLevelFragment = | ||
rendered != null && rendered.type === Fragment && rendered.key == null; | ||
rendered = isTopLevelFragment ? rendered.props.children : rendered; | ||
// Recurse into children before invoking the after-diff hook | ||
@@ -242,0 +252,0 @@ const str = _renderToString( |
@@ -0,0 +0,0 @@ import { VNode } from 'preact'; |
@@ -0,0 +0,0 @@ import './polyfills'; |
@@ -0,0 +0,0 @@ if (typeof Symbol !== 'function') { |
@@ -32,2 +32,3 @@ import { | ||
if (typeof vnode !== 'object') { | ||
if (typeof vnode === 'function') return ''; | ||
return encodeEntities(vnode); | ||
@@ -57,2 +58,5 @@ } | ||
// VNodes have {constructor:undefined} to prevent JSON injection: | ||
if (vnode.constructor !== undefined) return ''; | ||
let nodeName = vnode.type, | ||
@@ -59,0 +63,0 @@ props = vnode.props, |
@@ -0,0 +0,0 @@ // DOM properties that should NOT have "px" added when numeric |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1231
1.32%371073
-1.13%