{"version":3,"file":"18.js?v=025770521610d6c0e037","sources":["webpack:///18.js"],"sourcesContent":["(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{44:function(e,t,n){\"use strict\";n.r(t),n.d(t,\"Page\",(function(){return m}));var o,r=n(16),a=n(17),i=n(60),s=n(59),l=n(1),c=n(18),p=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),u=function(e,t,n,o){var r,a=arguments.length,i=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){return r.createElement(\"div\",null,a.createPortal(r.createElement(i.b,{isHome:!0,pageInputs:{}}),document.getElementById(\"header\")),Object.keys(c.a).filter((function(e){return\"default\"!==e})).map((function(e){return r.createElement(\"a\",{key:e,className:\"borderRadius hoverable\"+(Object(l.k)()?\"\":\" floatLeft\"),href:\"/\"+e,style:{padding:20,marginBottom:20,marginRight:Object(l.k)()?0:20,minWidth:\"calc(33.333% - 20px)\",width:Object(l.k)()?\"auto\":\"290px\",overflow:\"hidden\",display:\"block\"}},r.createElement(\"span\",{className:\"bold\",style:{display:\"block\",marginBottom:10}},c.a[e].pageHeader),r.createElement(\"span\",{style:{display:\"block\"}},c.a[e].description))})),r.createElement(\"div\",{className:\"clear\"}))},t=u([s.a],t)}(r.Component)},60:function(e,t,n){\"use strict\";n.d(t,\"b\",(function(){return m})),n.d(t,\"a\",(function(){return d})),n.d(t,\"c\",(function(){return h})),n.d(t,\"d\",(function(){return f}));var o,r=n(16),a=n(59),i=n(57),s=n(1),l=n(18),c=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),p=function(){return(p=Object.assign||function(e){for(var t,n=1,o=arguments.length;n=0;s--)(r=e[s])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},m=function(e){function t(t){var n=e.call(this,t)||this;return n.showSpinner=!1,n.permaLink=null,n.pageName=Object(s.f)(),n.permaLinkField=null,n.showPermaLinkTooltip=i.n.box(!1),n.storageKey=\"devutils_recent_input_\"+n.pageName,document.getElementById(\"header\").innerHTML=\"\",n}return c(t,e),t.prototype.componentDidMount=function(){var e=this,t=l.a[this.pageName];document.title=\"\"+t.pageHeader,document.querySelectorAll(\"meta[name=description]\")[0].setAttribute(\"content\",t.description+t.extra);var n=Object(s.h)(window.location.href);n?this.loadFromPermaLink(n):this.loadFromLocalStorage(),this.disposePageUnload=this.saveToLocalStorage.bind(this),window.addEventListener(\"unload\",this.disposePageUnload),window.addEventListener(\"devutils_page_navigate\",this.disposePageUnload),this.disposeReaction=Object(i.o)((function(){return Object.keys(e.props.pageInputs).map((function(t){return e.props.pageInputs[t]}))}),(function(){e.permaLink=null}))},t.prototype.componentWillUnmount=function(){this.disposeReaction&&this.disposeReaction(),this.disposePageUnload&&(window.removeEventListener(\"unload\",this.disposePageUnload),window.removeEventListener(\"devutils_page_navigate\",this.disposePageUnload))},t.prototype.render=function(){var e=this,t=l.a[this.pageName];return this.props.isHome?r.createElement(\"div\",null,r.createElement(\"h1\",null,\"JSToolset\"),r.createElement(\"div\",{className:\"subtle\"},\"A collection of tools for web developers.\")):r.createElement(\"div\",null,r.createElement(\"div\",{className:\"floatLeft\"},r.createElement(\"h1\",null,t.pageHeader),r.createElement(\"h2\",null,t.description+t.extra),r.createElement(\"div\",{className:\"subtle\"},t.description)),r.createElement(\"div\",{className:\"floatRight\"},r.createElement(\"div\",{className:\"floatLeft\",style:{position:\"relative\",overflow:\"visible\"}},r.createElement(d,{style:{paddingRight:0},onClick:function(){return e.generatePermanentLink()},title:\"Get a permanent, shareable link for the current page including any inputs\"},this.showSpinner&&r.createElement(\"div\",{className:\"spinner floatLeft\",style:{height:13,width:13,marginRight:3}}),!this.showSpinner&&r.createElement(\"span\",{className:\"fontawesome\"},String.fromCharCode(61633)),!Object(s.k)()&&r.createElement(\"span\",null,\" Permanent Link\")),r.createElement(g,{style:{cursor:\"auto\",whiteSpace:\"nowrap\"},show:this.showPermaLinkTooltip,fadeOutTimeInMs:15e3},\"Here's a shareable, permanent link for this page:\",r.createElement(\"br\",null),r.createElement(\"span\",{className:\"lightNeutralBackground borderRadius\",style:{display:\"inline-block\",padding:\"1px 3px\",margin:\"5px 0\"}},r.createElement(\"span\",{ref:function(t){return e.permaLinkField=t}},this.permaLink),r.createElement(\"span\",{dangerouslySetInnerHTML:{__html:\"  \"}}),r.createElement(\"span\",{className:\"fontawesome pointer\",onClick:function(){return Object(s.b)(e.permaLinkField)}},String.fromCharCode(61637))),r.createElement(\"br\",null),\"Your browser's URL has been updated to this URL.\"))),r.createElement(\"div\",{className:\"floatRight\"},this.props.children),r.createElement(\"div\",{className:\"clear\"}))},t.prototype.generatePermanentLink=function(){var e=this;this.showSpinner=!0;var t=Object(s.i)(16);Object(s.a)(\"/blob/set/\"+t,\"POST\",JSON.stringify(Object(i.r)(this.props.pageInputs))).then((function(){e.showSpinner=!1,e.permaLink=e.getPermaLink(t),e.showPermaLinkTooltip.set(!0),window.history.pushState(null,null,e.permaLink)})).catch((function(){e.showSpinner=!1}))},t.prototype.getPermaLink=function(e){return window.location.origin+\"/\"+this.pageName+\"/\"+e},t.prototype.loadFromPermaLink=function(e){var t=this;this.showSpinner=!0,Object(s.a)(\"/blob/get/\"+e).then((function(n){t.showSpinner=!1,t.setInputs(n.responseText),setTimeout((function(){t.permaLink=t.getPermaLink(e)}),1)})).catch((function(){t.showSpinner=!1}))},t.prototype.setInputs=function(e){var t,n=this;try{t=JSON.parse(e)}catch(e){}t&&Object.keys(this.props.pageInputs).forEach((function(e){null!=t[e]&&\"\"!==t[e]&&(n.props.pageInputs[e]=t[e])}))},t.prototype.saveToLocalStorage=function(){try{localStorage.setItem(this.storageKey,JSON.stringify(Object(i.r)(this.props.pageInputs)))}catch(e){console.warn(e),window.appInsights.trackException({exception:e,properties:{source:\"saveToLocalStorage\"}})}},t.prototype.loadFromLocalStorage=function(){var e=this;setTimeout((function(){var t=localStorage.getItem(e.storageKey);t&&e.setInputs(t)}),1)},u([i.n],t.prototype,\"showSpinner\",void 0),u([i.n],t.prototype,\"permaLink\",void 0),u([i.f],t.prototype,\"generatePermanentLink\",null),u([i.f],t.prototype,\"setInputs\",null),u([i.f],t.prototype,\"loadFromLocalStorage\",null),t=u([a.a],t)}(r.Component),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.render=function(){var e=this;return r.createElement(\"button\",p({},this.props,{ref:function(t){return e.element=t}}),this.props.children)},t.prototype.componentDidMount=function(){var e=this;this.element.addEventListener(\"click\",(function(){-1===e.element.className.indexOf(\"clicked\")&&(e.element.className+=\" clicked\"),setTimeout((function(){e.element.className=e.element.className.replace(/\\sclicked/g,\"\")}),1e3)}))},t=u([a.a],t)}(r.Component),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}var n;return c(t,e),n=t,Object.defineProperty(t,\"initialShowing\",{get:function(){return!Object(s.k)()&&\"1\"!==localStorage.getItem(this.storageKey)},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e=this;return this.props.showing.get()?r.createElement(\"div\",{className:\"lightBackground subtle\",style:{padding:\"4px 20px\",fontSize:12,textAlign:\"center\",position:\"relative\",height:24,overflow:\"hidden\"}},r.createElement(\"span\",null,\"We don't send your data to our servers.\",\" \",r.createElement(\"a\",{className:\"pointer\",onClick:function(){return Object(s.e)(document.getElementById(\"privacyLink\"),\"click\")}},\"Read more\"),\" \",\"about our privacy policy.\"),r.createElement(\"div\",{className:\"fontawesome pointer\",onClick:function(){e.props.showing.set(!1),localStorage.setItem(n.storageKey,\"1\")},style:{position:\"absolute\",right:6,top:6}},\"\")):null},t.storageKey=\"devutils_hide_privacy_statement\",t=n=u([a.a],t)}(r.Component),f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.showingPrivacyStatement=i.n.box(h.initialShowing),t}return c(t,e),t.prototype.render=function(){var e=this,t=(this.props.textAreaProps.value||\"\").toString().length;return r.createElement(\"div\",{className:this.props.className,style:this.props.style},r.createElement(\"div\",{className:\"cardHeader\"},r.createElement(\"div\",{className:\"floatLeft label\"},this.props.label,this.props.labelExtra&&r.createElement(\"span\",{className:\"subtle\"},\" (\",this.props.labelExtra,\")\")),!this.props.noCopyButton&&r.createElement(d,{className:\"floatRight\",onClick:function(){return Object(s.b)(e.textAreaElem)}},r.createElement(\"span\",{className:\"fontawesome\"},String.fromCharCode(61637)),r.createElement(\"span\",null,\" Copy\")),!this.props.noCharCount&&r.createElement(\"div\",{className:\"floatRight subtle charCount\"},t>0?t+\" chars\":\"\"),r.createElement(\"div\",{className:\"clear\"})),r.createElement(\"div\",{className:\"border borderRadius\"},r.createElement(\"textarea\",p({className:\"code\",spellCheck:!1,autoCapitalize:\"false\",autoCorrect:\"false\",ref:function(t){return e.textAreaElem=t}},this.props.textAreaProps)),this.props.showPrivacyStatement&&r.createElement(h,{showing:this.showingPrivacyStatement})),r.createElement(\"div\",{className:\"vspace\"}))},t=u([a.a],t)}(r.Component),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.componentDidMount=function(){var e=this;this.disposeObserve=this.props.show.observe((function(){clearTimeout(e.fadeOutTimeout),e.props.show.get()&&(e.fadeOutTimeout=setTimeout((function(){e.props.show.set(!1)}),e.props.fadeOutTimeInMs))}))},t.prototype.componentWillUnmount=function(){this.disposeObserve&&this.disposeObserve()},t.prototype.render=function(){var e=this,t={backgroundColor:\"white\",position:\"absolute\",right:\"calc(100% + 7px)\",top:\"50%\",transform:\"translateY(-50%)\",boxShadow:\"-1px 1px 3px rgba(0,0,0, 0.3)\",display:this.props.show.get()?\"block\":\"none\",borderRadius:10,fontSize:12,zIndex:this.props.show.get()?12:0};return r.createElement(\"div\",{className:\"padding subtle\",style:p(p({},t),this.props.style)},this.props.children,r.createElement(\"div\",{className:\"fontawesome pointer\",onClick:function(){return e.props.show.set(!1)},style:{position:\"absolute\",right:5,top:5}},String.fromCharCode(61453)),r.createElement(\"div\",{style:{height:10,width:10,backgroundColor:\"white\",position:\"absolute\",right:0,top:\"50%\",transform:\"rotate(45deg) translateY(-50%)\"}}))},t=u([a.a],t)}(r.Component)}}]);"],"mappings":"AAAA","sourceRoot":""}