1import{a as W,b as X}from"./chunk-SYEIQDUI.js";import{a as Q}from"./chunk-6KE6O5IE.js";import"./chunk-EUZ5ALPO.js";import"./chunk-Z6D74UMB.js";import{a as J}from"./chunk-NLNRFD76.js";import{a as G}from"./chunk-SMPFV5HB.js";import"./chunk-NKFHN2UT.js";import"./chunk-Z72XREES.js";import"./chunk-LXGHVDMZ.js";import{a as q}from"./chunk-4DCMMXMQ.js";import{a as j}from"./chunk-SD3WE74N.js";import"./chunk-5BH2DXPY.js";import{a as $}from"./chunk-ZG4SWA7Y.js";import{a as H}from"./chunk-VCT4T2P2.js";import"./chunk-W7PPZJOL.js";import"./chunk-LBQHVHOD.js";import"./chunk-RJBNMGAI.js";import{a as N}from"./chunk-6JVWF4IY.js";import"./chunk-KK6ZZPUF.js";import"./chunk-BTMCQCAC.js";import"./chunk-P5X5UTD7.js";import"./chunk-FISCDIEQ.js";import"./chunk-OFDVQPEO.js";import{c as P,d as M,f as b,g as x,h as S}from"./chunk-W4BNGQYG.js";import"./chunk-RENC6YYK.js";import"./chunk-M2LBETCN.js";import"./chunk-TTH7GFZH.js";import{a as L}from"./chunk-PKRSU6VJ.js";import"./chunk-MAW7FMI2.js";import{a as K}from"./chunk-KO2D6ELQ.js";import"./chunk-W2FPCXJS.js";import{f as U,h as B}from"./chunk-PRNDDZIA.js";import"./chunk-B7G3T42L.js";import"./chunk-A44CX4PV.js";import{$b as T,Ab as r,Fc as s,Gc as w,Ia as A,Ja as z,Ka as p,La as h,Mb as E,Rb as g,Zb as f,_a as k,bd as y,cd as R,dc as _,dd as F,ec as V,gc as I,hc as D,ic as a,jc as i,kc as C,oc as v,qa as O,tc as u,uc as l,za as d}from"./chunk-HWT7D4EW.js";function Y(o,c){if(o&1){let t=v();a(0,"app-button",11),u("onClick",function(){p(t);let e=l();return h(e.showSidebar("CREATE"))}),i()}}function Z(o,c){o&1&&(a(0,"div",6),C(1,"span",12),i())}function tt(o,c){o&1&&(a(0,"div",7),C(1,"img",13),a(2,"div"),s(3,"No shared authorizations found"),i()())}function et(o,c){o&1&&(a(0,"th"),s(1,"Actions"),i())}function nt(o,c){if(o&1){let t=v();a(0,"td")(1,"span",18)(2,"button",19),u("click",function(){p(t);let e=l().$implicit,m=l(2);return h(m.showSidebar("UPDATE",e.type,e))}),C(3,"i",20),i(),a(4,"button",21),u("click",function(){p(t);let e=l().$implicit,m=l(2);return h(m.showDeleteConfirmationModal(e))}),C(5,"i",22),i()()()}}function it(o,c){if(o&1&&(a(0,"tr")(1,"td"),s(2),i(),a(3,"td"),s(4),i(),a(5,"td")(6,"span",16),s(7),y(8,"authType"),i()(),a(9,"td")(10,"span",17),s(11),y(12,"authValue"),i()(),g(13,nt,6,0,"td"),i()),o&2){let t=c.$implicit,n=c.$index,e=l(2);r(2),w(n+1),r(2),w(t==null?null:t.name),r(3),w(R(8,5,t==null?null:t.type)),r(4),w(F(12,7,t.value,t.type)),r(2),_(e.allowEdit?13:-1)}}function ot(o,c){if(o&1&&(a(0,"div",8)(1,"table")(2,"tr")(3,"th"),s(4,"#"),i(),a(5,"th",14),s(6,"Name"),i(),a(7,"th",15),s(8,"Type"),i(),a(9,"th"),s(10,"Value"),i(),g(11,et,2,0,"th"),i(),I(12,it,14,10,"tr",null,V),i()()),o&2){let t=l();r(11),_(t.allowEdit?11:-1),r(),D(t.authorizations)}}function at(o,c){if(o&1){let t=v();a(0,"div",9)(1,"div",23),u("click",function(){p(t);let e=l();return h(e.hideOverlay())}),i(),a(2,"div",24)(3,"app-authorization",25),u("save",function(e){p(t);let m=l();return h(m.saveVariable(e))})("updateState",function(){p(t);let e=l();return h(e.onUpdateState())}),i()()()}if(o&2){let t=l();f("@showHideOverlay",t.showSidePanel().category.length>0?"show":"hide"),r(2),f("@toggleSidebar",t.showSidePanel().category.length>0?"show":"hide"),r(),f("appKey",t.applicationKey)}}function rt(o,c){if(o&1&&(a(0,"div",34),C(1,"i",38),a(2,"span",33),s(3),i()()),o&2){let t=l(2);r(3),w(t.deleteAuth.errMsg)}}function lt(o,c){if(o&1){let t=v();a(0,"div",26)(1,"div",27)(2,"div",28)(3,"span"),s(4,"Delete authorization"),i(),a(5,"i",29),u("click",function(){p(t);let e=l();return h(e.cancelDelete())}),i()(),a(6,"div",30)(7,"div",31),C(8,"i",32),a(9,"div",33),s(10,"Are you sure you want to delete this authorization?"),i()(),g(11,rt,4,1,"div",34),a(12,"div",35)(13,"app-button",36),u("onClick",function(){p(t);let e=l();return h(e.cancelDelete())}),i(),a(14,"app-button",37),u("onClick",function(){p(t);let e=l();return h(e.deleteAuthorization())}),i()()()()()}if(o&2){let t=l();T("show",t.deleteAuth.state!="INITIAL"),r(11),_(t.deleteAuth.errMsg.length>0?11:-1),r(2),f("type","ghost-white")("label","Cancel")("size","sm"),r(),f("type","danger")("label","Delete")("iconClass","bs-delete-bin-line")("showSpinner",t.deleteAuth.state=="DELETE_AUTH")("size","sm")}}var Ot=(()=>{class o{applicationKey="";uiState="INITIAL";authorizations=[];allowEdit=!0;showSidePanel=k({show:!1,category:""});deleteAuth={name:"",type:"",errMsg:"",showModal:!1,state:"INITIAL"};crispService=d(N);router=d(B);route=d(U);apiDataService=d(G);sharedResourceService=d(J);toastr=d(L);apiTestingService=d($);summaryService=d(H);reloadService=d(q);constructor(){this.reloadService.reload.pipe(j()).subscribe(()=>{this.applicationKey&&this.getAllAuthorization()})}ngOnInit(){this.apiDataService.appConfig$.subscribe(t=>{t&&t.key?(this.applicationKey=t.key,this.getAllAuthorization()):this.authorizations=[]}),this.route.queryParams.subscribe(t=>{t.action&&t.action.length>0&&(this.crispService.hideChat(),this.showSidePanel().show=!0,setTimeout(()=>{this.showSidePanel().category="AUTH"},10))})}getAllAuthorization(){this.uiState="GET_VARIABLES",this.sharedResourceService.getSharedResources("authorization",this.applicationKey).pipe(O({error:t=>{this.uiState="API_ERROR"}})).subscribe(t=>{this.authorizations=t.authorizations,this.uiState="SUCCESS",this.allowEdit=t.allowEdit})}showSidebar(t,n,e){let m={action:t};n&&(m.category=n),e&&(m.authorization=btoa(JSON.stringify(e))),console.log(n),this.router.navigate([],{relativeTo:this.route,queryParams:m})}hideOverlay(){this.crispService.hideChat(),this.showSidePanel().category="",setTimeout(()=>{this.showSidePanel().show=!1},310),this.router.navigate([],{relativeTo:this.route,queryParams:{}})}saveVariable(t){if(t){let n=this.authorizations.findIndex(e=>t.key&&e.key===t.key||e.name===t.name);n>-1?(this.authorizations[n].type=t.type,this.authorizations[n].value=t.value):this.authorizations.push(t)}this.hideOverlay()}showDeleteConfirmationModal(t){this.deleteAuth.name=t.name,this.deleteAuth.type=t.type,this.deleteAuth.errMsg="",this.deleteAuth.showModal=!0,setTimeout(()=>{this.deleteAuth.state="SHOW"},10)}deleteAuthorization(){this.deleteAuth.state="DELETE_AUTH",this.deleteAuth.errMsg="",this.apiTestingService.deleteAuthorization(this.applicationKey,this.deleteAuth.name,this.deleteAuth.type).pipe(O({error:t=>{this.deleteAuth.state="API_ERROR";let n="";t.status==400&&t.error.message?n=t.error.message:n="Couldn't delete authorization, try again later",this.deleteAuth.errMsg=n}})).subscribe(t=>{this.deleteAuth.state="SUCCESS",this.toastr.success("Authorization deleted successfully","Success"),this.summaryService.triggerRefresh(),this.authorizations=this.authorizations.filter(n=>!(n.name===this.deleteAuth.name&&n.type===this.deleteAuth.type)),this.cancelDelete()})}cancelDelete(){this.deleteAuth.state="INITIAL",setTimeout(()=>{this.deleteAuth.showModal=!1,this.deleteAuth.errMsg="",this.deleteAuth.name="",this.deleteAuth.type=""},300)}onUpdateState(){this.getAllAuthorization()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=E({type:o,selectors:[["app-shared-authorization"]],decls:14,vars:4,consts:[[1,"sub-page-wrapper"],[1,"d-flex","justify-content-between","mt-3","mb-5"],[1,"main-description","m-0"],[1,"fw-500"],[1,"d-flex","gap-4"],["type","primary","size","sm","label","Add authorization","iconClass","bs-add"],[1,"d-flex","align-items-center","justify-content-center","p-6"],[1,"w-100","mt-5","text-center","no-data"],[1,"table-wrapper"],[1,"drawer-overlay"],[1,"modal-wrap",3,"show"],["type","primary","size","sm","label","Add authorization","iconClass","bs-add",3,"onClick"],[1,"loader"],["src","/assets/images/apitesting/no-assests.svg","alt","No data","height","100",1,"no-data-img"],[2,"min-width","135px"],[2,"min-width","100px"],[1,"n
1o-wrap"],[1,"auth-value"],[1,"d-flex","gap-2"],[1,"action-btn","edit",3,"click"],[1,"bs-pencil-line"],[1,"action-btn","delete",3,"click"],[1,"bs-delete-bin-line"],[1,"left-dummy-panel",3,"click"],[1,"sidebar","sm-sidebar"],["location","SHARED",3,"save","updateState","appKey"],[1,"modal-wrap"],[1,"confirmation-modal"],[1,"d-flex","justify-content-between","title"],[1,"bs-cancel",3,"click"],[1,"message-wrap"],[1,"d-flex","align-items-center","confirm-message"],[1,"bs-information-line","delete-icon"],[1,"message"],[1,"d-flex","align-items-center","error-wrap"],[1,"d-flex","justify-content-end","btn-wrap"],[3,"onClick","type","label","size"],[3,"onClick","type","label","iconClass","showSpinner","size"],[1,"bs-error-fill"]],template:function(n,e){n&1&&(a(0,"div",0)(1,"div",1)(2,"p",2),s(3,"Shared variables allow you to easily reuse values across your configuration. To reference a variable, wrap its name in double curly brackets \u2014 for example: "),a(4,"span",3),z(),s(5," {{token}}"),A(),i(),s(6," to insert your saved token wherever it\u2019s needed."),i(),a(7,"div",4),g(8,Y,1,0,"app-button",5),i()(),g(9,Z,2,0,"div",6)(10,tt,4,0,"div",7)(11,ot,14,1,"div",8),i(),g(12,at,4,3,"div",9)(13,lt,15,11,"div",10)),n&2&&(r(8),_(e.allowEdit?8:-1),r(),_(e.uiState=="GET_VARIABLES"?9:e.authorizations.length==0?10:11),r(3),_(e.showSidePanel().show?12:-1),r(),_(e.deleteAuth.showModal?13:-1))},dependencies:[K,W,Q,X],styles:[` 2 3table[_ngcontent-%COMP%] { 4 border-collapse: separate; 5 border-spacing: 0; 6 width: 100%; 7} 8table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%] { 9 background: var(--card-bg); 10 border-bottom: 1px solid var(--border-color); 11 border-top: 1px solid var(--border-color); 12 padding: 14px 12px; 13 position: sticky; 14 top: 0; 15 z-index: 1; 16} 17table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%] { 18 padding: 10px 12px; 19 background-color: var(--bs-card-bg); 20 border-bottom: 1px solid var(--border-color); 21} 22table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, 23table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child { 24 border-left: 1px solid var(--border-color); 25} 26table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child, 27table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:last-child { 28 border-right: 1px solid var(--border-color); 29} 30table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:first-child th[_ngcontent-%COMP%]:first-child { 31 border-top-left-radius: 6px; 32} 33table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:first-child th[_ngcontent-%COMP%]:last-child { 34 border-top-right-radius: 6px; 35} 36table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]:first-child { 37 border-bottom-left-radius: 6px; 38} 39table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]:last-child { 40 border-bottom-right-radius: 6px; 41}`,` 42 43.page-wrapper[_ngcontent-%COMP%] { 44 padding: 16px 0; 45 height: 100%; 46 overflow: hidden; 47} 48.main-description[_ngcontent-%COMP%] { 49 font-size: 0.813rem; 50 max-width: 800px; 51 color: var(--text-tertiary); 52} 53.main-description[_ngcontent-%COMP%] span[_ngcontent-%COMP%] { 54 color: var(--text-primary); 55} 56.table-wrapper[_ngcontent-%COMP%] { 57 height: calc(100% - 95px); 58 overflow: auto; 59} 60.table-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar {
61 width: 6px; 62 background: transparent; 63} 64.table-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar-track { 65 border-radius: 3px; 66 background-color: #FAFAFA; 67} 68.table-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar-thumb { 69 background: #ececec; 70 border-radius: 3px; 71} 72.table-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover { 73 background: #dfdfdf; 74} 75table[_ngcontent-%COMP%] { 76 font-size: 0.813rem; 77} 78.anchor-link[_ngcontent-%COMP%] { 79 cursor: help; 80 color: var(--text-primary); 81} 82.action-btn[_ngcontent-%COMP%] { 83 width: 26px; 84 height: 26px; 85 border: none; 86 border-radius: 8px; 87 padding: 0; 88 background-color: transparent; 89 display: flex; 90 align-items: center; 91 justify-content: center; 92 transition: all 0.2s ease-in-out; 93 cursor: pointer; 94} 95.action-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { 96 color: var(--text-tertiary); 97 font-size: 14px; 98 line-height: 1; 99} 100.action-btn[_ngcontent-%COMP%]:hover { 101 background-color: #e5e5e5; 102} 103.action-btn[_ngcontent-%COMP%]:hover i[_ngcontent-%COMP%] { 104 color: var(--text-primary); 105} 106.action-btn.edit[_ngcontent-%COMP%]:hover i[_ngcontent-%COMP%] { 107 color: var(--bs-primary); 108} 109.action-btn.delete[_ngcontent-%COMP%]:hover i[_ngcontent-%COMP%] { 110 color: var(--error-text-color); 111} 112.no-data[_ngcontent-%COMP%] { 113 font-size: 0.875rem; 114} 115.auth-value[_ngcontent-%COMP%] { 116 word-break: break-all; 117} 118.loader[_ngcontent-%COMP%] { 119 width: 24px; 120 height: 24px; 121 border: 3px solid var(--bs-primary); 122 border-bottom-color: transparent; 123 border-radius: 50%; 124 display: inline-block; 125 box-sizing: border-box; 126 animation: _ngcontent-%COMP%_rotation 1s linear infinite; 127} 128@keyframes _ngcontent-%COMP%_rotation { 129 0% { 130 transform: rotate(0deg); 131 } 132 100% { 133 transform: rotate(360deg); 134 } 135} 136.modal-wrap[_ngcontent-%COMP%] { 137 position: fixed; 138 top: 0; 139 left: 0; 140 width: 100%; 141 height: 100%; 142 z-index: 9; 143 background-color: rgba(0, 0, 0, 0.5); 144 opacity: 0; 145 transition: opacity 0.2s ease-in-out; 146} 147.modal-wrap.show[_ngcontent-%COMP%] { 148 opacity: 1; 149} 150.modal-wrap.show[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] { 151 top: 50%; 152 opacity: 1; 153} 154.modal-wrap[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] { 155 opacity: 0; 156 position: absolute; 157 top: 60%; 158 left: 50%; 159 transform: translate(-50%, -50%); 160 width: 500px; 161 background-color: #FFFFFF; 162 border-radius: 8px; 163 transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out; 164} 165.modal-wrap[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] { 166 color: var(--text-primary); 167 padding: 16px 24px; 168 font-size: 1.125rem; 169 font-weight: 500; 170 border-bottom: 1px solid var(--border-color); 171} 172.modal-wrap[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { 173 font-size: 1rem; 174 cursor: pointer; 175} 176.modal-wrap[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] .message-wrap[_ngcontent-%COMP%] { 177 padding: 24px; 178} 179.modal-wrap[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] .confirm-message[_ngcontent-%COMP%] { 180 margin-bottom: 10px; 181} 182.modal-wrap[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] .confirm-message[_ngcontent-%COMP%] .delete-icon[_ngcontent-%COMP%] { 183 color: var(--error-text-color); 184 font-size: 2rem; 185 margin-right: 20px; 186 line-height: 1; 187} 188.modal-wrap[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] .confirm-message[_ngcontent-%COMP%] .message[_ngcontent-%COMP%] { 189 font-size: 0.875rem; 190} 191.modal-wrap[_ngcontent-%COMP%] .confirmation-modal[_ngcontent-%COMP%] .btn-wrap[_ngcontent-%COMP%] { 192 gap: 16px; 193 padding-top: 10px; 194} 195.modal-wrap[_ngcontent-%COMP%] .install-modal[_ngcontent-%COMP%] { 196 width: 750px; 197}`,` 198 199.action-btn[_ngcontent-%COMP%] { 200 width: 26px; 201 height: 26px; 202 border: none; 203 border-radius: 8px; 204 padding: 0; 205 background-color: transparent; 206 display: flex; 207 align-items: center; 208 justify-content: center; 209 transition: all 0.2s ease-in-out; 210} 211.action-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { 212 color: var(--text-tertiary); 213 font-size: 14px; 214 line-height: 1; 215 position: relative; 216 top: -1px; 217} 218.action-btn[_ngcontent-%COMP%]:hover { 219 background-color: #e5e5e5; 220} 221.action-btn[_ngcontent-%COMP%]:hover i[_ngcontent-%COMP%] { 222 color: var(--text-primary); 223} 224.action-btn.edit[_ngcontent-%COMP%]:hover i[_ngcontent-%COMP%] { 225 color: #006ceb; 226}
227.action-btn.delete[_ngcontent-%COMP%]:hover i[_ngcontent-%COMP%] { 228 color: #cb0000; 229}`],data:{animation:[P("expandView",[x("collapse",b({height:"0px"})),x("expand",b({height:"*"})),S("collapse <=> expand",[M("0.3s ease-in-out")])]),P("showHideOverlay",[x("show",b({opacity:"1"})),x("hide",b({opacity:"0"})),S("show <=> hide",[M("0.3s ease-in-out")])]),P("toggleSidebar",[x("show",b({right:"0"})),x("hide",b({right:"-100%"})),S("show <=> hide",[M("0.3s ease-in-out")])])]}})}return o})();export{Ot as SharedAuthorizationComponent};
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.