!function(){var t={};t=React;var e=function(e){var n=e.control,r=e.customizerSetting,a=e.choices,i="",o=function(t){return t<a.min&&(t=a.min),t>a.max&&(t=a.max),t},c=function(t){var e=(t="string"!=typeof t?t.toString():t).replace(/\d+/g,""),n=t.replace(e,"");return n=parseFloat(n.trim()),{number:n=o(n),unit:e}},l=function(t){var e=c(t);return e.number+e.unit},u=function(t){return c(t).number};n.updateComponentState=function(t){"slider"===i?f.current.value=l(t):"input"===i?d.current.value=u(t):"reset"===i&&(f.current.value=t,d.current.value=t)};var s="kirki-control-input-".concat(r.id),m=u(e.value),p=l(e.value),d=t.useRef(null),f=t.useRef(null);return React.createElement("div",{className:"kirki-control-form",tabIndex:"1"},React.createElement("label",{className:"kirki-control-label",htmlFor:s},React.createElement("span",{className:"customize-control-title"},e.label),React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:e.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:function(t){""!==e.default&&void 0!==e.default?(d.current.value=e.default,f.current.value=e.default):""!==e.value?(d.current.value=e.value,f.current.value=e.value):(d.current.value=a.min,f.current.value=""),i="reset",r.set(d.current.value)}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},React.createElement("input",{ref:d,type:"range",id:s,defaultValue:m,min:a.min,max:a.max,step:a.step,className:"kirki-control-input-slider kirki-pro-control-input-slider",onChange:function(t){i="slider";var e=parseFloat(t.target.value),n=(e=o(e))+c(f.current.value).unit;r.set(n)}})),React.createElement("div",{className:"kirki-control-right-col"},React.createElement("input",{ref:f,type:"text",defaultValue:p,className:"kirki-control-input",onChange:function(t){i="input",r.set(l(t.target.value))}}))))};function n(){return n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}var r=wp.customize.Control.extend({initialize:function(t,e){var n=this;n.setNotificationContainer=n.setNotificationContainer.bind(n),wp.customize.Control.prototype.initialize.call(n,t,e),wp.customize.control.bind("removed",(function t(e){n===e&&(n.destroy(),n.container.remove(),wp.customize.control.unbind("removed",t))}))},setNotificationContainer:function(t){this.notifications.container=jQuery(t),this.notifications.render()},renderContent:function(){var t=this;ReactDOM.render(React.createElement(e,n({},t.params,{control:t,customizerSetting:t.setting,setNotificationContainer:t.setNotificationCotainer,value:t.params.value})),t.container[0]),!1!==t.params.choices.allowCollapse&&t.container.addClass("allowCollapse")},ready:function(){var t=this;t.setting.bind((function(e){t.updateComponentState(e)}))},updateComponentState:function(t){},destroy:function(){ReactDOM.unmountComponentAtNode(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["kirki-input-slider"]=r}();
//# sourceMappingURL=control.js.map
