PageSourceSearch

https://roiscale.ai/chunk-BFTRJW4Z.js

js roiscale.ai collected 2026-10-05 14:43:24 UTC 38,640 bytes, 3 lines download raw bytes

1import{a as B}from"./chunk-QUVHIJGT.js";import{a as X}from"./chunk-53JQ5TNC.js";import"./chunk-5VPXBEUU.js";import{a as D,b as L,d as W,h as N,r as Y,s as H,t as K,w as Q,z as $}from"./chunk-P5GJR4AC.js";import"./chunk-ME32OR76.js";import"./chunk-RGZ4OJ2S.js";import{z as I}from"./chunk-BQVU46A6.js";import{$a as V,$b as U,Ab as P,C as O,I as y,Ib as v,Mb as u,Na as d,Ob as l,S as F,X as m,Y as g,Yb as s,Zb as M,_b as z,bc as C,cc as h,d as T,dc as x,ha as _,rb as b,sb as f,tb as A,ub as R,vb as w,wb as S,xb as p,yb as n,zb as i}from"./chunk-NLDCKMPI.js";import{a as j,b as q}from"./chunk-ODN5LVDJ.js";var te=(r,c)=>c.id;function ne(r,c){if(r&1){let e=v();n(0,"div",1)(1,"span",4),s(2,"error"),i(),n(3,"span"),s(4),i(),n(5,"button",5),u("click",function(){m(e);let t=l();return g(t.error.set(null))}),s(6,"\xD7"),i()()}if(r&2){let e=l();d(4),M(e.error())}}function ie(r,c){r&1&&(n(0,"div",2),s(1,"Category saved"),i())}function oe(r,c){r&1&&(n(0,"div",9),P(1,"div",11),n(2,"p"),s(3,"Loading categories\u2026"),i()())}function re(r,c){r&1&&(n(0,"div",10)(1,"h3"),s(2,"No categories yet"),i(),n(3,"p"),s(4,"Add at least one so visitors can tell you what they need."),i()())}function ae(r,c){r&1&&(n(0,"span",15),s(1,"Disabled"),i())}function se(r,c){if(r&1&&s(0),r&2){let e=l().$implicit;U(" \xB7 ",e.submissionCount," ticket",e.submissionCount===1?"":"s"," ")}}function de(r,c){if(r&1){let e=v();n(0,"div",12)(1,"div",13)(2,"div",14),s(3),b(4,ae,2,0,"span",15),i(),n(5,"div",16),s(6),b(7,se,1,2),i()(),n(8,"div",17)(9,"button",18),u("click",function(){let t=m(e).$index,a=l(3);return g(a.move(t,-1))}),s(10," Move up "),i(),n(11,"button",18),u("click",function(){let t=m(e).$index,a=l(3);return g(a.move(t,1))}),s(12," Move down "),i(),n(13,"button",19),u("click",function(){let t=m(e).$implicit,a=l(3);return g(a.startEdit(t))}),s(14,"Edit"),i(),n(15,"button",20),u("click",function(){let t=m(e).$implicit,a=l(3);return g(a.toggleEnabled(t))}),s(16),i(),n(17,"button",20),u("click",function(){let t=m(e).$implicit,a=l(3);return g(a.deleteCategory(t))}),s(18,"Delete"),i()()()}if(r&2){let e=c.$implicit,o=c.$index,t=l(3);d(3),z(" ",e.label," "),d(),f(e.enabled?-1:4),d(2),z(" ",e.description||"No description"," "),d(),f(e.submissionCount?7:-1),d(2),p("disabled",o===0),d(2),p("disabled",o===t.categories().length-1),d(5),z(" ",e.enabled?"Disable":"Enable"," ")}}function le(r,c){if(r&1&&w(0,de,19,7,"div",12,te),r&2){let e=l(2);S(e.categories())}}function ce(r,c){if(r&1){let e=v();n(0,"div",6)(1,"p",7),s(2,' These are the choices in the "What is this about?" dropdown on your support form, in the order shown here. Disable a category to hide it without losing its tickets. '),i(),n(3,"button",8),u("click",function(){m(e);let t=l();return g(t.startCreate())}),s(4," Add category "),i()(),b(5,oe,4,0,"div",9)(6,re,5,0,"div",10)(7,le,2,0)}if(r&2){let e=l();d(5),f(e.isLoading()?5:e.categories().length===0?6:7)}}function me(r,c){r&1&&P(0,"span",36)}function ge(r,c){if(r&1){let e=v();n(0,"div",3)(1,"div",21)(2,"h2"),s(3),i(),n(4,"p"),s(5,"Renaming a category leaves existing tickets labelled the way they were filed."),i()(),n(6,"div",22)(7,"div",23)(8,"label",24),s(9,"Label"),i(),n(10,"input",25),x("ngModelChange",function(t){m(e);let a=l();return h(a.draftLabel,t)||(a.draftLabel=t),g(t)}),i()(),n(11,"div",23)(12,"label",26),s(13,"Description"),i(),n(14,"textarea",27),x("ngModelChange",function(t){m(e);let a=l();return h(a.draftDescription,t)||(a.draftDescription=t),g(t)}),i(),n(15,"span",28),s(16,"Optional hint shown under the dropdown once this option is picked."),i()(),n(17,"div",29)(18,"input",30),x("ngModelChange",function(t){m(e);let a=l();return h(a.draftEnabled,t)||(a.draftEnabled=t),g(t)}),i(),n(19,"label",31)(20,"span",32),s(21,"Offer this category on the public form"),i()()(),n(22,"div",33)(23,"button",34),u("click",function(){m(e);let t=l();return g(t.cancelEdit())}),s(24,"Cancel"),i(),n(25,"button",35),u("click",function(){m(e);let t=l();return g(t.save())}),b(26,me,1,0,"span",36),s(27," Save category "),i()()()()}if(r&2){let e=l();d(3),M(e.isNew()?"New category":"Edit category"),d(7),C("ngModel",e.draftLabel),d(4),C("ngModel",e.draftDescription),d(4),C("ngModel",e.draftEnabled),d(7),p("disabled",e.isSaving()||!e.draftL
1abel.trim()),d(),f(e.isSaving()?26:-1)}}var G=(()=>{class r{constructor(){this.supportService=F(B),this.destroy$=new T,this.categories=_([]),this.isLoading=_(!0),this.isSaving=_(!1),this.error=_(null),this.saveSuccess=_(!1),this.editing=_(null),this.isNew=_(!1),this.draftLabel="",this.draftDescription="",this.draftEnabled=!0}ngOnInit(){this.loadCategories()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadCategories(){this.isLoading.set(!0),this.supportService.getCategories().pipe(y(this.destroy$),O(()=>this.isLoading.set(!1))).subscribe({next:e=>this.categories.set(e),error:e=>this.error.set(e.message||"Failed to load categories")})}startCreate(){this.isNew.set(!0),this.draftLabel="",this.draftDescription="",this.draftEnabled=!0,this.editing.set({id:"",tenantId:"",label:"",slug:"",enabled:!0,sortOrder:0})}startEdit(e){this.isNew.set(!1),this.draftLabel=e.label,this.draftDescription=e.description||"",this.draftEnabled=e.enabled,this.editing.set(e)}cancelEdit(){this.editing.set(null)}save(){let e=this.editing();if(!e)return;let o={label:this.draftLabel.trim(),description:this.draftDescription.trim()||void 0,enabled:this.draftEnabled};this.isSaving.set(!0),this.error.set(null),(this.isNew()?this.supportService.createCategory(o):this.supportService.updateCategory(e.id,o)).pipe(y(this.destroy$),O(()=>this.isSaving.set(!1))).subscribe({next:()=>{this.editing.set(null),this.saveSuccess.set(!0),setTimeout(()=>this.saveSuccess.set(!1),3e3),this.loadCategories()},error:a=>this.error.set(a.message||"Failed to save the category")})}toggleEnabled(e){this.supportService.updateCategory(e.id,{label:e.label,description:e.description,enabled:!e.enabled}).pipe(y(this.destroy$)).subscribe({next:()=>this.loadCategories(),error:o=>this.error.set(o.message||"Failed to update the category")})}deleteCategory(e){this.supportService.deleteCategory(e.id).pipe(y(this.destroy$)).subscribe({next:()=>this.loadCategories(),error:o=>this.error.set(o.message||"Failed to delete the category")})}move(e,o){let t=this.categories(),a=e+o;if(a<0||a>=t.length)return;let k=t.map(E=>E.id);
1[k[e],k[a]]=[k[a],k[e]],this.supportService.reorderCategories(k).pipe(y(this.destroy$)).subscribe({next:E=>this.categories.set(E),error:E=>this.error.set(E.message||"Failed to reorder categories")})}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=V({type:r,selectors:[["app-support-categories"]],decls:5,vars:3,consts:[["data-cy","support-categories",1,"categories-page"],[1,"message","error-message"],[1,"success-message"],[1,"settings-section"],[1,"material-icons"],["type","button",1,"close-btn",3,"click"],[1,"toolbar"],[1,"muted"],["type","button","data-cy","support-add-category",1,"btn","btn-primary",3,"click"],[1,"loading-state"],[1,"empty-state"],[1,"spinner"],[1,"item-card"],[1,"item-info"],[1,"item-title"],[1,"status-badge","status-closed"],[1,"item-subtitle"],[1,"item-actions"],["type","button",1,"btn","btn-ghost","btn-sm",3,"click","disabled"],["type","button",1,"btn","btn-secondary","btn-sm",3,"click"],["type","button",1,"btn","btn-ghost","btn-sm",3,"click"],[1,"section-header"],[1,"section-content"],[1,"form-group"],["for","category-label",1,"form-label"],["id","category-label","placeholder","Report a technical issue","data-cy","support-category-label",1,"form-input",3,"ngModelChange","ngModel"],["for","category-description",1,"form-label"],["id","category-description","rows","2",1,"form-input","form-textarea",3,"ngModelChange","ngModel"],[1,"form-hint"],[1,"form-group","form-checkbox-group"],["id","category-enabled","type","checkbox",1,"form-checkbox",3,"ngModelChange","ngModel"],["for","category-enabled",1,"checkbox-label"],[1,"label-text"],[1,"form-actions"],["type","button",1,"btn","btn-ghost",3,"click"],["type","button","data-cy","support-save-category",1,"btn","btn-primary",3,"click","disabled"],[1,"spinner-sm"]],template:function(o,t){o&1&&(n(0,"div",0),b(1,ne,7,1,"div",1),b(2,ie,2,0,"div",2),b(3,ce,8,1)(4,ge,28,6,"div",3),i()),o&2&&(d(),f(t.error()?1:-1),d(),f(t.saveSuccess()?2:-1),d(),f(t.editing()?4:3))},dependencies:[I,$,L,D,W,N],styles:[`.settings-page[_ngcontent-%COMP%]{padding:2rem;max-width:900px}.page-header[_ngcontent-%COMP%]{margin-bottom:2rem}.page-header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:1.75rem;font-weight:700;color:var(--text-primary);margin-bottom:.25rem}.page-header[_ngcontent-%COMP%]   .subtitle[_ngcontent-%COMP%]{color:var(--text-secondary);font-size:.9375rem}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem;gap:1rem}.loading-state[_ngcontent-%COMP%]   .spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid var(--gray-200);border-top-color:var(--primary-600);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:var(--text-secondary)}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.settings-section[_ngcontent-%COMP%]{background:var(--bg-primary);border-radius:var(--radius-xl);box-shadow:var(--shadow-md);margin-bottom:1.5rem;overflow:hidden}.section-header[_ngcontent-%COMP%]{padding:1.25rem 1.5rem;border-bottom:1px solid var(--border-light)}.section-header[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;color:var(--text-primary);margin-bottom:.25rem}.section-header[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-secondary);margin:0}.section-content[_ngcontent-%COMP%]{padding:1.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:1.5rem}@media(max-width:640px){.form-row[_ngcontent-%COMP%]{grid-template-columns:1fr}}.form-group[_ngcontent-%COMP%]{margin-bottom:1.25rem}.form-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;font-size:.875rem;color:var(--text-primary)}.form-input[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:.9375rem;border:2px solid var(--border-light);border-radius:var(--radius-lg);background:var(--bg-primary);color:var(--text-primary);transition:all var(--transition-fast)}.form-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--primary-500);box-shadow:0 0 0 3px #6366f11a}.form-input[_ngcontent-%COMP%]::placeholder{color:var(--text-muted)}.form-input.error[_ngcontent-%COMP%]{border-color:var(--error-500)}.form-input.error[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 3px #ef44441a}.form-input[_ngcontent-%COMP%]:disabled{background:var(--bg-secondary);color:var(--text-muted);cursor:not-allowed}.form-select[_ngcontent-%COMP%]{appearance:none;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .75rem center;background-repeat:no-repeat;background-size:1.25em 1.25em;padding-right:2.5rem}.form-textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px}.form-checkbox-group[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem}.form-checkbox[_ngcontent-%COMP%]{width:20px;height:20px;border:2px solid var(--border-default);border-radius:var(--radius-sm);cursor:pointer;flex-shrink:0;margin-top:2px;accent-color:var(--primary-600)}.checkbox-label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.125rem}.checkbox-label[_ngcontent-%COMP%]   .label-text[_ngcontent-%COMP%]{font-weight:500;color:var(--text-primary);font-size:.9375rem}.checkbox-label[_ngcontent-%COMP%]   .label-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--text-muted)}.error-message[_ngcontent-%COMP%]{display:block;margin-top:.375rem;font-size:.8125rem;color:var(--error-500)}.form-hint[_ngcontent-%COMP%]{display:block;margin-top:.375rem;font-size:.8125rem;color:var(--text-muted)}.form-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;
1gap:1rem;padding-top:1rem}.success-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.625rem 1rem;background:#dcfce7;color:#166534;border-radius:var(--radius-lg);font-size:.875rem;font-weight:500;animation:_ngcontent-%COMP%_slideIn .3s ease}@keyframes _ngcontent-%COMP%_slideIn{0%{opacity:0;transform:translate(10px)}to{opacity:1;transform:translate(0)}}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1.5rem;font-size:.9375rem;font-weight:600;line-height:1.5;border:none;border-radius:var(--radius-lg);cursor:pointer;transition:all var(--transition-base);text-decoration:none}.btn[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.btn-primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--primary-600) 0%,var(--primary-700) 100%);color:var(--text-inverse);box-shadow:var(--shadow-md)}.btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:linear-gradient(135deg,var(--primary-700) 0%,var(--primary-800) 100%);box-shadow:var(--shadow-lg);transform:translateY(-1px)}.btn-secondary[_ngcontent-%COMP%]{background:var(--bg-primary);color:var(--text-primary);border:2px solid var(--border-default)}.btn-secondary[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--primary-500);color:var(--primary-600)}.btn-ghost[_ngcontent-%COMP%]{background:transparent;color:var(--text-secondary);padding:.5rem 1rem}.btn-ghost[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--bg-secondary);color:var(--text-primary)}.btn-danger[_ngcontent-%COMP%]{background:var(--error-500);color:#fff}.btn-danger[_ngcontent-%COMP%]:hover:not(:disabled){background:#dc2626}.btn-sm[_ngcontent-%COMP%]{padding:.5rem 1rem;font-size:.8125rem}.spinner-sm[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:_ngcontent-%COMP%_spin .75s linear infinite}.status-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.25rem .75rem;font-size:.75rem;font-weight:600;border-radius:var(--radius-full);text-transform:uppercase;letter-spacing:.03em}.status-badge.status-active[_ngcontent-%COMP%], .status-badge.status-verified[_ngcontent-%COMP%]{background:#dcfce7;color:#166534}.status-badge.status-pending[_ngcontent-%COMP%], .status-badge.status-verifying[_ngcontent-%COMP%]{background:#fef3c7;color:#92400e}.status-badge.status-failed[_ngcontent-%COMP%]{background:#fee2e2;color:#991b1b}.empty-state[_ngcontent-%COMP%]{text-align:center;padding:3rem 1.5rem;color:var(--text-muted)}.empty-state[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:48px;height:48px;margin-bottom:1rem;opacity:.5}.empty-state[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;color:var(--text-primary);margin-bottom:.5rem}.empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:.875rem;margin-bottom:1.5rem}.item-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1rem;border:1px solid var(--border-light);border-radius:var(--radius-lg);background:var(--bg-secondary);margin-bottom:.75rem}.item-card[_ngcontent-%COMP%]:last-child{margin-bottom:0}.item-info[_ngcontent-%COMP%]{flex:1;min-width:0}.item-info[_ngcontent-%COMP%]   .item-title[_ngcontent-%COMP%]{font-weight:600;color:var(--text-primary);font-size:.9375rem}.item-info[_ngcontent-%COMP%]   .item-subtitle[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--text-muted)}.item-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.toggle-switch[_ngcontent-%COMP%]{position:relative;width:48px;height:26px;background:var(--gray-300);border-radius:var(--radius-full);cursor:pointer;transition:background var(--transition-fast)}.toggle-switch.active[_ngcontent-%COMP%]{background:var(--primary-600)}.toggle-switch[_ngcontent-%COMP%]   .toggle-knob[_ngcontent-%COMP%]{position:absolute;top:3px;left:3px;width:20px;height:20px;background:#fff;border-radius:50%;transition:transform var(--transition-fast);box-shadow:var(--shadow-sm)}.toggle-switch.active[_ngcontent-%COMP%]   .toggle-knob[_ngcontent-%COMP%]{transform:translate(22px)}@media(max-width:768px){.settings-page[_ngcontent-%COMP%]{padding:1.5rem}.page-header[_ngcontent-%COMP%]{margin-bottom:1.5rem}.page-header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:1.5rem}.section-header[_ngcontent-%COMP%], .section-content[_ngcontent-%COMP%]{padding:1rem}.form-actions[_ngcontent-%COMP%]{flex-direction:column-reverse}.form-actions[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{width:100%}}.toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.5rem}.muted[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-muted);margin:0}.message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:var(--radius-lg);margin-bottom:1rem}.message.error-message[_ngcontent-%COMP%]{background:#fee2e2;color:#991b1b}.close-btn[_ngcontent-%COMP%]{margin-left:auto;border:none;background:transparent;font-size:1.25rem;line-height:1;cursor:pointer;color:inherit}.status-badge.status-closed[_ngcontent-%COMP%]{background:var(--gray-200, #e5e7eb);color:var(--text-secondary);margin-left:.5rem}.fields-heading[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);margin:1.5rem 0 .75rem}
1.field-editor[_ngcontent-%COMP%]{border:1px solid var(--border-light);border-radius:var(--radius-lg);padding:1rem;margin-bottom:1rem;background:var(--bg-secondary)}.field-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem}`]})}}return r})();var J=(r,c)=>c.id;function pe(r,c){if(r&1){let e=v();n(0,"div",1)(1,"span",4),s(2,"error"),i(),n(3,"span"),s(4),i(),n(5,"button",5),u("click",function(){m(e);let t=l();return g(t.error.set(null))}),s(6,"\xD7"),i()()}if(r&2){let e=l();d(4),M(e.error())}}function ue(r,c){r&1&&(n(0,"div",2),s(1,"Form saved"),i())}function _e(r,c){r&1&&(n(0,"div",3),P(1,"div",6),n(2,"p"),s(3,"Loading the form\u2026"),i()())}function be(r,c){r&1&&P(0,"span",11)}function fe(r,c){if(r&1&&(n(0,"option",23),s(1),i()),r&2){let e=c.$implicit;p("ngValue",e.id),d(),M(e.name)}}function Ce(r,c){r&1&&(n(0,"span",21),s(1,"*"),i())}function he(r,c){if(r&1&&(n(0,"option",23),s(1),i()),r&2){let e=c.$implicit;p("ngValue",e.id),d(),M(e.name)}}function xe(r,c){if(r&1&&(n(0,"option",40),s(1),i()),r&2){let e=c.$implicit;p("value",e),d(),M(e)}}function ye(r,c){if(r&1){let e=v();n(0,"div",13)(1,"label",36),s(2,"Options"),i(),n(3,"textarea",45),x("ngModelChange",function(t){m(e);let a=l().$implicit;return h(a.optionsText,t)||(a.optionsText=t),g(t)}),i()()}if(r&2){let e=l(),o=e.$implicit,t=e.$index;d(3),C("ngModel",o.optionsText),p("name","options-"+t)}}function ve(r,c){if(r&1){let e=v();n(0,"div",32)(1,"div",19)(2,"div",13)(3,"label",36),s(4,"Label"),i(),n(5,"input",37),x("ngModelChange",function(t){let a=m(e).$implicit;return h(a.label,t)||(a.label=t),g(t)}
1),i()(),n(6,"div",13)(7,"label",36),s(8,"Key"),i(),n(9,"input",38),x("ngModelChange",function(t){let a=m(e).$implicit;return h(a.key,t)||(a.key=t),g(t)}),i(),n(10,"span",18),s(11,"Lowercase letters, digits, and underscores."),i()()(),n(12,"div",19)(13,"div",13)(14,"label",36),s(15,"Type"),i(),n(16,"select",39),x("ngModelChange",function(t){let a=m(e).$implicit;return h(a.type,t)||(a.type=t),g(t)}),w(17,xe,2,2,"option",40,R),i()(),n(19,"div",26)(20,"input",41),x("ngModelChange",function(t){let a=m(e).$implicit;return h(a.required,t)||(a.required=t),g(t)}),i(),n(21,"label",42)(22,"span",29),s(23,"Required"),i()()()(),b(24,ye,4,2,"div",13),n(25,"div",43)(26,"button",44),u("click",function(){let t=m(e).$index,a=l(2);return g(a.moveField(t,-1))}),s(27,"Move up"),i(),n(28,"button",44),u("click",function(){let t=m(e).$index,a=l(2);return g(a.moveField(t,1))}),s(29,"Move down"),i(),n(30,"button",44),u("click",function(){let t=m(e).$index,a=l(2);return g(a.removeField(t))}),s(31,"Remove"),i()()()}if(r&2){let e=c.$implicit,o=c.$index,t=l(2);d(5),C("ngModel",e.label),p("name","label-"+o),d(4),C("ngModel",e.key),p("name","key-"+o),d(7),C("ngModel",e.type),p("name","type-"+o),d(),S(t.fieldTypes),d(3),C("ngModel",e.required),p("name","required-"+o),d(4),f(e.type==="SELECT"?24:-1)}}function Me(r,c){if(r&1){let e=v();n(0,"div",7)(1,"div",8)(2,"div",9)(3,"h2"),s(4,"Your support form"),i(),n(5,"p"),s(6," Visitors always give a name, an email address, and pick a category. Add any extra questions you want answered below. "),i()(),n(7,"button",10),u("click",function(){m(e);let t=l();return g(t.save())}),b(8,be,1,0,"span",11),s(9," Save form "),i()(),n(10,"div",12)(11,"div",13)(12,"label",14),s(13,"Heading"),i(),n(14,"input",15),x("ngModelChange",function(t){m(e);let a=l();return h(a.draftTitle,t)||(a.draftTitle=t),g(t)}),i()(),n(15,"div",13)(16,"label",16),s(17,"Description"),i(),n(18,"textarea",17),x("ngModelChange",function(t){m(e);let a=l();return h(a.draftDescription,t)||(a.draftDescription=t),g(t)}),i(),n(19,"span",18),s(20,"Shown above the form on the public page."),i()(),n(21,"div",19)(22,"div",13)(23,"label",20),s(24,"Category "),n(25,"span",21),s(26,"*"),i()(),n(27,"select",22),u("ngModelChange",function(t){m(e);let a=l();return g(a.onCategoryChange(t))}),n(28,"option",23),s(29,"\u2014 Select a category \u2014"),i(),w(30,fe,2,2,"option",23,J),i()(),n(32,"div",13)(33,"label",24),s(34," Subcategory "),b(35,Ce,2,0,"span",21),i(),n(36,"select",25),x("ngModelChange",function(t){m(e);let a=l();return h(a.selectedSubcategoryId,t)||(a.selectedSubcategoryId=t),g(t)}),n(37,"option",23),s(38),i(),w(39,he,2,2,"option",23,J),i(),n(41,"span",18),s(42," Files the form like a content item under that category. Use a single-page subcategory so the menu opens the form directly; a regular subcategory lists it with other items. "),i()()(),n(43,"div",26)(44,"input",27),x("ngModelChange",function(t){m(e);let a=l();return h(a.draftShowForm,t)||(a.draftShowForm=t),g(t)}),i(),n(45,"label",28)(46,"span",29),s(47,"Publish the contact form"),i(),n(48,"span",30),s(49,"When off, the /support page and menu link are hidden from visitors."),i()()(),n(50,"h3",31),s(51,"Questions"),i(),w(52,ve,32,9,"div",32,A),n(54,"button",33),u("click",function(){m(e);let t=l();return g(t.addField())}),s(55," Add question "),i()()(),n(56,"div",34)(57,"div",35)(58,"h2"),s(59,"Form categories"),i(),n(60,"p"),s(61,"Topic dropdown options visitors pick on the contact form."),i()(),n(62,"div",12),P(63,"app-support-categories"),i()()}if(r&2){let e=l();d(7),p("disabled",e.isSaving()),d(),f(e.isSaving()?8:-1),d(6),C("ngModel",e.draftTitle),d(4),C("ngModel",e.draftDescription),d(9),p("ngModel",e.selectedCategoryId),d(),p("ngValue",null),d(2),S(e.rootCategories()),d(5),f(e.subcategories().length>0?35:-1),d(),C("ngModel",e.selectedSubcategoryId),p("disabled",!e.selectedCategoryId),d(),p("ngValue",null),d(),M(e.subcategories().length>0?"\u2014 Select a subcategory \u2014":"\u2014 None \u2014"),d(),S(e.subcategories()),d(5),C("ngModel",e.draftShowForm),d(8),S(e.draftFields)}}var $e=(()=>
1{class r{constructor(){this.supportService=F(B),this.contentService=F(X),this.destroy$=new T,this.fieldTypes=["TEXT","EMAIL","TEXTAREA","SELECT"],this.isLoading=_(!0),this.isSaving=_(!1),this.error=_(null),this.saveSuccess=_(!1),this.draftTitle="",this.draftDescription="",this.draftFields=[],this.draftShowForm=!0,this.rootCategories=_([]),this.subcategories=_([]),this.selectedCategoryId=null,this.selectedSubcategoryId=null}ngOnInit(){this.loadRootCategories(),this.loadForm()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadForm(){this.isLoading.set(!0),this.supportService.getConfig().pipe(y(this.destroy$),O(()=>this.isLoading.set(!1))).subscribe({next:e=>{this.draftTitle=e.formTitle||"",this.draftDescription=e.formDescription||"",this.draftShowForm=e.showForm!==!1,this.draftFields=(e.fields||[]).map(o=>q(j({},o),{optionsText:(o.options||[]).join(`
2`)})),this.restoreCategorySelection(e.primaryCategoryId??null)},error:e=>this.error.set(e.message||"Failed to load the form")})}onCategoryChange(e){if(this.selectedCategoryId=e,this.selectedSubcategoryId=null,!e){this.subcategories.set([]);return}this.loadSubcategories(e)}loadRootCategories(){this.contentService.getCategories(null).pipe(y(this.destroy$)).subscribe({next:e=>this.rootCategories.set(Array.isArray(e)?e:[]),error:()=>this.rootCategories.set([])})}loadSubcategories(e){this.contentService.getCategories(e).pipe(y(this.destroy$)).subscribe({next:o=>this.subcategories.set(Array.isArray(o)?o:[]),error:()=>this.subcategories.set([])})}restoreCategorySelection(e){if(!e){this.selectedCategoryId=null,this.selectedSubcategoryId=null,this.subcategories.set([]);return}this.contentService.getCategoryById(e).pipe(y(this.destroy$)).subscribe({next:o=>{o.parentId?(this.selectedCategoryId=o.parentId,this.selectedSubcategoryId=o.id,this.loadSubcategories(o.parentId)):(this.selectedCategoryId=o.id,this.selectedSubcategoryId=null,this.loadSubcategories(o.id))},error:()=>{this.selectedCategoryId=null,this.selectedSubcategoryId=null}})}addField(){this.draftFields=[...this.draftFields,this.blankField()]}removeField(e){this.draftFields=this.draftFields.filter((o,t)=>t!==e)}moveField(e,o){let t=e+o;if(t<0||t>=this.draftFields.length)return;let a=[...this.draftFields];[a[e],a[t]]=[a[t],a[e]],this.draftFields=a}save(){if(!this.selectedCategoryId){this.error.set("Choose a category to file the Support form under.");return}if(this.subcategories().length>0&&!this.selectedSubcategoryId){this.error.set("Choose a subcategory (the form is filed like a content item under a leaf category).");return}this.isSaving.set(!0),this.error.set(null),this.supportService.updateConfig({formTitle:this.draftTitle.trim(),formDescription:this.draftDescription.trim(),showForm:this.draftShowForm,primaryCategoryId:this.selectedSubcategoryId??this.selectedCategoryId,fields:this.draftFields.map(e=>({key:e.key.trim(),label:e.label.trim(),type:e.type,required:e.required,placeholder:e.placeholder||void 0,maxLength:e.maxLength||void 0,options:e.type==="SELECT"?e.optionsText.split(`
3`).map(o=>o.trim()).filter(Boolean):void 0}))}).pipe(y(this.destroy$),O(()=>this.isSaving.set(!1))).subscribe({next:()=>{this.saveSuccess.set(!0),setTimeout(()=>this.saveSuccess.set(!1),3e3)},error:e=>this.error.set(e.message||"Failed to save the form")})}blankField(){return{key:"",label:"",type:"TEXT",required:!1,optionsText:""}}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=V({type:r,selectors:[["app-support-form"]],decls:5,vars:3,consts:[["data-cy","support-form",1,"form-page"],[1,"message","error-message"],[1,"success-message"],[1,"loading-state"],[1,"material-icons"],["type","button",1,"close-btn",3,"click"],[1,"spinner"],[1,"settings-section"],[1,"section-header","section-header-row"],[1,"section-header-text"],["type","button","data-cy","support-save-form",1,"btn","btn-primary",3,"click","disabled"],[1,"spinner-sm"],[1,"section-content"],[1,"form-group"],["for","form-title",1,"form-label"],["id","form-title","data-cy","support-form-title",1,"form-input",3,"ngModelChange","ngModel"],["for","form-description",1,"form-label"],["id","form-description","rows","2",1,"form-input","form-textarea",3,"ngModelChange","ngModel"],[1,"form-hint"],[1,"form-row"],["for","support-category",1,"form-label"],[1,"required"],["id","supp
3ort-category","data-cy","support-form-category","required","",1,"form-input","form-select",3,"ngModelChange","ngModel"],[3,"ngValue"],["for","support-subcategory",1,"form-label"],["id","support-subcategory","data-cy","support-form-subcategory",1,"form-input","form-select",3,"ngModelChange","ngModel","disabled"],[1,"form-group","form-checkbox-group"],["id","form-publish","type","checkbox","data-cy","support-form-publish",1,"form-checkbox",3,"ngModelChange","ngModel"],["for","form-publish",1,"checkbox-label"],[1,"label-text"],[1,"label-hint"],[1,"fields-heading"],[1,"field-editor"],["type","button","data-cy","support-add-field",1,"btn","btn-secondary","btn-sm",3,"click"],[1,"settings-section","categories-section"],[1,"section-header"],[1,"form-label"],[1,"form-input",3,"ngModelChange","ngModel","name"],["placeholder","message",1,"form-input",3,"ngModelChange","ngModel","name"],[1,"form-input","form-select",3,"ngModelChange","ngModel","name"],[3,"value"],["type","checkbox",1,"form-checkbox",3,"ngModelChange","ngModel","name"],[1,"checkbox-label"],[1,"field-actions"],["type","button",1,"btn","btn-ghost","btn-sm",3,"click"],["rows","3","placeholder","One option per line",1,"form-input","form-textarea",3,"ngModelChange","ngModel","name"]],template:function(o,t){o&1&&(n(0,"div",0),b(1,pe,7,1,"div",1),b(2,ue,2,0,"div",2),b(3,_e,4,0,"div",3)(4,Me,64,12),i()),o&2&&(d(),f(t.error()?1:-1),d(),f(t.saveSuccess()?2:-1),d(),f(t.isLoading()?3:4))},dependencies:[I,$,H,K,L,D,Y,W,Q,N,G],styles:[`.settings-page[_ngcontent-%COMP%]{padding:2rem;max-width:900px}.page-header[_ngcontent-%COMP%]{margin-bottom:2rem}.page-header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:1.75rem;font-weight:700;color:var(--text-primary);margin-bottom:.25rem}.page-header[_ngcontent-%COMP%]   .subtitle[_ngcontent-%COMP%]{color:var(--text-secondary);font-size:.9375rem}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem;gap:1rem}.loading-state[_ngcontent-%COMP%]   .spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid var(--gray-200);border-top-color:var(--primary-600);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:var(--text-secondary)}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.settings-section[_ngcontent-%COMP%]{background:var(--bg-primary);border-radius:var(--radius-xl);box-shadow:var(--shadow-md);margin-bottom:1.5rem;overflow:hidden}.section-header[_ngcontent-%COMP%]{padding:1.25rem 1.5rem;border-bottom:1px solid var(--border-light)}.section-header[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;color:var(--text-primary);margin-bottom:.25rem}.section-header[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-secondary);margin:0}.section-content[_ngcontent-%COMP%]{padding:1.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:1.5rem}@media(max-width:640px){.form-row[_ngcontent-%COMP%]{grid-template-columns:1fr}}.form-group[_ngcontent-%COMP%]{margin-bottom:1.25rem}.form-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;font-size:.875rem;color:var(--text-primary)}.form-input[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:.9375rem;border:2px solid var(--border-light);border-radius:var(--radius-lg);background:var(--bg-primary);color:var(--text-primary);transition:all var(--transition-fast)}.form-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--primary-500);box-shadow:0 0 0 3px #6366f11a}.form-input[_ngcontent-%COMP%]::placeholder{color:var(--text-muted)}.form-input.error[_ngcontent-%COMP%]{border-color:var(--error-500)}.form-input.error[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 3px #ef44441a}.form-input[_ngcontent-%COMP%]:disabled{background:var(--bg-secondary);color:var(--text-muted);cursor:not-allowed}.form-select[_ngcontent-%COMP%]{appearance:none;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .75rem center;background-repeat:no-repeat;background-size:1.25em 1.25em;padding-right:2.5rem}.form-textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px}.form-checkbox-group[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem}.form-checkbox[_ngcontent-%COMP%]{width:20px;height:20px;border:2px solid var(--border-default);border-radius:var(--radius-sm);cursor:pointer;flex-shrink:0;margin-top:2px;accent-color:var(--primary-600)}.checkbox-label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.125rem}.checkbox-label[_ngcontent-%COMP%]   .label-text[_ngcontent-%COMP%]{font-weight:500;color:var(--text-primary);font-size:.9375rem}.checkbox-label[_ngcontent-%COMP%]   .label-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--text-muted)}.error-message[_ngcontent-%COMP%]{display:block;margin-top:.375rem;font-size:.8125rem;color:var(--error-500)}.form-hint[_ngcontent-%COMP%]{display:block;margin-top:.375rem;font-size:.8125rem;color:var(--text-muted)}.form-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;
3gap:1rem;padding-top:1rem}.success-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.625rem 1rem;background:#dcfce7;color:#166534;border-radius:var(--radius-lg);font-size:.875rem;font-weight:500;animation:_ngcontent-%COMP%_slideIn .3s ease}@keyframes _ngcontent-%COMP%_slideIn{0%{opacity:0;transform:translate(10px)}to{opacity:1;transform:translate(0)}}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1.5rem;font-size:.9375rem;font-weight:600;line-height:1.5;border:none;border-radius:var(--radius-lg);cursor:pointer;transition:all var(--transition-base);text-decoration:none}.btn[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.btn-primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--primary-600) 0%,var(--primary-700) 100%);color:var(--text-inverse);box-shadow:var(--shadow-md)}.btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:linear-gradient(135deg,var(--primary-700) 0%,var(--primary-800) 100%);box-shadow:var(--shadow-lg);transform:translateY(-1px)}.btn-secondary[_ngcontent-%COMP%]{background:var(--bg-primary);color:var(--text-primary);border:2px solid var(--border-default)}.btn-secondary[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--primary-500);color:var(--primary-600)}.btn-ghost[_ngcontent-%COMP%]{background:transparent;color:var(--text-secondary);padding:.5rem 1rem}.btn-ghost[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--bg-secondary);color:var(--text-primary)}.btn-danger[_ngcontent-%COMP%]{background:var(--error-500);color:#fff}.btn-danger[_ngcontent-%COMP%]:hover:not(:disabled){background:#dc2626}.btn-sm[_ngcontent-%COMP%]{padding:.5rem 1rem;font-size:.8125rem}.spinner-sm[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:_ngcontent-%COMP%_spin .75s linear infinite}.status-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.25rem .75rem;font-size:.75rem;font-weight:600;border-radius:var(--radius-full);text-transform:uppercase;letter-spacing:.03em}.status-badge.status-active[_ngcontent-%COMP%], .status-badge.status-verified[_ngcontent-%COMP%]{background:#dcfce7;color:#166534}.status-badge.status-pending[_ngcontent-%COMP%], .status-badge.status-verifying[_ngcontent-%COMP%]{background:#fef3c7;color:#92400e}.status-badge.status-failed[_ngcontent-%COMP%]{background:#fee2e2;color:#991b1b}.empty-state[_ngcontent-%COMP%]{text-align:center;padding:3rem 1.5rem;color:var(--text-muted)}.empty-state[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:48px;height:48px;margin-bottom:1rem;opacity:.5}.empty-state[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;color:var(--text-primary);margin-bottom:.5rem}.empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:.875rem;margin-bottom:1.5rem}.item-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1rem;border:1px solid var(--border-light);border-radius:var(--radius-lg);background:var(--bg-secondary);margin-bottom:.75rem}.item-card[_ngcontent-%COMP%]:last-child{margin-bottom:0}.item-info[_ngcontent-%COMP%]{flex:1;min-width:0}.item-info[_ngcontent-%COMP%]   .item-title[_ngcontent-%COMP%]{font-weight:600;color:var(--text-primary);font-size:.9375rem}.item-info[_ngcontent-%COMP%]   .item-subtitle[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--text-muted)}.item-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.toggle-switch[_ngcontent-%COMP%]{position:relative;width:48px;height:26px;background:var(--gray-300);border-radius:var(--radius-full);cursor:pointer;transition:background var(--transition-fast)}.toggle-switch.active[_ngcontent-%COMP%]{background:var(--primary-600)}.toggle-switch[_ngcontent-%COMP%]   .toggle-knob[_ngcontent-%COMP%]{position:absolute;top:3px;left:3px;width:20px;height:20px;background:#fff;border-radius:50%;transition:transform var(--transition-fast);box-shadow:var(--shadow-sm)}.toggle-switch.active[_ngcontent-%COMP%]   .toggle-knob[_ngcontent-%COMP%]{transform:translate(22px)}@media(max-width:768px){.settings-page[_ngcontent-%COMP%]{padding:1.5rem}.page-header[_ngcontent-%COMP%]{margin-bottom:1.5rem}.page-header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:1.5rem}.section-header[_ngcontent-%COMP%], .section-content[_ngcontent-%COMP%]{padding:1rem}.form-actions[_ngcontent-%COMP%]{flex-direction:column-reverse}.form-actions[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{width:100%}}.section-header-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.section-header-text[_ngcontent-%COMP%]{flex:1;min-width:0}
3.categories-section[_ngcontent-%COMP%]{margin-top:1.5rem}.message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:var(--radius-lg);margin-bottom:1rem}.message.error-message[_ngcontent-%COMP%]{background:#fee2e2;color:#991b1b}.close-btn[_ngcontent-%COMP%]{margin-left:auto;border:none;background:transparent;font-size:1.25rem;line-height:1;cursor:pointer;color:inherit}.fields-heading[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);margin:1.5rem 0 .75rem}.field-editor[_ngcontent-%COMP%]{border:1px solid var(--border-light);border-radius:var(--radius-lg);padding:1rem;margin-bottom:1rem;background:var(--bg-secondary)}.field-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem}`]})}}return r})();export{$e as SupportFormComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.