"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("next/head");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),l=a(t);function n(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===a&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");var c=function(e){var t=e.className,a=e.required,l=e.text,n=e.tooltip;return r.default.createElement("label",{className:t+" flex font-medium items-center mb-1 text-gray-700 text-xs"},l,a&&r.default.createElement("span",{className:"mx-1 text-red-500"},"*"),n&&r.default.createElement("span",{className:"flex group items-center ml-2"},r.default.createElement("i",{className:"fa-regular fa-circle-question cursor-pointer mr-2"}),r.default.createElement("span",{className:"bg-gray-100 hidden group-hover:inline px-2 rounded text-xs whitespace-nowrap"},n)))};n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");n("");n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");n("@import '../../index.css';\r\n");var s=function(){return s=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var l in t=arguments[a])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},s.apply(this,arguments)};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */exports.Address=function(e){var t=e.data,a=e.className;return r.default.createElement("p",{className:a+" text-sm"},t.address_1&&r.default.createElement("span",{className:"block"},t.address_1,","),t.address_2&&r.default.createElement("span",{className:"block"},t.address_2,","),t.city&&r.default.createElement("span",{className:"block"},t.city,","),t.county&&r.default.createElement("span",null,t.county," ")," ",t.postcode&&r.default.createElement("span",null,t.postcode))},exports.Badge=function(e){var t=e.children,a=function(e){var t={};switch(e){case"fail":t={bg:"bg-red-200",border:"border-red-800",icon:"fa-regular fa-xmark-circle",text:"text-red-800"};break;case"high":t={bg:"bg-red-100",border:"border-vapta-red",icon:"fa-regular fa-fire",text:"text-vapta-red"};break;case"low":t={bg:"bg-green-100",border:"border-green-800",icon:"fa-regular fa-caret-down",text:"text-green-800"};break;case"medium":t={bg:"bg-orange-100",border:"border-orange-800",icon:"fa-regular fa-clock",text:"text-orange-800"};break;case"pass":t={bg:"bg-green-100",border:"border-green-800",icon:"fa-regular fa-check-circle",text:"text-green-800"};break;case"pending":t={bg:"bg-yellow-200",border:"border-yellow-800",icon:"fa-regular fa-clock",text:"text-yellow-800"};break;case"rectified":t={bg:"bg-green-200",border:"border-green-500",icon:"fa-regular fa-check-double",text:"text-green-800"};break;case"repaired":t={bg:"bg-orange-200",border:"border-orange-800",icon:"fa-regular fa-clock",text:"text-orange-800"};break;default:t={bg:"bg-gray-300",border:"border-gray-800",icon:"fa-regular fa-clock",text:"text-gray-800"}}return t}(e.type);return r.default.createElement("span",{className:"".concat(a.bg," border ").concat(a.border," border-opacity-50 capitalize font-medium px-4 rounded-full ").concat(a.text," text-xs w-fit")},r.default.createElement("i",{className:a.icon+" mr-1"})," ",t)},exports.Button=function(e){var t=e.children,a=e.className,l=e.disabled;e.icon;var n=e.onClick,c=e.onMouseDown,s=e.type,o=void 0===s?"button":s,d=e.variant,i=function(e){var t="";switch(e){case"action":t="bg-emerald-500 hover:bg-emerald-100 text-white hover:text-emerald-600";break;case"cancel":t="bg-gray-100 hover:bg-gray-50 text-gray-400 hover:text-gray-500";break;case"delete":t="bg-transparent hover:bg-red-500 border border-red-500 text-red-500 hover:text-white";break;case"primary":t="bg-red-500 text-white";break;case"secondary":t="bg-blue-500 text-white";break;default:t="bg-gray-100 text-gray-600"}return t}(void 0===d?"action":d);return r.default.createElement("button",{className:a+" flex font-medium items-center justify-center px-4 py-1 relative rounded text-sm transition-colors whitespace-nowrap "+i,disabled:l,onClick:n,onMouseDown:c,type:o},t)},exports.Checkbox=function(e){var t=e.checked,a=e.className,l=e.label,n=e.onChange;return r.default.createElement("div",{className:"w-full"},r.default.createElement(c,{text:l}),r.default.createElement("span",{className:"relative"},r.default.createElement("input",{type:"checkbox",checked:t,onChange:function(e){return n(e.target.checked)},className:a})))},exports.Field=function(e){var t=e.autoFocus,a=e.className,l=e.disabled,n=e.icon,s=e.inputMode,o=e.label,d=e.placeholder,i=e.required,u=e.tooltip,m=e.type,g=e.value,f=e.onChange;return r.default.createElement("div",{className:"w-full"},r.default.createElement(c,{text:o,tooltip:u,required:i}),r.default.createElement("span",{className:"relative"},n&&r.default.createElement("span",{className:"absolute bg-red-100 flex h-5 items-center justify-center left-1.5 rounded text-red-500 top-1/2 transform -translate-y-1/2 w-5"},r.default.createElement("i",{className:"fa-regular ".concat(n," fa-xs")})),r.default.createElement("input",{autoFocus:t,disabled:l,inputMode:s,onChange:function(e){return f(e.target.value)},placeholder:d,type:m,value:g,className:a+" "+(n&&"pl-8")+" bg-transparent border borer-gray-300 outline-none px-2 py-1 rounded text-sm w-full",required:i})))},exports.Grid=function(e){var t=e.children,a=e.className,l=function(e){var t={};switch(e){case 1:t={default:"grid-cols-1 gap-4"};break;case 2:t={default:"grid-cols-2",sm:"sm:grid-cols-1 gap-4",md:"md:grid-cols-2"};break;case 3:t={default:"grid-cols-2",sm:"sm:grid-cols-1 gap-4",md:"md:grid-cols-2",lg:"lg:grid-cols-3"};break;case 4:t={default:"grid-cols-2",sm:"sm:grid-cols-1 gap-4",md:"md:grid-cols-2",lg:"lg:grid-cols-4"};break;case 5:t={default:"grid-cols-2",sm:"sm:grid-cols-1 gap-4",md:"md:grid-cols-4",lg:"lg:grid-cols-5"};break;case 6:t={default:"grid-cols-2",sm:"sm:grid-cols-1 gap-2",md:"md:grid-cols-4",lg:"lg:grid-cols-6"};break;case 7:t={default:"grid-cols-2",sm:"sm:grid-cols-1 gap-4",md:"md:grid-cols-4",lg:"lg:grid-cols-7"};break;case 8:t={default:"grid-cols-2",sm:"sm:grid-cols-1 gap-4",md:"md:grid-cols-4",lg:"lg:grid-cols-8"};break;default:t={default:"grid-cols-1",sm:"sm:grid-cols-2 gap-4",md:"md:grid-cols-3",lg:"lg:grid-cols-4"}}return t}(e.columns);return r.default.createElement("div",{className:"".concat(a," grid ").concat(l.default," ").concat(l.xs," ").concat(l.sm," ").concat(l.md," ").concat(l.lg," ").concat(l.xl)},t)},exports.Label=c,exports.Modal=function(e){},exports.Navigation=function(e){var t=e.user;return r.default.createElement("div",{className:"bg-vapta-red flex items-center px-4 py-2 w-full"},r.default.createElement("div",{className:"text-right w-full"},r.default.createElement("p",{className:"text-xs text-red-100"},"Signed in as ",t&&t.email)))},exports.Page=function(e){var t=e.children,a=e.color,l=e.icon,n=e.meta,c=e.title,s="fa-regular fa-"+l,o=function(e){var t={};switch(e){case"blue":t={bg:"bg-blue-50",text:"text-blue-500"};break;case"green":t={bg:"bg-green-50",text:"text-green-500"};break;case"indigo":t={bg:"bg-indigo-50",text:"text-indigo-500"};break;case"orange":t={bg:"bg-orange-50",text:"text-orange-500"};break;case"purple":t={bg:"bg-purple-50",text:"text-purple-500"};break;case"red":t={bg:"bg-red-50",text:"text-red-500"};break;case"vapta-red":t={bg:"bg-vapta-red bg-opacity-10",text:"text-vapta-red"};break;case"yellow":t={bg:"bg-yellow-100",text:"text-yellow-500"};break;default:t={bg:"bg-gray-100",text:"text-gray-600"}}return t}(a);return r.default.createElement("div",{className:"grid ".concat(t?"grid-cols-2":"grid-cols-1"," mb-4")},r.default.createElement("div",null,r.default.createElement("h1",{className:"flex flex-row font-bold items-center space-y-2"},l&&r.default.createElement("span",{className:"".concat(o.bg," flex h-8 items-center justify-center mr-4 p-4 rounded w-8")},r.default.createElement("i",{className:"".concat(s," ").concat(o.text)})),c),n&&r.default.createElement("p",{className:"mt-4 text-slate-700 text-sm"},n)),t&&r.default.createElement("div",{className:"flex items-end justify-end space-x-4 w-full"},t))},exports.SEO=function(e){var t=e.title,a=e.description;return e.image,e.article,r.default.createElement(l.default,null,r.default.createElement("title",null,t),a&&r.default.createElement("meta",{name:"description",content:a}))},exports.Select=function(t){var a=t.className,l=t.disabled,n=t.label,s=t.options,o=t.tooltip,d=t.required,i=t.value,u=t.onChange,m=e.useState([]),g=m[0],f=m[1];return e.useEffect((function(){s&&f(s)}),[s]),r.default.createElement("div",{className:"w-full"},r.default.createElement(c,{text:n,tooltip:o,required:d}),r.default.createElement("select",{value:null!=i?i:"",onChange:function(e){return u(e.target.value)},disabled:l,required:d,className:a+"  bg-transparent border borer-gray-300 outline-none px-2 py-1 rounded text-sm w-full"},r.default.createElement("option",{value:"",hidden:!0},"Please select an option"),g&&g.map((function(e){return e&&r.default.createElement("option",{key:e.value,value:e.value},e.name)}))))},exports.Textarea=function(e){var t=e.autoFocus,a=e.className,l=e.disabled,n=e.icon,s=e.inputMode,o=e.label,d=e.placeholder,i=e.required,u=e.tooltip,m=e.rows,g=e.value,f=e.onChange;return r.default.createElement("div",{className:"w-full"},r.default.createElement(c,{text:o,tooltip:u,required:i}),r.default.createElement("span",{className:"relative"},n&&r.default.createElement("span",{className:"absolute bg-red-100 flex h-5 items-center justify-center left-1.5 rounded text-red-500 top-1/2 transform -translate-y-1/2 w-5"},r.default.createElement("i",{className:"fa-regular ".concat(n," fa-xs")})),r.default.createElement("textarea",{autoFocus:t,disabled:l,inputMode:s,onChange:function(e){return f(e.target.value)},placeholder:d,value:g,rows:m,className:a+" "+(n&&"pl-8")+" bg-transparent border borer-gray-300 outline-none px-2 py-1 rounded text-sm w-full",required:i})))},exports.Widget=function(e){var t=e.children,a=e.className,l=e.icon,n=e.title,c="fa-regular fa-"+l;return r.default.createElement("div",{className:a+" bg-white border p-4 rounded"},r.default.createElement("div",{className:"flex font-semibold items-center mb-4 text-sm"},l&&r.default.createElement("span",{className:"bg-gray-300 flex h-7.5 items-center justify-center mr-3 p-2 rounded text-gray-900 w-7.5"},r.default.createElement("i",{className:"".concat(c," block")})),n),r.default.createElement("div",{className:"text-sm"},t))},exports.useForm=function(t){void 0===t&&(t={});var a=e.useState(t),r=a[0],l=a[1];return[r,function(e){return l((function(t){return s(s({},t),e)}))}]},exports.useLocalStorage=function(t,a){var r=e.useState((function(){if("undefined"==typeof window)return a;try{var e=window.localStorage.getItem(t);return e?JSON.parse(e):a}catch(e){return console.error(e),a}})),l=r[0],n=r[1];return[l,function(e){try{var a=e instanceof Function?e(l):e;n(a),"undefined"!=typeof window&&window.localStorage.setItem(t,JSON.stringify(a))}catch(e){console.error(e)}}]},exports.useToggle=function(t){void 0===t&&(t=!1);var a=e.useState(t),r=a[0],l=a[1],n=e.useCallback((function(){return l((function(e){return!e}))}),[]);return[r,n]};
//# sourceMappingURL=index.js.map
