"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react"),a=require("../../styles/OnboardingLoader.module.css.js"),h=[{id:1,label:"Saving station details"},{id:2,label:"Applying rule template"},{id:3,label:"Finalizing station setup"}],d=function(t){var h=t.status;return"complete"===h?s.jsx("div",e.__assign({className:a.default.successIndicator},{children:s.jsx(i.Check,{size:12,color:"white",strokeWidth:3})})):"in-progress"===h?s.jsx("div",e.__assign({className:a.default.progressIndicator},{children:s.jsx(i.Sparkles,{size:18,color:"#7C3AED"})})):s.jsx("div",{className:a.default.pendingIndicator})},l=function(t){var i=t.width,h=void 0===i?"100%":i,d=t.height,l=void 0===d?"10px":d,n=t.style;return s.jsx("div",{className:a.default.shimmerBar,style:e.__assign({width:h,height:l},n)})},n=function(){return s.jsxs("div",e.__assign({className:a.default.shimmer1},{children:[s.jsx(l,{width:"100%",height:"12px"}),s.jsx(l,{width:"85%",height:"10px"}),s.jsx("div",{style:{height:"8px"}}),s.jsx(l,{width:"60%",height:"12px"}),s.jsx(l,{width:"90%",height:"10px"}),s.jsx(l,{width:"75%",height:"10px"}),s.jsx("div",{style:{height:"8px"}}),s.jsx(l,{width:"40%",height:"12px"}),s.jsx(l,{width:"100%",height:"10px"}),s.jsx(l,{width:"80%",height:"10px"}),s.jsx("div",{style:{height:"8px"}}),s.jsx(l,{width:"55%",height:"12px"}),s.jsx(l,{width:"95%",height:"10px"}),s.jsx(l,{width:"70%",height:"10px"}),s.jsx(l,{width:"45%",height:"12px"}),s.jsx(l,{width:"88%",height:"10px"})]}))},r=function(){return s.jsxs("div",e.__assign({className:a.default.shimmer2},{children:[s.jsxs("div",e.__assign({className:a.default.shimmer2Left},{children:[s.jsx(l,{width:"70%",height:"12px"}),s.jsx(l,{width:"50%",height:"10px"}),s.jsx("div",{style:{height:"12px"}}),s.jsx(l,{width:"80%",height:"12px"}),s.jsx(l,{width:"60%",height:"10px"}),s.jsx(l,{width:"90%",height:"10px"}),s.jsx("div",{style:{height:"12px"}}),s.jsx(l,{width:"45%",height:"12px"}),s.jsx(l,{width:"75%",height:"10px"}),s.jsx(l,{width:"55%",height:"10px"}),s.jsx("div",{style:{height:"12px"}}),s.jsx(l,{width:"65%",height:"10px"}),s.jsx(l,{width:"85%",height:"10px"})]})),s.jsx("div",{className:a.default.shimmer2Right})]}))},x=function(){return s.jsxs("div",e.__assign({className:a.default.shimmer3},{children:[s.jsxs("div",e.__assign({className:a.default.shimmer3Left},{children:[s.jsx(l,{width:"60%",height:"14px"}),s.jsx(l,{width:"40%",height:"10px"}),s.jsx("div",{style:{height:"16px"}}),s.jsx(l,{width:"75%",height:"12px"}),s.jsx(l,{width:"50%",height:"10px"})]})),s.jsxs("div",e.__assign({className:a.default.shimmer3Right},{children:[s.jsx("div",{className:a.default.shimmer3Card}),s.jsx("div",{className:a.default.shimmer3Card,style:{animationDelay:"0.2s"}}),s.jsx("div",{className:a.default.shimmer3Card,style:{animationDelay:"0.4s"}})]}))]}))},c=function(e){switch(e.currentStepIndex){case 0:default:return s.jsx(n,{});case 1:return s.jsx(r,{});case 2:return s.jsx(x,{})}};exports.default=function(l){var n=l.isLoading,r=l.steps,x=void 0===r?h:r,u=l.currentStep,g=l.stepIntervalMs,p=void 0===g?3e3:g,j=l.onComplete,o=t.useState(0),m=o[0],f=o[1],v=void 0!==u,_=v?u:m;t.useEffect(function(){if(!v){if(n){var e=setInterval(function(){f(function(s){var t=s+1;return t>=x.length?(clearInterval(e),null==j||j(),s):t})},p);return function(){return clearInterval(e)}}f(0)}},[n,x.length,p,j,v]),t.useEffect(function(){n||f(0)},[n]),t.useEffect(function(){v&&void 0!==u&&u>=x.length&&(null==j||j())},[v,u,x.length,j]);return n?s.jsxs("div",e.__assign({className:a.default.overlay},{children:[s.jsxs("div",e.__assign({className:a.default.leftSide},{children:[s.jsx("div",e.__assign({className:a.default.sparkleWrapper},{children:s.jsx(i.Sparkles,{size:32,color:"#7C3AED"})})),s.jsx("h2",e.__assign({className:a.default.title},{children:"Onboarding your Station"})),s.jsxs("p",e.__assign({className:a.default.subtitle},{children:["We're setting up your station and applying the selected rule",s.jsx("br",{}),"templates. This may take a moment."]})),s.jsx("div",e.__assign({className:a.default.stepsList},{children:x.map(function(t,i){var h,l=(h=i)<_?"complete":h===_?"in-progress":"pending";return s.jsxs("div",e.__assign({className:a.default.stepRow},{children:[s.jsx(d,{status:l}),s.jsx("span",e.__assign({className:"".concat(a.default.stepText," ").concat("in-progress"===l?a.default.stepTextActive:a.default.stepTextPending)},{children:t.label}))]}),t.id)})}))]})),s.jsx("div",e.__assign({className:a.default.rightSide},{children:s.jsx(c,{currentStepIndex:_})}))]})):null};
//# sourceMappingURL=OnboardingLoader.js.map
