1"use strict";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i]}return arr2}function _iterableToArrayLimit(arr,i){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(arr)))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}var CustomAlert=React.memo(function CustomAlert(props){var title=props.title,body=props.body,error=props.error,closeButton=props.closeButton,submitOnClose=props.submitOnClose,buttons=props.buttons,children=props.children,onSubmit=props.onSubmit,onClose=props.onClose;var rootRef=React.useRef(null);var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),top=_React$useState2[0],setTop=_React$useState2[1];var _React$useState3=React.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),left=_React$useState4[0],setLeft=_React$useState4[1];var submit=React.useCallback(function(event){onSubmit()},[onSubmit]);var close=React.useCallback(function(event){if(submitOnClose){onSubmit()}onClose()},[submitOnClose,onSubmit,onClose]);React.useEffect(function(){setTop(window.innerHeight/2-rootRef.current.clientHeight/2);setLeft(window.innerWidth/2-rootRef.current.clientWidth/2)},[]);var renderedButtons=[];_.each(buttons,function(text,type){if(type==="ok"){renderedButtons.push(/*#__PURE__*/React.createElement("button",{className:"customAlertButtonOk",onClick:submit,key:"button-"+text},text))}if(type==="cancel"){renderedButtons.push(/*#__PURE__*/React.createElement("button",{className:"customAlertButtonOk",onClick:close,key:"button-"+text},text))}});return/*#__PURE__*/React.createElement("div",{className:"customAlert",style:{display:"block",top:top,left:left},ref:rootRef},/*#__PURE__*/React.createElement("div",{className:"customAlertInner"},/*#__PURE__*/React.createElement("div",{className:"customAlertTitle"},title&&/*#__PURE__*/React.createElement("span",null,title),closeButton&&/*#__PURE__*/React.createElement("a",{className:"closeAlert",href:"#",onClick:onClose})),/*#__PURE__*/React.createElement("div",{className:"customAlertMsg"},children||body),error&&/*#__PURE__*/React.createElement("div",{className:"customAlertError"},error),/*#__PURE__*/React.createElement("div",{className:"customAlertButtons center"},renderedButtons)))});CustomAlert.defaultProps={title:null,body:null,error:null,closeButton:true,submitOnClose:false,buttons:{ok:"OK"},onSubmit:function onSubmit(){},onClose:function onClose(){}};CustomAlert.displayName="CustomAlert"; 2 3//# sourceMappingURL=CustomAlert.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.