@enerex/template-studio 1.1.40 → 1.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,14 @@
1
- (function(B,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("@tanstack/react-query"),require("axios"),require("react-bootstrap"),require("react-hook-form"),require("react-select")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@tanstack/react-query","axios","react-bootstrap","react-hook-form","react-select"],e):(B=typeof globalThis<"u"?globalThis:B||self,e(B.EnerexTemplateEditor={},B.jsxRuntime,B.React,B.reactQuery,B.axios,B.reactBootstrap,B.reactHookForm,B.Select$1))})(this,function(B,e,a,V,de,Me,we,ae){"use strict";const Te=a.createContext(void 0),Ae=({children:t,configs:r})=>{const[s,l]=a.useState(r.clientId),[o,n]=a.useState(r.apiKey),[i,d]=a.useState(r.enerexIdentifier),[c,w]=a.useState(r.projectId),[m,N]=a.useState(r.userEmail),[g,S]=a.useState(r.isAdmin),[L,h]=a.useState(r.meBaseUrl),[y,b]=a.useState(r.defaultSelector),p=v=>{n(v.apiKey),l(v.clientId),w(v.projectId),d(v.enerexIdentifier),N(v.userEmail),S(v.isAdmin),b(v.defaultSelector),h(v.meBaseUrl)};return e.jsx(Te.Provider,{value:{clientId:s,apiKey:o,setConfiguration:p,enerexIdentifier:i,projectId:c,userEmail:m,isAdmin:g,defaultSelector:y,meBaseUrl:L},children:t})},H=()=>{const t=a.useContext(Te);if(!t)throw new Error("widgetConfig must be used within a ConfigProvider");return t},$e=({message:t,type:r="info",duration:s=3e3,onClose:l})=>(a.useEffect(()=>{const o=setTimeout(l,s);return()=>clearTimeout(o)},[s,l]),e.jsxs("div",{className:`ts-toast ts-toast-${r}`,children:[e.jsx("span",{className:"ts-toast-message",children:t}),e.jsx("button",{className:"ts-toast-close",onClick:l,children:"×"})]})),_e=()=>{const[t,r]=a.useState(null),s=a.useRef(null);return{showNotification:a.useCallback((n,i="info")=>{s.current!==n&&(s.current=n,r({message:n,type:i}))},[]),NotificationRenderer:()=>t?e.jsx($e,{message:t.message,type:t.type,onClose:()=>{s.current=null,r(null)}}):null}},Ne=a.createContext(null),De=({children:t})=>{const r=_e();return e.jsxs(Ne.Provider,{value:r,children:[t,e.jsx(r.NotificationRenderer,{})]})},Ce=()=>{const t=a.useContext(Ne);if(!t)throw new Error("useGlobalNotification must be used within NotificationProvider");return t},Ee=(t="",r)=>({get:async(n,i)=>{try{const d=await de.get(`${t}${n}`,i??r);if(d.status===200)return d.data}catch(d){throw d}},post:async(n,i,d)=>{try{const c=await de.post(`${t}${n}`,i,d??r);if(c.status===200)return c.data}catch(c){throw c}},delete:async(n,i)=>{try{const d=await de.delete(`${t}${n}`,i??r);if(d.status===200||d.status===204)return d.data}catch(d){throw d}}}),Se=a.createContext({get:()=>{throw new Error("HttpClientContext.get not implemented")},post:()=>{throw new Error("HttpClientContext.post not implemented")},delete:()=>{throw new Error("HttpClientContext.delete not implemented")}}),qe=({children:t})=>{const{clientId:r,apiKey:s,isAdmin:l,meBaseUrl:o}=H(),n={headers:{client_id:r,"x-api-key":s,"Security-Context":l?"admin":"viewer"}},{get:i,post:d,delete:c}=Ee(o,n);return e.jsx(Se.Provider,{value:{get:i,post:d,delete:c},children:t})},Oe=({children:t})=>{const r=new V.QueryClient;return e.jsx(qe,{children:e.jsx(V.QueryClientProvider,{client:r,children:t})})},z=()=>{const t=a.useContext(Se);if(t)return t;throw new Error("useHttpClient must be used within a HttpClientProvider")},X={Template_list:"/Template/list/",Template:"/Template/GetTemplate/",MergeTags:"/Template/TemplateMergeTags/",ExcludeCategory:"/Template/GetExcludeCategories/",SaveTemplate:"/Template/save-update/",TemplateTypes:"/Template/TemplateTypes/",markFavourite:"/Template/MarkFavourite/",deleteTemplate:"/Template/DeleteTemplate/",duplicateTemplate:"/Template/DuplicateTemplate/"},Be=()=>{const t=z(),{enerexIdentifier:r,projectId:s}=H();return V.useQuery({queryKey:["getTemplatesList"],queryFn:async o=>await t.get(`${X.Template_list}${s}/${r}`),refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1})},Fe=()=>{const t=z(),{enerexIdentifier:r,projectId:s}=H();return V.useQuery({queryKey:["getTemplateTypes"],queryFn:async o=>await t.get(`${X.TemplateTypes}${r}/${s}`),refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1})},je=()=>{const t=z(),{enerexIdentifier:r,projectId:s}=H();return V.useMutation({mutationKey:["getTemplate"],mutationFn:async({id:o})=>{if(o)return await t.get(`${X.Template}${r}/${o}/${s}`)}})},Q=({size:t="md",center:r=!1,overlay:s=!1})=>{const l=e.jsx("div",{className:`ts-loader ts-loader-${t}`});return s?e.jsx("div",{className:"ts-loader-overlay",children:l}):r?e.jsx("div",{className:"ts-loader-center",children:l}):l};function Ue({template:t,openActionId:r,setOpenActionId:s,onEdit:l,onDuplicate:o,onRemove:n,onPreview:i}){const{isAdmin:d}=H(),c=r===t.id,w=a.useRef(null),m=a.useRef(null),[N,g,S]=t.categoryChain,L=N?.key,h=g?.key,y=S?.key,b=L===28||h===9&&y===3||y===2,p=d||h===9&&y===3,v=d||h===9&&y===3;return a.useEffect(()=>{function C(T){c&&w.current&&!w.current.contains(T.target)&&!m.current?.contains(T.target)&&s(null)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[c,s]),a.useEffect(()=>{function C(T){T.key==="Escape"&&s(null)}return c&&document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[c,s]),a.useEffect(()=>{if(!c||!w.current)return;const C=Array.from(w.current.querySelectorAll('[role="menuitem"]'));if(!C.length)return;let T=0;C[0].focus();function x(_){_.key==="ArrowDown"&&(T=(T+1)%C.length,C[T].focus(),_.preventDefault()),_.key==="ArrowUp"&&(T=(T-1+C.length)%C.length,C[T].focus(),_.preventDefault())}return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[c]),e.jsx(e.Fragment,{children:e.jsxs("tr",{className:"ts-table-row",children:[e.jsx("td",{children:e.jsxs("div",{className:"ts-name-cell",children:[e.jsx("span",{className:t.readonly?"ts-badge default":"ts-badge custom",children:t.readonly?"Default":"Custom"}),e.jsx("span",{children:t.name})]})}),e.jsx("td",{children:N?.name??""}),e.jsx("td",{children:g?.name??""}),e.jsx("td",{children:S?.name??""}),e.jsx("td",{children:t?.updatedByName??""}),e.jsx("td",{className:"ts-actions-cell",children:e.jsxs("div",{className:"ts-actions-wrapper",children:[e.jsx("button",{ref:m,className:"ts-actions-btn","aria-haspopup":"true","aria-expanded":c,onClick:()=>s(c?null:t.id),children:"⋯"}),e.jsxs("div",{ref:w,className:`ts-actions-menu ${c?"open":""}`,role:"menu",children:[e.jsx("button",{type:"button",role:"menuitem",className:"ts-menu-item",onClick:()=>{s(null),i(t)},children:"Preview"}),p&&e.jsx("button",{type:"button",role:"menuitem",className:"ts-menu-item",onClick:()=>{s(null),l(t)},children:"Edit"}),b&&e.jsx("button",{type:"button",role:"menuitem",className:"ts-menu-item",onClick:()=>{s(null),o(t)},children:"Duplicate"}),v&&e.jsx("button",{type:"button",role:"menuitem",className:"ts-menu-item danger",onClick:()=>{s(null),n(t)},children:"Remove"})]})]})})]})})}const Ve=a.memo(Ue),pe=5,He=({page:t,pageSize:r,totalRecords:s,onPageChange:l,onPageSizeChange:o})=>{const n=Math.ceil(s/r),d=n<=pe?Array.from({length:n},(m,N)=>N+1):Array.from({length:pe},(m,N)=>N+1),c=n>pe,w=n;return e.jsxs("div",{className:"ts-pagination-bar",children:[e.jsxs("div",{className:"ts-page-container",children:[e.jsxs("div",{className:"ts-page-size",children:["Display:",e.jsx("select",{value:r,onChange:m=>{o(Number(m.target.value)),l(1)},children:[10,25,50,100].map(m=>e.jsx("option",{value:m,children:m},m))})]}),e.jsxs("div",{className:"ts-page-info",children:["Page ",t," of ",n]}),e.jsxs("div",{className:"ts-go-to",children:["Go to page:",e.jsx("input",{type:"number",min:1,max:n,value:t,onChange:m=>{const N=Number(m.target.value);N>=1&&N<=n&&l(N)}})]})]}),e.jsxs("div",{className:"ts-total",children:["Total: ",s]}),e.jsxs("div",{className:"ts-page-buttons",children:[e.jsx("button",{disabled:t===1,onClick:()=>l(t-1),children:"‹"}),d.map(m=>e.jsx("button",{className:m===t?"active":"",onClick:()=>l(m),children:m},m)),c&&e.jsx("span",{style:{padding:"0 6px"},children:"…"}),c&&e.jsx("button",{className:t===w?"active":"",onClick:()=>l(w),children:w}),e.jsx("button",{disabled:t===n,onClick:()=>l(t+1),children:"›"})]})]})},Ke=({show:t,variant:r,title:s="Are you sure?",message:l,label:o="Name",value:n="",placeholder:i="",requiredMessage:d="This field is required",externalError:c=!1,externalErrorMessage:w="",confirmText:m="Ok",cancelText:N="Cancel",confirmButtonVariant:g="danger",disableConfirm:S=!1,onConfirm:L,onCancel:h,onInputChange:y})=>{const[b,p]=a.useState(n),[v,C]=a.useState(!1),T=a.useRef(null);if(a.useEffect(()=>{if(!t)return;const k=A=>{A.key==="Escape"&&h()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[t,h]),a.useEffect(()=>{if(!t)return;const k=A=>{T.current&&!T.current.contains(A.target)&&h()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[t,h]),a.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),a.useEffect(()=>{t&&(p(n),C(!1))},[t,n]),a.useEffect(()=>{c&&C(!0)},[c]),!t)return null;const x=r==="input"&&!b.trim(),_=r==="input"&&(x||c),$=x?d:c?w:"",F=()=>{if(_||S){C(!0);return}L(b.trim())};return e.jsx("div",{className:"ts-modal-overlay",children:e.jsxs("div",{ref:T,className:"ts-modal",children:[e.jsxs("div",{className:"ts-modal-header",children:[e.jsx("h4",{className:"ts-modal-title ",children:s}),e.jsx("button",{className:"ts-modal-close",onClick:h,children:"✕"})]}),e.jsxs("div",{className:"ts-modal-body",children:[l&&e.jsx("p",{className:"ts-modal-message",children:l}),r==="input"&&e.jsxs("div",{className:"ts-form-group",children:[e.jsxs("label",{className:"ts-label",children:[o,e.jsx("span",{className:"ts-required",children:"*"})]}),e.jsx("input",{type:"text",className:`ts-input ${v&&_?"ts-input-error":""}`,placeholder:i,value:b,onChange:k=>{p(k.target.value),v&&C(!1),y?.(k.target.value)},autoFocus:!0,style:{paddingBlock:"0",paddingInline:"0"}}),v&&_&&e.jsx("div",{className:"ts-error-text",children:$})]})]}),e.jsxs("div",{className:"ts-modal-footer",children:[e.jsx("button",{type:"button",className:"ts-btn ts-btn-secondary",onClick:h,children:N}),e.jsx("button",{type:"button",className:`ts-btn ts-btn-${g}`,onClick:F,disabled:S,children:m})]})]})})},We=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",width:"16px",height:"16px",children:e.jsx("path",{fill:"#ffffff",d:"M368 208A160 160 0 1 0 48 208a160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"})}),Ge=()=>{const t=z(),{enerexIdentifier:r,projectId:s,userEmail:l}=H();return V.useMutation({mutationKey:["duplicateTemplate"],mutationFn:async({templateId:n,request:i})=>(i.enerexIdentifier=r??"",i.projectId=s??"",i.updatedBy=l??"",await t.post(`${X.duplicateTemplate}${n}`,i))})},ze=()=>{const t=z();return V.useMutation({mutationKey:["deleteTemplate"],mutationFn:async r=>{await t.delete(`${X.deleteTemplate}${r}`)}})},Xe=({data:t,page:r,pageSize:s})=>{const l=a.useMemo(()=>Math.ceil(t.length/s),[t.length,s]);return{pagedData:a.useMemo(()=>{const n=(r-1)*s,i=r*s;return t.slice(n,i)},[t,r,s]),totalPages:l}},Ye=({templates:t,templateTypes:r,onRefresh:s,onAdd:l,onEdit:o,onPreview:n})=>{const{mutateAsync:i,isPending:d}=Ge(),{mutateAsync:c,isPending:w}=ze(),[m,N]=a.useState(""),[g,S]=a.useState(""),[L,h]=a.useState(null),[y,b]=a.useState(t),[p,v]=a.useState(r),[C,T]=a.useState(!1),[x,_]=a.useState("input"),[$,F]=a.useState(!1),[k,A]=a.useState(null),[q,ie]=a.useState("asc"),j=f=>{k===f?ie(I=>I==="asc"?"desc":"asc"):(A(f),ie("asc")),ne(1)},[G,K]=a.useState(null);a.useEffect(()=>{const f=[...t].sort((I,D)=>{const P=new Date(D.updatedDateTime).getTime()-new Date(I.updatedDateTime).getTime();return P!==0?P:I.readonly!==D.readonly?Number(I.readonly)-Number(D.readonly):I.name.localeCompare(D.name)});b(f),A(null)},[t]),a.useEffect(()=>{v(r.filter(f=>f.id!=null))},[r]);const R=a.useMemo(()=>{const f=new Map;return p.forEach(I=>f.set(I.id,I)),f},[p]),ge=a.useCallback(f=>{const I=[],D=new Set;let P=R.get(f);for(;P&&!(D.has(P.id)||(D.add(P.id),I.push({id:P.id,name:P.name,key:P.key}),!P.parent_id));)P=R.get(P.parent_id);return I.reverse()},[R]),ee=a.useMemo(()=>!y.length||!p.length?[]:y.map(f=>({...f,categoryChain:ge(f.type)})),[y,p]);a.useEffect(()=>{const f=setTimeout(()=>{S(m),ne(1)},300);return()=>clearTimeout(f)},[m]);const[te,J]=a.useState(10),[W,ne]=a.useState(1),re=a.useMemo(()=>{const f=g.trim().toLowerCase();return f?ee.filter(I=>{const D=I.name.toLowerCase().includes(f),P=I.categoryChain?.some(Z=>Z.name.toLowerCase().includes(f));return D||P}):ee},[ee,g]),ce=a.useMemo(()=>{const f=[...re];return f.sort((I,D)=>{let P="",Z="";switch(k){case"name":P=I.name,Z=D.name;break;case"category":P=I.categoryChain?.[0]?.name??"",Z=D.categoryChain?.[0]?.name??"";break;case"type":P=I.categoryChain?.[1]?.name??"",Z=D.categoryChain?.[1]?.name??"";break;case"subtype":P=I.categoryChain?.[2]?.name??"",Z=D.categoryChain?.[2]?.name??"";break}const Le=P.localeCompare(Z,void 0,{sensitivity:"base"});return q==="asc"?Le:-Le}),f},[re,k,q]),{pagedData:be}=Xe({data:ce,page:W,pageSize:te}),se=a.useCallback(f=>y.some(I=>I.name.trim().toLowerCase()===f.trim().toLowerCase()),[y]),ve=f=>{K(f),F(!1),_("input"),T(!0)},u=f=>{K(f),_("confirm"),T(!0)},{showNotification:E}=Ce(),M=async f=>{if(G)try{if(x==="input"){if(!f)return;if(se(f)){F(!0);return}await i({templateId:G.id,request:{projectId:"",enerexIdentifier:"",newName:f,parent_id:G.id??null}}),E(`Template "${f}" duplicated successfully`,"success")}x==="confirm"&&(await c(G.id),E(`Template "${G.name}" deleted successfully`,"success")),T(!1),K(null),s()}catch{E(x==="confirm"?"Failed to delete template. Please try again.":"Failed to duplicate template. Please try again.","error")}},U=G?.categoryChain?.[2]?.name?.toLowerCase()??"this",Y=G?.name?.toLowerCase()??"",O=d||w;return e.jsxs(e.Fragment,{children:[O&&e.jsx(Q,{overlay:!0}),e.jsxs("div",{className:"ts-page",children:[e.jsxs("div",{className:"ts-header",children:[e.jsx("h1",{className:"ts-title",children:"Templates"}),e.jsx("button",{className:"ts-btn ts-btn-primary",onClick:l,children:"+ Add Template"})]}),e.jsx("div",{className:"ts-search",children:e.jsxs("div",{className:"ts-search-box",children:[e.jsx("input",{type:"text",placeholder:"Search...",value:m,onChange:f=>N(f.target.value)}),m&&e.jsx("button",{className:"ts-clear-btn","aria-label":"Clear search",onClick:()=>N(""),children:"×"}),e.jsx("button",{className:"ts-search-btn","aria-label":"Search",children:e.jsx(We,{})})]})}),e.jsxs("div",{className:"ts-table-wrapper",children:[e.jsxs("table",{className:"ts-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{onClick:()=>j("name"),className:"ts-sortable",children:e.jsxs("div",{className:"ts-th-sort",children:["Name",e.jsxs("span",{className:"ts-sort-icons",children:[e.jsx("span",{className:k==="name"&&q==="asc"?"active":"",children:"▲"}),e.jsx("span",{className:k==="name"&&q==="desc"?"active":"",children:"▼"})]})]})}),e.jsx("th",{onClick:()=>j("category"),className:"ts-sortable",children:e.jsxs("div",{className:"ts-th-sort",children:["Category",e.jsxs("span",{className:"ts-sort-icons",children:[e.jsx("span",{className:k==="category"&&q==="asc"?"active":"",children:"▲"}),e.jsx("span",{className:k==="category"&&q==="desc"?"active":"",children:"▼"})]})]})}),e.jsx("th",{onClick:()=>j("type"),className:"ts-sortable",children:e.jsxs("div",{className:"ts-th-sort",children:["Type",e.jsxs("span",{className:"ts-sort-icons",children:[e.jsx("span",{className:k==="type"&&q==="asc"?"active":"",children:"▲"}),e.jsx("span",{className:k==="type"&&q==="desc"?"active":"",children:"▼"})]})]})}),e.jsx("th",{onClick:()=>j("subtype"),className:"ts-sortable",children:e.jsxs("div",{className:"ts-th-sort",children:["Subtype",e.jsxs("span",{className:"ts-sort-icons",children:[e.jsx("span",{className:k==="subtype"&&q==="asc"?"active":"",children:"▲"}),e.jsx("span",{className:k==="subtype"&&q==="desc"?"active":"",children:"▼"})]})]})}),e.jsx("th",{children:"Updated by"}),e.jsx("th",{className:"align-right",children:"Actions"})]})}),e.jsx("tbody",{children:be.map(f=>e.jsx(Ve,{template:f,openActionId:L,setOpenActionId:h,onDuplicate:ve,onEdit:o,onRemove:u,onPreview:n},f.id))})]}),e.jsx(He,{page:W,pageSize:te,totalRecords:ce.length,onPageChange:ne,onPageSizeChange:J})]})]}),e.jsx(Ke,{show:C,variant:x,title:x==="confirm"?"Are you sure?":"Save Template As",message:x==="confirm"?`Are you sure you want to remove ${U} template "${Y}"?`:"",placeholder:x==="input"?"New name":"",label:"New Name",requiredMessage:"Enter a new name",externalError:$,externalErrorMessage:"Template name already exists. Please choose a different name",confirmText:x==="confirm"?"Ok":"Save as",confirmButtonVariant:x==="confirm"?"danger":"primary",onConfirm:M,onCancel:()=>T(!1),onInputChange:x==="input"?()=>F(!1):void 0})]})},le=`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
1
+ (function(j,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("@tanstack/react-query"),require("axios"),require("react-bootstrap"),require("react-hook-form"),require("react-select")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@tanstack/react-query","axios","react-bootstrap","react-hook-form","react-select"],e):(j=typeof globalThis<"u"?globalThis:j||self,e(j.EnerexTemplateEditor={},j.jsxRuntime,j.React,j.reactQuery,j.axios,j.reactBootstrap,j.reactHookForm,j.Select$1))})(this,function(j,e,o,K,me,_e,Ee,oe){"use strict";const Se=o.createContext(void 0),Be=({children:t,configs:n})=>{const[r,a]=o.useState(n.clientId),[l,s]=o.useState(n.apiKey),[i,c]=o.useState(n.enerexIdentifier),[d,v]=o.useState(n.projectId),[S,k]=o.useState(n.userEmail),[b,E]=o.useState(n.isAdmin),[p,f]=o.useState(n.meBaseUrl),[w,h]=o.useState(n.defaultSelector),y=g=>{s(g.apiKey),a(g.clientId),v(g.projectId),c(g.enerexIdentifier),k(g.userEmail),E(g.isAdmin),h(g.defaultSelector),f(g.meBaseUrl)};return e.jsx(Se.Provider,{value:{clientId:r,apiKey:l,setConfiguration:y,enerexIdentifier:i,projectId:d,userEmail:S,isAdmin:b,defaultSelector:w,meBaseUrl:p},children:t})},U=()=>{const t=o.useContext(Se);if(!t)throw new Error("widgetConfig must be used within a ConfigProvider");return t},qe=({message:t,type:n="info",duration:r=3e3,onClose:a})=>(o.useEffect(()=>{const l=setTimeout(a,r);return()=>clearTimeout(l)},[r,a]),e.jsxs("div",{className:`ts-toast ts-toast-${n}`,children:[e.jsx("span",{className:"ts-toast-message",children:t}),e.jsx("button",{className:"ts-toast-close",onClick:a,children:"×"})]})),Fe=()=>{const[t,n]=o.useState(null),r=o.useRef(null);return{showNotification:o.useCallback((s,i="info")=>{r.current!==s&&(r.current=s,n({message:s,type:i}))},[]),NotificationRenderer:()=>t?e.jsx(qe,{message:t.message,type:t.type,onClose:()=>{r.current=null,n(null)}}):null}},Ce=o.createContext(null),Oe=({children:t})=>{const n=Fe();return e.jsxs(Ce.Provider,{value:n,children:[t,e.jsx(n.NotificationRenderer,{})]})},le=()=>{const t=o.useContext(Ce);if(!t)throw new Error("useGlobalNotification must be used within NotificationProvider");return t},xe=(t="",n)=>({get:async(s,i)=>{try{const c=await me.get(`${t}${s}`,i??n);if(c.status===200)return c.data}catch(c){throw c}},post:async(s,i,c)=>{try{const d=await me.post(`${t}${s}`,i,c??n);if(d.status===200)return d.data}catch(d){throw d}},delete:async(s,i)=>{try{const c=await me.delete(`${t}${s}`,i??n);if(c.status===200||c.status===204)return c.data}catch(c){throw c}}}),ke=o.createContext({get:()=>{throw new Error("HttpClientContext.get not implemented")},post:()=>{throw new Error("HttpClientContext.post not implemented")},delete:()=>{throw new Error("HttpClientContext.delete not implemented")}}),je=({children:t})=>{const{clientId:n,apiKey:r,isAdmin:a,meBaseUrl:l}=U(),s={headers:{client_id:n,"x-api-key":r,"Security-Context":a?"admin":"viewer"}},{get:i,post:c,delete:d}=xe(l,s);return e.jsx(ke.Provider,{value:{get:i,post:c,delete:d},children:t})},Ue=({children:t})=>{const n=new K.QueryClient;return e.jsx(je,{children:e.jsx(K.QueryClientProvider,{client:n,children:t})})},W=()=>{const t=o.useContext(ke);if(t)return t;throw new Error("useHttpClient must be used within a HttpClientProvider")},Y={Template_list:"/Template/list/",Template:"/Template/GetTemplate/",MergeTags:"/Template/TemplateMergeTags/",ExcludeCategory:"/Template/GetExcludeCategories/",SaveTemplate:"/Template/save-update/",TemplateTypes:"/Template/TemplateTypes/",markFavourite:"/Template/MarkFavourite/",deleteTemplate:"/Template/DeleteTemplate/",duplicateTemplate:"/Template/DuplicateTemplate/"},Ve=()=>{const t=W(),{enerexIdentifier:n,projectId:r}=U();return K.useQuery({queryKey:["getTemplatesList"],queryFn:async l=>await t.get(`${Y.Template_list}${r}/${n}`),refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1})},Ke=()=>{const t=W(),{enerexIdentifier:n,projectId:r}=U();return K.useQuery({queryKey:["getTemplateTypes"],queryFn:async l=>await t.get(`${Y.TemplateTypes}${n}/${r}`),refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1})},He=()=>{const t=W(),{enerexIdentifier:n,projectId:r}=U();return K.useMutation({mutationKey:["getTemplate"],mutationFn:async({id:l})=>{if(l)return await t.get(`${Y.Template}${n}/${l}/${r}`)}})},ee=({size:t="md",center:n=!1,overlay:r=!1})=>{const a=e.jsx("div",{className:`ts-loader ts-loader-${t}`});return r?e.jsx("div",{className:"ts-loader-overlay",children:a}):n?e.jsx("div",{className:"ts-loader-center",children:a}):a},Le=()=>{const t=W(),{enerexIdentifier:n,projectId:r}=U();return K.useMutation({mutationKey:["markFavourite"],mutationFn:async l=>await t.post(`${Y.markFavourite}${r}/${n}`,l)})},he=t=>{let n=e.jsx("span",{style:{width:"20px",height:"20px",display:"inline-block"}});return t.variant==="filled"?n=e.jsx("svg",{version:"1.0",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",width:"18px",height:"18px",viewBox:"0 0 64 64","enable-background":"new 0 0 64 64",children:e.jsx("path",{fill:"#2196F3",d:`M63.893,24.277c-0.238-0.711-0.854-1.229-1.595-1.343l-19.674-3.006L33.809,1.15\r
2
+ C33.479,0.448,32.773,0,31.998,0s-1.48,0.448-1.811,1.15l-8.815,18.778L1.698,22.935c-0.741,0.113-1.356,0.632-1.595,1.343\r
3
+ c-0.238,0.71-0.059,1.494,0.465,2.031l14.294,14.657L11.484,61.67c-0.124,0.756,0.195,1.517,0.822,1.957\r
4
+ c0.344,0.243,0.747,0.366,1.151,0.366c0.332,0,0.666-0.084,0.968-0.25l17.572-9.719l17.572,9.719c0.302,0.166,0.636,0.25,0.968,0.25\r
5
+ c0.404,0,0.808-0.123,1.151-0.366c0.627-0.44,0.946-1.201,0.822-1.957l-3.378-20.704l14.294-14.657\r
6
+ C63.951,25.771,64.131,24.987,63.893,24.277z`})}):t.variant==="outlined"&&(n=e.jsx("svg",{version:"1.0",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",width:"18px",height:"18px",viewBox:"0 0 64 64",enableBackground:"new 0 0 64 64",children:e.jsx("path",{fill:t.fill||"rgba(247, 216, 40, 0)",stroke:t.stroke||"#000000",strokeWidth:t.strokeWidth||"2",d:`M63.893,24.277c-0.238-0.711-0.854-1.229-1.595-1.343l-19.674-3.006L33.809,1.15\r
7
+ C33.479,0.448,32.773,0,31.998,0s-1.48,0.448-1.811,1.15l-8.815,18.778L1.698,22.935c-0.741,0.113-1.356,0.632-1.595,1.343\r
8
+ c-0.238,0.71-0.059,1.494,0.465,2.031l14.294,14.657L11.484,61.67c-0.124,0.756,0.195,1.517,0.822,1.957\r
9
+ c0.344,0.243,0.747,0.366,1.151,0.366c0.332,0,0.666-0.084,0.968-0.25l17.572-9.719l17.572,9.719c0.302,0.166,0.636,0.25,0.968,0.25\r
10
+ c0.404,0,0.808-0.123,1.151-0.366c0.627-0.44,0.946-1.201,0.822-1.957l-3.378-20.704l14.294-14.657\r
11
+ C63.951,25.771,64.131,24.987,63.893,24.277z`})})),n};function ye(t){return t.sort((n,r)=>n.name.localeCompare(r.name))}function ze(t){const n=new Map,r=[];t.forEach(s=>n.set(s.id,s));let a=t.filter(s=>s.parent_id===0),l=0;for(;a.length>0;){r.push({level:l,data:a});const s=a.map(c=>c.id);a=t.filter(c=>s.includes(c.parent_id)),l++}return r}function ge(t,n){const a=ze(t).find(l=>l.level===n);return a?a.data:[]}const Ge=t=>{if(!t)return"";const n=new Date(t);if(isNaN(n.getTime()))return"";const r=String(n.getMonth()+1).padStart(2,"0"),a=String(n.getDate()).padStart(2,"0"),l=String(n.getFullYear()).slice(-2);return`${r}/${a}/${l}`},We=t=>e.jsx("svg",{"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 128 512",height:"11px",width:"14px",...t,children:e.jsx("path",{fill:"#6c757d",d:"M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"})});function Ye({template:t,openActionId:n,setOpenActionId:r,onEdit:a,onDuplicate:l,onRemove:s,onPreview:i,onRefresh:c}){const{isAdmin:d}=U(),v=n===t.id,S=o.useRef(null),k=o.useRef(null),[b,E,p]=t.categoryChain,{mutateAsync:f,isPending:w}=Le(),{showNotification:h}=le(),y=E?.key,g=p?.key,$=!d&&y===9,_=d||g!==2,A=d||g!==2;o.useEffect(()=>{function C(L){v&&S.current&&!S.current.contains(L.target)&&!k.current?.contains(L.target)&&r(null)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[v,r]),o.useEffect(()=>{function C(L){L.key==="Escape"&&r(null)}return v&&document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[v,r]),o.useEffect(()=>{if(!v||!S.current)return;const C=Array.from(S.current.querySelectorAll('[role="menuitem"]'));if(!C.length)return;let L=0;C[0].focus();function D(T){T.key==="ArrowDown"&&(L=(L+1)%C.length,C[L].focus(),T.preventDefault()),T.key==="ArrowUp"&&(L=(L-1+C.length)%C.length,C[L].focus(),T.preventDefault())}return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[v]);const M=async()=>{try{await f({categoryId:g?.toString()??"",templateId:t.id??""}),c(),h(`Template "${t?.name}" marked as favourite`,"success")}catch(C){console.error(C),h("Unable to mark template as favourite. Please try again.","error")}};return e.jsx(e.Fragment,{children:e.jsxs("tr",{className:"ts-table-row",children:[e.jsxs("td",{children:[" ",e.jsxs("div",{className:"ts-name-cell",children:[$&&e.jsx("button",{type:"button",className:"ts-fav-btn ts-btn-light",disabled:t.is_favourite,onClick:M,title:"Mark as favourite",children:w?e.jsx(ee,{size:"sm"}):t.is_favourite?e.jsx(he,{variant:"filled"}):e.jsx(he,{variant:"outlined"})}),e.jsx("span",{className:t.readonly?"ts-badge default":"ts-badge custom",children:t.readonly?"Default":"Custom"})]})]}),e.jsx("td",{children:e.jsx("div",{className:"",children:e.jsx("span",{className:"ts-template-name",children:t.name})})}),d&&e.jsx("td",{children:t?.id??""}),e.jsx("td",{children:b?.name??""}),e.jsx("td",{children:E?.name??""}),e.jsx("td",{children:p?.name??""}),d&&e.jsx("td",{children:t?.companyName??""}),e.jsx("td",{children:t?.updatedByName??""}),e.jsx("td",{children:Ge(t.updatedDateTime)}),e.jsx("td",{className:"ts-actions-cell",children:e.jsxs("div",{className:"ts-actions-wrapper",children:[e.jsx("button",{ref:k,className:"ts-actions-btn","aria-haspopup":"true","aria-expanded":v,onClick:()=>r(v?null:t.id),children:e.jsx(We,{})}),e.jsxs("div",{ref:S,className:`ts-actions-menu ${v?"open":""}`,role:"menu",children:[e.jsx("button",{type:"button",role:"menuitem",className:"ts-menu-item",onClick:()=>{r(null),i(t)},children:"Preview"}),_&&e.jsx("button",{type:"button",role:"menuitem",className:"ts-menu-item",onClick:()=>{r(null),a(t)},children:"Edit"}),e.jsx("button",{type:"button",role:"menuitem",className:"ts-menu-item",onClick:()=>{r(null),l(t)},children:"Duplicate"}),A&&e.jsx("button",{type:"button",role:"menuitem",className:"ts-menu-item danger",onClick:()=>{r(null),s(t)},children:"Remove"})]})]})})]})})}const Xe=o.memo(Ye),Je=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",width:"6.01px",height:"9.63px",...t,children:e.jsx("path",{fill:t.fill||"#6c757d",d:"M182.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8H288c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"})}),Ze=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",width:"6.01px",height:"9.63px",...t,children:e.jsx("path",{fill:t.fill||"#6c757d",d:"M182.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128z"})}),J=({label:t,sortKey:n,sortBy:r,sortOrder:a,onSort:l})=>e.jsx("th",{onClick:()=>l(n),className:"ts-sortable",children:e.jsxs("div",{className:"ts-th-sort",children:[t,e.jsxs("div",{className:"ts-sort-icons",children:[e.jsx(Je,{fill:r===n&&a==="asc"?"#007bff":"#6c757d",className:r===n&&a==="asc"?"active":""}),e.jsx(Ze,{style:{marginTop:-9.6},fill:r===n&&a==="desc"?"#007bff":"#6c757d",className:r===n&&a==="desc"?"active":""})]})]})}),ve=5,Qe=({page:t,pageSize:n,totalRecords:r,onPageChange:a,onPageSizeChange:l})=>{const s=Math.ceil(r/n),c=s<=ve?Array.from({length:s},(p,f)=>f+1):Array.from({length:ve},(p,f)=>f+1),d=s>ve,v=s,{showNotification:S}=le(),[k,b]=o.useState(String(t));o.useEffect(()=>{b(String(t))},[t]);const E=()=>{const p=Number(k);if(!p||p<1||p>s){S("Page out of range","error"),b(String(t));return}a(p)};return e.jsxs("div",{className:"ts-pagination-bar",children:[e.jsxs("div",{className:"ts-page-container",children:[e.jsxs("div",{className:"ts-page-size",children:[e.jsx("label",{children:"Display:"}),e.jsx("select",{value:n,onChange:p=>{l(Number(p.target.value)),a(1)},children:[10,25,50,100].map(p=>e.jsx("option",{value:p,children:p},p))})]}),e.jsxs("div",{className:"ts-page-info",children:["Page ",e.jsxs("span",{children:[t," of ",s]})]}),e.jsxs("div",{className:"ts-go-to",children:[e.jsx("span",{children:"Go to page:"}),e.jsx("input",{type:"number",value:k,onChange:p=>b(p.target.value),onBlur:E,onKeyDown:p=>{p.key==="Enter"&&E()}})]})]}),e.jsxs("div",{className:"ts-total",children:[e.jsx("span",{children:"Total:"})," ",r]}),e.jsxs("div",{className:"ts-page-buttons",children:[e.jsx("button",{disabled:t===1,onClick:()=>a(t-1),children:"‹"}),c.map(p=>e.jsx("button",{className:p===t?"active":"",onClick:()=>a(p),children:p},p)),d&&e.jsx("span",{style:{padding:"0 6px"},children:"…"}),d&&e.jsx("button",{className:t===v?"active":"",onClick:()=>a(v),children:v}),e.jsx("button",{disabled:t===s,onClick:()=>a(t+1),children:"›"})]})]})},Re=({show:t,variant:n,title:r="Are you sure?",message:a,label:l="Name",value:s="",placeholder:i="",requiredMessage:c="This field is required",externalError:d=!1,externalErrorMessage:v="",confirmText:S="Ok",cancelText:k="Cancel",confirmButtonVariant:b="danger",disableConfirm:E=!1,onConfirm:p,onCancel:f,onInputChange:w})=>{const[h,y]=o.useState(s),[g,$]=o.useState(!1),_=o.useRef(null);if(o.useEffect(()=>{if(!t)return;const D=T=>{T.key==="Escape"&&f()};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[t,f]),o.useEffect(()=>{if(!t)return;const D=T=>{_.current&&!_.current.contains(T.target)&&f()};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[t,f]),o.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),o.useEffect(()=>{t&&(y(s),$(!1))},[t,s]),o.useEffect(()=>{d&&$(!0)},[d]),!t)return null;const A=n==="input"&&!h.trim(),M=n==="input"&&(A||d),C=A?c:d?v:"",L=()=>{if(M||E){$(!0);return}p(h.trim())};return e.jsx("div",{className:"ts-modal-overlay",children:e.jsxs("div",{ref:_,className:"ts-modal",children:[e.jsxs("div",{className:"ts-modal-header",children:[e.jsx("h4",{className:"ts-modal-title ",children:r}),e.jsx("button",{className:"ts-modal-close",onClick:f,children:"✕"})]}),e.jsxs("div",{className:"ts-modal-body",children:[a&&e.jsx("p",{className:"ts-modal-message",children:a}),n==="input"&&e.jsxs("div",{className:"ts-form-group",children:[e.jsxs("label",{className:"ts-label",children:[l,e.jsx("span",{className:"ts-required",children:"*"})]}),e.jsx("input",{type:"text",className:`ts-input ${g&&M?"ts-input-error":""}`,placeholder:i,value:h,onChange:D=>{y(D.target.value),g&&$(!1),w?.(D.target.value)},autoFocus:!0,style:{paddingBlock:"0",paddingInline:"0"}}),g&&M&&e.jsx("div",{className:"ts-error-text",children:C})]})]}),e.jsxs("div",{className:"ts-modal-footer",children:[e.jsx("button",{type:"button",className:"ts-btn ts-btn-secondary",onClick:f,children:k}),e.jsx("button",{type:"button",className:`ts-btn ts-btn-${b}`,onClick:L,disabled:E,children:S})]})]})})},et=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",width:"11px",height:"11px",children:e.jsx("path",{fill:"#ffffff",d:"M368 208A160 160 0 1 0 48 208a160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"})}),tt=()=>{const t=W(),{enerexIdentifier:n,projectId:r,userEmail:a}=U();return K.useMutation({mutationKey:["duplicateTemplate"],mutationFn:async({templateId:s,request:i})=>(i.enerexIdentifier=n??"",i.projectId=r??"",i.updatedBy=a??"",await t.post(`${Y.duplicateTemplate}${s}`,i))})},nt=()=>{const t=W();return K.useMutation({mutationKey:["deleteTemplate"],mutationFn:async n=>{await t.delete(`${Y.deleteTemplate}${n}`)}})},rt=({data:t,page:n,pageSize:r})=>{const a=o.useMemo(()=>Math.ceil(t.length/r),[t.length,r]);return{pagedData:o.useMemo(()=>{const s=(n-1)*r,i=n*r;return t.slice(s,i)},[t,n,r]),totalPages:a}},st=({templates:t,templateTypes:n,onRefresh:r,onAdd:a,onEdit:l,onPreview:s})=>{const{isAdmin:i}=U(),{mutateAsync:c,isPending:d}=tt(),{mutateAsync:v,isPending:S}=nt(),[k,b]=o.useState(""),[E,p]=o.useState(""),[f,w]=o.useState(null),[h,y]=o.useState(t),[g,$]=o.useState(n),[_,A]=o.useState(!1),[M,C]=o.useState("input"),[L,D]=o.useState(!1),[T,te]=o.useState(null),[V,X]=o.useState("asc"),H=u=>{T===u?X(N=>N==="asc"?"desc":"asc"):(te(u),X("asc")),R(1)},[q,ne]=o.useState(null);o.useEffect(()=>{const u=[...t].sort((N,P)=>{if(!i&&N.is_favourite!==P.is_favourite)return Number(P.is_favourite)-Number(N.is_favourite);const I=new Date(P.updatedDateTime).getTime()-new Date(N.updatedDateTime).getTime();return I!==0?I:N.readonly!==P.readonly?Number(N.readonly)-Number(P.readonly):N.name.localeCompare(P.name)});y(u),te(null)},[t]),o.useEffect(()=>{$(n.filter(u=>u.id!=null))},[n]);const se=o.useMemo(()=>{const u=new Map;return g.forEach(N=>u.set(N.id,N)),u},[g]),de=o.useCallback(u=>{const N=[],P=new Set;let I=se.get(u);for(;I&&!(P.has(I.id)||(P.add(I.id),N.push({id:I.id,name:I.name,key:I.key}),!I.parent_id));)I=se.get(I.parent_id);return N.reverse()},[se]),Q=o.useMemo(()=>!h.length||!g.length?[]:h.map(u=>({...u,categoryChain:de(u.type)})),[h,g]);o.useEffect(()=>{const u=setTimeout(()=>{p(k),R(1)},300);return()=>clearTimeout(u)},[k]);const[re,z]=o.useState(25),[pe,R]=o.useState(1),ue=o.useMemo(()=>{const u=E.trim().toLowerCase();return u?Q.filter(N=>{const P=N.name.toLowerCase().includes(u),I=N.categoryChain?.some(G=>G.name.toLowerCase().includes(u));return P||I}):Q},[Q,E]),fe=o.useMemo(()=>{const u=[...ue];return u.sort((N,P)=>{if(T==="lastUpdatedOn"){const Tt=new Date(N.updatedDateTime).getTime(),Nt=new Date(P.updatedDateTime).getTime(),$e=Tt-Nt;return V==="asc"?$e:-$e}let I="",G="";switch(T){case"name":I=N.name,G=P.name;break;case"category":I=N.categoryChain?.[0]?.name??"",G=P.categoryChain?.[0]?.name??"";break;case"type":I=N.categoryChain?.[1]?.name??"",G=P.categoryChain?.[1]?.name??"";break;case"subtype":I=N.categoryChain?.[2]?.name??"",G=P.categoryChain?.[2]?.name??"";break;case"templateId":I=N.id??"",G=P.id??"";break;case"companyName":I=N.companyName??"",G=P.companyName??"";break;case"lastUpdatedBy":I=N.updatedByName??"",G=P.updatedByName??"";break}const Ae=I.localeCompare(G,void 0,{sensitivity:"base"});return V==="asc"?Ae:-Ae}),u},[ue,T,V]),{pagedData:Te}=rt({data:fe,page:pe,pageSize:re}),m=o.useCallback(u=>h.some(N=>N.name.trim().toLowerCase()===u.trim().toLowerCase()),[h]),x=u=>{ne(u),D(!1),C("input"),A(!0)},B=u=>{ne(u),C("confirm"),A(!0)},{showNotification:F}=le(),Z=async u=>{if(q)try{if(M==="input"){if(!u)return;if(m(u)){D(!0);return}await c({templateId:q.id,request:{projectId:"",enerexIdentifier:"",newName:u,parent_id:q.id??null}}),F(`Template "${u}" duplicated successfully`,"success")}M==="confirm"&&(await v(q.id),F(`Template "${q.name}" deleted successfully`,"success")),A(!1),ne(null),r()}catch{F(M==="confirm"?"Failed to delete template. Please try again.":"Failed to duplicate template. Please try again.","error")}},O=q?.categoryChain?.[2]?.name?.toLowerCase()??"this",ae=q?.name?.toLowerCase()??"",Ne=d||S;return e.jsxs(e.Fragment,{children:[Ne&&e.jsx(ee,{overlay:!0}),e.jsxs("div",{className:"ts-page",children:[e.jsxs("div",{className:"ts-header",children:[e.jsx("h1",{className:"ts-title",children:"Templates"}),e.jsx("button",{className:"ts-btn ts-btn-primary",onClick:a,children:"+ Add Template"})]}),e.jsx("div",{className:"ts-search-container",children:e.jsxs("div",{className:"ts-search-container-inner",children:[e.jsx("div",{className:"ts-search",children:e.jsxs("div",{className:"ts-search-box",children:[e.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:u=>b(u.target.value)}),e.jsx("button",{className:"ts-search-btn","aria-label":"Search",children:e.jsx(et,{})})]})}),e.jsxs("div",{className:"ts-table-wrapper",children:[e.jsxs("table",{className:"ts-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"ts-cursor-default"}),e.jsx(J,{label:"Name",sortKey:"name",sortBy:T,sortOrder:V,onSort:H}),i&&e.jsx(J,{label:"Template Id",sortKey:"templateId",sortBy:T,sortOrder:V,onSort:H}),e.jsx(J,{label:"Category",sortKey:"category",sortBy:T,sortOrder:V,onSort:H}),e.jsx(J,{label:"Type",sortKey:"type",sortBy:T,sortOrder:V,onSort:H}),e.jsx(J,{label:"Subtype",sortKey:"subtype",sortBy:T,sortOrder:V,onSort:H}),i&&e.jsx(J,{label:"Company Name",sortKey:"companyName",sortBy:T,sortOrder:V,onSort:H}),e.jsx(J,{label:"Last Updated by",sortKey:"lastUpdatedBy",sortBy:T,sortOrder:V,onSort:H}),e.jsx(J,{label:"Last Updated on",sortKey:"lastUpdatedOn",sortBy:T,sortOrder:V,onSort:H}),e.jsx("th",{className:"ts-cursor-default",children:"Actions"})]})}),e.jsx("tbody",{children:Te.map(u=>e.jsx(Xe,{template:u,openActionId:f,setOpenActionId:w,onDuplicate:x,onEdit:l,onRemove:B,onPreview:s,onRefresh:r},u.id))})]}),e.jsx(Qe,{page:pe,pageSize:re,totalRecords:fe.length,onPageChange:R,onPageSizeChange:z})]})]})})]}),e.jsx(Re,{show:_,variant:M,title:M==="confirm"?"Are you sure?":"Save Template As",message:M==="confirm"?`Are you sure you want to remove ${O} template "${ae}"?`:"",placeholder:M==="input"?"New name":"",label:"New Name",requiredMessage:"Enter a new name",externalError:L,externalErrorMessage:"Template name already exists. Please choose a different name",confirmText:M==="confirm"?"Ok":"Save as",confirmButtonVariant:M==="confirm"?"danger":"primary",onConfirm:Z,onCancel:()=>A(!1),onInputChange:M==="input"?()=>D(!1):void 0})]})},ie=`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
2
12
  <html\r
3
13
  dir="ltr"\r
4
14
  xmlns:o="urn:schemas-microsoft-com:office:office"\r
@@ -354,18 +364,8 @@
354
364
  </div>\r
355
365
  </body>\r
356
366
  </html>\r
357
- `,ue={EDITOR_SCRIPT_URL:"https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",EDITOR_PLUGIN_ID:"1afdc3161ec7409a8627a1c8561d45f5",EDITOR_SECRET_KEY:"54ba748ed7e94f2e929555783acb03da"},Je=t=>{const r=Array.from(new Set(t.map(l=>l.category))),s=[];return r.forEach(l=>{const o=t.filter(n=>n.category===l).map(n=>({label:n.label,value:n.value,hint:n.hint,hidden:n.hidden}));s.push({category:l,entries:o})}),s},Ze=()=>{const t=z(),{enerexIdentifier:r,projectId:s}=H();return V.useQuery({queryKey:["getTemplateTags"],queryFn:async o=>await t.get(`${X.MergeTags}${s}/${r}`)})},Qe=()=>{const t=z(),{enerexIdentifier:r,projectId:s}=H();return V.useQuery({queryKey:["getExcludeCategory"],queryFn:async o=>await t.get(`${X.ExcludeCategory}${s}/${r}`)})},Re=({templateHTML:t,className:r="",loading:s=!1,onEditorInitialized:l})=>{const{post:o}=Ee(),{data:n}=Ze(),{data:i}=Qe(),[d,c]=a.useState(t??{html:le,css:""}),{userEmail:w}=H(),m=a.useRef(null),N="https://plugin.stripocdn.email/content/guids/CABINET_eab4e7d5a4603ac03f4120652a3a5a540f0c79c688514939f095f67433ed4a67/images/photo256.png",g="https://plugins.stripo.email/api/v1/auth";a.useEffect(()=>{(async()=>(await S(),n&&i&&await L(ue.EDITOR_SCRIPT_URL)))()},[n,i]);async function S(){window.Zone||await new Promise((y,b)=>{const p=document.createElement("script");p.src="https://unpkg.com/zone.js@0.13.1/bundles/zone.umd.min.js";const v=document.querySelector("script[nonce]")?.nonce;v&&p.setAttribute("nonce",v),p.onload=()=>y(),p.onerror=()=>b(new Error("Failed to load zone.js")),document.head.appendChild(p)})}async function L(y){let b=document.getElementById("UiEditorScript");b||(b=document.createElement("script"),b.id="UiEditorScript",b.src=y,b.onload=async()=>{await h()},document.body.appendChild(b)),await new Promise(p=>b.addEventListener("load",()=>p(),{once:!0}))}const h=async()=>{const y=m.current;if(!y){console.error("Missing #stripoEditorContainer in DOM");return}if(!window.UIEditor||typeof window.UIEditor.initEditor!="function"){console.error("UIEditor script not loaded or not exposing initEditor");return}const b={html:d.html,css:d.css,modulesExcludedCategories:i??[],forceRecreate:!0,metadata:{emailId:w,userId:"1",avatarUrl:N},locale:"en",onTokenRefreshRequest:async p=>{const v={pluginId:ue.EDITOR_PLUGIN_ID,secretKey:ue.EDITOR_SECRET_KEY,userId:w,role:"user"},C=await o(g,v);C?.token&&p(C.token)},onTemplateLoaded:()=>{l&&l(!0)},mergeTags:Je(n??[])};for(const[p,v]of Object.entries({codeEditorButtonSelector:"#codeEditor",undoButtonSelector:"#undoButton",redoButtonSelector:"#redoButton",mobileViewButtonSelector:"#mobileViewButton",desktopViewButtonSelector:"#desktopViewButton"}))y.ownerDocument&&y.getRootNode()instanceof ShadowRoot&&y.getRootNode().querySelector(v)&&(b[p]=v);await window.UIEditor.initEditor(y,b)};return e.jsx("div",{className:"position-relative",children:e.jsxs("div",{className:`editor-container ${r}`,children:[s&&e.jsx("div",{className:"loading-overlay",children:e.jsx(Me.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:e.jsx("span",{className:"visually-hidden",children:"Loading..."})})}),e.jsx("div",{id:"externalSystemContainer"}),e.jsx("div",{id:"stripoEditorContainer",ref:m})]})})},xe=({label:t,register:r,validation:s,required:l=!1,name:o,error:n,className:i="",...d})=>{const c=!!(n&&n[o]);return e.jsxs("div",{className:`ts-form-group ${i}`,children:[t&&e.jsxs("label",{className:"ts-form-label",children:[t,l&&e.jsx("span",{className:"ts-required",children:"*"})]}),e.jsx("input",{name:o,type:"text",...d,...r?r(o,{...s}):{},className:`ts-input ${c?"ts-input-error":""}`,"aria-invalid":c}),c&&e.jsx("div",{className:"ts-error-text",children:n?.[o]?.message})]})};function fe(t){return t.sort((r,s)=>r.name.localeCompare(s.name))}function et(t){const r=new Map,s=[];t.forEach(n=>r.set(n.id,n));let l=t.filter(n=>n.parent_id===0),o=0;for(;l.length>0;){s.push({level:o,data:l});const n=l.map(d=>d.id);l=t.filter(d=>n.includes(d.parent_id)),o++}return s}function me(t,r){const l=et(t).find(o=>o.level===r);return l?l.data:[]}const tt=()=>{const t=z(),{enerexIdentifier:r,projectId:s}=H();return V.useMutation({mutationKey:["markFavourite"],mutationFn:async o=>await t.post(`${X.markFavourite}${s}/${r}`,o)})};function rt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var he={exports:{}};/*!
367
+ `,be={EDITOR_SCRIPT_URL:"https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",EDITOR_PLUGIN_ID:"1afdc3161ec7409a8627a1c8561d45f5",EDITOR_SECRET_KEY:"54ba748ed7e94f2e929555783acb03da"},at=t=>{const n=Array.from(new Set(t.map(a=>a.category))),r=[];return n.forEach(a=>{const l=t.filter(s=>s.category===a).map(s=>({label:s.label,value:s.value,hint:s.hint,hidden:s.hidden}));r.push({category:a,entries:l})}),r},ot=()=>{const t=W(),{enerexIdentifier:n,projectId:r}=U();return K.useQuery({queryKey:["getTemplateTags"],queryFn:async l=>await t.get(`${Y.MergeTags}${r}/${n}`)})},lt=()=>{const t=W(),{enerexIdentifier:n,projectId:r}=U();return K.useQuery({queryKey:["getExcludeCategory"],queryFn:async l=>await t.get(`${Y.ExcludeCategory}${r}/${n}`)})},it=({templateHTML:t,className:n="",loading:r=!1,onEditorInitialized:a})=>{const{post:l}=xe(),{data:s}=ot(),{data:i}=lt(),[c,d]=o.useState(t??{html:ie,css:""}),{userEmail:v}=U(),S=o.useRef(null),k="https://plugin.stripocdn.email/content/guids/CABINET_eab4e7d5a4603ac03f4120652a3a5a540f0c79c688514939f095f67433ed4a67/images/photo256.png",b="https://plugins.stripo.email/api/v1/auth";o.useEffect(()=>{(async()=>(await E(),s&&i&&await p(be.EDITOR_SCRIPT_URL)))()},[s,i]);async function E(){window.Zone||await new Promise((w,h)=>{const y=document.createElement("script");y.src="https://unpkg.com/zone.js@0.13.1/bundles/zone.umd.min.js";const g=document.querySelector("script[nonce]")?.nonce;g&&y.setAttribute("nonce",g),y.onload=()=>w(),y.onerror=()=>h(new Error("Failed to load zone.js")),document.head.appendChild(y)})}async function p(w){let h=document.getElementById("UiEditorScript");h||(h=document.createElement("script"),h.id="UiEditorScript",h.src=w,h.onload=async()=>{await f()},document.body.appendChild(h)),await new Promise(y=>h.addEventListener("load",()=>y(),{once:!0}))}const f=async()=>{const w=S.current;if(!w){console.error("Missing #stripoEditorContainer in DOM");return}if(!window.UIEditor||typeof window.UIEditor.initEditor!="function"){console.error("UIEditor script not loaded or not exposing initEditor");return}const h={html:c.html,css:c.css,modulesExcludedCategories:i??[],forceRecreate:!0,metadata:{emailId:v,userId:"1",avatarUrl:k},locale:"en",onTokenRefreshRequest:async y=>{const g={pluginId:be.EDITOR_PLUGIN_ID,secretKey:be.EDITOR_SECRET_KEY,userId:v,role:"user"},$=await l(b,g);$?.token&&y($.token)},onTemplateLoaded:()=>{a&&a(!0)},mergeTags:at(s??[])};for(const[y,g]of Object.entries({codeEditorButtonSelector:"#codeEditor",undoButtonSelector:"#undoButton",redoButtonSelector:"#redoButton",mobileViewButtonSelector:"#mobileViewButton",desktopViewButtonSelector:"#desktopViewButton"}))w.ownerDocument&&w.getRootNode()instanceof ShadowRoot&&w.getRootNode().querySelector(g)&&(h[y]=g);await window.UIEditor.initEditor(w,h)};return e.jsx("div",{className:"position-relative",children:e.jsxs("div",{className:`editor-container ${n}`,children:[r&&e.jsx("div",{className:"loading-overlay",children:e.jsx(_e.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:e.jsx("span",{className:"visually-hidden",children:"Loading..."})})}),e.jsx("div",{id:"externalSystemContainer"}),e.jsx("div",{id:"stripoEditorContainer",ref:S})]})})},Ie=({label:t,register:n,validation:r,required:a=!1,name:l,error:s,className:i="",...c})=>{const d=!!(s&&s[l]);return e.jsxs("div",{className:`ts-form-group ${i}`,children:[t&&e.jsxs("label",{className:"ts-form-label",children:[t,a&&e.jsx("span",{className:"ts-required",children:"*"})]}),e.jsx("input",{name:l,type:"text",...c,...n?n(l,{...r}):{},className:`ts-input ${d?"ts-input-error":""}`,"aria-invalid":d}),d&&e.jsx("div",{className:"ts-error-text",children:s?.[l]?.message})]})};function ct(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var we={exports:{}};/*!
358
368
  Copyright (c) 2018 Jed Watson.
359
369
  Licensed under the MIT License (MIT), see
360
370
  http://jedwatson.github.io/classnames
361
- */var ke;function nt(){return ke||(ke=1,function(t){(function(){var r={}.hasOwnProperty;function s(){for(var n="",i=0;i<arguments.length;i++){var d=arguments[i];d&&(n=o(n,l(d)))}return n}function l(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return s.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var d in n)r.call(n,d)&&n[d]&&(i=o(i,d));return i}function o(n,i){return i?n?n+" "+i:n+i:n}t.exports?(s.default=s,t.exports=s):window.classNames=s})()}(he)),he.exports}var st=nt();const Ie=rt(st),Pe=t=>t.data.isSeparator?e.jsx("div",{style:{padding:0,margin:"2px 0"},children:e.jsx("hr",{style:{border:0,borderTop:"1px solid #bdbdbdff",padding:0,margin:0}})}):t.data.icon?e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx(ae.components.Option,{...t}),e.jsx("span",{className:"px-1 template-studio-dropdown-postfix-icon",children:t.data.icon})]}):e.jsx(ae.components.Option,{...t}),at=({name:t="",control:r,options:s,multiple:l=!1,placeholder:o,validation:n,labelKey:i="name",disabled:d,isInvalid:c,value:w,onChange:m,uncontrolled:N,menuPlacement:g="auto",closeOnSelect:S=!0})=>{const L={control:h=>({...h,minHeight:"33px",borderColor:c?"var(--bs-form-invalid-border-color) !important":"var(--ct-input-border-color)",backgroundImage:c?'url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 12%27 width=%2712%27 height=%2712%27 fill=%27none%27 stroke=%27%23fa5c7c%27%3e%3ccircle cx=%276%27 cy=%276%27 r=%274.5%27/%3e%3cpath stroke-linejoin=%27round%27 d=%27M5.8 3.6h.4L6 6.5z%27/%3e%3ccircle cx=%276%27 cy=%278.2%27 r=%27.6%27 fill=%27%23fa5c7c%27 stroke=%27none%27/%3e%3c/svg%3e")':"none",backgroundRepeat:"no-repeat",backgroundPosition:"right calc(0.375em + 0.225rem) center",backgroundSize:"calc(0.75em + 0.45rem) calc(0.75em + 0.45rem)","&:hover":{borderColor:c?"var(--bs-form-invalid-border-color)":"var(--ct-input-border-color)"},"& .react-select__single-value":{color:"var(--ct-input-color) !important"},"& .react-select__placeholder":{color:"var(--ct-input-placeholder-color) !important"},"& .react-select__indicators":{display:"none"}}),menu:h=>({...h,marginTop:0,width:"max-content",minWidth:"100%"}),menuPortal:h=>({...h,zIndex:1e4}),multiValueRemove:h=>({...h,display:d?"none":"block"})};return N?e.jsx(ae,{components:{Option:Pe},isOptionDisabled:h=>!!h.isSeparator,className:Ie({"is-invalid":c}),styles:L,classNamePrefix:"react-select",isMulti:l,options:s,onChange:m,placeholder:o,menuPortalTarget:document.body,value:w,getOptionLabel:typeof i=="string"?h=>h[i]:i,getOptionValue:h=>h.id,isDisabled:d,menuPlacement:g,closeMenuOnSelect:S}):e.jsx(we.Controller,{control:r,name:t,rules:n,render:({field:{onChange:h,value:y,onBlur:b}})=>e.jsx(ae,{components:{Option:Pe},isOptionDisabled:p=>!!p.isSeparator,className:Ie({"is-invalid":c}),styles:L,classNamePrefix:"react-select",isMulti:l,options:s,onBlur:b,onChange:h,placeholder:o,menuPortalTarget:document.body,value:y,getOptionLabel:typeof i=="string"?p=>p[i]:i,getOptionValue:p=>p.id,isDisabled:d,menuPlacement:g,closeMenuOnSelect:S},y?y.id||y.value||JSON.stringify(y):"reset")})},oe=({label:t,name:r,validation:s,control:l,error:o,options:n=[],required:i=!1,disabled:d=!1,className:c=""})=>{const w=!!(o&&o[r]);return e.jsxs("div",{className:`ts-form-group ${c}`,children:[t&&e.jsxs("label",{className:"ts-form-label",children:[t,i&&e.jsx("span",{className:"ts-required",children:"*"})]}),e.jsx(at,{name:r,control:l,options:n,validation:s,disabled:d,isInvalid:w}),w&&e.jsx("div",{className:"ts-error-text",children:o?.[r]?.message})]})},lt=()=>{const t=z();V.useQueryClient();const{enerexIdentifier:r,projectId:s}=H();return V.useMutation({mutationKey:["saveTemplate"],mutationFn:async o=>(o.enerexIdentifier=r??"",o.projectId=s??"",await t.post(`${X.SaveTemplate}`,o))})},ye=t=>{let r=e.jsx("span",{style:{width:"20px",height:"20px",display:"inline-block"}});return t.variant==="filled"?r=e.jsx("svg",{version:"1.0",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",width:"20px",height:"20px",viewBox:"0 0 64 64","enable-background":"new 0 0 64 64",children:e.jsx("path",{fill:"#2196F3",d:`M63.893,24.277c-0.238-0.711-0.854-1.229-1.595-1.343l-19.674-3.006L33.809,1.15\r
362
- C33.479,0.448,32.773,0,31.998,0s-1.48,0.448-1.811,1.15l-8.815,18.778L1.698,22.935c-0.741,0.113-1.356,0.632-1.595,1.343\r
363
- c-0.238,0.71-0.059,1.494,0.465,2.031l14.294,14.657L11.484,61.67c-0.124,0.756,0.195,1.517,0.822,1.957\r
364
- c0.344,0.243,0.747,0.366,1.151,0.366c0.332,0,0.666-0.084,0.968-0.25l17.572-9.719l17.572,9.719c0.302,0.166,0.636,0.25,0.968,0.25\r
365
- c0.404,0,0.808-0.123,1.151-0.366c0.627-0.44,0.946-1.201,0.822-1.957l-3.378-20.704l14.294-14.657\r
366
- C63.951,25.771,64.131,24.987,63.893,24.277z`})}):t.variant==="outlined"&&(r=e.jsx("svg",{version:"1.0",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",width:"20px",height:"20px",viewBox:"0 0 64 64",enableBackground:"new 0 0 64 64",children:e.jsx("path",{fill:t.fill||"rgba(247, 216, 40, 0)",stroke:t.stroke||"#000000",strokeWidth:t.strokeWidth||"2",d:`M63.893,24.277c-0.238-0.711-0.854-1.229-1.595-1.343l-19.674-3.006L33.809,1.15\r
367
- C33.479,0.448,32.773,0,31.998,0s-1.48,0.448-1.811,1.15l-8.815,18.778L1.698,22.935c-0.741,0.113-1.356,0.632-1.595,1.343\r
368
- c-0.238,0.71-0.059,1.494,0.465,2.031l14.294,14.657L11.484,61.67c-0.124,0.756,0.195,1.517,0.822,1.957\r
369
- c0.344,0.243,0.747,0.366,1.151,0.366c0.332,0,0.666-0.084,0.968-0.25l17.572-9.719l17.572,9.719c0.302,0.166,0.636,0.25,0.968,0.25\r
370
- c0.404,0,0.808-0.123,1.151-0.366c0.627-0.44,0.946-1.201,0.822-1.957l-3.378-20.704l14.294-14.657\r
371
- C63.951,25.771,64.131,24.987,63.893,24.277z`})})),r},ot={id:"",name:"New (Blank)"},it=({onReset:t,editorInitialized:r,mode:s,templateTypes:l,templateList:o,template:n,onRefresh:i,closeEditorModal:d})=>{const{defaultSelector:c,isAdmin:w,userEmail:m}=H(),{mutateAsync:N,isPending:g}=tt(),{register:S,handleSubmit:L,clearErrors:h,setValue:y,control:b,watch:p,reset:v,setError:C,formState:{errors:T}}=we.useForm({defaultValues:{templateName:"",subTemplateType:void 0,subTemplateType2:void 0,subject:"",templateType:void 0,template:ot},mode:"onChange"}),[x,_]=a.useState([]),[$,F]=a.useState(),{mutateAsync:k,isPending:A}=lt(),[q,ie]=a.useState([]),[j,G]=a.useState([]),[K,R]=a.useState([]),[ge,ee]=a.useState(!1),te=a.useRef(!1),{showNotification:J}=Ce(),W=s==="edit",ne=ge||A||g||!r;a.useEffect(()=>{if(l){let u=l.filter(M=>M.id!=null),E=me(u,0);ie(fe(E))}},[l]),a.useEffect(()=>{s==="edit"&&!te.current&&ee(!0)},[s]),a.useEffect(()=>{if(s!=="edit"||!n||!r||!l.length||!x.length||te.current)return;const u=x.find(O=>O.id===n.templateID);if(!u)return;const E=l.filter(O=>O.id!=null),M=E.find(O=>`${O.id}`==`${u.type}`),U=M?E.find(O=>`${O.id}`==`${M.parent_id}`):void 0,Y=U?E.find(O=>`${O.id}`==`${U.parent_id}`):void 0;v({templateType:Y?re(Y):void 0,subTemplateType:U?re(U):void 0,subTemplateType2:M?re(M):void 0,template:u,templateName:n.name??"",subject:n.subject??""}),F(u),te.current=!0,ee(!1)},[s,n,r,l,x,v]);const re=u=>({id:String(u.id),name:u.name,key:u.key});a.useEffect(()=>{o?.sort((u,E)=>u.readonly!==E.readonly?(u.readonly?0:1)-(E.readonly?0:1):u.name.localeCompare(E.name)),_(o??[])},[o]),a.useEffect(()=>{if(!p("templateType"))return;const u=me(l,1);G(fe(u.filter(E=>`${E.parent_id}`==`${p("templateType")?.id}`)))},[p("templateType"),l]),a.useEffect(()=>{const u=p("subTemplateType");if(!u)return;const E=me(l,2);let M=fe(E.filter(U=>`${U.parent_id}`==`${u.id}`));s!=="edit"&&!w&&(M=M.filter(U=>U.key!==2)),console.log(M),R(M)},[p("subTemplateType"),l,s]),a.useEffect(()=>{if(c&&c.type1){const u=q?.find(E=>`${E.id}`===c.type1);y("templateType",u)}},[l,q]),a.useEffect(()=>{if(c&&c.type2){const u=j?.find(E=>`${E.id}`===c.type2);y("subTemplateType",u)}},[l,j]),a.useEffect(()=>{if(c&&c.type3){const u=K?.find(E=>`${E.id}`===c.type3);y("subTemplateType2",u)}},[l,K]);const ce=u=>{window.StripoEditorApi.actionsApi.getTemplateData(async E=>{try{let M=u.template.id,U="";const Y=u.templateName.trim();$?.readonly&&(M="",U=u.template.id);const O=x.find(P=>P.name===u.templateName.trim());if(O&&O.id!==M){C("templateName",{type:"validate",message:"Template name already exists. Please choose a different name."});return}let f=u.templateType.id;K?.length>0?f=u.subTemplateType2.id:j?.length>0&&(f=u.subTemplateType.id);const I={enerexIdentifier:"",projectId:"",templateId:M,templateType:f,name:Y,html:E.html,css:E.css,subject:u.templateType.id==="2"?u?.subject??"":"",parent_id:U,updatedBy:m??""};if(!await k(I)){J("Failed to save template. Please try again.","error");return}J(W?`Template "${Y}" updated successfully.`:`Template "${Y}" created successfully.`,"success"),h(),i(),d()}catch(M){console.error(M),J("Something went wrong while saving the template.","error")}})},be=async()=>{try{let u=p("templateType")?.id;K&&K.length>0?u=p("subTemplateType2")?.id:j&&j.length>0&&(u=p("subTemplateType")?.id),await N({categoryId:u??"",templateId:p("template")?.id??""}),$&&F({...$,is_favourite:!0}),J("Template marked as favourite","success"),i()}catch(u){console.error("Mark favourite failed",u),J("Unable to mark template as favourite. Please try again.","error")}},se=p("templateType"),ve=p("subTemplateType");return e.jsxs(e.Fragment,{children:[ne&&e.jsx(Q,{overlay:!0}),e.jsx("div",{className:"ts-card",children:e.jsx("div",{className:"ts-card-body",children:e.jsx("form",{children:e.jsx("div",{className:"template-list-container",children:e.jsxs("div",{className:"ts-row",children:[e.jsx("div",{className:"ts-col",children:e.jsx(oe,{label:"Category",control:b,error:T,options:q,required:!0,disabled:W||A||g||!r,validation:{required:{value:!0,message:"Select a category"}},...S("templateType")})}),j&&j.length>0&&e.jsx("div",{className:"ts-col",children:e.jsx(oe,{label:"Type",control:b,error:T,options:j,required:!0,disabled:W||A||g||!r,validation:{required:{value:!0,message:"Select a type"}},...S("subTemplateType")})}),K&&K.length>0&&e.jsx("div",{className:"ts-col",children:e.jsx(oe,{label:"Sub Type",control:b,error:T,options:K,required:!0,disabled:W||A||g||!r,validation:{required:{value:!0,message:"Select a subtype"}},...S("subTemplateType2")})}),e.jsx("div",{className:"ts-col",children:e.jsx(oe,{label:"Template",control:b,error:T,disabled:W||!W||A||g||!r,options:[],required:!1,...S("template")})}),e.jsxs("div",{className:"ts-col ts-template-name-col",children:[e.jsx(xe,{label:"Name",register:S,error:T,required:!0,name:"templateName",validation:{required:{value:!0,message:"Enter a name"}}}),ve?.key?.toString()==="9"&&W&&e.jsx("button",{type:"button",className:"template-favourite-btn ts-btn-light",disabled:A||g||($?$?.is_favourite:!1),onClick:be,children:A||g?e.jsx(Q,{size:"sm"}):$?$?.is_favourite?e.jsx(ye,{variant:"filled"}):e.jsx(ye,{variant:"outlined"}):e.jsx(ye,{variant:"outlined"})})]}),se?.key?.toString()==="12"&&e.jsx("div",{className:"ts-col",children:e.jsx(xe,{label:"Subject",register:S,error:T,required:!1,name:"subject"})}),e.jsxs("div",{className:"ts-col ts-actions btn-padding",children:[!W&&e.jsx("button",{type:"button",className:"ts-btn ts-btn-primary",disabled:A||g||!r,onClick:()=>{F(void 0),v(),G([]),R([]),t()},children:A||g?e.jsx(Q,{size:"sm"}):"Clear"}),(se?.key?.toString()!=="12"||(se?.key?.toString()==="12"&&($?.id??""))!=="")&&e.jsx("button",{type:"button",className:"ts-btn ts-btn-primary",disabled:A||g||!r,onClick:L(ce),children:A||g?e.jsx(Q,{size:"sm"}):"Save"})]})]})})})})})]})},ct=({show:t,mode:r,template:s,templateTypes:l,templateList:o,editorInitialized:n,previewHtml:i,onEditorInitialized:d,onClose:c,onRefresh:w})=>{const m=a.useRef(null),[N,g]=a.useState(!1);a.useEffect(()=>{t&&n&&window.StripoEditorApi?.actionsApi&&(r==="add"?window.StripoEditorApi.actionsApi.updateHtmlAndCss(le,"",""):r==="edit"&&s&&window.StripoEditorApi.actionsApi.updateHtmlAndCss(s.html??le,s.css??"",""))},[t,n,r,s]),a.useEffect(()=>{t||g(!1)},[t]);const S=()=>{window.StripoEditorApi.actionsApi.updateHtmlAndCss(le,"","")};return t?e.jsx("div",{className:"ts-editor-modal-overlay",children:e.jsxs("div",{className:`ts-editor-modal ${N?"ts-editor-modal--fullscreen":""}`,ref:m,children:[e.jsxs("div",{className:"ts-editor-modal-header",children:[e.jsxs("h3",{className:"ts-modal-title",children:[r==="add"&&"Create Template",r==="edit"&&"Edit Template",r==="preview"&&"Preview Template"]}),e.jsxs("div",{className:"ts-editor-header-actions",children:[e.jsx("button",{className:"ts-editor-fullscreen-btn",onClick:()=>g(L=>!L),"aria-label":"Toggle fullscreen",children:N?"🗗":"🗖"}),e.jsx("button",{className:"ts-editor-close-btn",onClick:c,"aria-label":"Close editor",children:"✕"})]})]}),e.jsxs("div",{className:"ts-editor-modal-body",children:[r!=="preview"&&e.jsx(it,{mode:r,template:s,templateTypes:l,templateList:o,editorInitialized:n,onReset:S,onRefresh:w,closeEditorModal:c}),r==="preview"?e.jsx("div",{className:"ts-template-preview",children:e.jsx("iframe",{title:"Template Preview",className:"ts-template-preview-frame",srcDoc:i??""})}):e.jsx(Re,{onEditorInitialized:d,loading:!1,className:"editor-container"})]})]})}):null},dt=()=>{const{data:t,isLoading:r,isFetching:s,refetch:l}=Be(),{data:o,isLoading:n,isFetching:i}=Fe(),{mutateAsync:d,isPending:c}=je(),[w,m]=a.useState(!1),[N,g]=a.useState("add"),[S,L]=a.useState(!1),[h,y]=a.useState(""),[b,p]=a.useState(),v=()=>{g("add"),m(!0)},C=async $=>{const F=await d({id:$.id});p({...F}),g("edit"),m(!0)},T=$=>{if(!t||t.length===0)return;const F=t.find(k=>k.id===$.id);y(F?.html??""),g("preview"),m(!0)},x=()=>{m(!1),L(!1),document.getElementById("UiEditorScript")?.remove()},_=r||n||s||i||c;return e.jsxs(e.Fragment,{children:[_&&e.jsx(Q,{overlay:!0}),e.jsx(Ye,{templates:t??[],templateTypes:o??[],onRefresh:l,onAdd:v,onEdit:C,onPreview:T}),e.jsx(ct,{show:w,mode:N,template:b,templateTypes:o??[],templateList:t??[],editorInitialized:S,onEditorInitialized:L,onClose:x,onSaved:()=>{x(),l()},onRefresh:l,previewHtml:h})]})},pt=({config:t})=>e.jsx(Ae,{configs:t,children:e.jsx(Oe,{children:e.jsx(De,{children:e.jsx("div",{className:"root-widget",children:e.jsx(dt,{})})})})});B.EditorWidget=pt,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
371
+ */var Me;function dt(){return Me||(Me=1,function(t){(function(){var n={}.hasOwnProperty;function r(){for(var s="",i=0;i<arguments.length;i++){var c=arguments[i];c&&(s=l(s,a(c)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return r.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var i="";for(var c in s)n.call(s,c)&&s[c]&&(i=l(i,c));return i}function l(s,i){return i?s?s+" "+i:s+i:s}t.exports?(r.default=r,t.exports=r):window.classNames=r})()}(we)),we.exports}var pt=dt();const Pe=ct(pt),De=t=>t.data.isSeparator?e.jsx("div",{style:{padding:0,margin:"2px 0"},children:e.jsx("hr",{style:{border:0,borderTop:"1px solid #bdbdbdff",padding:0,margin:0}})}):t.data.icon?e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx(oe.components.Option,{...t}),e.jsx("span",{className:"px-1 template-studio-dropdown-postfix-icon",children:t.data.icon})]}):e.jsx(oe.components.Option,{...t}),ut=({name:t="",control:n,options:r,multiple:a=!1,placeholder:l,validation:s,labelKey:i="name",disabled:c,isInvalid:d,value:v,onChange:S,uncontrolled:k,menuPlacement:b="auto",closeOnSelect:E=!0})=>{const p={control:f=>({...f,minHeight:"33px",borderColor:d?"var(--bs-form-invalid-border-color) !important":"var(--ct-input-border-color)",backgroundImage:d?'url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 12%27 width=%2712%27 height=%2712%27 fill=%27none%27 stroke=%27%23fa5c7c%27%3e%3ccircle cx=%276%27 cy=%276%27 r=%274.5%27/%3e%3cpath stroke-linejoin=%27round%27 d=%27M5.8 3.6h.4L6 6.5z%27/%3e%3ccircle cx=%276%27 cy=%278.2%27 r=%27.6%27 fill=%27%23fa5c7c%27 stroke=%27none%27/%3e%3c/svg%3e")':"none",backgroundRepeat:"no-repeat",backgroundPosition:"right calc(0.375em + 0.225rem) center",backgroundSize:"calc(0.75em + 0.45rem) calc(0.75em + 0.45rem)","&:hover":{borderColor:d?"var(--bs-form-invalid-border-color)":"var(--ct-input-border-color)"},"& .react-select__single-value":{color:"var(--ct-input-color) !important"},"& .react-select__placeholder":{color:"var(--ct-input-placeholder-color) !important"},"& .react-select__indicators":{display:"none"}}),menu:f=>({...f,marginTop:0,width:"max-content",minWidth:"100%"}),menuPortal:f=>({...f,zIndex:1e4}),multiValueRemove:f=>({...f,display:c?"none":"block"})};return k?e.jsx(oe,{components:{Option:De},isOptionDisabled:f=>!!f.isSeparator,className:Pe({"is-invalid":d}),styles:p,classNamePrefix:"react-select",isMulti:a,options:r,onChange:S,placeholder:l,menuPortalTarget:document.body,value:v,getOptionLabel:typeof i=="string"?f=>f[i]:i,getOptionValue:f=>f.id,isDisabled:c,menuPlacement:b,closeMenuOnSelect:E}):e.jsx(Ee.Controller,{control:n,name:t,rules:s,render:({field:{onChange:f,value:w,onBlur:h}})=>e.jsx(oe,{components:{Option:De},isOptionDisabled:y=>!!y.isSeparator,className:Pe({"is-invalid":d}),styles:p,classNamePrefix:"react-select",isMulti:a,options:r,onBlur:h,onChange:f,placeholder:l,menuPortalTarget:document.body,value:w,getOptionLabel:typeof i=="string"?y=>y[i]:i,getOptionValue:y=>y.id,isDisabled:c,menuPlacement:b,closeMenuOnSelect:E},w?w.id||w.value||JSON.stringify(w):"reset")})},ce=({label:t,name:n,validation:r,control:a,error:l,options:s=[],required:i=!1,disabled:c=!1,className:d=""})=>{const v=!!(l&&l[n]);return e.jsxs("div",{className:`ts-form-group ${d}`,children:[t&&e.jsxs("label",{className:"ts-form-label",children:[t,i&&e.jsx("span",{className:"ts-required",children:"*"})]}),e.jsx(ut,{name:n,control:a,options:s,validation:r,disabled:c,isInvalid:v}),v&&e.jsx("div",{className:"ts-error-text",children:l?.[n]?.message})]})},ft=()=>{const t=W();K.useQueryClient();const{enerexIdentifier:n,projectId:r}=U();return K.useMutation({mutationKey:["saveTemplate"],mutationFn:async l=>(l.enerexIdentifier=n??"",l.projectId=r??"",await t.post(`${Y.SaveTemplate}`,l))})},mt={id:"",name:"New (Blank)"},ht=({onReset:t,editorInitialized:n,mode:r,templateTypes:a,templateList:l,template:s,onRefresh:i,closeEditorModal:c})=>{const{defaultSelector:d,isAdmin:v,userEmail:S}=U(),{mutateAsync:k,isPending:b}=Le(),{register:E,handleSubmit:p,clearErrors:f,setValue:w,control:h,watch:y,reset:g,setError:$,formState:{errors:_}}=Ee.useForm({defaultValues:{templateName:"",subTemplateType:void 0,subTemplateType2:void 0,subject:"",templateType:void 0,template:mt},mode:"onChange"}),[A,M]=o.useState([]),[C,L]=o.useState(),{mutateAsync:D,isPending:T}=ft(),[te,V]=o.useState([]),[X,H]=o.useState([]),[q,ne]=o.useState([]),[se,de]=o.useState(!1),Q=o.useRef(!1),{showNotification:re}=le(),z=r==="edit",pe=se||T||b||!n;o.useEffect(()=>{if(a){let m=a.filter(B=>B.id!=null),x=ge(m,0);V(ye(x))}},[a]),o.useEffect(()=>{r==="edit"&&!Q.current&&de(!0)},[r]),o.useEffect(()=>{if(r!=="edit"||!s||!n||!a.length||!A.length||Q.current)return;const m=A.find(O=>O.id===s.templateID);if(!m)return;const x=a.filter(O=>O.id!=null),B=x.find(O=>`${O.id}`==`${m.type}`),F=B?x.find(O=>`${O.id}`==`${B.parent_id}`):void 0,Z=F?x.find(O=>`${O.id}`==`${F.parent_id}`):void 0;g({templateType:Z?R(Z):void 0,subTemplateType:F?R(F):void 0,subTemplateType2:B?R(B):void 0,template:m,templateName:s.name??"",subject:s.subject??""}),L(m),Q.current=!0,de(!1)},[r,s,n,a,A,g]);const R=m=>({id:String(m.id),name:m.name,key:m.key});o.useEffect(()=>{l?.sort((m,x)=>m.readonly!==x.readonly?(m.readonly?0:1)-(x.readonly?0:1):m.name.localeCompare(x.name)),M(l??[])},[l]),o.useEffect(()=>{if(!y("templateType"))return;const m=ge(a,1);H(ye(m.filter(x=>`${x.parent_id}`==`${y("templateType")?.id}`))),w("subTemplateType",void 0),w("subTemplateType2",void 0)},[y("templateType"),a]),o.useEffect(()=>{const m=y("subTemplateType");if(!m)return;const x=ge(a,2);let B=ye(x.filter(F=>`${F.parent_id}`==`${m.id}`));r!=="edit"&&!v&&(B=B.filter(F=>F.key!==2)),ne(B),w("subTemplateType2",void 0)},[y("subTemplateType"),a,r]),o.useEffect(()=>{if(d&&d.type1){const m=te?.find(x=>`${x.id}`===d.type1);w("templateType",m)}},[a,te]),o.useEffect(()=>{if(d&&d.type2){const m=X?.find(x=>`${x.id}`===d.type2);w("subTemplateType",m)}},[a,X]),o.useEffect(()=>{if(d&&d.type3){const m=q?.find(x=>`${x.id}`===d.type3);w("subTemplateType2",m)}},[a,q]);const ue=m=>{window.StripoEditorApi.actionsApi.getTemplateData(async x=>{try{let B=m.template.id,F="";const Z=m.templateName.trim(),O=A.find(N=>N.name===m.templateName.trim());if(O&&O?.id!==m.template.id){$("templateName",{type:"validate",message:"Template name already exists. Please choose a different name."});return}let ae=m.templateType.id;q?.length>0?ae=m.subTemplateType2.id:X?.length>0&&(ae=m.subTemplateType.id);const Ne={enerexIdentifier:"",projectId:"",templateId:B,templateType:ae,name:Z,html:x.html,css:x.css,subject:m.templateType.id==="2"?m?.subject??"":"",parent_id:F,updatedBy:S??""};if(!await D(Ne)){re("Failed to save template. Please try again.","error");return}re(z?`Template "${Z}" updated successfully.`:`Template "${Z}" created successfully.`,"success"),f(),i(),c()}catch(B){console.error(B),re("Something went wrong while saving the template.","error")}})},fe=y("templateType"),Te=y("subTemplateType");return e.jsxs(e.Fragment,{children:[pe&&e.jsx(ee,{overlay:!0}),e.jsx("div",{className:"ts-card",children:e.jsx("div",{className:"ts-card-body",children:e.jsx("form",{children:e.jsx("div",{className:"template-list-container",children:e.jsxs("div",{className:"ts-row",children:[e.jsx("div",{className:"ts-col",children:e.jsx(ce,{label:"Category",control:h,error:_,options:te,required:!0,disabled:z||T||b||!n,validation:{required:{value:!0,message:"Select a category"}},...E("templateType")})}),X&&X.length>0&&e.jsx("div",{className:"ts-col",children:e.jsx(ce,{label:"Type",control:h,error:_,options:X,required:!0,disabled:z||T||b||!n,validation:{required:{value:!0,message:"Select a type"}},...E("subTemplateType")})}),q&&q.length>0&&e.jsx("div",{className:"ts-col",children:e.jsx(ce,{label:"Sub Type",control:h,error:_,options:q,required:!0,disabled:z||T||b||!n,validation:{required:{value:!0,message:"Select a subtype"}},...E("subTemplateType2")})}),e.jsx("div",{className:"ts-col",children:e.jsx(ce,{label:"Template",control:h,error:_,disabled:z||!z||T||b||!n,options:[],required:!1,...E("template")})}),e.jsxs("div",{className:"ts-col ts-template-name-col",children:[e.jsx(Ie,{label:"Name",register:E,error:_,required:!0,name:"templateName",validation:{required:{value:!0,message:"Enter a name"}}}),Te?.key?.toString()==="9"&&z&&!v&&C?.is_favourite&&e.jsx("span",{className:"ts-favourite-icon",children:e.jsx(he,{variant:"filled"})})]}),fe?.key?.toString()==="12"&&e.jsx("div",{className:"ts-col",children:e.jsx(Ie,{label:"Subject",register:E,error:_,required:!1,name:"subject"})}),e.jsxs("div",{className:"ts-col ts-actions btn-padding",children:[!z&&e.jsx("button",{type:"button",className:"ts-btn ts-btn-primary",disabled:T||b||!n,onClick:()=>{L(void 0),g(),H([]),ne([]),t()},children:T||b?e.jsx(ee,{size:"sm"}):"Clear"}),e.jsx("button",{type:"button",className:"ts-btn ts-btn-primary",disabled:T||b||!n,onClick:p(ue),children:T||b?e.jsx(ee,{size:"sm"}):"Save"})]})]})})})})})]})},yt=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20px",width:"20px",viewBox:"0 0 640 640",...t,children:e.jsx("path",{fill:"#6c757d",d:"M560 144L240 144L240 176L192 176L192 96L608 96L608 416L496 416L496 368L560 368L560 144zM80 352L80 496L400 496L400 352L80 352zM80 224L448 224L448 544L32 544L32 224L80 224z"})}),gt=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20px",width:"20px",viewBox:"0 0 640 640",...t,children:e.jsx("path",{fill:"#6c757d",d:"M112 288L112 464L528 464L528 288L112 288zM64 128L576 128L576 512L64 512L64 128z"})}),vt=({show:t,mode:n,template:r,templateTypes:a,templateList:l,editorInitialized:s,previewHtml:i,onEditorInitialized:c,onClose:d,onRefresh:v})=>{const S=o.useRef(null),[k,b]=o.useState(!1);o.useEffect(()=>{t&&s&&window.StripoEditorApi?.actionsApi&&(n==="add"?window.StripoEditorApi.actionsApi.updateHtmlAndCss(ie,"",""):n==="edit"&&r&&window.StripoEditorApi.actionsApi.updateHtmlAndCss(r.html??ie,r.css??"",""))},[t,s,n,r]),o.useEffect(()=>{t||b(!1)},[t]);const E=()=>{window.StripoEditorApi.actionsApi.updateHtmlAndCss(ie,"","")};return t?e.jsx("div",{className:"ts-editor-modal-overlay",children:e.jsxs("div",{className:`ts-editor-modal ${k?"ts-editor-modal--fullscreen":""}`,ref:S,children:[e.jsxs("div",{className:"ts-editor-modal-header",children:[e.jsxs("h3",{className:"ts-modal-title",children:[n==="add"&&"Create Template",n==="edit"&&"Edit Template",n==="preview"&&"Preview Template"]}),e.jsxs("div",{className:"ts-editor-header-actions",children:[e.jsx("button",{className:"ts-editor-fullscreen-btn",onClick:()=>b(p=>!p),"aria-label":"Toggle fullscreen",children:k?e.jsx(yt,{style:{display:"block"}}):e.jsx(gt,{style:{display:"block"}})}),e.jsx("button",{className:"ts-editor-close-btn",onClick:d,"aria-label":"Close editor",children:"✕"})]})]}),e.jsxs("div",{className:"ts-editor-modal-body",children:[n!=="preview"&&e.jsx(ht,{mode:n,template:r,templateTypes:a,templateList:l,editorInitialized:s,onReset:E,onRefresh:v,closeEditorModal:d}),n==="preview"?e.jsx("div",{className:"ts-template-preview",children:e.jsx("iframe",{title:"Template Preview",className:"ts-template-preview-frame",srcDoc:i??""})}):e.jsx(it,{onEditorInitialized:c,loading:!1,className:"editor-container"})]})]})}):null},bt=()=>{const{data:t,isLoading:n,isFetching:r,refetch:a}=Ve(),{data:l,isLoading:s,isFetching:i}=Ke(),{mutateAsync:c,isPending:d}=He(),[v,S]=o.useState(!1),[k,b]=o.useState("add"),[E,p]=o.useState(!1),[f,w]=o.useState(""),[h,y]=o.useState(),g=()=>{b("add"),S(!0)},$=async C=>{const L=await c({id:C.id});y({...L}),b("edit"),S(!0)},_=C=>{if(!t||t.length===0)return;const L=t.find(D=>D.id===C.id);w(L?.html+"<style>"+L?.css+"</style>"),b("preview"),S(!0)},A=()=>{S(!1),p(!1),document.getElementById("UiEditorScript")?.remove()},M=n||s||r||i||d;return e.jsxs(e.Fragment,{children:[M&&e.jsx(ee,{overlay:!0}),e.jsx(st,{templates:t??[],templateTypes:l??[],onRefresh:a,onAdd:g,onEdit:$,onPreview:_}),e.jsx(vt,{show:v,mode:k,template:h,templateTypes:l??[],templateList:t??[],editorInitialized:E,onEditorInitialized:p,onClose:A,onSaved:()=>{A(),a()},onRefresh:a,previewHtml:f})]})},wt=({config:t})=>e.jsx(Be,{configs:t,children:e.jsx(Ue,{children:e.jsx(Oe,{children:e.jsx("div",{className:"root-widget",children:e.jsx(bt,{})})})})});j.EditorWidget=wt,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- .root-widget{--ts-color-primary: #131c45;--ts-color-primary-hover: #10183b;--ts-color-primary-active: #0f1637;--ts-color-primary-text: #ffffff;--ts-white: #ffffff;--ts-gray-50: #fafafa;--ts-gray-100: #f6f7f9;--ts-gray-200: #f0f0f0;--ts-gray-300: #e5e5e5;--ts-gray-400: #d1d5db;--ts-gray-500: #9ca3af;--ts-gray-600: #6b7280;--ts-gray-700: #374151;--ts-gray-900: #111827;--ts-bg-page: var(--ts-gray-100);--ts-bg-surface: var(--ts-white);--ts-bg-surface-hover: var(--ts-gray-50);--ts-bg-muted: var(--ts-gray-200);--ts-bg-selected: #deebff;--ts-text-primary: var(--ts-gray-900);--ts-text-secondary: var(--ts-gray-700);--ts-text-muted: var(--ts-gray-500);--ts-text-inverse: var(--ts-white);--ts-text-inverse: #ffffff;--ts-border-default: var(--ts-gray-300);--ts-border-strong: var(--ts-gray-400);--ts-border-focus: #2563eb;--ts-color-danger: #dc2626;--ts-color-danger-hover: #bb2d3b;--ts-color-success: #16a34a;--ts-color-warning: #f59e0b;--ts-color-info: #2563eb;--ts-color-success-bg: #dff5e6;--ts-color-success-text: #2e8b57;--ts-color-info-bg: #e6f3ff;--ts-color-info-text: #1c6ed5;--ts-shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);--ts-shadow-md: 0 10px 30px rgba(0, 0, 0, .2);--ts-radius-sm: 4px;--ts-radius-md: 6px;--ts-radius-lg: 8px;--ts-shadow-md: 0 6px 16px rgba(0, 0, 0, .15);--ts-focus-ring-primary: 0 0 0 3px rgba(19, 28, 69, .35);--ts-focus-ring-info: 0 0 0 2px rgba(37, 99, 235, .15);--ts-disabled-opacity: .6;--ts-transition-fast: .15s ease;--ts-popover-bg: #1e1e1e;--ts-popover-border: #444;--ts-popover-text: #f1f1f1;--ts-z-toast: 9999}.dark-popover{left:50%;transform:translate(-50%) translateY(-8px);z-index:9999;width:50px!important;font-size:.85rem!important;padding:.5rem;background-color:var(--ts-popover-bg)!important;color:var(--ts-popover-text);border:1px solid var(--ts-popover-border)}.dark-popover.bs-popover-top>.popover-arrow:before,.dark-popover.bs-popover-bottom>.popover-arrow:before,.dark-popover.bs-popover-left>.popover-arrow:before,.dark-popover.bs-popover-right>.popover-arrow:before{border-color:transparent!important}.dark-popover.bs-popover-top>.popover-arrow:after{border-top-color:var(--ts-popover-bg)!important}.dark-popover.bs-popover-bottom>.popover-arrow:after{border-bottom-color:var(--ts-popover-bg)!important}.dark-popover.bs-popover-left>.popover-arrow:after{border-left-color:var(--ts-popover-bg)!important}.dark-popover.bs-popover-right>.popover-arrow:after{border-right-color:var(--ts-popover-bg)!important}.root-widget .logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.root-widget .logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.root-widget .logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}.root-widget .requiredField:after{content:"";font-family:FontAwesome;position:absolute;left:10px;top:10px;color:red}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.root-widget .card{padding:.3em}.root-widget .read-the-docs{color:#888}.root-widget .row{margin:0!important}.root-widget{--ct-input-border-color: #ced4da !important}.root-widget .react-select__value-container{padding:2px 8px}.root-widget .btn-padding{padding-top:32px}.root-widget{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.root-widget code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.root-widget .ng-star-inserted{display:none}.root-widget .wraped-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.root-widget .required:after{content:" *";color:var(--ts-color-danger)}.root-widget .loader-container{display:flex;justify-content:center;align-items:center;height:100vh;width:100vw}.root-widget .info-icon{height:14px}.root-widget .info-icon img{width:100%;height:100%}.root-widget .ts-label-height{height:16.5px!important}.ts-modal-title{margin:0;font-size:22px;font-weight:600;color:var(--ts-text-primary);line-height:1.4}.ts-btn{padding:10px 14px!important;border-radius:var(--ts-radius-sm)!important;border:none!important;cursor:pointer;font-family:inherit;font-size:16px;font-weight:500;line-height:1.2;letter-spacing:.01em;-webkit-user-select:none;user-select:none;white-space:nowrap}.ts-btn-primary{background:var(--ts-color-primary);color:var(--ts-text-inverse);transition:background-color var(--ts-transition-fast),box-shadow var(--ts-transition-fast)}.ts-btn-primary:hover{background:var(--ts-color-primary-hover);border-color:transparent!important}.ts-btn-primary:focus{outline:none;box-shadow:var(--ts-focus-ring-primary)}.ts-btn-primary:active{background:var(--ts-color-primary-active)}.ts-input{height:36px;padding:6px 10px;font-size:14px;border-radius:var(--ts-radius-md);border:1px solid var(--ts-border-strong);outline:none;color:var(--ts-text-primary);background:var(--ts-bg-surface);transition:border-color var(--ts-transition-fast),box-shadow var(--ts-transition-fast)}.ts-input:focus{outline:1px solid var(--ts-border-focus);outline-offset:0;box-shadow:none}.ts-input-error{border-color:var(--ts-color-danger)}.ts-btn-danger{background:var(--ts-color-danger);color:var(--ts-text-inverse);transition:background-color var(--ts-transition-fast),box-shadow var(--ts-transition-fast)}.ts-btn-danger:hover{background:var(--ts-color-danger-hover)}.ts-btn-danger:focus,.ts-btn-danger:focus-visible{outline:none;box-shadow:0 0 0 3px #dc262659}.ts-btn-danger:active{background:var(--ts-color-danger-hover)}.ts-btn-danger:disabled,.ts-btn-danger[disabled]{opacity:var(--ts-disabled-opacity);cursor:not-allowed}.ts-toast{position:fixed;top:20px;right:20px;min-width:260px;max-width:360px;padding:12px 16px;border-radius:8px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px;color:#fff;box-shadow:0 6px 16px #00000026;animation:slide-in .25s ease;z-index:9999}@keyframes slide-in{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.ts-toast-success{background:#16a34a}.ts-toast-error{background:#dc2626}.ts-toast-warning{background:#f59e0b}.ts-toast-info{background:#2563eb}.ts-toast-close{background:none;border:none!important;color:#fff;font-size:18px;cursor:pointer}.ts-loader{border-radius:50%;border:3px solid #e5e7eb;border-top-color:#131c45;animation:ts-spin .8s linear infinite}.ts-loader-sm{width:16px;height:16px}.ts-loader-md{width:24px;height:24px}.ts-loader-lg{width:40px;height:40px}.ts-loader-center{display:flex;align-items:center;justify-content:center;padding:24px}.ts-loader-overlay{position:fixed;inset:0;background:#ffffffb3;display:flex;align-items:center;justify-content:center;z-index:9999}.ts-page{padding:24px;background:var(--ts-bg-page);min-height:100vh;font-family:Inter,Arial,sans-serif}.ts-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.ts-title{font-size:20px;font-weight:600;color:var(--ts-text-primary)}.ts-table-wrapper{background:var(--ts-bg-surface);box-shadow:var(--ts-shadow-sm)}.ts-table{width:100%;border-collapse:collapse}.ts-table th,.ts-table td{border-bottom:1px solid var(--ts-border-default);font-size:14px;vertical-align:center}.ts-table th{padding:12px;color:var(--ts-text-secondary);text-align:left}.ts-table td{padding:8px;color:var(--ts-text-primary)}.ts-name-cell{display:flex;gap:8px;align-items:center}.ts-badge{font-size:11px;padding:2px 8px;border-radius:12px}.ts-badge.default{background:var(--ts-color-success-bg);color:var(--ts-color-success-text)}.ts-badge.custom{background:var(--ts-color-info-bg);color:var(--ts-color-info-text)}.align-right{text-align:right}.ts-actions-btn{background:transparent;border:none;font-size:18px;cursor:pointer;padding:0!important}.ts-menu-item{width:100%;padding:8px 12px;background:none;border:none!important;border-radius:0!important;text-align:left;font-size:14px;cursor:pointer}.ts-menu-item:hover,.ts-menu-item:focus-visible{background:var(--ts-bg-muted);outline:none}.ts-menu-item.danger{color:var(--ts-color-danger)}.ts-search{margin-bottom:16px}.ts-search-box{display:flex;align-items:center;width:280px;height:40px;background:var(--ts-bg-surface);border:1px solid var(--ts-border-strong);border-radius:var(--ts-radius-sm);overflow:hidden;transition:border-color var(--ts-transition-fast),box-shadow var(--ts-transition-fast)}.ts-search-box input{flex:1;height:100%;border:none!important;padding:0 14px!important;font-size:14px;line-height:1.5;color:var(--ts-text-primary);outline:none}.ts-search-box input::placeholder{color:var(--ts-text-muted)}.ts-clear-btn{display:flex;align-items:center;justify-content:center;width:32px;height:100%;border:none!important;background:transparent;color:var(--ts-text-muted);cursor:pointer;padding:0!important;font-size:24px!important}.ts-clear-btn:hover{color:var(--ts-text-secondary);border:none!important}.ts-search-btn{width:44px;height:100%;border:none!important;background:var(--ts-color-primary);color:var(--ts-text-inverse);cursor:pointer;padding:0!important;display:flex;align-items:center;justify-content:center;border-radius:0 var(--ts-radius-sm) var(--ts-radius-sm) 0!important}.ts-search-btn:hover{background:var(--ts-color-primary-hover)}.ts-search-btn:active{background:var(--ts-color-primary-active)}.ts-search-btn:focus{outline:none}.ts-actions-menu{position:absolute;top:70%;left:100%;margin-top:6px;background:var(--ts-bg-surface);border:1px solid var(--ts-border-default);border-radius:var(--ts-radius-md);box-shadow:var(--ts-shadow-sm);z-index:10;opacity:0;transform:scale(.95);pointer-events:none;transition:all var(--ts-transition-fast)}.ts-actions-menu.open{opacity:1;transform:scale(1);pointer-events:auto}.ts-actions-wrapper{position:relative;display:inline-flex;align-items:center}.ts-actions-btn:hover{border-color:transparent!important}.ts-table th{cursor:pointer;-webkit-user-select:none;user-select:none}.ts-table .ts-sortable:hover{background-color:var(--ts-bg-muted)}.ts-th-sort{display:flex;align-items:center;justify-content:space-between;gap:6px}.ts-sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.ts-sort-icons{margin-left:6px;display:inline-flex;flex-direction:column;font-size:10px;line-height:10px}.ts-sort-icons span{color:var(--ts-text-muted)}.ts-sort-icons span.active{color:var(--ts-color-primary)}.ts-pagination-bar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:12px 16px;border-top:1px solid #e5e7eb;background:#fff;font-size:13px;color:#374151}.ts-page-container{display:flex;align-items:center;gap:20px;justify-self:start}.ts-page-size,.ts-page-info,.ts-go-to{display:flex;align-items:center;gap:6px;white-space:nowrap}.ts-page-size,.ts-go-to{color:#6b7280}.ts-page-info{color:#374151;font-weight:500}.ts-page-size select,.ts-go-to input{height:28px;padding:0 8px;font-size:13px;border:1px solid #d1d5db;border-radius:6px;background-color:#fff;color:#111827}.ts-go-to input{width:56px;text-align:center}.ts-page-size select:focus,.ts-go-to input:focus{outline:none;border-color:#0f172a;box-shadow:0 0 0 1px #0f172a33}.ts-total{justify-self:center;font-size:13px;font-weight:500;color:#374151}.ts-page-buttons{display:flex;align-items:center;gap:4px;justify-self:end}.ts-page-buttons button{min-width:28px;height:28px;padding:0 8px;border-radius:50%;border:1px solid #e5e7eb;background:transparent;font-size:13px;color:#111827;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease}.ts-page-buttons button:hover:not(:disabled):not(.active){background-color:#f1f5f9;border-color:#cbd5e1}.ts-page-buttons button.active{background-color:#0f172a;color:#fff;border-color:#0f172a}.ts-page-buttons button:focus-visible{outline:none;box-shadow:0 0 0 2px #0f172a4d}.ts-page-buttons button:disabled{background-color:#f8fafc;border-color:#e5e7eb;color:#9ca3af;cursor:not-allowed}@media (max-width: 768px){.ts-pagination-bar{grid-template-columns:1fr;row-gap:12px}.ts-total,.ts-page-buttons{justify-self:start}}.ts-modal-overlay{position:fixed;inset:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:1000}.ts-modal{background:var(--ts-bg-surface);width:600px;border-radius:var(--ts-radius-lg);box-shadow:var(--ts-shadow-md);animation:templateStudioFadeIn .2s ease-in-out}.ts-modal-message{margin:0!important}.ts-modal-header{padding:22px 16px 10px;border-bottom:1px solid var(--ts-border-default);display:flex;justify-content:space-between;align-items:center}.ts-modal-header button{background:none;border:none;font-size:18px;cursor:pointer;padding:0 0 6px;color:var(--ts-text-secondary)}.ts-modal-body{padding:16px}.ts-modal-footer{padding:16px;border-top:1px solid var(--ts-border-default);display:flex;justify-content:flex-end;gap:8px}@keyframes templateStudioFadeIn{0%{transform:scale(.95);opacity:0}to{transform:scale(1);opacity:1}}.ts-form-group{display:flex;flex-direction:column;gap:6px}.ts-label{font-size:13px;font-weight:500;color:var(--ts-text-secondary)}.ts-input{padding:8px 10px!important}.ts-error-text{font-size:12px;color:var(--ts-color-danger)}.ts-btn-modal{padding:6px 14px!important;border-radius:var(--ts-radius-sm);border:none!important;font-size:14px!important;cursor:pointer}.ts-btn-secondary{background:var(--ts-bg-surface);color:var(--ts-text-primary)}.ts-btn-primary{background:var(--ts-color-primary);color:var(--ts-text-inverse)}.ts-editor-modal-overlay{position:fixed;inset:0;background:#0f172a99;z-index:9999;display:flex;align-items:center;justify-content:center}.ts-editor-modal{width:95vw;height:95vh;background:var(--ts-bg-surface);border-radius:var(--ts-radius-lg);display:flex;flex-direction:column;box-shadow:var(--ts-shadow-md)}.ts-editor-modal-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--ts-border-default)}.ts-editor-close-btn{background:transparent;border:none;font-size:20px;cursor:pointer;color:var(--ts-text-secondary)}.ts-editor-close-btn:hover{color:var(--ts-text-primary)}.ts-editor-modal-body{flex:1;overflow-y:auto;overflow-x:hidden}.editor-container{flex:1}.ts-editor-modal--fullscreen{width:100vw;height:100vh;border-radius:0}.ts-editor-modal--fullscreen{box-shadow:none}.ts-editor-header-actions{display:flex;align-items:center;gap:8px}.ts-editor-fullscreen-btn{background:transparent;border:none;font-size:18px;cursor:pointer;padding:6px;border-radius:4px;color:var(--ts-text-secondary)}.ts-template-preview{flex:1;background:#f8fafc;overflow:hidden;height:100%}.ts-template-preview-frame{width:100%;height:100%;border:none;background:#fff}#stripoEditorContainer{height:calc(100% + -0px)}.editor-container{height:100vh;position:absolute;min-width:1200px;width:100%;overflow:auto}.root-widget .loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fffc;display:flex;justify-content:center;align-items:center;z-index:1000}.ts-form-group{display:flex;flex-direction:column;width:100%;margin-bottom:6px}.ts-form-label{font-size:13px;font-weight:500;margin-bottom:6px;color:var(--ts-text-secondary)}.ts-required{color:var(--ts-color-danger);margin-left:4px}.ts-error-text{margin-top:4px;font-size:12px;color:var(--ts-color-danger)}.ts-card{background:var(--ts-bg-surface)}.ts-card:hover{background:var(--ts-bg-surface)!important}.ts-card-body{padding:16px}.ts-card-body:hover,.ts-card-body form:hover,.template-list-container:hover{background:var(--ts-bg-surface)!important}.ts-row{display:flex;flex-wrap:wrap;gap:12px}.ts-col{flex:1;min-width:200px}.ts-flex-start{display:flex;gap:8px}.ts-actions{display:flex;justify-content:flex-end;align-items:flex-start;gap:8px}.ts-btn-light{background:transparent}.ts-spinner{width:12px;height:12px;border:2px solid var(--ts-border-strong);border-top:2px solid var(--ts-text-primary);border-radius:50%;display:inline-block;animation:ts-spin .6s linear infinite}@keyframes ts-spin{to{transform:rotate(360deg)}}.ts-template-name-col{position:relative;width:100%}.ts-template-name-col input[type=text]{width:100%;padding-right:42px;box-sizing:border-box}.template-favourite-btn{position:absolute;right:-32px;top:42%;transform:translateY(-50%);width:26px;height:26px;display:flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;z-index:2}.template-favourite-btn:hover:not(:disabled){background-color:#0000000d;border-radius:50%}.template-favourite-btn:disabled{opacity:.6;cursor:not-allowed}.template-favourite-btn{background:transparent!important;border:none!important;box-shadow:none!important;padding:0;margin-top:18px}.template-favourite-btn:hover,.template-favourite-btn:active,.template-favourite-btn:focus,.template-favourite-btn:focus-visible{background:transparent!important;box-shadow:none!important;outline:none!important}.template-favourite-btn:disabled{opacity:var(--ts-disabled-opacity);cursor:not-allowed}
1
+ @charset "UTF-8";.root-widget{--ts-color-primary: #131c45;--ts-color-primary-hover: rgb(13.4943181818, 19.8863636364, 49.0056818182);--ts-color-primary-active: rgb(10.1909090909, 15.0181818182, 37.0090909091);--ts-color-primary-text: #fff;--ts-white: #fff;--ts-gray-50: #f6f7fb;--ts-gray-100: #f6f7fb;--ts-gray-200: #eef2f7;--ts-gray-300: #dee2e6;--ts-gray-400: #ced4da;--ts-gray-500: #a1a9b1;--ts-gray-600: #8a969c;--ts-gray-700: #6c757d;--ts-gray-900: #313a46;--ts-bg-page: #fafbfe;--ts-bg-surface: #fff;--ts-bg-surface-hover: #f6f7fb;--ts-bg-muted: #eef2f7;--ts-bg-selected: rgb(219.6, 220.95, 227.1);--ts-text-primary: #6c757d;--ts-text-secondary: rgba(108, 117, 125, .75);--ts-text-muted: rgba(108, 117, 125, .75);--ts-text-inverse: #fff;--ts-border-default: #dee2e6;--ts-border-strong: #dee2e6;--ts-border-focus: #131c45;--ts-color-danger: #ff5b5b;--ts-color-danger-hover: rgb(255, 65.5, 65.5);--ts-color-success: #10c469;--ts-color-warning: #f9c851;--ts-color-info: #3d73dd;--ts-color-success-bg: rgb(219.15, 246.15, 232.5);--ts-color-success-text: #10c469;--ts-color-info-bg: rgb(235.6, 241, 251.6);--ts-color-info-text: #3d73dd;--ts-font-size-base: .9rem;--ts-font-size-sm: .875rem;--ts-font-size-lg: 1.251rem;--ts-font-size-small: .75rem;--ts-line-height-base: 1.5;--ts-font-weight-normal: 400;--ts-font-weight-semibold: 600;--ts-font-weight-bold: 700;--ts-input-height: 2.031rem;--ts-input-height-sm: 2.031rem;--ts-input-padding-y: .45rem;--ts-input-padding-x: .9rem;--ts-input-font-size: .9rem;--ts-input-border-radius: .25rem;--ts-input-border-radius-sm: .2rem;--ts-input-border-radius-lg: .3rem;--ts-input-transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;--ts-table-cell-padding-y: .95rem;--ts-table-cell-padding-x: .95rem;--ts-table-cell-padding-y-sm: .5rem;--ts-table-cell-padding-x-sm: .5rem;--ts-table-color: #6c757d;--ts-table-bg: transparent;--ts-table-border-color: #dee2e6;--ts-table-border-width: 1px;--ts-table-th-font-weight: ;--ts-btn-padding-y: .45rem;--ts-btn-padding-x: .9rem;--ts-btn-font-size: .9rem;--ts-btn-border-radius: .15rem;--ts-btn-box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);--ts-btn-box-shadow-primary: 0px 2px 6px 0px rgba($tp-primary, .5);--ts-btn-box-shadow-danger: 0px 2px 6px 0px rgba($tp-red, .5);--ts-btn-active-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);--ts-form-label-font-size: ;--ts-form-text-font-size: .75rem;--ts-spacer: 1.5rem;--ts-spacer-1: .375rem;--ts-spacer-2: .75rem;--ts-spacer-3: 1.5rem;--ts-spacer-4: 2.25rem;--ts-spacer-5: 3rem;--ts-col-min-width: 12.5rem;--ts-title-font-size: .936rem;--ts-line-height-tight: 1.25;--ts-shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);--ts-shadow-md: 0 0 35px 0 rgba(154, 161, 171, .15);--ts-radius-sm: .2rem;--ts-radius-md: .25rem;--ts-radius-lg: .3rem;--ts-focus-ring-primary: 0 0 0 3px rgba($tp-primary, .35);--ts-focus-ring-info: 0 0 0 2px rgba($tp-blue, .15);--ts-disabled-opacity: .65;--ts-transition-fast: .15s ease;--ts-popover-bg: #1e1e1e;--ts-popover-border: #444;--ts-popover-text: #f1f1f1;--ts-z-modal: 9999;--ts-z-modal-backdrop: 1050;--ts-z-toast: 1090;--ts-z-dropdown: 1000;--bs-form-invalid-border-color: #ff5b5b}.root-widget{margin:0;font-family:Nunito,Nunito Bold,sans-serif;font-size:.9rem;line-height:1.5;font-weight:400;color:#6c757d;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.root-widget .ng-star-inserted{display:none}.root-widget .wraped-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.root-widget .required:after{content:" *";color:var(--ts-color-danger)}.root-widget .loader-container{display:flex;justify-content:center;align-items:center;height:100vh;width:100vw}.root-widget .info-icon{height:14px}.root-widget .info-icon img{width:100%;height:100%}.root-widget .ts-label-height{height:16.5px!important}.ts-modal-title{margin:0;font-size:1.125rem;font-weight:700;color:var(--ts-text-primary);line-height:1.1}.ts-btn{padding:.45rem .9rem!important;border-radius:.15rem!important;border:none!important;cursor:pointer;font-size:11px!important;font-weight:400;line-height:1.5;letter-spacing:.01em;-webkit-user-select:none;user-select:none;white-space:nowrap;box-shadow:0 .125rem .25rem #00000013;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-btn-primary{background:var(--ts-color-primary);color:var(--ts-text-inverse);box-shadow:0 2px 6px #131c4580}.ts-btn-primary:hover{color:#fff;background-color:#10183b;border-color:#0f1637}.ts-btn-primary:focus{outline:none;box-shadow:var(--ts-focus-ring-primary)}.ts-btn-primary:active{background:var(--ts-color-primary-active);box-shadow:0 2px 6px #131c4580}.ts-input{padding:.45rem .9rem;font-size:11px!important;line-height:1.5;border-radius:.25rem;border:1px solid #dee2e6;outline:none;color:#6c757d;background:#fff;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-input:focus{outline:none;box-shadow:none}.ts-input-error{border-color:var(--ts-color-danger)}.ts-btn-danger{background:var(--ts-color-danger);color:var(--ts-text-inverse);box-shadow:0 2px 6px #ff5b5b80;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-btn-danger:hover{background:var(--ts-color-danger-hover)}.ts-btn-danger:focus,.ts-btn-danger:focus-visible{outline:none;box-shadow:0 0 0 3px #ff5b5b59}.ts-btn-danger:active{background:var(--ts-color-danger-hover);box-shadow:inset 0 3px 5px #00000020}.ts-btn-danger:disabled,.ts-btn-danger[disabled]{opacity:var(--ts-disabled-opacity);cursor:not-allowed;box-shadow:none}.root-widget .react-select__control{max-height:2.031rem!important;font-size:.9rem;font-family:Nunito,Nunito Bold,sans-serif;border-radius:.25rem;border-color:#dee2e6}.root-widget .react-select__control--is-focused{box-shadow:none}.root-widget .react-select__single-value,.root-widget .react-select__placeholder{font-size:11px!important;margin-top:2px!important}.dark-popover{left:50%;transform:translate(-50%) translateY(-8px);z-index:1070;width:50px!important;font-size:.875rem!important;padding:.375rem 1.5rem;background-color:var(--ts-popover-bg)!important;color:var(--ts-popover-text);border:1px solid var(--ts-popover-border);border-radius:.25rem;box-shadow:0 0 35px #9aa1ab26}.dark-popover.bs-popover-top>.popover-arrow:before,.dark-popover.bs-popover-bottom>.popover-arrow:before,.dark-popover.bs-popover-left>.popover-arrow:before,.dark-popover.bs-popover-right>.popover-arrow:before{border-color:transparent!important}.dark-popover.bs-popover-top>.popover-arrow:after{border-top-color:var(--ts-popover-bg)!important}.dark-popover.bs-popover-bottom>.popover-arrow:after{border-bottom-color:var(--ts-popover-bg)!important}.dark-popover.bs-popover-left>.popover-arrow:after{border-left-color:var(--ts-popover-bg)!important}.dark-popover.bs-popover-right>.popover-arrow:after{border-right-color:var(--ts-popover-bg)!important}.root-widget .logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.root-widget .logo:hover{filter:drop-shadow(0 0 2em rgba(100,108,255,.6666666667))}.root-widget .logo.react:hover{filter:drop-shadow(0 0 2em rgba(97,218,251,.6666666667))}.root-widget .requiredField:after{content:"";font-family:FontAwesome;position:absolute;left:10px;top:10px;color:red}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.root-widget .card{padding:.5rem}.root-widget .read-the-docs{color:#6c757dbf}.root-widget .row{margin:0!important}.root-widget{--tp-input-border-color: #dee2e6 !important}.root-widget .react-select__value-container{padding:.28rem .8rem;height:2.031rem!important}.root-widget .react-select__input-container{margin:0!important;padding-bottom:0!important}.root-widget .react-select__input-container input{font-size:11px!important}.root-widget .btn-padding{padding-top:2rem}.ts-modal-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1050}.ts-modal{background:#fff;width:600px;max-width:95vw;border-radius:.3rem;border:1px solid transparent;box-shadow:0 0 35px #9aa1ab26;animation:templateStudioFadeIn transform .3s ease-out;z-index:9999}.ts-modal-message{margin:0!important;font-size:11px}.ts-modal-header{padding:1rem;border-bottom:1px solid #dee2e6;display:flex;justify-content:space-between;align-items:center}.ts-modal-header button{background:none;border:none;font-size:1.251rem;cursor:pointer;padding:0;color:#6c757dbf}.ts-modal-body{padding:.5rem}.ts-modal-footer{padding:1rem;border-top:1px solid #dee2e6;display:flex;justify-content:flex-end;gap:.5rem}@keyframes templateStudioFadeIn{0%{transform:translateY(-50px);opacity:0}to{transform:none;opacity:1}}.ts-form-group{display:flex;flex-direction:column}.ts-label{font-size:.875rem;font-weight:600;color:var(--ts-text-secondary);margin-bottom:.5rem}.ts-required{color:var(--ts-color-danger);margin-left:4px}.ts-input{padding:.45rem .9rem!important}.ts-error-text{font-size:.75rem;color:var(--ts-color-danger);margin-top:.25rem}.ts-btn-modal{padding:.28rem .9rem!important;border-radius:.2rem;border:none!important;font-size:.875rem!important;cursor:pointer;box-shadow:0 .125rem .25rem #00000013;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-btn-modal:active{box-shadow:inset 0 3px 5px #00000020}.ts-btn-secondary{background:var(--ts-bg-surface);color:var(--ts-text-primary);box-shadow:0 .125rem .25rem #00000013}.ts-btn-secondary:hover{box-shadow:none}.ts-btn-secondary:active{box-shadow:inset 0 3px 5px #00000020}.ts-loader{border-radius:50rem;border:3px solid #dee2e6;border-top-color:var(--ts-color-primary);animation:ts-spin .8s linear infinite}.ts-loader-sm{width:1rem;height:1rem}.ts-loader-md{width:1.5rem;height:1.5rem}.ts-loader-lg{width:2.5rem;height:2.5rem}.ts-loader-center{display:flex;align-items:center;justify-content:center;padding:2.25rem}.ts-loader-overlay{position:fixed;inset:0;background:#ffffffd9;display:flex;align-items:center;justify-content:center;z-index:9999}@keyframes ts-spin{to{transform:rotate(360deg)}}.ts-page{background:transparent;min-height:100%;font-family:Nunito,Nunito Bold,sans-serif!important;font-size:.9rem;padding-top:10px!important}.ts-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding:0 1.5rem;padding-right:0!important}.ts-title{font-size:1.125rem;font-weight:700;color:var(--ts-text-primary)}.ts-table-wrapper{background:#fff;overflow:visible}.ts-table{width:100%;border-collapse:collapse;--tp-table-color: #6c757d;--tp-table-bg: #f6f7fb;--tp-table-border-color: #dee2e6;color:var(--tp-table-color)}.ts-table th,.ts-table td{border-bottom:1px solid #eef2f7;font-size:11px;vertical-align:middle}.ts-table td{background-color:#fff;padding:.25rem .5rem}.ts-table th{color:#313a46;text-align:left;background-color:#eef2f7;font-weight:600;padding:.438rem .5rem}.ts-table td{color:var(--tp-table-color);background-color:#fff}.ts-name-cell{display:inline-flex;align-items:center;gap:6px;width:auto;max-width:100%}.ts-table td:first-child,.ts-table th:first-child{width:1%;white-space:nowrap}.ts-cursor-default{cursor:default!important}.ts-badge{font-size:11px;padding:0px .5rem;border-radius:50rem}.ts-badge.default{background:var(--ts-color-success-bg);color:var(--ts-color-success-text)}.ts-badge.custom{background:var(--ts-color-info-bg);color:var(--ts-color-info-text)}.align-right{text-align:right}.ts-actions-btn{background:transparent;border:none;font-size:1.251rem;cursor:pointer;padding:0!important}.ts-menu-item{width:100%;padding:.375rem 1.5rem;background:none;border:none!important;border-radius:0!important;text-align:left;font-size:.9rem;color:#6c757d;cursor:pointer}.ts-menu-item:hover,.ts-menu-item:focus-visible{background:#f6f7fb;color:#6c757d;outline:none}.ts-menu-item.danger{color:#ff5b5b}.ts-search-container{background-color:#fff}.ts-search-container-inner{padding:1.5rem}.ts-search{margin-bottom:.75rem}.ts-search-box{display:flex;align-items:center;width:17.075rem;height:2.031rem;background:#fff;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-search-box input{flex:1;width:14.55rem;border:1px solid #dee2e6;border-radius:.25rem;padding:.45rem .9rem!important;font-size:11px;line-height:1.5;color:#6c757d;outline:none;border-top-right-radius:0;border-bottom-right-radius:0}.ts-search-box input::placeholder{color:#6c757dbf}.ts-clear-btn{display:flex;align-items:center;justify-content:center;width:2.5rem;height:100%;border:none!important;background:transparent;color:#6c757dbf;cursor:pointer;padding:0!important;font-size:1.251rem!important;box-shadow:0 2px 6px #131c4580}.ts-clear-btn:hover{color:var(--ts-text-secondary);border:none!important}.ts-search-btn{width:2.58rem;height:100%;border:none!important;background:var(--ts-color-primary);color:var(--ts-text-inverse);cursor:pointer;padding:0 .9rem!important;font-size:.9rem;display:flex;align-items:center;justify-content:center;border-radius:.15rem;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 2px 6px #131c4580;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-search-btn:hover{color:#fff;background-color:#10183b;border-color:#0f1637}.ts-search-btn:active{background:var(--ts-color-primary-active);box-shadow:0 2px 6px #131c4580}.ts-search-btn:focus{outline:none}.ts-actions-menu{position:absolute;top:70%;right:0;margin-top:.25rem;background:#fff;border:1px solid #dee2e6;border-radius:.25rem;box-shadow:0 0 35px #9aa1ab26;z-index:1000;opacity:0;transform:scale(.95);pointer-events:none;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-actions-menu.open{opacity:1;transform:scale(1);pointer-events:auto}.ts-actions-wrapper{position:relative;display:inline-flex;align-items:center}.ts-actions-btn:hover{border-color:transparent!important}.ts-table th{cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:700}.ts-table .ts-sortable:hover{background-color:var(--ts-bg-muted)}.ts-th-sort{display:flex;align-items:center;justify-content:space-between}.ts-sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.ts-sort-icons{margin-left:.25rem;display:flex!important;flex-direction:column;font-size:.75rem;line-height:1}.ts-sort-icons span{color:#6c757dbf}.ts-sort-icons span.active{color:var(--ts-color-primary)}.ts-fav-btn{border:none;background:transparent;cursor:pointer;padding:.14rem;display:flex;align-items:center}.ts-fav-btn:disabled{opacity:.5;cursor:not-allowed}.ts-card{background:#fff;box-shadow:0 0 35px #9aa1ab26;border-radius:.25rem}.ts-card:hover{background:#fff!important}.ts-card-body{padding:1.5rem}.ts-card-body:hover,.ts-card-body form:hover,.template-list-container:hover{background:#fff!important}.ts-row{display:flex;flex-wrap:wrap;gap:1.125rem}.ts-col{flex:1;min-width:200px}.ts-flex-start{display:flex;gap:.75rem}.ts-actions{display:flex;justify-content:flex-end;align-items:flex-start;gap:.75rem}.ts-btn-light{background:transparent}.ts-spinner{width:1rem;height:1rem;border:2px solid #dee2e6;border-top-color:#6c757d;border-radius:50rem;display:inline-block;animation:ts-spin .6s linear infinite}.ts-template-name-col{position:relative;width:100%}.ts-template-name-col input[type=text]{width:100%;padding-right:3.75rem;box-sizing:border-box}.ts-favourite-icon{position:absolute;right:-2rem;top:65%;transform:translateY(-50%);width:1.625rem;height:1.625rem;display:flex;align-items:center;justify-content:center;background:transparent;border:none;z-index:1020}.ts-form-label{font-size:.875rem;font-weight:600;margin-bottom:.5rem;color:#6c757dbf}.ts-form-group{margin-bottom:.25rem}.ts-editor-modal-overlay{position:fixed;inset:0;background:#00000080;z-index:9999;display:flex;align-items:center;justify-content:center}.ts-editor-modal{width:95vw;height:95vh;background:#fff;border-radius:.3rem;border:1px solid transparent;display:flex;flex-direction:column;box-shadow:0 0 35px #9aa1ab26}.ts-editor-modal-header{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid #dee2e6}.ts-editor-close-btn{background:transparent;border:none;font-size:.936rem;cursor:pointer;color:#6c757dbf;padding:6px!important}.ts-editor-close-btn:hover{color:#6c757d}.ts-editor-modal-body{flex:1;overflow-y:auto;overflow-x:hidden}.editor-container{flex:1}.ts-editor-modal--fullscreen{width:100vw;height:100vh;border-radius:0;box-shadow:none}.ts-editor-header-actions{display:flex;align-items:center;gap:.75rem}.ts-editor-fullscreen-btn{background:transparent;border:none;cursor:pointer;border-radius:.25rem;color:#6c757dbf;padding:0!important}.ts-template-preview{flex:1;background:#f6f7fb;overflow:hidden;height:100%}.ts-template-preview-frame{width:100%;height:100%;border:none;background:#fff}#stripoEditorContainer{height:calc(100% - 10px)}.root-widget .editor-container{height:100vh!important}.root-widget .loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#ffffffd9;display:flex;justify-content:center;align-items:center;z-index:1030}.ts-toast{position:fixed;top:.75rem;right:.75rem;min-width:260px;max-width:350px;padding:.5rem .75rem;border-radius:.25rem;border:1px solid #dee2e6;display:flex;align-items:center;justify-content:space-between;gap:1.5rem;font-size:.875rem;color:#fff;box-shadow:0 0 35px #9aa1ab26;animation:slide-in .25s ease;z-index:1090;font-family:Nunito,Nunito Bold,sans-serif!important}@keyframes slide-in{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.ts-toast-success{background:#10c469}.ts-toast-error{background:#ff5b5b}.ts-toast-warning{background:#f9c851}.ts-toast-info{background:#3d73dd}.ts-toast-close{background:none;border:none!important;color:#fff;font-size:1.251rem;cursor:pointer}.ts-pagination-bar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:.5rem .95rem;background:#fff;font-size:11px;color:#6c757d}.ts-page-container{display:flex;align-items:center;gap:1.5rem;justify-self:start}.ts-page-size,.ts-page-info,.ts-go-to{display:flex;align-items:center;gap:.25rem;white-space:nowrap}.ts-page-size,.ts-go-to{color:#6c757dbf}.ts-page-info{color:#6c757d}.ts-page-info span,.ts-go-to span,.ts-total span{font-weight:600}.ts-page-size select{height:36.6px!important;width:84px!important;font-size:.9rem!important}.ts-page-size label{font-size:11px;font-weight:600}.ts-page-size select,.ts-go-to input{height:2.031rem;padding:0 .8rem;font-size:11px;border:1px solid #dee2e6;border-radius:.25rem;background-color:#fff;color:#6c757d;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-go-to input{width:59.14px!important;height:32.5px!important;text-align:center;padding:0!important}.ts-page-size select:focus,.ts-go-to input:focus{outline:none;border-color:#dee2e6;box-shadow:none}.ts-total{justify-self:center;font-size:11px;color:#6c757d}.ts-page-buttons{display:flex;align-items:center;gap:.375rem;justify-self:end}.ts-page-buttons button{min-width:2rem;height:2.031rem;padding:0 .8rem;border-radius:1.875rem;border:none;border-radius:30px;background:transparent;font-size:11px;color:#131c45!important;cursor:pointer;box-shadow:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.ts-page-buttons button:hover:not(:disabled):not(.active){background-color:#f6f7fb;box-shadow:none;cursor:pointer}.ts-page-buttons button.active{background-color:#131c45;color:#fff!important;border-color:#131c45;box-shadow:none}.ts-page-buttons button:focus-visible{outline:none;box-shadow:none}.ts-page-buttons button:disabled{border-color:#dee2e6;color:#6c757dbf;box-shadow:none;cursor:default}@media (max-width: 767.98px){.ts-pagination-bar{grid-template-columns:1fr;row-gap:1.125rem}.ts-total,.ts-page-buttons{justify-self:start}}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ type SortKey = "name" | "category" | "type" | "subtype" | "companyName" | "lastUpdatedBy" | "lastUpdatedOn" | "templateId" | null;
3
+ interface SortableThProps {
4
+ label: string;
5
+ sortKey: NonNullable<SortKey>;
6
+ sortBy: SortKey;
7
+ sortOrder: "asc" | "desc";
8
+ onSort: (key: SortKey) => void;
9
+ }
10
+ declare const SortableTh: React.FC<SortableThProps>;
11
+ export default SortableTh;
@@ -1,4 +1,3 @@
1
- import "./template-list.css";
2
1
  import type { ITemplatesList, ITemplateTypes } from "../../queries/types";
3
2
  export interface ChainNode {
4
3
  id: number;
@@ -1,4 +1,3 @@
1
- import "./pagination.css";
2
1
  interface PaginationProps {
3
2
  page: number;
4
3
  pageSize: number;
@@ -1,4 +1,3 @@
1
- import "./template-list.css";
2
1
  import type { ITemplateWithChain } from ".";
3
2
  interface TemplateRowProps {
4
3
  template: ITemplateWithChain;
@@ -8,7 +7,8 @@ interface TemplateRowProps {
8
7
  onDuplicate: (template: ITemplateWithChain) => void;
9
8
  onRemove: (template: ITemplateWithChain) => void;
10
9
  onPreview: (template: ITemplateWithChain) => void;
10
+ onRefresh: () => void;
11
11
  }
12
- declare function TemplateRow({ template, openActionId, setOpenActionId, onEdit, onDuplicate, onRemove, onPreview }: TemplateRowProps): import("react/jsx-runtime").JSX.Element;
12
+ declare function TemplateRow({ template, openActionId, setOpenActionId, onEdit, onDuplicate, onRemove, onPreview, onRefresh, }: TemplateRowProps): import("react/jsx-runtime").JSX.Element;
13
13
  declare const _default: import("react").MemoExoticComponent<typeof TemplateRow>;
14
14
  export default _default;
@@ -1,4 +1,3 @@
1
- import "./editor-style.css";
2
1
  import type { stripoData } from "../../type/application-type";
3
2
  interface IproposalEditorProps {
4
3
  templateHTML?: stripoData;
@@ -1,4 +1,3 @@
1
- import "./editormodal.css";
2
1
  import type { ITemplate, ITemplatesList, ITemplateTypes } from "../../queries/types";
3
2
  import type { EditorModalVariant } from "../../type/application-type";
4
3
  interface EditorModalProps {
@@ -1,6 +1,5 @@
1
1
  import React, { type ReactElement } from "react";
2
2
  import type { FieldErrors } from "react-hook-form";
3
- import "./forminput.css";
4
3
  export type HasId = {
5
4
  id: string;
6
5
  };
@@ -1,6 +1,5 @@
1
1
  import React, { type InputHTMLAttributes } from "react";
2
2
  import type { FieldErrors } from "react-hook-form";
3
- import "./forminput.css";
4
3
  interface TextBoxProps extends InputHTMLAttributes<HTMLInputElement> {
5
4
  label?: string;
6
5
  error?: FieldErrors | undefined;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface DownIconProps extends React.SVGProps<SVGSVGElement> {
3
+ fill?: string;
4
+ }
5
+ declare const DownIcon: React.FC<DownIconProps>;
6
+ export default DownIcon;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface EllipsisVerticalIconProps extends React.SVGProps<SVGSVGElement> {
3
+ fill?: string;
4
+ }
5
+ declare const EllipsisVerticalIcon: React.FC<EllipsisVerticalIconProps>;
6
+ export default EllipsisVerticalIcon;
@@ -0,0 +1,2 @@
1
+ declare const MaximizeIcon: React.FC<React.SVGProps<SVGSVGElement>>;
2
+ export default MaximizeIcon;
@@ -0,0 +1,2 @@
1
+ declare const RestoreIcon: React.FC<React.SVGProps<SVGSVGElement>>;
2
+ export default RestoreIcon;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface UpIconProps extends React.SVGProps<SVGSVGElement> {
3
+ fill?: string;
4
+ }
5
+ declare const UpIcon: React.FC<UpIconProps>;
6
+ export default UpIcon;
@@ -1,4 +1,3 @@
1
- import "./loader.css";
2
1
  interface LoaderProps {
3
2
  size?: "sm" | "md" | "lg";
4
3
  center?: boolean;
@@ -1,5 +1,4 @@
1
1
  import type { ModalVariant } from "../../type/application-type";
2
- import "./modal.css";
3
2
  interface AppModalProps {
4
3
  show: boolean;
5
4
  variant: ModalVariant;
@@ -1,4 +1,3 @@
1
- import "./notification.css";
2
1
  import type { NotificationType } from "../../type/application-type";
3
2
  export interface NotificationProps {
4
3
  message: string;
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import type { ITemplate, ITemplatesList, ITemplateTypes } from "../../queries/types";
3
3
  import type { EditorModalVariant } from "../../type/application-type";
4
- import "./templateform.css";
5
4
  interface ITemplateFormProps {
6
5
  onReset: () => void;
7
6
  editorInitialized?: boolean;
@@ -1,3 +1,2 @@
1
- import "./style.css";
2
- import "./editor-style.css";
1
+ import "./styles/main.scss";
3
2
  export { EditorWidget } from "./component/widget";
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Home: React.FC;
3
+ export default Home;
@@ -13,6 +13,8 @@ export type ITemplatesList = {
13
13
  updatedDateTime: string;
14
14
  updatedByName: string;
15
15
  html: string;
16
+ css?: string;
17
+ companyName?: string;
16
18
  };
17
19
  export type ITemplate = {
18
20
  templateID: string;
@@ -7,3 +7,4 @@ export declare function groupBy(array: any[]): {
7
7
  data: any[];
8
8
  }[];
9
9
  export declare function groupByLevel(array: any[], level: number): any[];
10
+ export declare const formatToMMDDYY: (dateString?: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enerex/template-studio",
3
- "version": "1.1.40",
3
+ "version": "1.1.43",
4
4
  "main": "./dist/enerex-template-editor.umd.js",
5
5
  "module": "./dist/enerex-template-editor.es.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -20,21 +20,22 @@
20
20
  "build": "vite build && tsc"
21
21
  },
22
22
  "peerDependencies": {
23
- "react": ">=16.14.0 <20",
24
- "react-dom": ">=16.14.0 <20",
25
23
  "@tanstack/react-query": "^4 || ^5",
26
24
  "axios": "^0.21.1 || ^1",
27
25
  "bootstrap": ">=5.0.2 <6",
26
+ "react": ">=16.14.0 <20",
28
27
  "react-bootstrap": ">=2.2.0 <3",
28
+ "react-dom": ">=16.14.0 <20",
29
29
  "react-hook-form": ">=7 <8",
30
30
  "react-router-dom": ">=6 <7",
31
31
  "react-select": ">=5 <6"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@vitejs/plugin-react": "^4.0.0",
35
+ "raw-loader": "^4.0.2",
36
+ "sass-embedded": "^1.97.3",
35
37
  "typescript": "^5.0.0",
36
- "vite": "^7.0.5",
37
- "raw-loader": "^4.0.2"
38
+ "vite": "^7.0.5"
38
39
  },
39
40
  "author": "Rahul",
40
41
  "license": "MIT",