lula2 0.5.1 → 0.6.1
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.
- package/dist/_app/immutable/chunks/{R1gz3SOr.js → BXUi170M.js} +1 -1
- package/dist/_app/immutable/chunks/{BNbzyHlf.js → BaNghdtJ.js} +1 -1
- package/dist/_app/immutable/chunks/{CWggGNM7.js → C43miErR.js} +1 -1
- package/dist/_app/immutable/chunks/CIUsQQm2.js +65 -0
- package/dist/_app/immutable/chunks/{CPEw6sZY.js → CRa0j_Fx.js} +1 -1
- package/dist/_app/immutable/chunks/{CXdZVXJf.js → Cq7PwVfU.js} +1 -1
- package/dist/_app/immutable/chunks/DTWPdvjs.js +2 -0
- package/dist/_app/immutable/chunks/{zYrdvxnm.js → WlyXjfrM.js} +1 -1
- package/dist/_app/immutable/chunks/{GToHgjp8.js → e7OeeeKP.js} +1 -1
- package/dist/_app/immutable/entry/{app.DMBX4AyV.js → app.DW8m8_kr.js} +2 -2
- package/dist/_app/immutable/entry/start.BstRoW_s.js +1 -0
- package/dist/_app/immutable/nodes/{0.ePBNOec_.js → 0.DIHiDqse.js} +1 -1
- package/dist/_app/immutable/nodes/{1.BjVPQIpm.js → 1.DyuqnWpt.js} +1 -1
- package/dist/_app/immutable/nodes/{2.DAjmdkWJ.js → 2.DCVMr5cE.js} +1 -1
- package/dist/_app/immutable/nodes/{3.C42QL2CH.js → 3.CRa3NPUY.js} +1 -1
- package/dist/_app/immutable/nodes/{4.BKr3XX2Z.js → 4.BIaoIDIb.js} +1 -1
- package/dist/_app/version.json +1 -1
- package/dist/cli/commands/crawl.js +53 -1
- package/dist/index.html +10 -10
- package/dist/index.js +52 -1
- package/package.json +1 -1
- package/src/lib/components/controls/ControlsList.svelte +82 -9
- package/src/lib/components/ui/FilterBuilder.svelte +167 -27
- package/src/lib/types.ts +1 -0
- package/src/stores/compliance.ts +13 -0
- package/dist/_app/immutable/chunks/Bvop-7hR.js +0 -2
- package/dist/_app/immutable/chunks/y6toZMLe.js +0 -65
- package/dist/_app/immutable/entry/start.CXGxkyju.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l,m,t as p,E as _,v,w as h,x as s,y as b,z as x,A as y}from"./
|
|
1
|
+
import{l,m,t as p,E as _,v,w as h,x as s,y as b,z as x,A as y}from"./DTWPdvjs.js";function g(d,i,u){l&&m();var r=d,n,e,a=null,f=null;function t(){e&&(y(e),e=null),a&&(a.lastChild.remove(),r.before(a),a=null),e=f,f=null}p(()=>{if(n!==(n=i())){var c=b();if(n){var o=r;c&&(a=document.createDocumentFragment(),a.append(o=v()),e&&s.skipped_effects.add(e)),f=h(()=>u(o,n))}c?s.add_callback(t):t()}},_),l&&(r=x)}export{g as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{O as K,l as m,at as Me,v as de,m as Oe,t as re,h as te,a3 as Ie,L as We,M as De,N as ie,P as R,z as L,au as Le,av as Ue,w as H,y as Pe,x as W,aw as ve,ax as he,T as Re,ab as oe,ay as le,Q as pe,A as $e,az as B,aA as X,aB as V,aC as J,aD as He,aE as Ve,aF as qe,aG as Fe,aH as Ye,a1 as Be,q as we,aI as be,aJ as Je,i as ne,aK as se,aL as ze,aM as Ge,X as Ke,aN as Xe,aO as Qe,aP as Ze,aQ as je,aR as xe,aS as et,aT as tt,U as at,aU as rt,aV as nt,aW as st,aX as it,aY as ot,aZ as lt,ai as ct,k as ge,j as _e,a_ as ft,a$ as ut}from"./
|
|
1
|
+
import{O as K,l as m,at as Me,v as de,m as Oe,t as re,h as te,a3 as Ie,L as We,M as De,N as ie,P as R,z as L,au as Le,av as Ue,w as H,y as Pe,x as W,aw as ve,ax as he,T as Re,ab as oe,ay as le,Q as pe,A as $e,az as B,aA as X,aB as V,aC as J,aD as He,aE as Ve,aF as qe,aG as Fe,aH as Ye,a1 as Be,q as we,aI as be,aJ as Je,i as ne,aK as se,aL as ze,aM as Ge,X as Ke,aN as Xe,aO as Qe,aP as Ze,aQ as je,aR as xe,aS as et,aT as tt,U as at,aU as rt,aV as nt,aW as st,aX as it,aY as ot,aZ as lt,ai as ct,k as ge,j as _e,a_ as ft,a$ as ut}from"./DTWPdvjs.js";function yt(e,t){return t}function dt(e,t,a){for(var r=e.items,n=[],s=t.length,o=0;o<s;o++)qe(t[o].e,n,!0);var f=s>0&&n.length===0&&a!==null;if(f){var h=a.parentNode;Fe(h),h.append(a),r.clear(),M(e,t[0].prev,t[s-1].next)}Ye(n,()=>{for(var v=0;v<s;v++){var b=t[v];f||(r.delete(b.k),M(e,b.prev,b.next)),V(b.e,!f)}})}function Tt(e,t,a,r,n,s=null){var o=e,f={flags:t,items:new Map,first:null},h=(t&be)!==0;if(h){var v=e;o=m?K(Me(v)):v.appendChild(de())}m&&Oe();var b=null,g=!1,u=new Map,k=Ie(()=>{var S=a();return he(S)?S:S==null?[]:ve(S)}),c,p;function d(){vt(p,c,f,u,o,n,t,r,a),s!==null&&(c.length===0?b?pe(b):b=H(()=>s(o)):b!==null&&$e(b,()=>{b=null}))}re(()=>{p??=Be,c=te(k);var S=c.length;if(g&&S===0)return;g=S===0;let E=!1;if(m){var y=We(o)===De;y!==(S===0)&&(o=ie(),K(o),R(!1),E=!0)}if(m){for(var _=null,A,i=0;i<S;i++){if(L.nodeType===Le&&L.data===Ue){o=L,E=!0,R(!1);break}var l=c[i],w=r(l,i);A=ae(L,f,_,null,l,w,i,n,t,a),f.items.set(w,A),_=A}S>0&&K(ie())}if(m)S===0&&s&&(b=H(()=>s(o)));else if(Pe()){var T=new Set,C=W;for(i=0;i<S;i+=1){l=c[i],w=r(l,i);var O=f.items.get(w)??u.get(w);O?(t&(J|B))!==0&&Se(O,l,i,t):(A=ae(null,f,null,null,l,w,i,n,t,a,!0),u.set(w,A)),T.add(w)}for(const[N,q]of f.items)T.has(N)||C.skipped_effects.add(q.e);C.add_callback(d)}else d();E&&R(!0),te(k)}),m&&(o=L)}function vt(e,t,a,r,n,s,o,f,h){var v=(o&Je)!==0,b=(o&(J|B))!==0,g=t.length,u=a.items,k=a.first,c=k,p,d=null,S,E=[],y=[],_,A,i,l;if(v)for(l=0;l<g;l+=1)_=t[l],A=f(_,l),i=u.get(A),i!==void 0&&(i.a?.measure(),(S??=new Set).add(i));for(l=0;l<g;l+=1){if(_=t[l],A=f(_,l),i=u.get(A),i===void 0){var w=r.get(A);if(w!==void 0){r.delete(A),u.set(A,w);var T=d?d.next:c;M(a,d,w),M(a,w,T),Q(w,T,n),d=w}else{var C=c?c.e.nodes_start:n;d=ae(C,a,d,d===null?a.first:d.next,_,A,l,s,o,h)}u.set(A,d),E=[],y=[],c=d.next;continue}if(b&&Se(i,_,l,o),(i.e.f&X)!==0&&(pe(i.e),v&&(i.a?.unfix(),(S??=new Set).delete(i))),i!==c){if(p!==void 0&&p.has(i)){if(E.length<y.length){var O=y[0],N;d=O.prev;var q=E[0],z=E[E.length-1];for(N=0;N<E.length;N+=1)Q(E[N],O,n);for(N=0;N<y.length;N+=1)p.delete(y[N]);M(a,q.prev,z.next),M(a,d,q),M(a,z,O),c=O,d=z,l-=1,E=[],y=[]}else p.delete(i),Q(i,c,n),M(a,i.prev,i.next),M(a,i,d===null?a.first:d.next),M(a,d,i),d=i;continue}for(E=[],y=[];c!==null&&c.k!==A;)(c.e.f&X)===0&&(p??=new Set).add(c),y.push(c),c=c.next;if(c===null)continue;i=c}E.push(i),d=i,c=i.next}if(c!==null||p!==void 0){for(var D=p===void 0?[]:ve(p);c!==null;)(c.e.f&X)===0&&D.push(c),c=c.next;var G=D.length;if(G>0){var Te=(o&be)!==0&&g===0?n:null;if(v){for(l=0;l<G;l+=1)D[l].a?.measure();for(l=0;l<G;l+=1)D[l].a?.fix()}dt(a,D,Te)}}v&&we(()=>{if(S!==void 0)for(i of S)i.a?.apply()}),e.first=a.first&&a.first.e,e.last=d&&d.e;for(var Ne of r.values())V(Ne.e);r.clear()}function Se(e,t,a,r){(r&J)!==0&&le(e.v,t),(r&B)!==0?le(e.i,a):e.i=a}function ae(e,t,a,r,n,s,o,f,h,v,b){var g=(h&J)!==0,u=(h&He)===0,k=g?u?Re(n,!1,!1):oe(n):n,c=(h&B)===0?o:oe(o),p={i:c,v:k,k:s,a:null,e:null,prev:a,next:r};try{if(e===null){var d=document.createDocumentFragment();d.append(e=de())}return p.e=H(()=>f(e,k,c,v),m),p.e.prev=a&&a.e,p.e.next=r&&r.e,a===null?b||(t.first=p):(a.next=p,a.e.next=p.e),r!==null&&(r.prev=p,r.e.prev=p.e),p}finally{}}function Q(e,t,a){for(var r=e.next?e.next.e.nodes_start:a,n=t?t.e.nodes_start:a,s=e.e.nodes_start;s!==null&&s!==r;){var o=Ve(s);n.before(s),s=o}}function M(e,t,a){t===null?e.first=a:(t.next=a,t.e.next=a&&a.e),a!==null&&(a.prev=t,a.e.prev=t&&t.e)}function ht(e,t){var a=void 0,r;re(()=>{a!==(a=t())&&(r&&(V(r),r=null),a&&(r=H(()=>{ne(()=>a(e))})))})}function Ce(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(a=Ce(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function pt(){for(var e,t,a=0,r="",n=arguments.length;a<n;a++)(e=arguments[a])&&(t=Ce(e))&&(r&&(r+=" "),r+=t);return r}function wt(e){return typeof e=="object"?pt(e):e??""}const ce=[...`
|
|
2
2
|
\r\f \v\uFEFF`];function bt(e,t,a){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),a){for(var n in a)if(a[n])r=r?r+" "+n:n;else if(r.length)for(var s=n.length,o=0;(o=r.indexOf(n,o))>=0;){var f=o+s;(o===0||ce.includes(r[o-1]))&&(f===r.length||ce.includes(r[f]))?r=(o===0?"":r.substring(0,o))+r.substring(f+1):o=f}}return r===""?null:r}function fe(e,t=!1){var a=t?" !important;":";",r="";for(var n in e){var s=e[n];s!=null&&s!==""&&(r+=" "+n+": "+s+a)}return r}function Z(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function gt(e,t){if(t){var a="",r,n;if(Array.isArray(t)?(r=t[0],n=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,o=0,f=!1,h=[];r&&h.push(...Object.keys(r).map(Z)),n&&h.push(...Object.keys(n).map(Z));var v=0,b=-1;const p=e.length;for(var g=0;g<p;g++){var u=e[g];if(f?u==="/"&&e[g-1]==="*"&&(f=!1):s?s===u&&(s=!1):u==="/"&&e[g+1]==="*"?f=!0:u==='"'||u==="'"?s=u:u==="("?o++:u===")"&&o--,!f&&s===!1&&o===0){if(u===":"&&b===-1)b=g;else if(u===";"||g===p-1){if(b!==-1){var k=Z(e.substring(v,b).trim());if(!h.includes(k)){u!==";"&&g++;var c=e.substring(v,g).trim();a+=" "+c+";"}}v=g+1,b=-1}}}}return r&&(a+=fe(r)),n&&(a+=fe(n,!0)),a=a.trim(),a===""?null:a}return e==null?null:String(e)}function _t(e,t,a,r,n,s){var o=e.__className;if(m||o!==a||o===void 0){var f=bt(a,r,s);(!m||f!==e.getAttribute("class"))&&(f==null?e.removeAttribute("class"):t?e.className=f:e.setAttribute("class",f)),e.__className=a}else if(s&&n!==s)for(var h in s){var v=!!s[h];(n==null||v!==!!n[h])&&e.classList.toggle(h,v)}return s}function j(e,t={},a,r){for(var n in a){var s=a[n];t[n]!==s&&(a[n]==null?e.style.removeProperty(n):e.style.setProperty(n,s,r))}}function St(e,t,a,r){var n=e.__style;if(m||n!==t){var s=gt(t,r);(!m||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}else r&&(Array.isArray(r)?(j(e,a?.[0],r[0]),j(e,a?.[1],r[1],"important")):j(e,a,r));return r}function F(e,t,a=!1){if(e.multiple){if(t==null)return;if(!he(t))return ze();for(var r of e.options)r.selected=t.includes($(r));return}for(r of e.options){var n=$(r);if(Ge(n,t)){r.selected=!0;return}}(!a||t!==void 0)&&(e.selectedIndex=-1)}function ke(e){var t=new MutationObserver(()=>{F(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ke(()=>{t.disconnect()})}function Nt(e,t,a=t){var r=!0;se(e,"change",n=>{var s=n?"[selected]":":checked",o;if(e.multiple)o=[].map.call(e.querySelectorAll(s),$);else{var f=e.querySelector(s)??e.querySelector("option:not([disabled])");o=f&&$(f)}a(o)}),ne(()=>{var n=t();if(F(e,n,r),r&&n===void 0){var s=e.querySelector(":checked");s!==null&&(n=$(s),a(n))}e.__value=n,r=!1}),ke(e)}function $(e){return"__value"in e?e.__value:e.value}const U=Symbol("class"),P=Symbol("style"),Ae=Symbol("is custom element"),Ee=Symbol("is html");function Ct(e){if(m){var t=!1,a=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;Y(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var n=e.checked;Y(e,"checked",null),e.checked=n}}};e.__on_r=a,we(a),rt()}}function kt(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Y(e,t,a,r){var n=me(e);m&&(n[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||n[t]!==(n[t]=a)&&(t==="loading"&&(e[it]=a),a==null?e.removeAttribute(t):typeof a!="string"&&ye(e).includes(t)?e[t]=a:e.setAttribute(t,a))}function At(e,t,a,r,n=!1,s=!1){if(m&&n&&e.tagName==="INPUT"){var o=e,f=o.type==="checkbox"?"defaultChecked":"defaultValue";f in a||Ct(o)}var h=me(e),v=h[Ae],b=!h[Ee];let g=m&&v;g&&R(!1);var u=t||{},k=e.tagName==="OPTION";for(var c in t)c in a||(a[c]=null);a.class?a.class=wt(a.class):a[U]&&(a.class=null),a[P]&&(a.style??=null);var p=ye(e);for(const i in a){let l=a[i];if(k&&i==="value"&&l==null){e.value=e.__value="",u[i]=l;continue}if(i==="class"){var d=e.namespaceURI==="http://www.w3.org/1999/xhtml";_t(e,d,l,r,t?.[U],a[U]),u[i]=l,u[U]=a[U];continue}if(i==="style"){St(e,l,t?.[P],a[P]),u[i]=l,u[P]=a[P];continue}var S=u[i];if(!(l===S&&!(l===void 0&&e.hasAttribute(i)))){u[i]=l;var E=i[0]+i[1];if(E!=="$$")if(E==="on"){const w={},T="$$"+i;let C=i.slice(2);var y=ot(C);if(Ze(C)&&(C=C.slice(0,-7),w.capture=!0),!y&&S){if(l!=null)continue;e.removeEventListener(C,u[T],w),u[T]=null}if(l!=null)if(y)e[`__${C}`]=l,xe([C]);else{let O=function(N){u[i].call(this,N)};u[T]=je(C,e,O,w)}else y&&(e[`__${C}`]=void 0)}else if(i==="style")Y(e,i,l);else if(i==="autofocus")et(e,!!l);else if(!v&&(i==="__value"||i==="value"&&l!=null))e.value=e.__value=l;else if(i==="selected"&&k)kt(e,l);else{var _=i;b||(_=tt(_));var A=_==="defaultValue"||_==="defaultChecked";if(l==null&&!v&&!A)if(h[i]=null,_==="value"||_==="checked"){let w=e;const T=t===void 0;if(_==="value"){let C=w.defaultValue;w.removeAttribute(_),w.defaultValue=C,w.value=w.__value=T?C:null}else{let C=w.defaultChecked;w.removeAttribute(_),w.defaultChecked=C,w.checked=T?C:!1}}else e.removeAttribute(i);else A||p.includes(_)&&(v||typeof l!="string")?(e[_]=l,_ in h&&(h[_]=at)):typeof l!="function"&&Y(e,_,l)}}}return g&&R(!0),u}function Mt(e,t,a=[],r=[],n,s=!1,o=!1){Xe(a,r,f=>{var h=void 0,v={},b=e.nodeName==="SELECT",g=!1;if(re(()=>{var k=t(...f.map(te)),c=At(e,h,k,n,s,o);g&&b&&"value"in k&&F(e,k.value);for(let d of Object.getOwnPropertySymbols(v))k[d]||V(v[d]);for(let d of Object.getOwnPropertySymbols(k)){var p=k[d];d.description===Qe&&(!h||p!==h[d])&&(v[d]&&V(v[d]),v[d]=H(()=>ht(e,()=>p))),c[d]=p}h=c}),b){var u=e;ne(()=>{F(u,h.value,!0),ke(u)})}g=!0})}function me(e){return e.__attributes??={[Ae]:e.nodeName.includes("-"),[Ee]:e.namespaceURI===nt}}var ue=new Map;function ye(e){var t=e.getAttribute("is")||e.nodeName,a=ue.get(t);if(a)return a;ue.set(t,a=[]);for(var r,n=e,s=Element.prototype;s!==n;){r=lt(n);for(var o in r)r[o].set&&a.push(o);n=st(n)}return a}function Ot(e,t,a=t){var r=new WeakSet;se(e,"input",async n=>{var s=n?e.defaultValue:e.value;if(s=x(e)?ee(s):s,a(s),W!==null&&r.add(W),await ct(),s!==(s=t())){var o=e.selectionStart,f=e.selectionEnd;e.value=s??"",f!==null&&(e.selectionStart=o,e.selectionEnd=Math.min(f,e.value.length))}}),(m&&e.defaultValue!==e.value||ge(t)==null&&e.value)&&(a(x(e)?ee(e.value):e.value),W!==null&&r.add(W)),_e(()=>{var n=t();if(e===document.activeElement){var s=ft??W;if(r.has(s))return}x(e)&&n===ee(e.value)||e.type==="date"&&!n&&!e.value||n!==e.value&&(e.value=n??"")})}function It(e,t,a=t){se(e,"change",r=>{var n=r?e.defaultChecked:e.checked;a(n)}),(m&&e.defaultChecked!==e.checked||ge(t)==null)&&a(e.checked),_e(()=>{var r=t();e.checked=!!r})}function x(e){var t=e.type;return t==="number"||t==="range"}function ee(e){return e===""?null:+e}const I=ut({id:"unknown",name:"Unknown Control Set",currentPath:"",controls:[],mappings:[],families:[],totalControls:0,totalMappings:0,isConnected:!1});class Et{ws=null;reconnectTimer=null;reconnectAttempts=0;maxReconnectAttempts=5;reconnectDelay=1e3;connect(){if(this.ws&&(this.ws.readyState===WebSocket.CONNECTING||this.ws.readyState===WebSocket.OPEN)){console.log("WebSocket already connected or connecting");return}const t=window.location.protocol==="https:"?"wss:":"ws:",a=window.location.hostname==="localhost"?"localhost:3000":window.location.host,r=`${t}//${a}/ws`;console.log("Connecting to WebSocket:",r);try{this.ws=new WebSocket(r),this.ws.onopen=()=>{console.log("WebSocket connected"),this.reconnectAttempts=0,this.reconnectDelay=1e3},this.ws.onmessage=n=>{try{const s=JSON.parse(n.data);this.handleMessage(s)}catch(s){console.error("Failed to parse WebSocket message:",s)}},this.ws.onerror=n=>{console.error("WebSocket error:",n)},this.ws.onclose=()=>{console.log("WebSocket disconnected"),I.update(n=>({...n,isConnected:!1})),this.ws=null,this.scheduleReconnect()}}catch(n){console.error("Failed to create WebSocket:",n),this.scheduleReconnect()}}handleMessage(t){switch(console.log("WebSocket message received:",t),t.type){case"connected":this.handleConnected();break;case"state-update":this.handleStateUpdate(t.payload);break;case"metadata-update":this.handleMetadataUpdate(t.payload);break;case"controls-update":this.handleControlsUpdate(t.payload);break;case"mappings-update":this.handleMappingsUpdate(t.payload);break;case"control-details":this.handleControlDetails(t.payload);break;case"control-sets-list":this.handleControlSetsList(t.payload);break;case"control-updated":this.handleControlUpdated(t.payload);break;case"mapping-created":case"mapping-updated":case"mapping-deleted":this.handleMappingOperation(t.type,t.payload);break;case"error":this.handleError(t.payload);break;default:console.warn("Unknown WebSocket message type:",t.type)}}handleConnected(){console.log("WebSocket connection confirmed"),I.update(t=>({...t,isConnected:!0}))}handleStateUpdate(t){console.log("State update received"),t&&I.set({...t,isConnected:!0,isSwitchingControlSet:!1})}handleMetadataUpdate(t){console.log("Metadata update received"),t&&I.update(a=>({...a,...t,isConnected:!0,isSwitchingControlSet:!1}))}handleControlsUpdate(t){console.log("Controls update received"),t&&I.update(a=>({...a,controls:t}))}handleMappingsUpdate(t){console.log("Mappings update received"),t&&I.update(a=>({...a,mappings:t}))}handleControlDetails(t){console.log("Control details received:",t),t&&window.dispatchEvent(new CustomEvent("control-details",{detail:t}))}handleControlSetsList(t){console.log("Control sets list received"),t&&window.dispatchEvent(new CustomEvent("control-sets-list",{detail:t}))}handleControlUpdated(t){console.log("Control updated successfully:",t)}handleMappingOperation(t,a){console.log(`Mapping operation successful: ${t}`,a),window.dispatchEvent(new CustomEvent("mappings-changed",{detail:a}))}handleError(t){console.error("WebSocket error:",t)}scheduleReconnect(){if(this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectAttempts>=this.maxReconnectAttempts){console.error("Max reconnection attempts reached");return}this.reconnectAttempts++,console.log(`Scheduling reconnect attempt ${this.reconnectAttempts} in ${this.reconnectDelay}ms`),this.reconnectTimer=window.setTimeout(()=>{this.connect()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*2,3e4)}disconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(),this.ws=null),I.update(t=>({...t,isConnected:!1}))}isConnected(){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN}async sendCommand(t,a){if(console.log(`Sending WebSocket command: ${t}`,a),!this.ws||this.ws.readyState!==WebSocket.OPEN){console.log("WebSocket not ready, waiting for connection...");try{await this.waitForConnection()}catch(r){throw console.error("Failed to connect:",r),r}}if(this.ws&&this.ws.readyState===WebSocket.OPEN){const r=JSON.stringify({type:t,payload:a});console.log("Sending message:",r),this.ws.send(r)}else{const r=new Error("WebSocket not connected after waiting");throw console.error(r),r}}waitForConnection(t=5e3){return new Promise((a,r)=>{const n=Date.now(),s=()=>{this.ws&&this.ws.readyState===WebSocket.OPEN?a():Date.now()-n>t?r(new Error("WebSocket connection timeout")):setTimeout(s,100)};s()})}async updateControl(t){return this.sendCommand("update-control",t)}async createMapping(t){return this.sendCommand("create-mapping",t)}async updateMapping(t){return this.sendCommand("update-mapping",t)}async deleteMapping(t){return this.sendCommand("delete-mapping",{uuid:t})}async switchControlSet(t){return I.update(a=>({...a,isSwitchingControlSet:!0})),this.sendCommand("switch-control-set",{path:t})}async getControlDetails(t){return this.sendCommand("get-control",{id:t})}async scanControlSets(){return this.sendCommand("scan-control-sets")}send(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(t)):console.warn("WebSocket not connected, cannot send message")}}const Wt=new Et;export{Mt as a,Y as b,Ot as c,Nt as d,Tt as e,I as f,wt as g,St as h,yt as i,It as j,Ct as r,_t as s,Wt as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
import{d as O,aa as Y,h as f,ae as B,af as G,ag as J,Y as K,ah as W,T as z,p as F,C as H,u as Q,o as X,g as x,ai as Z,f as V,a as k,s as $,b as E,e as ee,aj as L,c as te,r as re,ak as S,al as se,J as ae,K as ne}from"../chunks/
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DIHiDqse.js","../chunks/DsnmJJEf.js","../chunks/DTWPdvjs.js","../chunks/BXUi170M.js","../chunks/BaNghdtJ.js","../chunks/C43miErR.js","../chunks/WlyXjfrM.js","../chunks/e7OeeeKP.js","../chunks/Cq7PwVfU.js","../assets/0.CJjXKESY.css","../nodes/1.DyuqnWpt.js","../nodes/2.DCVMr5cE.js","../chunks/CIUsQQm2.js","../chunks/CRa0j_Fx.js","../assets/DynamicControlEditor.DoNLxeLe.css","../nodes/3.CRa3NPUY.js","../nodes/4.BIaoIDIb.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{d as O,aa as Y,h as f,ae as B,af as G,ag as J,Y as K,ah as W,T as z,p as F,C as H,u as Q,o as X,g as x,ai as Z,f as V,a as k,s as $,b as E,e as ee,aj as L,c as te,r as re,ak as S,al as se,J as ae,K as ne}from"../chunks/DTWPdvjs.js";import"../chunks/DsnmJJEf.js";import{p as A,i as C}from"../chunks/BXUi170M.js";import{c as j}from"../chunks/WlyXjfrM.js";import{b as T}from"../chunks/CRa0j_Fx.js";function oe(c){return class extends ce{constructor(e){super({component:c,...e})}}}class ce{#t;#e;constructor(e){var a=new Map,i=(r,t)=>{var s=z(t,!1,!1);return a.set(r,s),s};const l=new Proxy({...e.props||{},$$events:{}},{get(r,t){return f(a.get(t)??i(t,Reflect.get(r,t)))},has(r,t){return t===Y?!0:(f(a.get(t)??i(t,Reflect.get(r,t))),Reflect.has(r,t))},set(r,t,s){return O(a.get(t)??i(t,s),s),Reflect.set(r,t,s)}});this.#e=(e.hydrate?B:G)(e.component,{target:e.target,anchor:e.anchor,props:l,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&J(),this.#t=l.$$events;for(const r of Object.keys(this.#e))r==="$set"||r==="$destroy"||r==="$on"||K(this,r,{get(){return this.#e[r]},set(t){this.#e[r]=t},enumerable:!0});this.#e.$set=r=>{Object.assign(l,r)},this.#e.$destroy=()=>{W(this.#e)}}$set(e){this.#e.$set(e)}$on(e,a){this.#t[e]=this.#t[e]||[];const i=(...l)=>a.call(this,...l);return this.#t[e].push(i),()=>{this.#t[e]=this.#t[e].filter(l=>l!==i)}}$destroy(){this.#e.$destroy()}}const ie="modulepreload",le=function(c,e){return new URL(c,e).href},I={},R=function(e,a,i){let l=Promise.resolve();if(a&&a.length>0){let w=function(o){return Promise.all(o.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),p=s?.nonce||s?.getAttribute("nonce");l=w(a.map(o=>{if(o=le(o,i),o in I)return;I[o]=!0;const d=o.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(i)for(let h=t.length-1;h>=0;h--){const n=t[h];if(n.href===o&&(!d||n.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${m}`))return;const u=document.createElement("link");if(u.rel=d?"stylesheet":ie,d||(u.as="script"),u.crossOrigin="",u.href=o,p&&u.setAttribute("nonce",p),document.head.appendChild(u),d)return new Promise((h,n)=>{u.addEventListener("load",h),u.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${o}`)))})}))}function r(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return l.then(t=>{for(const s of t||[])s.status==="rejected"&&r(s.reason);return e().catch(r)})},Pe={};var ue=V('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),de=V("<!> <!>",1);function fe(c,e){F(e,!0);let a=A(e,"components",23,()=>[]),i=A(e,"data_0",3,null),l=A(e,"data_1",3,null);H(()=>e.stores.page.set(e.page)),Q(()=>{e.stores,e.page,e.constructors,a(),e.form,i(),l(),e.stores.page.notify()});let r=x(!1),t=x(!1),s=x(null);X(()=>{const n=e.stores.page.subscribe(()=>{f(r)&&(O(t,!0),Z().then(()=>{O(s,document.title||"untitled page",!0)}))});return O(r,!0),n});const p=S(()=>e.constructors[1]);var w=de(),o=k(w);{var d=n=>{const _=S(()=>e.constructors[0]);var v=L(),b=k(v);j(b,()=>f(_),(g,y)=>{T(y(g,{get data(){return i()},get form(){return e.form},get params(){return e.page.params},children:(P,_e)=>{var D=L(),M=k(D);j(M,()=>f(p),(N,q)=>{T(q(N,{get data(){return l()},get form(){return e.form},get params(){return e.page.params}}),U=>a()[1]=U,()=>a()?.[1])}),E(P,D)},$$slots:{default:!0}}),P=>a()[0]=P,()=>a()?.[0])}),E(n,v)},m=n=>{const _=S(()=>e.constructors[0]);var v=L(),b=k(v);j(b,()=>f(_),(g,y)=>{T(y(g,{get data(){return i()},get form(){return e.form},get params(){return e.page.params}}),P=>a()[0]=P,()=>a()?.[0])}),E(n,v)};C(o,n=>{e.constructors[1]?n(d):n(m,!1)})}var u=$(o,2);{var h=n=>{var _=ue(),v=te(_);{var b=g=>{var y=se();ae(()=>ne(y,f(s))),E(g,y)};C(v,g=>{f(t)&&g(b)})}re(_),E(n,_)};C(u,n=>{f(r)&&n(h)})}E(c,w),ee()}const Re=oe(fe),pe=[()=>R(()=>import("../nodes/0.DIHiDqse.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>R(()=>import("../nodes/1.DyuqnWpt.js"),__vite__mapDeps([10,1,8,2,4]),import.meta.url),()=>R(()=>import("../nodes/2.DCVMr5cE.js"),__vite__mapDeps([11,1,8,2,3,12,7,5,4,6,13,14]),import.meta.url),()=>R(()=>import("../nodes/3.CRa3NPUY.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,12,13,14]),import.meta.url),()=>R(()=>import("../nodes/4.BIaoIDIb.js"),__vite__mapDeps([16,1,8,2,3,7,4]),import.meta.url)],we=[],ke={"/":[2],"/control/[id]":[3],"/setup":[4]},me={handleError:(({error:c})=>{console.error(c)}),reroute:(()=>{}),transport:{}},he=Object.fromEntries(Object.entries(me.transport).map(([c,e])=>[c,e.decode])),Oe=!1,xe=(c,e)=>he[c](e);export{xe as decode,he as decoders,ke as dictionary,Oe as hash,me as hooks,Pe as matchers,pe as nodes,Re as root,we as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/BaNghdtJ.js";export{o as load_css,r as start};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import{aR as he,p as U,am as S,d as h,T as L,G as _,h as i,an as X,ao as A,c as r,n as P,r as a,b as p,e as Y,J as O,K as N,aj as le,a as K,f as I,ap as ze,g as ie,a0 as we,u as Ee,aq as Se,b0 as Le,s as $,i as He,o as Ae,b1 as De,b2 as ye}from"../chunks/
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{aR as he,p as U,am as S,d as h,T as L,G as _,h as i,an as X,ao as A,c as r,n as P,r as a,b as p,e as Y,J as O,K as N,aj as le,a as K,f as I,ap as ze,g as ie,a0 as we,u as Ee,aq as Se,b0 as Le,s as $,i as He,o as Ae,b1 as De,b2 as ye}from"../chunks/DTWPdvjs.js";import{l as H,p as C,i as E,a as be,s as ke}from"../chunks/BXUi170M.js";import{g as Pe}from"../chunks/BaNghdtJ.js";import{a as je,p as Re,D as Ne}from"../chunks/C43miErR.js";import{i as q}from"../chunks/Cq7PwVfU.js";import{a as ee,f as Ce,e as Te,d as Ve,i as Be,w as ce}from"../chunks/e7OeeeKP.js";he(["change"]);var Oe=A("<title> </title>"),Ue=A('<svg><!><path d="M11.41 26.59L7.83 23 28 23 28 21 7.83 21 11.41 17.41 10 16 4 22 10 28 11.41 26.59zM28 10L22 4 20.59 5.41 24.17 9 4 9 4 11 24.17 11 20.59 14.59 22 16 28 10z"></path></svg>');function Ye(v,t){const e=H(t,["children","$$slots","$$events","$$legacy"]),y=H(e,["size","title"]);U(t,!1);const o=L(),m=L();let g=C(t,"size",8,16),s=C(t,"title",8,void 0);S(()=>(_(e),_(s())),()=>{h(o,e["aria-label"]||e["aria-labelledby"]||s())}),S(()=>(i(o),_(e)),()=>{h(m,{"aria-hidden":i(o)?void 0:!0,role:i(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),X(),q();var n=Ue();ee(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:g(),height:g(),...i(m),...y}));var l=r(n);{var b=d=>{var c=Oe(),k=r(c,!0);a(c),O(()=>N(k,s())),p(d,c)};E(l,d=>{s()&&d(b)})}P(),a(n),p(v,n),Y()}var Ie=I('<a href="/setup" class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors" title="Switch control set"><!> Switch</a>'),Ge=I('<div class="text-sm text-gray-500 dark:text-gray-400">Loading...</div>');function Fe(v,t){U(t,!1);const e=()=>be(Ce,"$appState",y),[y,o]=ke();q();var m=le(),g=K(m);{var s=l=>{var b=Ie(),d=r(b);Ye(d,{size:16}),P(),a(b),p(l,b)},n=l=>{var b=Ge();p(l,b)};E(g,l=>{e().isConnected?l(s):l(n,!1)})}p(v,m),Y(),o()}var Ze=A("<title> </title>"),Je=A('<svg><!><path d="M17.4141 16L24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16z"></path></svg>');function Ke(v,t){const e=H(t,["children","$$slots","$$events","$$legacy"]),y=H(e,["size","title"]);U(t,!1);const o=L(),m=L();let g=C(t,"size",8,16),s=C(t,"title",8,void 0);S(()=>(_(e),_(s())),()=>{h(o,e["aria-label"]||e["aria-labelledby"]||s())}),S(()=>(i(o),_(e)),()=>{h(m,{"aria-hidden":i(o)?void 0:!0,role:i(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),X(),q();var n=Je();ee(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:g(),height:g(),...i(m),...y}));var l=r(n);{var b=d=>{var c=Ze(),k=r(c,!0);a(c),O(()=>N(k,s())),p(d,c)};E(l,d=>{s()&&d(b)})}P(),a(n),p(v,n),Y()}function qe(v,t){v.target===v.currentTarget&&t()}var We=(v,t)=>v.key==="Escape"&&t(),Qe=v=>v.stopPropagation(),Xe=I("<option> </option>"),et=I(`<div class="fixed inset-0 bg-gray-700 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-75 overflow-y-auto h-full w-full z-50 flex items-center justify-center p-4" role="dialog" aria-modal="true" tabindex="-1"><div class="bg-white dark:bg-gray-800 rounded-lg shadow-xl p-6 w-full max-w-md mx-auto" role="document"><div class="flex items-center justify-between mb-4"><h2 class="text-xl font-semibold text-gray-900 dark:text-white"> </h2> <button class="text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300" aria-label="Close dialog"><!></button></div> <div class="mb-6"><p class="text-sm text-gray-600 dark:text-gray-400 mb-4">Choose which column should contain the mappings data:</p> <div class="space-y-2"><label for="column-select" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Mappings Column</label> <select id="column-select" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"></select></div> <div class="mt-3 p-3 bg-blue-50 dark:bg-blue-900/20 rounded-md"><p class="text-xs text-blue-600 dark:text-blue-400"><strong>Note:</strong> Mappings data will be formatted as "status: description..." in the
|
|
2
2
|
selected column.</p></div></div> <div class="flex justify-end space-x-3"><button class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">Cancel</button> <button class="px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-lg transition-colors"> </button></div></div></div>`);function tt(v,t){U(t,!0);let e=C(t,"isOpen",15),y=C(t,"columnHeaders",19,()=>[]),o=C(t,"defaultColumn",3,"Mappings");const m=ze();let g=ie(we(o()));Ee(()=>{e()&&h(g,o())});function s(z){return e()&&setTimeout(()=>z.focus(),0),{update(D){D&&setTimeout(()=>z.focus(),0)}}}function n(){m("export",{format:t.format,mappingsColumn:i(g)}),e(!1)}function l(){m("cancel"),e(!1)}function b(z){z.key==="Escape"?l():z.key==="Enter"&&n()}var d=le();Se("keydown",Le,b);var c=K(d);{var k=z=>{var D=et();D.__click=[qe,l],D.__keydown=[We,l];var te=r(D);te.__click=[Qe];var ae=r(te),re=r(ae),ue=r(re);a(re);var f=$(re,2);f.__click=l;var x=r(f);Ke(x,{class:"w-6 h-6"}),a(f),a(ae);var u=$(ae,2),M=$(r(u),2),w=$(r(M),2);Te(w,21,y,Be,(j,G)=>{var F=Xe(),ge=r(F,!0);a(F);var de={};O(()=>{N(ge,i(G).label),de!==(de=i(G).value)&&(F.value=(F.__value=i(G).value)??"")}),p(j,F)}),a(w),je(w,(j,G)=>s?.(j),e),He(()=>Ve(w,()=>i(g),j=>h(g,j))),a(M),P(2),a(u);var T=$(u,2),J=r(T);J.__click=l;var W=$(J,2);W.__click=n;var ve=r(W);a(W),a(T),a(te),a(D),O((j,G)=>{N(ue,`Export as ${j??""}`),N(ve,`Export ${G??""}`)},[()=>t.format.toUpperCase(),()=>t.format.toUpperCase()]),p(z,D)};E(c,z=>{e()&&z(k)})}p(v,d),Y()}he(["click","keydown"]);var at=A("<title> </title>"),rt=A('<svg><!><path d="M31 16L24 23 22.59 21.59 28.17 16 22.59 10.41 24 9 31 16zM1 16L8 9 9.41 10.41 3.83 16 9.41 21.59 8 23 1 16z"></path><path d="M5.91 15H26.080000000000002V17H5.91z" transform="rotate(-75 15.996 16)"></path></svg>');function ot(v,t){const e=H(t,["children","$$slots","$$events","$$legacy"]),y=H(e,["size","title"]);U(t,!1);const o=L(),m=L();let g=C(t,"size",8,16),s=C(t,"title",8,void 0);S(()=>(_(e),_(s())),()=>{h(o,e["aria-label"]||e["aria-labelledby"]||s())}),S(()=>(i(o),_(e)),()=>{h(m,{"aria-hidden":i(o)?void 0:!0,role:i(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),X(),q();var n=rt();ee(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:g(),height:g(),...i(m),...y}));var l=r(n);{var b=d=>{var c=at(),k=r(c,!0);a(c),O(()=>N(k,s())),p(d,c)};E(l,d=>{s()&&d(b)})}P(2),a(n),p(v,n),Y()}var st=A("<title> </title>"),nt=A('<svg><!><path d="M13 21L26.17 21 23.59 23.59 25 25 30 20 25 15 23.59 16.41 26.17 19 13 19 13 21z"></path><path d="M22,14V10a1,1,0,0,0-.29-.71l-7-7A1,1,0,0,0,14,2H4A2,2,0,0,0,2,4V28a2,2,0,0,0,2,2H20a2,2,0,0,0,2-2V26H20v2H4V4h8v6a2,2,0,0,0,2,2h6v2Zm-8-4V4.41L19.59,10Z"></path></svg>');function it(v,t){const e=H(t,["children","$$slots","$$events","$$legacy"]),y=H(e,["size","title"]);U(t,!1);const o=L(),m=L();let g=C(t,"size",8,16),s=C(t,"title",8,void 0);S(()=>(_(e),_(s())),()=>{h(o,e["aria-label"]||e["aria-labelledby"]||s())}),S(()=>(i(o),_(e)),()=>{h(m,{"aria-hidden":i(o)?void 0:!0,role:i(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),X(),q();var n=nt();ee(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:g(),height:g(),...i(m),...y}));var l=r(n);{var b=d=>{var c=st(),k=r(c,!0);a(c),O(()=>N(k,s())),p(d,c)};E(l,d=>{s()&&d(b)})}P(2),a(n),p(v,n),Y()}var lt=A("<title> </title>"),dt=A('<svg><!><path d="M26 24v4H6V24H4v4H4a2 2 0 002 2H26a2 2 0 002-2h0V24zM26 14L24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14z"></path></svg>');function _e(v,t){const e=H(t,["children","$$slots","$$events","$$legacy"]),y=H(e,["size","title"]);U(t,!1);const o=L(),m=L();let g=C(t,"size",8,16),s=C(t,"title",8,void 0);S(()=>(_(e),_(s())),()=>{h(o,e["aria-label"]||e["aria-labelledby"]||s())}),S(()=>(i(o),_(e)),()=>{h(m,{"aria-hidden":i(o)?void 0:!0,role:i(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),X(),q();var n=dt();ee(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:g(),height:g(),...i(m),...y}));var l=r(n);{var b=d=>{var c=lt(),k=r(c,!0);a(c),O(()=>N(k,s())),p(d,c)};E(l,d=>{s()&&d(b)})}P(),a(n),p(v,n),Y()}var ct=A("<title> </title>"),ut=A('<svg><!><path fill-rule="evenodd" d="M16,2a14,14,0,0,0-4.43,27.28c.7.13,1-.3,1-.67s0-1.21,0-2.38c-3.89.84-4.71-1.88-4.71-1.88A3.71,3.71,0,0,0,6.24,22.3c-1.27-.86.1-.85.1-.85A2.94,2.94,0,0,1,8.48,22.9a3,3,0,0,0,4.08,1.16,2.93,2.93,0,0,1,.88-1.87c-3.1-.36-6.37-1.56-6.37-6.92a5.4,5.4,0,0,1,1.44-3.76,5,5,0,0,1,.14-3.7s1.17-.38,3.85,1.43a13.3,13.3,0,0,1,7,0c2.67-1.81,3.84-1.43,3.84-1.43a5,5,0,0,1,.14,3.7,5.4,5.4,0,0,1,1.44,3.76c0,5.38-3.27,6.56-6.39,6.91a3.33,3.33,0,0,1,.95,2.59c0,1.87,0,3.38,0,3.84s.25.81,1,.67A14,14,0,0,0,16,2Z"></path></svg>');function vt(v,t){const e=H(t,["children","$$slots","$$events","$$legacy"]),y=H(e,["size","title"]);U(t,!1);const o=L(),m=L();let g=C(t,"size",8,16),s=C(t,"title",8,void 0);S(()=>(_(e),_(s())),()=>{h(o,e["aria-label"]||e["aria-labelledby"]||s())}),S(()=>(i(o),_(e)),()=>{h(m,{"aria-hidden":i(o)?void 0:!0,role:i(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),X(),q();var n=ut();ee(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:g(),height:g(),...i(m),...y}));var l=r(n);{var b=d=>{var c=ct(),k=r(c,!0);a(c),O(()=>N(k,s())),p(d,c)};E(l,d=>{s()&&d(b)})}P(),a(n),p(v,n),Y()}var gt=(v,t)=>t("csv"),ft=(v,t)=>t("excel"),pt=(v,t)=>t("json"),mt=I('<div class="space-y-1 p-1"><button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as CSV</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as Excel</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as JSON</span></div></button></div>'),bt=I('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400">Switching control set...</p></div></div>'),ht=I('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400"> </p></div></div>'),xt=I('<header class="bg-white dark:bg-gray-900 shadow-sm border-b border-gray-200 dark:border-gray-700 flex-shrink-0"><div class="w-full px-6 lg:px-8"><div class="flex justify-between items-center h-16"><div class="flex items-center"><a href="/" class="flex items-center space-x-3 hover:opacity-80 transition-opacity"><img src="/lula.png" class="h-8 w-8" alt="Lula Logo"/> <div class="flex flex-col"><span class="text-xl font-bold text-gray-900 dark:text-white">Lula</span> <span class="text-xs text-gray-500 dark:text-gray-400 -mt-1">Gitops for Compliance</span></div></a></div> <div class="flex items-center space-x-4"><!> <!> <a class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors" title="Github" href="https://github.com/defenseunicorns/lula" target="_blank"><!></a></div></div></div></header> <div class="flex-1 flex gap-6 p-6 overflow-hidden"><!></div>',1),yt=I('<div class="h-screen flex flex-col"><!></div> <!>',1);function Et(v,t){U(t,!0);const e=()=>be(Ce,"$appState",o),y=()=>be(Re,"$page",o),[o,m]=ke();let g=!1,s=ie(!1),n=ie("csv"),l=ie(we([])),b=ie("Mappings");async function d(){try{if(!e().currentPath){console.error("No current control set path available"),h(l,[{value:"Mappings",label:"Mappings (Default)"}],!0),h(b,"Mappings");return}const x=await fetch("/api/export-column-headers");if(x.ok){const u=await x.json();h(l,u.columnHeaders||[],!0),h(b,u.defaultColumn||"Mappings",!0)}else console.error("Failed to load column headers"),h(l,[{value:"Mappings",label:"Mappings (Default)"}],!0),h(b,"Mappings")}catch(f){console.error("Error loading column headers:",f),h(l,[{value:"Mappings",label:"Mappings (Default)"}],!0),h(b,"Mappings")}}async function c(f){if(f==="json")try{const x=`/api/export-controls?format=${f}`,u=document.createElement("a");u.href=x,u.download="",document.body.appendChild(u),u.click(),document.body.removeChild(u)}catch(x){console.error("Export failed:",x)}else h(n,f,!0),await d(),h(s,!0)}async function k(f){try{const{format:x,mappingsColumn:u}=f.detail,M=`/api/export-controls?format=${x}&mappingsColumn=${encodeURIComponent(u)}`,w=document.createElement("a");w.href=M,w.download="",document.body.appendChild(w),w.click(),document.body.removeChild(w)}catch(x){console.error("Export failed:",x)}}Ae(()=>{ce.connect();let f=null;const x=async()=>{if(g||y().url.pathname==="/setup"||e().isSwitchingControlSet)return;const u=e();if(u.isConnected){if(g=!0,(!u.name||u.name==="Unknown Control Set"||u.id==="unknown"||u.id==="default")&&(!u.controls||u.controls.length===0)){await ce.scanControlSets();const M=await new Promise(w=>{const T=J=>{window.removeEventListener("control-sets-list",T),w(J.detail)};window.addEventListener("control-sets-list",T),setTimeout(()=>{window.removeEventListener("control-sets-list",T),w(null)},2e3)});M&&Array.isArray(M)&&M.length===1?(console.log("Auto-loading single control set:",M[0].path),await ce.switchControlSet(M[0].path)):Pe("/setup")}}else f=window.setTimeout(x,500)};return f=window.setTimeout(x,100),()=>{f&&clearTimeout(f)}}),De(()=>{ce.disconnect()});var z=yt(),D=K(z),te=r(D);{var ae=f=>{var x=xt(),u=K(x),M=r(u),w=r(M),T=$(r(w),2),J=r(T);Fe(J,{});var W=$(J,2);{var ve=R=>{Ne(R,{buttonLabel:"Export",get buttonIcon(){return _e},buttonClass:"inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors",dropdownClass:"w-48",children:fe=>{var se=mt(),Q=r(se);Q.__click=[gt,c];var V=r(Q),Z=r(V);it(Z,{class:"w-4 h-4"}),P(2),a(V),a(Q);var B=$(Q,2);B.__click=[ft,c];var ne=r(B),pe=r(ne);_e(pe,{class:"w-4 h-4"}),P(2),a(ne),a(B);var me=$(B,2);me.__click=[pt,c];var xe=r(me),Me=r(xe);ot(Me,{class:"w-4 h-4"}),P(2),a(xe),a(me),a(se),p(fe,se)},$$slots:{default:!0}})};E(W,R=>{e().isConnected&&e().controls&&e().controls.length>0&&R(ve)})}var j=$(W,2),G=r(j);vt(G,{class:"w-5 h-5"}),a(j),a(T),a(w),a(M),a(u);var F=$(u,2),ge=r(F);{var de=R=>{var oe=bt();p(R,oe)},$e=R=>{var oe=le(),fe=K(oe);{var se=V=>{var Z=ht(),B=r(Z),ne=$(r(B),2),pe=r(ne,!0);a(ne),a(B),a(Z),O(()=>N(pe,e().isConnected?e().fieldSchema?"Loading controls...":"Loading schema...":"Connecting...")),p(V,Z)},Q=V=>{var Z=le(),B=K(Z);ye(B,()=>t.children),p(V,Z)};E(fe,V=>{!e().isConnected||!e().controls||e().controls.length===0||!e().fieldSchema?V(se):V(Q,!1)},!0)}p(R,oe)};E(ge,R=>{e().isSwitchingControlSet?R(de):R($e,!1)})}a(F),p(f,x)},re=f=>{var x=le(),u=K(x);ye(u,()=>t.children),p(f,x)};E(te,f=>{y().url.pathname!=="/setup"?f(ae):f(re,!1)})}a(D);var ue=$(D,2);tt(ue,{get format(){return i(n)},get columnHeaders(){return i(l)},get defaultColumn(){return i(b)},get isOpen(){return i(s)},set isOpen(f){h(s,f,!0)},$$events:{export:k,cancel:()=>{}}}),p(v,z),Y(),m()}he(["click"]);export{Et as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/Cq7PwVfU.js";import{p as h,f as g,a as l,J as v,b as d,e as _,c as s,r as a,s as x,K as o}from"../chunks/DTWPdvjs.js";import{s as $,p}from"../chunks/BaNghdtJ.js";const b={get error(){return p.error},get status(){return p.status}};$.updated.check;const i=b;var k=g("<h1> </h1> <p> </p>",1);function q(m,c){h(c,!1),u();var t=k(),r=l(t),n=s(r,!0);a(r);var e=x(r,2),f=s(e,!0);a(e),v(()=>{o(n,i.status),o(f,i.error?.message)}),d(m,t),_()}export{q as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import"../chunks/
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import"../chunks/Cq7PwVfU.js";import{f,a as y,b as n,c as t,r,s as w,n as C}from"../chunks/DTWPdvjs.js";import{i as k,s as $,a as D}from"../chunks/BXUi170M.js";import{C as S,a as j,D as L}from"../chunks/CIUsQQm2.js";import{s as N}from"../chunks/C43miErR.js";var P=f('<div class=" h-full flex flex-col"><div class="flex-1 flex items-center justify-center p-8"><div class="text-center text-gray-500 dark:text-gray-400"><!> <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">No Control Selected</h3> <p class="text-gray-600 dark:text-gray-400">Select a control from the list to view and edit its details</p></div></div></div>'),q=f('<div class="w-1/2 flex flex-col"><div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm h-full flex flex-col"><!></div></div> <div class="w-1/2 flex flex-col"><!></div>',1);function H(m){const o=()=>D(N,"$selectedControl",x),[x,g]=$();var l=q(),a=y(l),i=t(a),p=t(i);S(p,{}),r(i),r(a);var d=w(a,2),_=t(d);{var h=e=>{j(e,{get control(){return o()}})},b=e=>{var s=P(),c=t(s),v=t(c),u=t(v);L(u,{class:"mx-auto h-16 w-16 mb-4"}),C(4),r(v),r(c),r(s),n(e,s)};k(_,e=>{o()?e(h):e(b,!1)})}r(d),n(m,l),g()}export{H as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import{p as S,u as A,d as x,o as B,f as n,a as F,b as i,e as H,c as s,g as N,r as a,s as h,h as P,n as R}from"../chunks/
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{p as S,u as A,d as x,o as B,f as n,a as F,b as i,e as H,c as s,g as N,r as a,s as h,h as P,n as R}from"../chunks/DTWPdvjs.js";import{a as C,i as b,s as U}from"../chunks/BXUi170M.js";import{g as V}from"../chunks/BaNghdtJ.js";import{p as q,s as _}from"../chunks/C43miErR.js";import{C as G,a as J,D as K}from"../chunks/CIUsQQm2.js";import{w}from"../chunks/e7OeeeKP.js";var O=n('<div class="absolute top-4 right-4 z-10"><div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30" title="Loading control..."><svg class="w-5 h-5 text-blue-600 dark:text-blue-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg></div></div>'),Q=n('<div class=" h-full flex flex-col"><div class="flex-1 flex items-center justify-center p-8"><div class="text-center text-gray-500 dark:text-gray-400"><!> <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">No Control Selected</h3> <p class="text-gray-600 dark:text-gray-400">Select a control from the list to view and edit its details</p></div></div></div>'),T=n('<div class="w-1/2 flex flex-col"><div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm h-full flex flex-col"><!></div></div> <div class="w-1/2 flex flex-col relative"><!> <!></div>',1);function se(y,k){S(k,!0);const $=()=>C(q,"$page",c),d=()=>C(_,"$selectedControl",c),[c,D]=U();let v="",r=N(!1);A(()=>{const e=$().params.id;if(!e)return;const t=decodeURIComponent(e);t&&t!==v&&w.isConnected()&&(v=t,x(r,!0),w.getControlDetails(t))}),B(()=>{const e=t=>{const o=t.detail;x(r,!1),o?_.set(o):V("/")};return window.addEventListener("control-details",e),()=>{window.removeEventListener("control-details",e)}});var f=T(),l=F(f),p=s(l),L=s(p);G(L,{}),a(p),a(l);var g=h(l,2),m=s(g);{var I=e=>{var t=O();i(e,t)};b(m,e=>{P(r)&&e(I)})}var z=h(m,2);{var j=e=>{J(e,{get control(){return d()}})},E=e=>{var t=Q(),o=s(t),u=s(o),M=s(u);K(M,{class:"mx-auto h-16 w-16 mb-4"}),R(4),a(u),a(o),a(t),i(e,t)};b(z,e=>{d()?e(j):e(E,!1)})}a(g),i(y,f),H(),D()}export{se as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import{i as Je}from"../chunks/CXdZVXJf.js";import{p as Ye,am as Te,d as o,T as k,G as ge,h as e,an as $r,ao as Ve,c as a,n as _e,r as t,b as d,e as We,J as F,K as E,ap as Lr,f as h,s as i,aq as g,a as ye,ar as mr,aj as Me,a3 as De,ak as hr,al as rr,as as yr,k as de,o as ot,W as lt}from"../chunks/Bvop-7hR.js";import{l as tr,p as Ue,i as M,a as st,s as it}from"../chunks/R1gz3SOr.js";import{a as Nr,s as se,r as Vr,e as ce,b as qe,c as jr,d as _r,i as Cr,f as Sr,w as wr}from"../chunks/GToHgjp8.js";import{g as nt}from"../chunks/BNbzyHlf.js";function dt(pe){return function(...q){var z=q[0];return z.stopPropagation(),pe?.apply(this,q)}}var vt=Ve("<title> </title>"),ct=Ve('<svg><!><path d="M11 18L12.41 19.41 15 16.83 15 29 17 29 17 16.83 19.59 19.41 21 18 16 13 11 18z"></path><path d="M23.5,22H23V20h.5a4.5,4.5,0,0,0,.36-9L23,11l-.1-.82a7,7,0,0,0-13.88,0L9,11,8.14,11a4.5,4.5,0,0,0,.36,9H9v2H8.5A6.5,6.5,0,0,1,7.2,9.14a9,9,0,0,1,17.6,0A6.5,6.5,0,0,1,23.5,22Z"></path></svg>');function gt(pe,q){const z=tr(q,["children","$$slots","$$events","$$legacy"]),X=tr(z,["size","title"]);Ye(q,!1);const O=k(),L=k();let N=Ue(q,"size",8,16),f=Ue(q,"title",8,void 0);Te(()=>(ge(z),ge(f())),()=>{o(O,z["aria-label"]||z["aria-labelledby"]||f())}),Te(()=>(e(O),ge(z)),()=>{o(L,{"aria-hidden":e(O)?void 0:!0,role:e(O)?"img":void 0,focusable:Number(z.tabindex)===0?!0:void 0})}),$r(),Je();var S=ct();Nr(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:N(),height:N(),...e(L),...X}));var K=a(S);{var re=P=>{var p=vt(),U=a(p,!0);t(p),F(()=>E(U,f())),d(P,p)};M(K,P=>{f()&&P(re)})}_e(2),t(S),d(pe,S),We()}var pt=Ve("<title> </title>"),ut=Ve('<svg><!><path d="M10 6H14V10H10zM18 6H22V10H18zM10 14H14V18H10zM18 14H22V18H18zM10 22H14V26H10zM18 22H22V26H18z"></path></svg>');function kr(pe,q){const z=tr(q,["children","$$slots","$$events","$$legacy"]),X=tr(z,["size","title"]);Ye(q,!1);const O=k(),L=k();let N=Ue(q,"size",8,16),f=Ue(q,"title",8,void 0);Te(()=>(ge(z),ge(f())),()=>{o(O,z["aria-label"]||z["aria-labelledby"]||f())}),Te(()=>(e(O),ge(z)),()=>{o(L,{"aria-hidden":e(O)?void 0:!0,role:e(O)?"img":void 0,focusable:Number(z.tabindex)===0?!0:void 0})}),$r(),Je();var S=ut();Nr(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:N(),height:N(),...e(L),...X}));var K=a(S);{var re=P=>{var p=pt(),U=a(p,!0);t(p),F(()=>E(U,f())),d(P,p)};M(K,P=>{f()&&P(re)})}_e(),t(S),d(pe,S),We()}var bt=h('<div class="p-4 text-sm text-blue-800 rounded-lg bg-blue-50 dark:bg-gray-800 dark:text-blue-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <div><span class="font-medium">File loaded:</span> <div class="mt-1"><span class="font-medium">Sheets:</span> <span class="font-medium">Fields:</span> <span class="font-medium">Controls found:</span> </div></div></div></div>'),ft=h('<div class="p-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),xt=h('<div class="p-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),mt=h("<option> </option>"),ht=h("<option> </option>"),yt=h("<option> </option>"),_t=h('<span class="ml-auto text-xs text-blue-600 dark:text-blue-400">ID</span>'),wt=h('<div draggable="true" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded text-sm cursor-move hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors opacity-75"><svg class="w-3 h-3 mr-2 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"></path></svg> <span class="truncate line-through"> </span> <!></div>'),kt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">No excluded fields</p>'),Ct=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),St=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),$t=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),Dt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),Mt=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),zt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),At=h('<div draggable="false" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 rounded text-sm hover:bg-orange-200 dark:hover:bg-orange-800/30 transition-colors"><span class="truncate"> </span> <button class="ml-auto text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400" title="Remove from mappings">×</button></div>'),Ft=h('<div role="region" aria-label="Justification field drop zone"><p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p></div>'),Ot=h('<th class="px-4 py-2"> </th>'),Pt=h('<td class="px-4 py-2"> </td>'),Ht=h('<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700"></tr>'),Et=h('<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Sample Data Preview</h3> <div class="overflow-x-auto"><table class="w-full text-sm text-left text-gray-500 dark:text-gray-400"><thead class="text-xs text-gray-700 uppercase bg-gray-100 dark:bg-gray-600 dark:text-gray-400"><tr></tr></thead><tbody></tbody></table></div></div>'),It=h('<span class="flex items-center"><svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Importing...</span>'),Tt=h(`<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Import Options</h3> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"><div><label for="controlSetName" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control Set Name <span class="text-red-500">*</span></label> <input type="text" id="controlSetName" placeholder="e.g., NIST 800-53 Rev 4" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white" required/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">This will be used as the display name and folder name</p></div> <div><label for="controlSetDescription" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Description</label> <input type="text" id="controlSetDescription" placeholder="Optional description" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Brief description of this control set</p></div></div> <div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label for="sheet" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Sheet</label> <select id="sheet" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select which worksheet contains your control data</p></div> <div><label for="headerRow" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Select Header Row</label> <select id="headerRow" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select the row containing column headers</p></div> <div><label for="controlIdField" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control ID Field <span class="text-red-500">*</span></label> <select id="controlIdField" required><option disabled>Select Control ID field</option><!></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Column containing unique control identifiers (e.g., AC-1, SC-7)</p></div></div></div> <div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Organize Fields</h3> <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">Drag fields to organize them. <strong>Overview fields</strong> will appear as table columns in
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{i as Je}from"../chunks/Cq7PwVfU.js";import{p as Ye,am as Te,d as o,T as k,G as ge,h as e,an as $r,ao as Ve,c as a,n as _e,r as t,b as d,e as We,J as F,K as E,ap as Lr,f as h,s as i,aq as g,a as ye,ar as mr,aj as Me,a3 as De,ak as hr,al as rr,as as yr,k as de,o as ot,W as lt}from"../chunks/DTWPdvjs.js";import{l as tr,p as Ue,i as M,a as st,s as it}from"../chunks/BXUi170M.js";import{a as Nr,s as se,r as Vr,e as ce,b as qe,c as jr,d as _r,i as Cr,f as Sr,w as wr}from"../chunks/e7OeeeKP.js";import{g as nt}from"../chunks/BaNghdtJ.js";function dt(pe){return function(...q){var z=q[0];return z.stopPropagation(),pe?.apply(this,q)}}var vt=Ve("<title> </title>"),ct=Ve('<svg><!><path d="M11 18L12.41 19.41 15 16.83 15 29 17 29 17 16.83 19.59 19.41 21 18 16 13 11 18z"></path><path d="M23.5,22H23V20h.5a4.5,4.5,0,0,0,.36-9L23,11l-.1-.82a7,7,0,0,0-13.88,0L9,11,8.14,11a4.5,4.5,0,0,0,.36,9H9v2H8.5A6.5,6.5,0,0,1,7.2,9.14a9,9,0,0,1,17.6,0A6.5,6.5,0,0,1,23.5,22Z"></path></svg>');function gt(pe,q){const z=tr(q,["children","$$slots","$$events","$$legacy"]),X=tr(z,["size","title"]);Ye(q,!1);const O=k(),L=k();let N=Ue(q,"size",8,16),f=Ue(q,"title",8,void 0);Te(()=>(ge(z),ge(f())),()=>{o(O,z["aria-label"]||z["aria-labelledby"]||f())}),Te(()=>(e(O),ge(z)),()=>{o(L,{"aria-hidden":e(O)?void 0:!0,role:e(O)?"img":void 0,focusable:Number(z.tabindex)===0?!0:void 0})}),$r(),Je();var S=ct();Nr(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:N(),height:N(),...e(L),...X}));var K=a(S);{var re=P=>{var p=vt(),U=a(p,!0);t(p),F(()=>E(U,f())),d(P,p)};M(K,P=>{f()&&P(re)})}_e(2),t(S),d(pe,S),We()}var pt=Ve("<title> </title>"),ut=Ve('<svg><!><path d="M10 6H14V10H10zM18 6H22V10H18zM10 14H14V18H10zM18 14H22V18H18zM10 22H14V26H10zM18 22H22V26H18z"></path></svg>');function kr(pe,q){const z=tr(q,["children","$$slots","$$events","$$legacy"]),X=tr(z,["size","title"]);Ye(q,!1);const O=k(),L=k();let N=Ue(q,"size",8,16),f=Ue(q,"title",8,void 0);Te(()=>(ge(z),ge(f())),()=>{o(O,z["aria-label"]||z["aria-labelledby"]||f())}),Te(()=>(e(O),ge(z)),()=>{o(L,{"aria-hidden":e(O)?void 0:!0,role:e(O)?"img":void 0,focusable:Number(z.tabindex)===0?!0:void 0})}),$r(),Je();var S=ut();Nr(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:N(),height:N(),...e(L),...X}));var K=a(S);{var re=P=>{var p=pt(),U=a(p,!0);t(p),F(()=>E(U,f())),d(P,p)};M(K,P=>{f()&&P(re)})}_e(),t(S),d(pe,S),We()}var bt=h('<div class="p-4 text-sm text-blue-800 rounded-lg bg-blue-50 dark:bg-gray-800 dark:text-blue-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <div><span class="font-medium">File loaded:</span> <div class="mt-1"><span class="font-medium">Sheets:</span> <span class="font-medium">Fields:</span> <span class="font-medium">Controls found:</span> </div></div></div></div>'),ft=h('<div class="p-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),xt=h('<div class="p-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),mt=h("<option> </option>"),ht=h("<option> </option>"),yt=h("<option> </option>"),_t=h('<span class="ml-auto text-xs text-blue-600 dark:text-blue-400">ID</span>'),wt=h('<div draggable="true" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded text-sm cursor-move hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors opacity-75"><svg class="w-3 h-3 mr-2 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"></path></svg> <span class="truncate line-through"> </span> <!></div>'),kt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">No excluded fields</p>'),Ct=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),St=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),$t=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),Dt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),Mt=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),zt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),At=h('<div draggable="false" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 rounded text-sm hover:bg-orange-200 dark:hover:bg-orange-800/30 transition-colors"><span class="truncate"> </span> <button class="ml-auto text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400" title="Remove from mappings">×</button></div>'),Ft=h('<div role="region" aria-label="Justification field drop zone"><p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p></div>'),Ot=h('<th class="px-4 py-2"> </th>'),Pt=h('<td class="px-4 py-2"> </td>'),Ht=h('<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700"></tr>'),Et=h('<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Sample Data Preview</h3> <div class="overflow-x-auto"><table class="w-full text-sm text-left text-gray-500 dark:text-gray-400"><thead class="text-xs text-gray-700 uppercase bg-gray-100 dark:bg-gray-600 dark:text-gray-400"><tr></tr></thead><tbody></tbody></table></div></div>'),It=h('<span class="flex items-center"><svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Importing...</span>'),Tt=h(`<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Import Options</h3> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"><div><label for="controlSetName" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control Set Name <span class="text-red-500">*</span></label> <input type="text" id="controlSetName" placeholder="e.g., NIST 800-53 Rev 4" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white" required/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">This will be used as the display name and folder name</p></div> <div><label for="controlSetDescription" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Description</label> <input type="text" id="controlSetDescription" placeholder="Optional description" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Brief description of this control set</p></div></div> <div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label for="sheet" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Sheet</label> <select id="sheet" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select which worksheet contains your control data</p></div> <div><label for="headerRow" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Select Header Row</label> <select id="headerRow" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select the row containing column headers</p></div> <div><label for="controlIdField" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control ID Field <span class="text-red-500">*</span></label> <select id="controlIdField" required><option disabled>Select Control ID field</option><!></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Column containing unique control identifiers (e.g., AC-1, SC-7)</p></div></div></div> <div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Organize Fields</h3> <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">Drag fields to organize them. <strong>Overview fields</strong> will appear as table columns in
|
|
2
2
|
the controls list.</p> <div class="grid grid-cols-1 lg:grid-cols-5 gap-4"><div class="border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700 rounded-t-lg"><h4 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Excluded Fields</h4> <p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Not imported</p></div> <div role="region" aria-label="Excluded fields drop zone"><!> <!></div></div> <div class="border border-blue-300 dark:border-blue-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-blue-700 dark:text-blue-300">Overview Tab</h4> <p class="text-xs text-blue-600 dark:text-blue-400 mt-1">Shows in details & table columns</p></div> <div role="region" aria-label="Overview tab drop zone"><!> <!></div></div> <div class="border border-green-300 dark:border-green-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-green-200 dark:border-green-800 bg-green-50 dark:bg-green-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-green-700 dark:text-green-300">Implementation Tab</h4> <p class="text-xs text-green-600 dark:text-green-400 mt-1">Status & compliance</p></div> <div role="region" aria-label="Implementation tab drop zone"><!> <!></div></div> <div class="border border-purple-300 dark:border-purple-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-purple-200 dark:border-purple-800 bg-purple-50 dark:bg-purple-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-purple-700 dark:text-purple-300">Custom Tab</h4> <p class="text-xs text-purple-600 dark:text-purple-400 mt-1">Additional fields</p></div> <div role="region" aria-label="Custom fields drop zone"><!> <!></div></div> <div class="border border-orange-300 dark:border-orange-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-orange-200 dark:border-orange-800 bg-orange-50 dark:bg-orange-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-orange-700 dark:text-orange-300">Mappings Tab</h4> <p class="text-xs text-orange-600 dark:text-orange-400 mt-1">Pre-populate justification for a control mapping</p></div> <div role="region" aria-label="Justifications tab drop zone"><div class="space-y-2"><!></div></div></div></div></div> <!> <div class="flex justify-center"><button class="px-5 py-2.5 text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm disabled:opacity-50 disabled:cursor-not-allowed"><!></button></div>`,1),Vt=h('<div class="space-y-6"><div role="button" tabindex="0" class="relative"><label><div class="flex flex-col items-center justify-center pt-5 pb-6"><!> <p class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">Click to upload</span> or drag and drop</p> <p class="text-xs text-gray-500 dark:text-gray-400">XLSX, XLS or CSV files</p></div> <input type="file" class="hidden" accept=".xlsx,.xls,.csv"/></label></div> <!> <!> <!> <!></div>');function jt(pe,q){Ye(q,!1);const z=Lr();let X=k(null),O=k(""),L=k(""),N=k([]),f=k([]),S=k([]),K=k(0),re=k([]),P=k([]),p=k(new Map),U=k(1),V=k(""),fe=k(""),J=k(""),G=k(!1),Q=k(""),ue=k(""),we=k(!1),te=k(!1),$=k(null),B=k(null),ae=k(null);function ke(){o(f,[]),o(S,[]),o(K,0),e(p).clear(),o(p,new Map),o(P,[]),o(V,""),o(Q,""),o(ue,""),o($,null),o(B,null),o(ae,null)}function u(l){l.preventDefault(),o(te,!0)}function b(){o(te,!1)}function D(l){l.preventDefault(),o(te,!1);const n=l.dataTransfer?.files;n&&n.length>0&&I(n[0])}function T(l){const n=l.target;n.files&&n.files.length>0&&I(n.files[0])}async function I(l){ke(),o(O,l.name),o(X,l),o(Q,""),o(G,!0),o(fe,e(O).replace(/\.[^.]+$/,"").replace(/[-_]/g," ")),o(J,`Imported from ${e(O)}`);try{const n=new FormData;n.append("file",l);const y=await fetch("/api/parse-excel",{method:"POST",body:n});if(!y.ok){const w=await y.json();throw new Error(w.error||"Failed to parse file")}const _=await y.json();o(N,_.sheets||[]),o(L,_.selectedSheet||e(N)[0]),o(re,_.rowPreviews||[]),e(re).length>0&&e(U)===1&&o(U,e(re)[0].row),await Z(),o(we,!0)}catch(n){o(Q,"Error reading file: "+n.message)}finally{o(G,!1)}}async function Z(){if(!(!e(X)||!e(L))){o(G,!0),e(p).clear(),o(p,new Map),o(V,"");try{const l=new FormData;l.append("file",e(X)),l.append("sheetName",e(L)),l.append("headerRow",e(U).toString());const n=await fetch("/api/parse-excel-sheet",{method:"POST",body:l});if(!n.ok){const _=await n.json();throw new Error(_.error||"Failed to parse sheet")}const y=await n.json();if(o(f,y.fields||[]),o(S,y.sampleData||[]),o(K,y.controlCount||0),e(f).forEach((_,w)=>{const v=_.toLowerCase();let H="custom",R="text";v.includes("implementation")||v.includes("status")||v.includes("narrative")||v.includes("guidance")?H="implementation":(v.includes("id")||v.includes("title")||v.includes("family")||v.includes("cci")||v.includes("control")||v.includes("acronym"))&&(H="overview"),v.includes("description")||v.includes("narrative")||v.includes("guidance")||v.includes("statement")?R="textarea":v.includes("status")||v.includes("type")||v.includes("designation")?R="select":v.includes("date")?R="date":(v.includes("count")||v.includes("number"))&&(R="number"),e(p).set(_,{originalName:_,tab:H,displayOrder:w,fieldType:R,required:v.includes("id")||v.includes("title")})}),o(p,e(p)),e(V)&&!e(f).includes(e(V))&&o(V,""),!e(V)&&e(f).includes("AP Acronym")){const _=!e(S).length||e(S).every(ee=>!ee["AP Acronym"]||String(ee["AP Acronym"]).length<25),w=e(S).map(ee=>ee["AP Acronym"]).filter(ee=>ee!=null&&ee!==""&&String(ee).trim()!==""),v=new Set(w),H=!w.length||v.size===w.length,R=w.length>0;_&&H&&R&&o(V,"AP Acronym")}}catch(l){o(Q,"Error loading sheet data: "+l.message)}finally{o(G,!1)}}}function ve(l){if(!l)return l;let n=l.trim().replace(/\r?\n/g," ").replace(/\s+/g," ").trim();return je(n)}function je(l){return l.replace(/\W+/g," ").split(/ |\s/).map(n=>n.toLowerCase()).join("-")}function xe(l,n){o($,n),l.dataTransfer&&(l.dataTransfer.effectAllowed="move",l.dataTransfer.setData("text/plain",n))}function oe(){o($,null),o(B,null),o(ae,null)}function C(l,n){l.preventDefault(),o(B,n),l.dataTransfer&&(l.dataTransfer.dropEffect="move")}function ie(){o(B,null)}function ne(l,n,y){if(l.preventDefault(),e($)&&e(p).has(e($))){const _=e(p).get(e($));if(n==="mappings")e(P).includes(e($))||o(P,[...e(P),e($)]);else{if(_.tab=n,y!==void 0&&n!==null){const v=Array.from(e(p).entries()).filter(([H,R])=>R.tab===n).sort((H,R)=>H[1].displayOrder-R[1].displayOrder).filter(([H])=>H!==e($));v.splice(y,0,[e($),_]),v.forEach(([H,R],ee)=>{R.displayOrder=ee,e(p).set(H,R)})}else if(n!==null){const w=Math.max(0,...Array.from(e(p).values()).filter(v=>v.tab===n).map(v=>v.displayOrder));_.displayOrder=w+1}e(p).set(e($),_),o(p,e(p))}}o($,null),o(B,null)}function ze(l,n){l.preventDefault(),l.stopPropagation(),o(ae,n)}function Ce(){o(ae,null)}function Se(l,n,y){if(l.preventDefault(),l.stopPropagation(),e($)&&e($)!==n){const w=Array.from(e(p).entries()).filter(([v,H])=>H.tab===y).sort((v,H)=>v[1].displayOrder-H[1].displayOrder).findIndex(([v])=>v===n);w!==-1&&ne(l,y,w)}o(ae,null)}async function Le(){if(!(!e(X)||!e(O))){if(!e(V)){o(Q,"Please select a Control ID field before importing"),o(ue,"");return}if(!e(fe)||e(fe).trim()===""){o(Q,"Please enter a Control Set Name before importing"),o(ue,"");return}o(G,!0),o(Q,""),o(ue,"");try{const l=new FormData;l.append("file",e(X),e(O)),l.append("controlIdField",e(V)),l.append("startRow",e(U).toString()),l.append("namingConvention","kebab-case"),l.append("skipEmpty","true"),l.append("skipEmptyRows","true"),l.append("controlSetName",e(fe)||e(O).replace(/\.[^.]+$/,"")),l.append("controlSetDescription",e(J)||`Imported from ${e(O)}`);const n=Array.from(e(p).entries()).filter(([w,v])=>v.tab!==null).map(([w,v])=>({fieldName:ve(w),...v}));l.append("fieldSchema",JSON.stringify(n)),l.append("justificationFields",JSON.stringify(e(P).map(w=>ve(w))));const y=await fetch("/api/import-spreadsheet",{method:"POST",body:l});if(!y.ok){const w=await y.json();throw new Error(w.error||"Import failed")}const _=await y.json();o(ue,`Successfully imported ${_.controlCount} controls into ${_.families.length} families`),z("created",{path:_.outputDir})}catch(l){o(Q,"Error importing spreadsheet: "+l.message)}finally{o(G,!1)}}}Je();var Ne=Vt(),me=a(Ne),Be=a(me),Ae=a(Be),ar=a(Ae);gt(ar,{class:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400"}),_e(4),t(Ae);var Xe=i(Ae,2);t(Be),t(me);var Fe=i(me,2);{var or=l=>{var n=bt(),y=a(n),_=i(a(y),2),w=i(a(_)),v=i(w),H=i(a(v)),R=i(H,2),ee=i(R,2);t(v),t(_),t(y),t(n),F(()=>{E(w,` ${e(O)??""} `),E(H,` ${e(N).length??""} | `),E(R,` ${e(f).length??""} | `),E(ee,` ${e(K)??""}`)}),d(l,n)};M(Fe,l=>{e(O)&&l(or)})}var Ke=i(Fe,2);{var lr=l=>{var n=ft(),y=a(n),_=i(a(y),2),w=a(_,!0);t(_),t(y),t(n),F(()=>E(w,e(Q))),d(l,n)};M(Ke,l=>{e(Q)&&l(lr)})}var Ze=i(Ke,2);{var sr=l=>{var n=xt(),y=a(n),_=i(a(y),2),w=a(_,!0);t(_),t(y),t(n),F(()=>E(w,e(ue))),d(l,n)};M(Ze,l=>{e(ue)&&l(sr)})}var ir=i(Ze,2);{var nr=l=>{var n=Tt(),y=ye(n),_=i(a(y),2),w=a(_),v=i(a(w),2);Vr(v),_e(2),t(w);var H=i(w,2),R=i(a(H),2);Vr(R),_e(2),t(H),t(_);var ee=i(_,2),dr=a(ee),Ge=i(a(dr),2);F(()=>{e(L),mr(()=>{e(N)})}),ce(Ge,5,()=>e(N),r=>r,(r,s)=>{var x=mt(),m=a(x,!0);t(x);var c={};F(()=>{E(m,e(s)),c!==(c=e(s))&&(x.value=(x.__value=e(s))??"")}),d(r,x)}),t(Ge),_e(2),t(dr);var vr=i(dr,2),Qe=i(a(vr),2);F(()=>{e(U),mr(()=>{e(re)})}),ce(Qe,5,()=>e(re),r=>r.row,(r,s)=>{var x=ht(),m=a(x);t(x);var c={};F(()=>{E(m,`Row ${e(s).row??""}: ${e(s).preview??""}`),c!==(c=e(s).row)&&(x.value=(x.__value=e(s).row)??"")}),d(r,x)}),t(Qe),_e(2),t(vr);var Dr=i(vr,2),er=i(a(Dr),2);F(()=>{e(V),mr(()=>{e(f),e(S)})});var cr=a(er);cr.value=cr.__value="";var Br=i(cr);ce(Br,1,()=>e(f),r=>r,(r,s)=>{const x=De(()=>e(S).length>0&&e(S)[0][e(s)]?String(e(S)[0][e(s)]).slice(0,30):""),m=De(()=>!e(S).length||e(S).every(le=>!le[e(s)]||String(le[e(s)]).length<25)),c=De(()=>e(S).map(le=>le[e(s)]).filter(le=>le!=null&&le!==""&&String(le).trim()!=="")),Y=De(()=>new Set(e(c))),W=De(()=>!e(c).length||e(Y).size===e(c).length),j=De(()=>e(c).length>0);var A=Me(),be=ye(A);{var $e=le=>{var he=yt(),xr=a(he);t(he);var Tr={};F(()=>{E(xr,`${e(s)??""}${e(x)?` (e.g., ${e(x)})`:""}`),Tr!==(Tr=e(s))&&(he.value=(he.__value=e(s))??"")}),d(le,he)};M(be,le=>{e(m)&&e(W)&&e(j)&&le($e)})}d(r,A)}),t(er),_e(2),t(Dr),t(ee),t(y);var gr=i(y,2),Mr=i(a(gr),4),pr=a(Mr),Oe=i(a(pr),2),zr=a(Oe);ce(zr,1,()=>e(f).filter(r=>!e(p).get(r)||e(p).get(r)?.tab===null),r=>r,(r,s)=>{var x=wt(),m=i(a(x),2),c=a(m,!0);t(m);var Y=i(m,2);{var W=j=>{var A=_t();d(j,A)};M(Y,j=>{e(s)===e(V)&&j(W)})}t(x),F(()=>{qe(x,"aria-label",`Drag ${e(s)??""} field`),E(c,e(s))}),g("dragstart",x,j=>xe(j,e(s))),g("dragend",x,oe),d(r,x)});var Zr=i(zr,2);{var Rr=r=>{var s=kt();d(r,s)};M(Zr,r=>{e(f).filter(s=>!e(p).get(s)||e(p).get(s)?.tab===null).length===0&&r(Rr)})}t(Oe),t(pr);var ur=i(pr,2),Pe=i(a(ur),2),Ar=a(Pe);ce(Ar,3,()=>Array.from(e(p).entries()).filter(([r,s])=>s.tab==="overview").sort((r,s)=>r[1].displayOrder-s[1].displayOrder),([r,s])=>r,(r,s)=>{var x=hr(()=>yr(e(s),2));let m=()=>e(x)[0];var c=Ct(),Y=a(c);kr(Y,{class:"w-3 h-3 mr-2 flex-shrink-0"});var W=i(Y,2),j=a(W,!0);t(W),t(c),F(()=>{qe(c,"aria-label",`${m()??""} field in Overview tab`),se(c,1,`flex items-center px-3 py-2 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded text-sm cursor-move hover:bg-blue-200 dark:hover:bg-blue-800/30 transition-colors
|
|
3
3
|
${e(ae)===m()&&e($)!==m()?"border-t-2 border-blue-500":""}`),E(j,m())}),g("dragstart",c,A=>xe(A,m())),g("dragend",c,oe),g("dragover",c,A=>ze(A,m())),g("dragleave",c,Ce),g("drop",c,A=>Se(A,m(),"overview")),d(r,c)});var qr=i(Ar,2);{var Ur=r=>{var s=St();d(r,s)};M(qr,r=>{Array.from(e(p).entries()).filter(([s,x])=>x.tab==="overview").length===0&&r(Ur)})}t(Pe),t(ur);var br=i(ur,2),He=i(a(br),2),Fr=a(He);ce(Fr,3,()=>Array.from(e(p).entries()).filter(([r,s])=>s.tab==="implementation").sort((r,s)=>r[1].displayOrder-s[1].displayOrder),([r,s])=>r,(r,s)=>{var x=hr(()=>yr(e(s),2));let m=()=>e(x)[0];var c=$t(),Y=a(c);kr(Y,{class:"w-3 h-3 mr-2 flex-shrink-0"});var W=i(Y,2),j=a(W,!0);t(W),t(c),F(()=>{qe(c,"aria-label",`${m()??""} field in Implementation tab`),se(c,1,`flex items-center px-3 py-2 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded text-sm cursor-move hover:bg-green-200 dark:hover:bg-green-800/30 transition-colors
|
|
4
4
|
${e(ae)===m()&&e($)!==m()?"border-t-2 border-green-500":""}`),E(j,m())}),g("dragstart",c,A=>xe(A,m())),g("dragend",c,oe),g("dragover",c,A=>ze(A,m())),g("dragleave",c,Ce),g("drop",c,A=>Se(A,m(),"implementation")),d(r,c)});var Jr=i(Fr,2);{var Yr=r=>{var s=Dt();d(r,s)};M(Jr,r=>{Array.from(e(p).entries()).filter(([s,x])=>x.tab==="implementation").length===0&&r(Yr)})}t(He),t(br);var fr=i(br,2),Ee=i(a(fr),2),Or=a(Ee);ce(Or,3,()=>Array.from(e(p).entries()).filter(([r,s])=>s.tab==="custom").sort((r,s)=>r[1].displayOrder-s[1].displayOrder),([r,s])=>r,(r,s)=>{var x=hr(()=>yr(e(s),2));let m=()=>e(x)[0];var c=Mt(),Y=a(c);kr(Y,{class:"w-3 h-3 mr-2 flex-shrink-0"});var W=i(Y,2),j=a(W,!0);t(W),t(c),F(()=>{qe(c,"aria-label",`${m()??""} field in Custom tab`),se(c,1,`flex items-center px-3 py-2 bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300 rounded text-sm cursor-move hover:bg-purple-200 dark:hover:bg-purple-800/30 transition-colors
|
package/dist/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1759788987595"}
|
|
@@ -107,6 +107,18 @@ function getChangedBlocks(oldText, newText) {
|
|
|
107
107
|
}
|
|
108
108
|
return changed;
|
|
109
109
|
}
|
|
110
|
+
function getRemovedBlocks(oldText, newText) {
|
|
111
|
+
const oldBlocks = extractMapBlocks(oldText);
|
|
112
|
+
const newBlocks = extractMapBlocks(newText);
|
|
113
|
+
const removed = [];
|
|
114
|
+
for (const oldBlock of oldBlocks) {
|
|
115
|
+
const newMatch = newBlocks.find((b) => b.uuid === oldBlock.uuid);
|
|
116
|
+
if (!newMatch) {
|
|
117
|
+
removed.push(oldBlock);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return removed;
|
|
121
|
+
}
|
|
110
122
|
function containsLulaAnnotations(text) {
|
|
111
123
|
const lines = text.split("\n");
|
|
112
124
|
return lines.some((line) => line.includes("@lulaStart") || line.includes("@lulaEnd"));
|
|
@@ -187,6 +199,7 @@ Please review whether:
|
|
|
187
199
|
fetchRawFileViaAPI({ octokit, owner, repo, path: file.filename, ref: prBranch })
|
|
188
200
|
]);
|
|
189
201
|
const changedBlocks = getChangedBlocks(oldText, newText);
|
|
202
|
+
const removedBlocks = getRemovedBlocks(oldText, newText);
|
|
190
203
|
for (const block of changedBlocks) {
|
|
191
204
|
console.log(`Commenting regarding \`${file.filename}\`.`);
|
|
192
205
|
leavePost = true;
|
|
@@ -202,6 +215,43 @@ Please review whether:
|
|
|
202
215
|
> **uuid**-\`${block.uuid}\`
|
|
203
216
|
**sha256** \`${blockSha256}\`
|
|
204
217
|
|
|
218
|
+
`;
|
|
219
|
+
}
|
|
220
|
+
if (removedBlocks.length > 0) {
|
|
221
|
+
leavePost = true;
|
|
222
|
+
console.log(`Found removed annotations in \`${file.filename}\`.`);
|
|
223
|
+
commentBody += `
|
|
224
|
+
|
|
225
|
+
**Compliance Warning: Lula annotations were removed from \`${file.filename}\`**
|
|
226
|
+
|
|
227
|
+
`;
|
|
228
|
+
commentBody += `The following compliance annotation blocks were present in the original file but are missing in the updated version:
|
|
229
|
+
|
|
230
|
+
`;
|
|
231
|
+
commentBody += `| File | Original Lines | UUID |
|
|
232
|
+
`;
|
|
233
|
+
commentBody += `| ---- | -------------- | ---- |
|
|
234
|
+
`;
|
|
235
|
+
for (const block of removedBlocks) {
|
|
236
|
+
const oldBlockText = oldText.split("\n").slice(block.startLine, block.endLine).join("\n");
|
|
237
|
+
const blockSha256 = createHash("sha256").update(oldBlockText).digest("hex");
|
|
238
|
+
commentBody += `| \`${file.filename}\` | \`${block.startLine + 1}\u2013${block.endLine}\` | \`${block.uuid}\` |
|
|
239
|
+
`;
|
|
240
|
+
commentBody += `> **sha256** \`${blockSha256}\`
|
|
241
|
+
|
|
242
|
+
`;
|
|
243
|
+
}
|
|
244
|
+
commentBody += `Please review whether:
|
|
245
|
+
`;
|
|
246
|
+
commentBody += `- The removal of these compliance annotations is intentional
|
|
247
|
+
`;
|
|
248
|
+
commentBody += `- Alternative compliance measures have been implemented
|
|
249
|
+
`;
|
|
250
|
+
commentBody += `- The compliance coverage is still adequate
|
|
251
|
+
|
|
252
|
+
`;
|
|
253
|
+
commentBody += `---
|
|
254
|
+
|
|
205
255
|
`;
|
|
206
256
|
}
|
|
207
257
|
} catch (err) {
|
|
@@ -305,7 +355,8 @@ async function dismissOldReviews({
|
|
|
305
355
|
if (!reviews.length) break;
|
|
306
356
|
for (const r of reviews) {
|
|
307
357
|
const hasSignature = (r.body ?? "").includes(LULA_SIGNATURE);
|
|
308
|
-
|
|
358
|
+
const isAlreadyDismissed = r.state === "DISMISSED";
|
|
359
|
+
if (hasSignature && !isAlreadyDismissed) {
|
|
309
360
|
await octokit.pulls.dismissReview({
|
|
310
361
|
owner,
|
|
311
362
|
repo,
|
|
@@ -330,5 +381,6 @@ export {
|
|
|
330
381
|
fetchRawFileViaAPI,
|
|
331
382
|
getChangedBlocks,
|
|
332
383
|
getPRContext,
|
|
384
|
+
getRemovedBlocks,
|
|
333
385
|
postFinding
|
|
334
386
|
};
|
package/dist/index.html
CHANGED
|
@@ -6,28 +6,28 @@
|
|
|
6
6
|
<link rel="icon" href="/lula.png" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
8
|
|
|
9
|
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
|
10
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
11
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
12
|
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
|
9
|
+
<link rel="modulepreload" href="/_app/immutable/entry/start.BstRoW_s.js">
|
|
10
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/BaNghdtJ.js">
|
|
11
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/DTWPdvjs.js">
|
|
12
|
+
<link rel="modulepreload" href="/_app/immutable/entry/app.DW8m8_kr.js">
|
|
13
13
|
<link rel="modulepreload" href="/_app/immutable/chunks/DsnmJJEf.js">
|
|
14
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
15
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
16
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
14
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/BXUi170M.js">
|
|
15
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/WlyXjfrM.js">
|
|
16
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/CRa0j_Fx.js">
|
|
17
17
|
</head>
|
|
18
18
|
<body data-sveltekit-preload-data="hover">
|
|
19
19
|
<div style="display: contents">
|
|
20
20
|
<script>
|
|
21
21
|
{
|
|
22
|
-
|
|
22
|
+
__sveltekit_t0tvav = {
|
|
23
23
|
base: ""
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const element = document.currentScript.parentElement;
|
|
27
27
|
|
|
28
28
|
Promise.all([
|
|
29
|
-
import("/_app/immutable/entry/start.
|
|
30
|
-
import("/_app/immutable/entry/app.
|
|
29
|
+
import("/_app/immutable/entry/start.BstRoW_s.js"),
|
|
30
|
+
import("/_app/immutable/entry/app.DW8m8_kr.js")
|
|
31
31
|
]).then(([kit, app]) => {
|
|
32
32
|
kit.start(app, element);
|
|
33
33
|
});
|
package/dist/index.js
CHANGED
|
@@ -5628,6 +5628,18 @@ function getChangedBlocks(oldText, newText) {
|
|
|
5628
5628
|
}
|
|
5629
5629
|
return changed;
|
|
5630
5630
|
}
|
|
5631
|
+
function getRemovedBlocks(oldText, newText) {
|
|
5632
|
+
const oldBlocks = extractMapBlocks(oldText);
|
|
5633
|
+
const newBlocks = extractMapBlocks(newText);
|
|
5634
|
+
const removed = [];
|
|
5635
|
+
for (const oldBlock of oldBlocks) {
|
|
5636
|
+
const newMatch = newBlocks.find((b) => b.uuid === oldBlock.uuid);
|
|
5637
|
+
if (!newMatch) {
|
|
5638
|
+
removed.push(oldBlock);
|
|
5639
|
+
}
|
|
5640
|
+
}
|
|
5641
|
+
return removed;
|
|
5642
|
+
}
|
|
5631
5643
|
function containsLulaAnnotations(text) {
|
|
5632
5644
|
const lines = text.split("\n");
|
|
5633
5645
|
return lines.some((line) => line.includes("@lulaStart") || line.includes("@lulaEnd"));
|
|
@@ -5708,6 +5720,7 @@ Please review whether:
|
|
|
5708
5720
|
fetchRawFileViaAPI({ octokit, owner, repo, path: file.filename, ref: prBranch })
|
|
5709
5721
|
]);
|
|
5710
5722
|
const changedBlocks = getChangedBlocks(oldText, newText);
|
|
5723
|
+
const removedBlocks = getRemovedBlocks(oldText, newText);
|
|
5711
5724
|
for (const block of changedBlocks) {
|
|
5712
5725
|
console.log(`Commenting regarding \`${file.filename}\`.`);
|
|
5713
5726
|
leavePost = true;
|
|
@@ -5723,6 +5736,43 @@ Please review whether:
|
|
|
5723
5736
|
> **uuid**-\`${block.uuid}\`
|
|
5724
5737
|
**sha256** \`${blockSha256}\`
|
|
5725
5738
|
|
|
5739
|
+
`;
|
|
5740
|
+
}
|
|
5741
|
+
if (removedBlocks.length > 0) {
|
|
5742
|
+
leavePost = true;
|
|
5743
|
+
console.log(`Found removed annotations in \`${file.filename}\`.`);
|
|
5744
|
+
commentBody += `
|
|
5745
|
+
|
|
5746
|
+
**Compliance Warning: Lula annotations were removed from \`${file.filename}\`**
|
|
5747
|
+
|
|
5748
|
+
`;
|
|
5749
|
+
commentBody += `The following compliance annotation blocks were present in the original file but are missing in the updated version:
|
|
5750
|
+
|
|
5751
|
+
`;
|
|
5752
|
+
commentBody += `| File | Original Lines | UUID |
|
|
5753
|
+
`;
|
|
5754
|
+
commentBody += `| ---- | -------------- | ---- |
|
|
5755
|
+
`;
|
|
5756
|
+
for (const block of removedBlocks) {
|
|
5757
|
+
const oldBlockText = oldText.split("\n").slice(block.startLine, block.endLine).join("\n");
|
|
5758
|
+
const blockSha256 = createHash2("sha256").update(oldBlockText).digest("hex");
|
|
5759
|
+
commentBody += `| \`${file.filename}\` | \`${block.startLine + 1}\u2013${block.endLine}\` | \`${block.uuid}\` |
|
|
5760
|
+
`;
|
|
5761
|
+
commentBody += `> **sha256** \`${blockSha256}\`
|
|
5762
|
+
|
|
5763
|
+
`;
|
|
5764
|
+
}
|
|
5765
|
+
commentBody += `Please review whether:
|
|
5766
|
+
`;
|
|
5767
|
+
commentBody += `- The removal of these compliance annotations is intentional
|
|
5768
|
+
`;
|
|
5769
|
+
commentBody += `- Alternative compliance measures have been implemented
|
|
5770
|
+
`;
|
|
5771
|
+
commentBody += `- The compliance coverage is still adequate
|
|
5772
|
+
|
|
5773
|
+
`;
|
|
5774
|
+
commentBody += `---
|
|
5775
|
+
|
|
5726
5776
|
`;
|
|
5727
5777
|
}
|
|
5728
5778
|
} catch (err) {
|
|
@@ -5826,7 +5876,8 @@ async function dismissOldReviews({
|
|
|
5826
5876
|
if (!reviews.length) break;
|
|
5827
5877
|
for (const r of reviews) {
|
|
5828
5878
|
const hasSignature = (r.body ?? "").includes(LULA_SIGNATURE);
|
|
5829
|
-
|
|
5879
|
+
const isAlreadyDismissed = r.state === "DISMISSED";
|
|
5880
|
+
if (hasSignature && !isAlreadyDismissed) {
|
|
5830
5881
|
await octokit.pulls.dismissReview({
|
|
5831
5882
|
owner,
|
|
5832
5883
|
repo,
|