diff --git a/dist/rapidoc-min.js b/dist/rapidoc-min.js index ddbeb4a6..592ade10 100644 --- a/dist/rapidoc-min.js +++ b/dist/rapidoc-min.js @@ -368,15 +368,6 @@ input[type="password"]::placeholder { opacity:1; } -select:focus, -textarea:focus, -input[type="text"]:focus, -input[type="password"]:focus, -textarea:active, -input[type="text"]:active, -input[type="password"]:active { - border:1px solid var(--primary-color); -} input[type="file"]{ font-family: var(--font-regular); @@ -430,10 +421,6 @@ textarea::-webkit-scrollbar-thumb { margin-bottom:2px; } -input[type="checkbox"]:focus{ - outline:0; -} - /* Toggle Body */ input[type="checkbox"] { appearance: none; @@ -466,7 +453,7 @@ input[type="checkbox"]:after { /* Toggle Body - Checked */ input[type="checkbox"]:checked { - box-shadow: inset 0 0 0 13px var(--green); + background-color: var(--green); border-color: var(--green); } /* Toggle Thumb - Checked*/ @@ -475,8 +462,7 @@ input[type="checkbox"]:checked:after { left: 16px; right: 1px; transition: border .25s, left .15s .25s, right .25s .175s; -} -`,Ye=c` +}`,Ye=c` .row, .col{ display:flex; } @@ -847,6 +833,7 @@ pre[class*="language-"] { } .tab-buttons { height:30px; + padding: 4px 4px 0 4px; border-bottom: 1px solid var(--light-border-color) ; align-items: stretch; overflow-y: hidden; @@ -885,6 +872,20 @@ pre[class*="language-"] { min-height: 50px; } `,tt=c` +.nav-bar-info:focus-visible, +.nav-bar-tag:focus-visible, +.nav-bar-path:focus-visible { + outline: 1px solid; + box-shadow: none; + outline-offset: -4px; +} +.nav-bar-expand-all:focus-visible, +.nav-bar-collapse-all:focus-visible, +.nav-bar-tag-icon:focus-visible { + outline: 1px solid; + box-shadow: none; + outline-offset: 2px; +} .nav-bar { width:0; height:100%; @@ -921,7 +922,23 @@ pre[class*="language-"] { } .nav-bar-paths-under-tag { overflow:hidden; - transition: max-height .2s ease-out; + transition: max-height .2s ease-out, visibility .3s; +} +.collapsed .nav-bar-paths-under-tag { + visibility: hidden; +} + +.nav-bar-expand-all { + transform: rotate(90deg); + cursor:pointer; + margin-right:10px; +} +.nav-bar-collapse-all { + transform: rotate(270deg); + cursor:pointer; +} +.nav-bar-expand-all:hover, .nav-bar-collapse-all:hover { + color: var(--primary-color); } .nav-bar-tag-icon { @@ -1323,6 +1340,8 @@ pre[class*="language-"] { :host{ display:flex; } + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } .json-tree { position: relative; font-family: var(--font-mono); @@ -1611,12 +1630,12 @@ pre[class*="language-"] { `}toggleObjectExpand(e){const t=e.target.closest(".tr");t.classList.contains("expanded")?(t.classList.replace("expanded","collapsed"),e.target.innerHTML=e.target.classList.contains("array-of-object")?"[{...}]":e.target.classList.contains("array-of-array")?"[[...]]":e.target.classList.contains("array")?"[...]":"{...}"):(t.classList.replace("collapsed","expanded"),e.target.innerHTML=e.target.classList.contains("array-of-object")?"[{":e.target.classList.contains("array-of-array")?`[[ ${e.target.dataset.arrayType}`:e.target.classList.contains("object")?"{":"[")}});customElements.define("tag-input",class extends ie{render(){let e="";return Array.isArray(this.value)&&(e=z`${this.value.filter((e=>"string"==typeof e&&""!==e.trim())).map((e=>z`${e}`))}`),z` -
+
${e}
`}static get properties(){return{placeholder:{type:String},value:{type:Array,attribute:"value"}}}attributeChangedCallback(e,t,r){"value"===e&&r&&t!==r&&(this.value=r.split(",").filter((e=>""!==e.trim()))),super.attributeChangedCallback(e,t,r)}afterPaste(e){const t=(e.clipboardData||window.clipboardData).getData("Text"),r=t?t.split(",").filter((e=>""!==e.trim())):"";r&&(Array.isArray(this.value)?this.value=[...this.value,...r]:this.value=r),e.preventDefault()}afterKeyDown(e){13===e.keyCode?(e.stopPropagation(),e.preventDefault(),e.target.value&&(Array.isArray(this.value)?this.value=[...this.value,e.target.value]:this.value=[e.target.value],e.target.value="")):8===e.keyCode&&0===e.target.value.length&&Array.isArray(this.value)&&this.value.length>0&&(this.value.splice(-1),this.value=[...this.value])}onBlur(e){e.target.value&&(Array.isArray(this.value)?this.value=[...this.value,e.target.value]:this.value=[e.target.value],e.target.value="")}static get styles(){return[c` - .tags{ + .tags { display:flex; flex-wrap: wrap; outline: none; @@ -1642,7 +1661,7 @@ pre[class*="language-"] { .tag:hover ~ #cursor { display: block; } - .editor{ + .editor { flex:1; border:1px solid transparent; color:var(--fg); @@ -1653,13 +1672,18 @@ pre[class*="language-"] { background:transparent; font-size: calc(var(--font-size-small) + 1px); } + .editor:focus-visible { + outline: 1px solid; + } .editor::placeholder { color: var(--placeholder-color); opacity:1; } `]}});customElements.define("api-request",class extends ie{constructor(){super(),this.responseMessage="",this.responseStatus="success",this.responseHeaders="",this.responseText="",this.responseUrl="",this.curlSyntax="",this.activeResponseTab="response",this.selectedRequestBodyType="",this.selectedRequestBodyExample="",this.activeParameterSchemaTabs={}}static get properties(){return{serverUrl:{type:String,attribute:"server-url"},servers:{type:Array},method:{type:String},path:{type:String},security:{type:Array},parameters:{type:Array},request_body:{type:Object},api_keys:{type:Array},parser:{type:Object},accept:{type:String},callback:{type:String},webhook:{type:String},responseMessage:{type:String,attribute:!1},responseText:{type:String,attribute:!1},responseHeaders:{type:String,attribute:!1},responseStatus:{type:String,attribute:!1},responseUrl:{type:String,attribute:!1},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},allowTry:{type:String,attribute:"allow-try"},renderStyle:{type:String,attribute:"render-style"},schemaStyle:{type:String,attribute:"schema-style"},activeSchemaTab:{type:String,attribute:"active-schema-tab"},activeParameterSchemaTabs:{type:Object,converter:{fromAttribute:e=>JSON.parse(e),toAttribute:e=>JSON.stringify(e)},attribute:"active-parameter-schema-tabs"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},fetchCredentials:{type:String,attribute:"fetch-credentials"},activeResponseTab:{type:String},selectedRequestBodyType:{type:String,attribute:"selected-request-body-type"},selectedRequestBodyExample:{type:String,attribute:"selected-request-body-example"}}}static get styles(){return[Ze,Je,Ke,Ye,kI,et,Xe,c` *, *:before, *:after { box-sizing: border-box; } - + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } + tag-input:focus-within { outline: 1px solid;} .read-mode { margin-top: 24px; } @@ -2188,7 +2212,7 @@ pre[class*="language-"] {
${""===this.responseMessage?"":this.apiResponseTabTemplate()} - `}async onFillRequestData(e){[...e.target.closest(".request-panel").querySelectorAll("input, tag-input, textarea:not(.is-hidden)")].forEach((e=>{e.dataset.example&&("TAG-INPUT"===e.tagName.toUpperCase()?e.value=e.dataset.example.split("~|~"):e.value=e.dataset.example)}))}async onClearRequestData(e){[...e.target.closest(".request-panel").querySelectorAll("input, tag-input, textarea:not(.is-hidden)")].forEach((e=>{e.value=""}))}async onTryClick(e){var t;const r=e.target;let n,a,o="",i="",s="",l="";const c=null===(t=this.closest(".expanded-req-resp-container, .req-resp-container"))||void 0===t?void 0:t.getElementsByTagName("api-response")[0],p=null==c?void 0:c.selectedMimeType,d=e.target.closest(".request-panel"),u=[...d.querySelectorAll("[data-ptype='path']")],h=[...d.querySelectorAll("[data-ptype='query']")],f=[...d.querySelectorAll("[data-ptype='query-object']")],m=[...d.querySelectorAll("[data-ptype='header']")],y=d.querySelector(".request-body-container");n=this.path;const g={method:this.method.toUpperCase()};u.map((e=>{n=n.replace(`{${e.dataset.pname}}`,encodeURIComponent(e.value))}));const v=new Map,b=[];h.length>0&&h.forEach((e=>{const t=new URLSearchParams;if("true"===e.dataset.paramAllowReserved&&b.push(e.dataset.pname),"false"===e.dataset.array)""!==e.value&&t.append(e.dataset.pname,e.value);else{const{paramSerializeStyle:r,paramSerializeExplode:n}=e.dataset;let a=e.value&&Array.isArray(e.value)?e.value:[];a=Array.isArray(a)?a.filter((e=>""!==e)):[],a.length>0&&("spaceDelimited"===r?t.append(e.dataset.pname,a.join(" ").replace(/^\s|\s$/g,"")):"pipeDelimited"===r?t.append(e.dataset.pname,a.join("|").replace(/^\||\|$/g,"")):"true"===n?a.forEach((r=>{t.append(e.dataset.pname,r)})):t.append(e.dataset.pname,a.join(",").replace(/^,|,$/g,"")))}t.toString()&&v.set(e.dataset.pname,t)})),f.length>0&&f.map((e=>{const t=new URLSearchParams;try{let r={};const{paramSerializeStyle:n,paramSerializeExplode:a}=e.dataset;if(r=Object.assign(r,JSON.parse(e.value.replace(/\s+/g," "))),"true"===e.dataset.paramAllowReserved&&b.push(e.dataset.pname),"json xml".includes(n))"json"===n?t.append(e.dataset.pname,JSON.stringify(r)):"xml"===n&&t.append(e.dataset.pname,CI(r));else for(const e in r)"object"==typeof r[e]?Array.isArray(r[e])&&("spaceDelimited"===n?t.append(e,r[e].join(" ")):"pipeDelimited"===n?t.append(e,r[e].join("|")):"true"===a?r[e].forEach((r=>{t.append(e,r)})):t.append(e,r[e])):t.append(e,r[e])}catch(t){console.log("RapiDoc: unable to parse %s into object",e.value)}t.toString()&&v.set(e.dataset.pname,t)}));let x="";if(v.size&&(x="?",v.forEach(((e,t)=>{b.includes(t)?(x+=`${t}=`,x+=e.getAll(t).join(`&${t}=`),x+="&"):x+=`${e.toString()}&`})),x=x.slice(0,-1)),n=`${n}${x}`,this.api_keys.filter((e=>"query"===e.in)).forEach((e=>{n=`${n}${n.includes("?")?"&":"?"}${e.name}=${encodeURIComponent(e.finalKeyValue)}`})),n=`${this.serverUrl.replace(/\/$/,"")}${n}`,!1===n.startsWith("http")){a=new URL(n,window.location.href).href}else a=n;o=`curl -X ${this.method.toUpperCase()} "${a}" \\\n`;const w=new Headers;if(p?(w.append("Accept",p),i+=` -H "Accept: ${p}" \\\n`):this.accept&&(w.append("Accept",this.accept),i+=` -H "Accept: ${this.accept}" \\\n`),this.api_keys.filter((e=>"header"===e.in)).forEach((e=>{w.append(e.name,e.finalKeyValue),i+=` -H "${e.name}: ${e.finalKeyValue}" \\\n`})),m.map((e=>{e.value&&(w.append(e.dataset.pname,e.value),i+=` -H "${e.dataset.pname}: ${e.value}" \\\n`)})),y){const e=y.dataset.selectedRequestBodyType;if(e.includes("form-urlencoded")){const e=d.querySelector("[data-ptype='dynamic-form']");if(e){const t=e.value,r=new URLSearchParams;let n,a=!0;if(t)try{n=JSON.parse(t)}catch(e){a=!1,console.warn("RapiDoc: Invalid JSON provided",e)}else a=!1;if(a){for(const e in n)r.append(e,JSON.stringify(n[e]));g.body=r,s=` -d ${r.toString()} \\\n`}}else{const e=[...d.querySelectorAll("[data-ptype='form-urlencode']")],t=new URLSearchParams;e.filter((e=>"file"!==e.type)).forEach((e=>{if("false"===e.dataset.array)e.value&&t.append(e.dataset.pname,e.value);else{const r=e.value&&Array.isArray(e.value)?e.value.join(","):"";t.append(e.dataset.pname,r)}})),g.body=t,s=` -d ${t.toString()} \\\n`}}else if(e.includes("form-data")){const e=new FormData;[...d.querySelectorAll("[data-ptype='form-data']")].forEach((t=>{"false"===t.dataset.array?"file"===t.type&&t.files[0]?(e.append(t.dataset.pname,t.files[0],t.files[0].name),l+=` -F "${t.dataset.pname}=@${t.files[0].name}" \\\n`):t.value&&(e.append(t.dataset.pname,t.value),l+=` -F "${t.dataset.pname}=${t.value}" \\\n`):t.value&&Array.isArray(t.value)&&(t.value.forEach((e=>{l=`${l} -F "${t.dataset.pname}[]=${e}" \\\n`})),e.append(t.dataset.pname,t.value.join(",")))})),g.body=e}else if(/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(e)){const e=d.querySelector(".request-body-param-file");null!=e&&e.files[0]&&(g.body=e.files[0],s=` --data-binary @${e.files[0].name} \\\n`)}else if(e.includes("json")||e.includes("xml")||e.includes("text")){const t=d.querySelector(".request-body-param-user-input");if(null!=t&&t.value){if(g.body=t.value,e.includes("json"))try{s=` -d '${JSON.stringify(JSON.parse(t.value))}' \\\n`}catch(e){}s||(s=` -d '${t.value.replace(/'/g,"'\"'\"'")}' \\\n`)}}e.includes("form-data")||w.append("Content-Type",e),i+=` -H "Content-Type: ${e}" \\\n`}this.responseUrl="",this.responseHeaders=[],this.curlSyntax="",this.responseStatus="success",this.responseIsBlob=!1,this.respContentDisposition="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl=""),this.curlSyntax=`${o}${i}${s}${l}`,this.fetchCredentials&&(g.credentials=this.fetchCredentials);const $=new AbortController,{signal:k}=$;g.headers=w;const S={url:n,...g};this.dispatchEvent(new CustomEvent("before-try",{bubbles:!0,composed:!0,detail:{request:S,controller:$}}));const A={method:S.method,headers:S.headers,credentials:S.credentials,body:S.body},O=new Request(S.url,A);let E,T;try{let e,t,n;r.disabled=!0,this.responseText="⌛",this.responseMessage="",this.requestUpdate();const a=performance.now();E=await fetch(O,{signal:k});const o=performance.now();T=E.clone(),r.disabled=!1,this.responseMessage=z`${E.statusText?`${E.statusText}:${E.status}`:E.status}
Took ${Math.round(o-a)} milliseconds
`,this.responseUrl=E.url;const i={};E.headers.forEach(((e,t)=>{i[t]=e,this.responseHeaders=`${this.responseHeaders}${t}: ${e}\n`}));const s=E.headers.get("content-type");if(0===(await E.clone().text()).length)this.responseText="";else if(s){if("application/x-ndjson"===s)this.responseText=await E.text();else if(s.includes("json"))if(/charset=[^"']+/.test(s)){const e=s.split("charset=")[1],r=await E.arrayBuffer();try{n=new TextDecoder(e).decode(r)}catch{n=new TextDecoder("utf-8").decode(r)}try{t=JSON.parse(n),this.responseText=JSON.stringify(t,null,2)}catch{this.responseText=n}}else t=await E.json(),this.responseText=JSON.stringify(t,null,2);else/^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$|^application\/vnd\./.test(s)?(this.responseIsBlob=!0,this.responseBlobType="download"):/^audio|^image|^video/.test(s)?(this.responseIsBlob=!0,this.responseBlobType="view"):(n=await E.text(),s.includes("xml")?this.responseText=$I()(n,{textNodesOnSameLine:!0,indentor:" "}):this.responseText=n);if(this.responseIsBlob){const t=E.headers.get("content-disposition");this.respContentDisposition=t?t.split("filename=")[1].replace(/"|'/g,""):"filename",e=await E.blob(),this.responseBlobUrl=URL.createObjectURL(e)}}else n=await E.text(),this.responseText=n;this.dispatchEvent(new CustomEvent("after-try",{bubbles:!0,composed:!0,detail:{request:O,response:T,responseHeaders:i,responseBody:t||n||e,responseStatus:T.ok}}))}catch(e){r.disabled=!1,"AbortError"===e.name?(this.dispatchEvent(new CustomEvent("request-aborted",{bubbles:!0,composed:!0,detail:{err:e,request:O}})),this.responseMessage="Request Aborted",this.responseText="Request Aborted"):(this.dispatchEvent(new CustomEvent("after-try",{bubbles:!0,composed:!0,detail:{err:e,request:O}})),this.responseMessage=`${e.message} (CORS or Network Issue)`)}this.requestUpdate()}onAddRemoveFileInput(e,t,r){if("button"!==e.target.tagName.toLowerCase())return;if(e.target.classList.contains("file-input-remove-btn")){return void e.target.closest(".input-set").remove()}const n=e.target.closest(".file-input-container"),a=document.createElement("div");a.setAttribute("class","input-set row");const o=document.createElement("input");o.type="file",o.style="width:200px; margin-top:2px;",o.setAttribute("data-pname",t),o.setAttribute("data-ptype",r.includes("form-urlencode")?"form-urlencode":"form-data"),o.setAttribute("data-array","false"),o.setAttribute("data-file-array","true");const i=document.createElement("button");i.setAttribute("class","file-input-remove-btn"),i.innerHTML="✕",a.appendChild(o),a.appendChild(i),n.insertBefore(a,e.target)}clearResponseData(){this.responseUrl="",this.responseHeaders="",this.responseText="",this.responseStatus="success",this.responseMessage="",this.responseIsBlob=!1,this.responseBlobType="",this.respContentDisposition="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl="")}disconnectedCallback(){this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl=""),super.disconnectedCallback()}});customElements.define("schema-table",class extends ie{static get properties(){return{schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},data:{type:Object}}}connectedCallback(){super.connectedCallback(),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true false".includes(this.schemaDescriptionExpanded)||(this.schemaDescriptionExpanded="false"),this.schemaHideReadOnly&&"true false".includes(this.schemaHideReadOnly)||(this.schemaHideReadOnly="true"),this.schemaHideWriteOnly&&"true false".includes(this.schemaHideWriteOnly)||(this.schemaHideWriteOnly="true")}static get styles(){return[Ke,zI,c` + `}async onFillRequestData(e){[...e.target.closest(".request-panel").querySelectorAll("input, tag-input, textarea:not(.is-hidden)")].forEach((e=>{e.dataset.example&&("TAG-INPUT"===e.tagName.toUpperCase()?e.value=e.dataset.example.split("~|~"):e.value=e.dataset.example)}))}async onClearRequestData(e){[...e.target.closest(".request-panel").querySelectorAll("input, tag-input, textarea:not(.is-hidden)")].forEach((e=>{e.value=""}))}async onTryClick(e){var t;const r=e.target;let n,a,o="",i="",s="",l="";const c=null===(t=this.closest(".expanded-req-resp-container, .req-resp-container"))||void 0===t?void 0:t.getElementsByTagName("api-response")[0],p=null==c?void 0:c.selectedMimeType,d=e.target.closest(".request-panel"),u=[...d.querySelectorAll("[data-ptype='path']")],h=[...d.querySelectorAll("[data-ptype='query']")],f=[...d.querySelectorAll("[data-ptype='query-object']")],m=[...d.querySelectorAll("[data-ptype='header']")],y=d.querySelector(".request-body-container");n=this.path;const g={method:this.method.toUpperCase()};u.map((e=>{n=n.replace(`{${e.dataset.pname}}`,encodeURIComponent(e.value))}));const v=new Map,b=[];h.length>0&&h.forEach((e=>{const t=new URLSearchParams;if("true"===e.dataset.paramAllowReserved&&b.push(e.dataset.pname),"false"===e.dataset.array)""!==e.value&&t.append(e.dataset.pname,e.value);else{const{paramSerializeStyle:r,paramSerializeExplode:n}=e.dataset;let a=e.value&&Array.isArray(e.value)?e.value:[];a=Array.isArray(a)?a.filter((e=>""!==e)):[],a.length>0&&("spaceDelimited"===r?t.append(e.dataset.pname,a.join(" ").replace(/^\s|\s$/g,"")):"pipeDelimited"===r?t.append(e.dataset.pname,a.join("|").replace(/^\||\|$/g,"")):"true"===n?a.forEach((r=>{t.append(e.dataset.pname,r)})):t.append(e.dataset.pname,a.join(",").replace(/^,|,$/g,"")))}t.toString()&&v.set(e.dataset.pname,t)})),f.length>0&&f.map((e=>{const t=new URLSearchParams;try{let r={};const{paramSerializeStyle:n,paramSerializeExplode:a}=e.dataset;if(r=Object.assign(r,JSON.parse(e.value.replace(/\s+/g," "))),"true"===e.dataset.paramAllowReserved&&b.push(e.dataset.pname),"json xml".includes(n))"json"===n?t.append(e.dataset.pname,JSON.stringify(r)):"xml"===n&&t.append(e.dataset.pname,CI(r));else for(const e in r)"object"==typeof r[e]?Array.isArray(r[e])&&("spaceDelimited"===n?t.append(e,r[e].join(" ")):"pipeDelimited"===n?t.append(e,r[e].join("|")):"true"===a?r[e].forEach((r=>{t.append(e,r)})):t.append(e,r[e])):t.append(e,r[e])}catch(t){console.error("RapiDoc: unable to parse %s into object",e.value)}t.toString()&&v.set(e.dataset.pname,t)}));let x="";if(v.size&&(x="?",v.forEach(((e,t)=>{b.includes(t)?(x+=`${t}=`,x+=e.getAll(t).join(`&${t}=`),x+="&"):x+=`${e.toString()}&`})),x=x.slice(0,-1)),n=`${n}${x}`,this.api_keys.filter((e=>"query"===e.in)).forEach((e=>{n=`${n}${n.includes("?")?"&":"?"}${e.name}=${encodeURIComponent(e.finalKeyValue)}`})),n=`${this.serverUrl.replace(/\/$/,"")}${n}`,!1===n.startsWith("http")){a=new URL(n,window.location.href).href}else a=n;o=`curl -X ${this.method.toUpperCase()} "${a}" \\\n`;const w=new Headers;if(p?(w.append("Accept",p),i+=` -H "Accept: ${p}" \\\n`):this.accept&&(w.append("Accept",this.accept),i+=` -H "Accept: ${this.accept}" \\\n`),this.api_keys.filter((e=>"header"===e.in)).forEach((e=>{w.append(e.name,e.finalKeyValue),i+=` -H "${e.name}: ${e.finalKeyValue}" \\\n`})),m.map((e=>{e.value&&(w.append(e.dataset.pname,e.value),i+=` -H "${e.dataset.pname}: ${e.value}" \\\n`)})),y){const e=y.dataset.selectedRequestBodyType;if(e.includes("form-urlencoded")){const e=d.querySelector("[data-ptype='dynamic-form']");if(e){const t=e.value,r=new URLSearchParams;let n,a=!0;if(t)try{n=JSON.parse(t)}catch(e){a=!1,console.warn("RapiDoc: Invalid JSON provided",e)}else a=!1;if(a){for(const e in n)r.append(e,JSON.stringify(n[e]));g.body=r,s=` -d ${r.toString()} \\\n`}}else{const e=[...d.querySelectorAll("[data-ptype='form-urlencode']")],t=new URLSearchParams;e.filter((e=>"file"!==e.type)).forEach((e=>{if("false"===e.dataset.array)e.value&&t.append(e.dataset.pname,e.value);else{const r=e.value&&Array.isArray(e.value)?e.value.join(","):"";t.append(e.dataset.pname,r)}})),g.body=t,s=` -d ${t.toString()} \\\n`}}else if(e.includes("form-data")){const e=new FormData;[...d.querySelectorAll("[data-ptype='form-data']")].forEach((t=>{"false"===t.dataset.array?"file"===t.type&&t.files[0]?(e.append(t.dataset.pname,t.files[0],t.files[0].name),l+=` -F "${t.dataset.pname}=@${t.files[0].name}" \\\n`):t.value&&(e.append(t.dataset.pname,t.value),l+=` -F "${t.dataset.pname}=${t.value}" \\\n`):t.value&&Array.isArray(t.value)&&(t.value.forEach((e=>{l=`${l} -F "${t.dataset.pname}[]=${e}" \\\n`})),e.append(t.dataset.pname,t.value.join(",")))})),g.body=e}else if(/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(e)){const e=d.querySelector(".request-body-param-file");null!=e&&e.files[0]&&(g.body=e.files[0],s=` --data-binary @${e.files[0].name} \\\n`)}else if(e.includes("json")||e.includes("xml")||e.includes("text")){const t=d.querySelector(".request-body-param-user-input");if(null!=t&&t.value){if(g.body=t.value,e.includes("json"))try{s=` -d '${JSON.stringify(JSON.parse(t.value))}' \\\n`}catch(e){}s||(s=` -d '${t.value.replace(/'/g,"'\"'\"'")}' \\\n`)}}e.includes("form-data")||w.append("Content-Type",e),i+=` -H "Content-Type: ${e}" \\\n`}this.responseUrl="",this.responseHeaders=[],this.curlSyntax="",this.responseStatus="success",this.responseIsBlob=!1,this.respContentDisposition="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl=""),this.curlSyntax=`${o}${i}${s}${l}`,this.fetchCredentials&&(g.credentials=this.fetchCredentials);const $=new AbortController,{signal:k}=$;g.headers=w;const S={url:n,...g};this.dispatchEvent(new CustomEvent("before-try",{bubbles:!0,composed:!0,detail:{request:S,controller:$}}));const A={method:S.method,headers:S.headers,credentials:S.credentials,body:S.body},O=new Request(S.url,A);let E,T;try{let e,t,n;r.disabled=!0,this.responseText="⌛",this.responseMessage="",this.requestUpdate();const a=performance.now();E=await fetch(O,{signal:k});const o=performance.now();T=E.clone(),r.disabled=!1,this.responseMessage=z`${E.statusText?`${E.statusText}:${E.status}`:E.status}
Took ${Math.round(o-a)} milliseconds
`,this.responseUrl=E.url;const i={};E.headers.forEach(((e,t)=>{i[t]=e,this.responseHeaders=`${this.responseHeaders}${t}: ${e}\n`}));const s=E.headers.get("content-type");if(0===(await E.clone().text()).length)this.responseText="";else if(s){if("application/x-ndjson"===s)this.responseText=await E.text();else if(s.includes("json"))if(/charset=[^"']+/.test(s)){const e=s.split("charset=")[1],r=await E.arrayBuffer();try{n=new TextDecoder(e).decode(r)}catch{n=new TextDecoder("utf-8").decode(r)}try{t=JSON.parse(n),this.responseText=JSON.stringify(t,null,2)}catch{this.responseText=n}}else t=await E.json(),this.responseText=JSON.stringify(t,null,2);else/^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$|^application\/vnd\./.test(s)?(this.responseIsBlob=!0,this.responseBlobType="download"):/^audio|^image|^video/.test(s)?(this.responseIsBlob=!0,this.responseBlobType="view"):(n=await E.text(),s.includes("xml")?this.responseText=$I()(n,{textNodesOnSameLine:!0,indentor:" "}):this.responseText=n);if(this.responseIsBlob){const t=E.headers.get("content-disposition");this.respContentDisposition=t?t.split("filename=")[1].replace(/"|'/g,""):"filename",e=await E.blob(),this.responseBlobUrl=URL.createObjectURL(e)}}else n=await E.text(),this.responseText=n;this.dispatchEvent(new CustomEvent("after-try",{bubbles:!0,composed:!0,detail:{request:O,response:T,responseHeaders:i,responseBody:t||n||e,responseStatus:T.ok}}))}catch(e){r.disabled=!1,"AbortError"===e.name?(this.dispatchEvent(new CustomEvent("request-aborted",{bubbles:!0,composed:!0,detail:{err:e,request:O}})),this.responseMessage="Request Aborted",this.responseText="Request Aborted"):(this.dispatchEvent(new CustomEvent("after-try",{bubbles:!0,composed:!0,detail:{err:e,request:O}})),this.responseMessage=`${e.message} (CORS or Network Issue)`)}this.requestUpdate()}onAddRemoveFileInput(e,t,r){if("button"!==e.target.tagName.toLowerCase())return;if(e.target.classList.contains("file-input-remove-btn")){return void e.target.closest(".input-set").remove()}const n=e.target.closest(".file-input-container"),a=document.createElement("div");a.setAttribute("class","input-set row");const o=document.createElement("input");o.type="file",o.style="width:200px; margin-top:2px;",o.setAttribute("data-pname",t),o.setAttribute("data-ptype",r.includes("form-urlencode")?"form-urlencode":"form-data"),o.setAttribute("data-array","false"),o.setAttribute("data-file-array","true");const i=document.createElement("button");i.setAttribute("class","file-input-remove-btn"),i.innerHTML="✕",a.appendChild(o),a.appendChild(i),n.insertBefore(a,e.target)}clearResponseData(){this.responseUrl="",this.responseHeaders="",this.responseText="",this.responseStatus="success",this.responseMessage="",this.responseIsBlob=!1,this.responseBlobType="",this.respContentDisposition="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl="")}disconnectedCallback(){this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl=""),super.disconnectedCallback()}});customElements.define("schema-table",class extends ie{static get properties(){return{schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},data:{type:Object}}}connectedCallback(){super.connectedCallback(),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true false".includes(this.schemaDescriptionExpanded)||(this.schemaDescriptionExpanded="false"),this.schemaHideReadOnly&&"true false".includes(this.schemaHideReadOnly)||(this.schemaHideReadOnly="true"),this.schemaHideWriteOnly&&"true false".includes(this.schemaHideWriteOnly)||(this.schemaHideWriteOnly="true")}static get styles(){return[Ke,zI,c` .table { font-size: var(--font-size-small); text-align: left; @@ -2356,13 +2380,13 @@ pre[class*="language-"] { `} `} ${e.description?z`
${QP(We(e.description))}
`:""} + ${hI.call(this,e.security)} ${null!==(a=e.externalDocs)&&void 0!==a&&a.url||null!==(o=e.externalDocs)&&void 0!==o&&o.description?z`
${QP(We((null===(i=e.externalDocs)||void 0===i?void 0:i.description)||""))}
${null!==(s=e.externalDocs)&&void 0!==s&&s.url?z`
${null===(c=e.externalDocs)||void 0===c?void 0:c.url}
`:""}
`:""} - ${hI.call(this,e.security)} ${g}
${QI.call(this)} - `}function eR(e,t="toggle"){const r=null==e?void 0:e.closest(".nav-bar-tag-and-paths"),n=r.querySelector(".nav-bar-paths-under-tag");if(r){const e=r.classList.contains("expanded");!e||"toggle"!==t&&"collapse"!==t?e||"toggle"!==t&&"expand"!==t||(r.classList.replace("collapsed","expanded"),n.style.maxHeight=`${n.scrollHeight}px`):(n.style.maxHeight=0,r.classList.replace("expanded","collapsed"))}}function tR(e){eR(e.target,"toggle")}function rR(e,t="expand-all"){!function(e,t="expand-all"){const r=[...e.querySelectorAll(".nav-bar-tag-and-paths")];"expand-all"===t?r.forEach((e=>{const t=e.querySelector(".nav-bar-paths-under-tag");e.classList.replace("collapsed","expanded"),t.style.maxHeight=`${null==t?void 0:t.scrollHeight}px`})):r.forEach((e=>{e.classList.replace("expanded","collapsed"),e.querySelector(".nav-bar-paths-under-tag").style.maxHeight=0}))}(e.target.closest(".nav-scroll"),t)}function nR(){var e,t,r,n;return!this.resolvedSpec||this.resolvedSpec.specLoadError?z` + `}function eR(e,t="toggle"){const r=null==e?void 0:e.closest(".nav-bar-tag-and-paths"),n=r.querySelector(".nav-bar-paths-under-tag");if(r){const e=r.classList.contains("expanded");!e||"toggle"!==t&&"collapse"!==t?e||"toggle"!==t&&"expand"!==t||(r.classList.replace("collapsed","expanded"),n.style.maxHeight=`${n.scrollHeight}px`):(n.style.maxHeight=0,r.classList.replace("expanded","collapsed"))}}function tR(e){var t,r,n,a;if("click"!==e.type&&("keyup"!==e.type||13!==e.keyCode))return;const o=e.target;e.stopPropagation(),"navigate"===(null===(t=o.dataset)||void 0===t?void 0:t.action)?this.scrollToEventTarget(e,!1):"expand-all"===(null===(r=o.dataset)||void 0===r?void 0:r.action)||"collapse-all"===(null===(n=o.dataset)||void 0===n?void 0:n.action)?function(e,t="expand-all"){if("click"!==e.type&&("keyup"!==e.type||13!==e.keyCode))return;const r=[...e.target.closest(".nav-scroll").querySelectorAll(".nav-bar-tag-and-paths")];"expand-all"===t?r.forEach((e=>{const t=e.querySelector(".nav-bar-paths-under-tag");e.classList.replace("collapsed","expanded"),t.style.maxHeight=`${null==t?void 0:t.scrollHeight}px`})):r.forEach((e=>{e.classList.replace("expanded","collapsed"),e.querySelector(".nav-bar-paths-under-tag").style.maxHeight=0}))}(e,o.dataset.action):"expand-collapse-tag"===(null===(a=o.dataset)||void 0===a?void 0:a.action)&&eR(o,"toggle")}function rR(){var e,t,r,n;return!this.resolvedSpec||this.resolvedSpec.specLoadError?z` @@ -2598,84 +2622,94 @@ pre[class*="language-"] { `}
`} - ${z` -`}function aR(e){const t=new We.Renderer;return t.heading=(t,r,n,a)=>`${t}`,t}function oR(e){return z` +`}function nR(e){const t=new We.Renderer;return t.heading=(t,r,n,a)=>`${t}`,t}function aR(e){return z`
${e} -
`}function iR(){var e;if("true"===this.showInfo)return oR(JI.call(this));const t=this.resolvedSpec.tags[0],r=null===(e=this.resolvedSpec.tags[0])||void 0===e?void 0:e.paths[0];return oR(t&&r?MI.call(this,r,t.name):"")}function sR(e){return z` + `}function oR(){var e;if("true"===this.showInfo)return aR(JI.call(this));const t=this.resolvedSpec.tags[0],r=null===(e=this.resolvedSpec.tags[0])||void 0===e?void 0:e.paths[0];return aR(t&&r?MI.call(this,r,t.name):"")}function iR(e){return z`

${e.name}

${"show-description"===this.onNavTagClick&&e.description?z`
- ${QP(`\n
\n ${We(e.description||"","true"===this.infoDescriptionHeadingsInNavBar?{renderer:aR(e.elementId)}:void 0)}\n
`)} + ${QP(`\n
\n ${We(e.description||"","true"===this.infoDescriptionHeadingsInNavBar?{renderer:nR(e.elementId)}:void 0)}\n
`)}
`:""} - `}function lR(){if(!this.focusedElementId||!this.resolvedSpec)return;const e=this.focusedElementId;let t,r=null,n=null,a=0;if(e.startsWith("overview")&&"true"===this.showInfo)t=JI.call(this);else if("auth"===e&&"true"===this.allowAuthentication)t=uI.call(this);else if("servers"===e&&"true"===this.allowServerSelection)t=XI.call(this);else if("operations-top"===e)t=z` + `}function sR(){if(!this.focusedElementId||!this.resolvedSpec)return;const e=this.focusedElementId;let t,r=null,n=null,a=0;if(e.startsWith("overview")&&"true"===this.showInfo)t=JI.call(this);else if("auth"===e&&"true"===this.allowAuthentication)t=uI.call(this);else if("servers"===e&&"true"===this.allowServerSelection)t=XI.call(this);else if("operations-top"===e)t=z`
-
`;else if(e.startsWith("cmp--")&&"true"===this.showComponents)t=GI.call(this);else if(e.startsWith("tag--")){const r=e.indexOf("--",4)>0?e.substring(0,e.indexOf("--",5)):e;n=this.resolvedSpec.tags.find((e=>e.elementId===r)),t=n?oR.call(this,sR.call(this,n)):iR.call(this)}else{for(a=0;a`${t.elementId}`===e)),!r);a+=1);if(r){eR(this.shadowRoot.getElementById(`link-${e}`),"expand"),t=oR.call(this,MI.call(this,r,n.name||"",n.description||""))}else t=iR.call(this)}return t}function cR(e){if(e.expanded)e.expanded=!1,"true"===this.updateRoute&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${"#"===this.routePrefix?"":`${this.routePrefix}`}`);else if(e.expanded=!0,"true"===this.updateRoute){const t=`${this.routePrefix||"#"}${e.elementId}`;window.location.hash!==t&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${t}`)}this.requestUpdate()}function pR(e,t="expand-all"){const r=[...e.querySelectorAll(".section-tag")];"expand-all"===t?r.map((e=>{e.classList.replace("collapsed","expanded")})):r.map((e=>{e.classList.replace("expanded","collapsed")}))}function dR(e,t="expand-all"){pR.call(this,e.target.closest(".operations-root"),t)}function uR(e,t=!1){return z` - + `;else if(e.startsWith("cmp--")&&"true"===this.showComponents)t=GI.call(this);else if(e.startsWith("tag--")){const r=e.indexOf("--",4)>0?e.substring(0,e.indexOf("--",5)):e;n=this.resolvedSpec.tags.find((e=>e.elementId===r)),t=n?aR.call(this,iR.call(this,n)):oR.call(this)}else{for(a=0;a`${t.elementId}`===e)),!r);a+=1);if(r){eR(this.shadowRoot.getElementById(`link-${e}`),"expand"),t=aR.call(this,MI.call(this,r,n.name||"",n.description||""))}else t=oR.call(this)}return t}function lR(e){if(e.expanded)e.expanded=!1,"true"===this.updateRoute&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${"#"===this.routePrefix?"":`${this.routePrefix}`}`);else if(e.expanded=!0,"true"===this.updateRoute){const t=`${this.routePrefix||"#"}${e.elementId}`;window.location.hash!==t&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${t}`)}this.requestUpdate()}function cR(e,t="expand-all"){const r=[...e.querySelectorAll(".section-tag")];"expand-all"===t?r.map((e=>{e.classList.replace("collapsed","expanded")})):r.map((e=>{e.classList.replace("expanded","collapsed")}))}function pR(e,t="expand-all"){cR.call(this,e.target.closest(".operations-root"),t)}function dR(e,t=!1){return z` +
${e.method}
${e.path} @@ -2728,7 +2763,7 @@ pre[class*="language-"] {
${e.summary||e.shortSummary}
`:""}
- `}function hR(e){var t,r,n,a,o,i,s;const l=new Set;for(const t in e.responses)for(const r in null===(c=e.responses[t])||void 0===c?void 0:c.content){var c;l.add(r.trim())}const p=[...l].join(", "),d=this.resolvedSpec.securitySchemes.filter((t=>{var r;return t.finalKeyValue&&(null===(r=e.security)||void 0===r?void 0:r.some((e=>t.securitySchemeId in e)))}))||[],u=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot&&"-"!==e.value));u&&d.push(u);const h=e.xCodeSamples?fI(e.xCodeSamples):"";return z` + `}function uR(e){var t,r,n,a,o,i,s;const l=new Set;for(const t in e.responses)for(const r in null===(c=e.responses[t])||void 0===c?void 0:c.content){var c;l.add(r.trim())}const p=[...l].join(", "),d=this.resolvedSpec.securitySchemes.filter((t=>{var r;return t.finalKeyValue&&(null===(r=e.security)||void 0===r?void 0:r.some((e=>t.securitySchemeId in e)))}))||[],u=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot&&"-"!==e.value));u&&d.push(u);const h=e.xCodeSamples?fI(e.xCodeSamples):"";return z`
${e.summary?z`
${e.summary}
`:e.shortSummary!==e.description?z`
${e.shortSummary}
`:""} @@ -2802,14 +2837,14 @@ pre[class*="language-"] { schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" >
-
`}function fR(e=!0,t=!0,r=!1){return this.resolvedSpec?z` +
`}function hR(e=!0,t=!0,r=!1){return this.resolvedSpec?z` ${e?z`
- + Expand all  |  - + Collapse all   sections @@ -2827,20 +2862,20 @@ pre[class*="language-"] {
${e.paths.filter((e=>!this.matchPaths||lt(this.matchPaths,e,this.matchType))).map((e=>z`
- ${uR.call(this,e,r)} - ${r||e.expanded?hR.call(this,e):""} + ${dR.call(this,e,r)} + ${r||e.expanded?uR.call(this,e):""}
`))}
`:z` `} - `))}`:""}function mR(){return z` + `))}`:""}function fR(){return z`
`;var e}customElements.define("api-response",class extends ie{constructor(){super(),this.selectedStatus="",this.headersForEachRespStatus={},this.mimeResponsesForEachStatus={},this.activeSchemaTab="schema"}static get properties(){return{callback:{type:String},webhook:{type:String},responses:{type:Object},parser:{type:Object},schemaStyle:{type:String,attribute:"schema-style"},renderStyle:{type:String,attribute:"render-style"},selectedStatus:{type:String,attribute:"selected-status"},selectedMimeType:{type:String,attribute:"selected-mime-type"},activeSchemaTab:{type:String,attribute:"active-schema-tab"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"}}}static get styles(){return[Ke,Ye,et,Ze,Je,kI,c` + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } .resp-head{ vertical-align: middle; padding:16px 0 8px; @@ -3049,7 +3086,7 @@ pre[class*="language-"] { exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" > `}`:z`
 Schema not found
- `}});const yR=c` + `}});const mR=c` *, *:before, *:after { box-sizing: border-box; } .dialog-box-overlay { @@ -3121,7 +3158,7 @@ pre[class*="language-"] { flex-grow: 1; font-size:24px; } -`;function gR(){var e;return document.addEventListener("close",(()=>{this.showAdvancedSearchDialog=!1})),document.addEventListener("open",this.onOpenSearchDialog),z` +`;function yR(){var e;return document.addEventListener("close",(()=>{this.showAdvancedSearchDialog=!1})),document.addEventListener("open",this.onOpenSearchDialog),z` `))} - `}customElements.define("dialog-box",class extends ie{static get properties(){return{heading:{type:String,attribute:"heading"},show:{type:String,attribute:"show"}}}static get styles(){return[yR]}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",(e=>{"Escape"===e.code&&this.onClose()}))}attributeChangedCallback(e,t,r){t!==r&&("heading"===e&&(this.heading=r),"show"===e&&(this.show=r,"true"===r&&document.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0,detail:this})))),super.attributeChangedCallback(e,t,r)}render(){return z` + `}customElements.define("dialog-box",class extends ie{static get properties(){return{heading:{type:String,attribute:"heading"},show:{type:String,attribute:"show"}}}static get styles(){return[mR]}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",(e=>{"Escape"===e.code&&this.onClose()}))}attributeChangedCallback(e,t,r){t!==r&&("heading"===e&&(this.heading=r),"show"===e&&(this.show=r,"true"===r&&document.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0,detail:this})))),super.attributeChangedCallback(e,t,r)}render(){return z` ${"true"===this.show?z`
@@ -3185,7 +3222,7 @@ pre[class*="language-"] {
- `:""}`}onClose(){document.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}});const vR={color:{inputReverseFg:"#fff",inputReverseBg:"#333",headerBg:"#444",getRgb(e){if(0===e.indexOf("#")&&(e=e.slice(1,7)),3!==e.length&&4!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6!==e.length)throw new Error("Invalid HEX color.");return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}},luminanace(e){const t=this.getRgb(e);return.299*t.r+.587*t.g+.114*t.b},invert(e){return this.luminanace(e)>135?"#000":"#fff"},opacity(e,t){const r=this.getRgb(e);return`rgba(${r.r}, ${r.g}, ${r.b}, ${t})`},brightness(e,t){const r=this.getRgb(e);return r.r+=t,r.g+=t,r.b+=t,r.r>255?r.r=255:r.r<0&&(r.r=0),r.g>255?r.g=255:r.g<0&&(r.g=0),r.b>255?r.b=255:r.b<0&&(r.b=0),`#${r.r.toString(16).padStart(2,"0")}${r.g.toString(16).padStart(2,"0")}${r.b.toString(16).padStart(2,"0")}`},hasGoodContrast(e,t){return this.luminanace(e)-this.luminanace(t)}}};function bR(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/i.test(e)}function xR(e,t={}){let r={};const n=t.primaryColor?t.primaryColor:"dark"===e?"#f76b39":"#ff591e",a=vR.color.invert(n),o=vR.color.opacity(n,"0.8");if("dark"===e){const e=t.bg1?t.bg1:"#2a2b2c",i=t.fg1?t.fg1:"#bbb",s=t.bg2?t.bg2:vR.color.brightness(e,5),l=t.bg3?t.bg3:vR.color.brightness(e,17),c=t.bg3?t.bg3:vR.color.brightness(e,35),p=t.fg2?t.fg2:vR.color.brightness(i,-15),d=t.fg3?t.fg3:vR.color.brightness(i,-20),u=t.fg3?t.fg3:vR.color.brightness(i,-65),h=t.inlineCodeFg?t.inlineCodeFg:"#aaa",f="#bbb",m="#eee",y=t.headerColor?t.headerColor:vR.color.brightness(e,10),g=t.navBgColor?t.navBgColor:vR.color.brightness(e,10);r={bg1:e,bg2:s,bg3:l,lightBg:c,fg1:i,fg2:p,fg3:d,lightFg:u,inlineCodeFg:h,primaryColor:n,primaryColorTrans:o,primaryColorInvert:a,selectionBg:f,selectionFg:m,overlayBg:"rgba(80, 80, 80, 0.4)",navBgColor:g,navTextColor:t.navTextColor?t.navTextColor:vR.color.opacity(vR.color.invert(g),"0.50"),navHoverBgColor:t.navHoverBgColor?t.navHoverBgColor:vR.color.brightness(g,-15),navHoverTextColor:t.navHoverTextColor?t.navHoverTextColor:vR.color.invert(g),navAccentColor:t.navAccentColor?t.navAccentColor:vR.color.brightness(n,25),headerColor:y,headerColorInvert:vR.color.invert(y),headerColorDarker:vR.color.brightness(y,-20),headerColorBorder:vR.color.brightness(y,10),borderColor:t.borderColor||vR.color.brightness(e,20),lightBorderColor:t.lightBorderColor||vR.color.brightness(e,15),codeBorderColor:t.codeBorderColor||vR.color.brightness(e,30),inputBg:t.inputBg||vR.color.brightness(e,-5),placeHolder:t.placeHolder||vR.color.opacity(i,"0.3"),hoverColor:t.hoverColor||vR.color.brightness(e,-10),red:t.red?t.red:"#F06560",lightRed:t.lightRed?t.lightRed:vR.color.brightness(e,-10),pink:t.pink?t.pink:"#ffb2b2",lightPink:t.lightPink||vR.color.brightness(e,-10),green:t.green||"#7ec699",lightGreen:t.lightGreen||vR.color.brightness(e,-10),blue:t.blue||"#71b7ff",lightBlue:t.lightBlue||vR.color.brightness(e,-10),orange:t.orange?t.orange:"#f08d49",lightOrange:t.lightOrange||vR.color.brightness(e,-10),yellow:t.yellow||"#827717",lightYellow:t.lightYellow||vR.color.brightness(e,-10),purple:t.purple||"#786FF1",brown:t.brown||"#D4AC0D",codeBg:t.codeBg||vR.color.opacity(vR.color.brightness(e,-15),.7),codeFg:t.codeFg||"#aaa",codePropertyColor:t.codePropertyColor||"#f8c555",codeKeywordColor:t.codeKeywordColor||"#cc99cd",codeOperatorColor:t.codeOperatorColor||"#67cdcc"}}else{const e=t.bg1?t.bg1:"#fafbfc",i=t.fg1?t.fg1:"#444444",s=t.bg2?t.bg2:vR.color.brightness(e,-5),l=t.bg3?t.bg3:vR.color.brightness(e,-15),c=t.bg3?t.bg3:vR.color.brightness(e,-45),p=t.fg2?t.fg2:vR.color.brightness(i,17),d=t.fg3?t.fg3:vR.color.brightness(i,30),u=t.fg3?t.fg3:vR.color.brightness(i,70),h=t.inlineCodeFg?t.inlineCodeFg:"brown",f="#444",m="#eee",y=t.headerColor?t.headerColor:vR.color.brightness(e,-180),g=t.navBgColor?t.navBgColor:vR.color.brightness(e,-200);r={bg1:e,bg2:s,bg3:l,lightBg:c,fg1:i,fg2:p,fg3:d,lightFg:u,inlineCodeFg:h,primaryColor:n,primaryColorTrans:o,primaryColorInvert:a,selectionBg:f,selectionFg:m,overlayBg:"rgba(0, 0, 0, 0.4)",navBgColor:g,navTextColor:t.navTextColor?t.navTextColor:vR.color.opacity(vR.color.invert(g),"0.65"),navHoverBgColor:t.navHoverBgColor?t.navHoverBgColor:vR.color.brightness(g,-15),navHoverTextColor:t.navHoverTextColor?t.navHoverTextColor:vR.color.invert(g),navAccentColor:t.navAccentColor?t.navAccentColor:vR.color.brightness(n,25),headerColor:y,headerColorInvert:vR.color.invert(y),headerColorDarker:vR.color.brightness(y,-20),headerColorBorder:vR.color.brightness(y,10),borderColor:t.borderColor||vR.color.brightness(e,-38),lightBorderColor:t.lightBorderColor||vR.color.brightness(e,-23),codeBorderColor:t.codeBorderColor||"transparent",inputBg:t.inputBg||vR.color.brightness(e,10),placeHolder:t.placeHolder||vR.color.brightness(u,20),hoverColor:t.hoverColor||vR.color.brightness(e,-5),red:t.red||"#F06560",lightRed:t.lightRed||"#fff0f0",pink:t.pink?t.pink:"#990055",lightPink:t.lightPink?t.lightPink:"#ffb2b2",green:t.green||"#690",lightGreen:t.lightGreen||"#fbfff0",blue:t.blue||"#47AFE8",lightBlue:t.lightBlue||"#eff8fd",orange:t.orange||"#FF9900",lightOrange:t.lightOrange||"#fff5e6",yellow:t.yellow||"#827717",lightYellow:t.lightYellow||"#fff5cc",purple:t.purple||"#786FF1",brown:t.brown||"#D4AC0D",codeBg:t.codeBg||vR.color.opacity(vR.color.brightness(e,-15),.7),codeFg:t.codeFg||"#666",codePropertyColor:t.codePropertyColor||"#905",codeKeywordColor:t.codeKeywordColor||"#07a",codeOperatorColor:t.codeOperatorColor||"#9a6e3a"}}return z` + `:""}`}onClose(){document.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}});const gR={color:{inputReverseFg:"#fff",inputReverseBg:"#333",headerBg:"#444",getRgb(e){if(0===e.indexOf("#")&&(e=e.slice(1,7)),3!==e.length&&4!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6!==e.length)throw new Error("Invalid HEX color.");return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}},luminanace(e){const t=this.getRgb(e);return.299*t.r+.587*t.g+.114*t.b},invert(e){return this.luminanace(e)>135?"#000":"#fff"},opacity(e,t){const r=this.getRgb(e);return`rgba(${r.r}, ${r.g}, ${r.b}, ${t})`},brightness(e,t){const r=this.getRgb(e);return r.r+=t,r.g+=t,r.b+=t,r.r>255?r.r=255:r.r<0&&(r.r=0),r.g>255?r.g=255:r.g<0&&(r.g=0),r.b>255?r.b=255:r.b<0&&(r.b=0),`#${r.r.toString(16).padStart(2,"0")}${r.g.toString(16).padStart(2,"0")}${r.b.toString(16).padStart(2,"0")}`},hasGoodContrast(e,t){return this.luminanace(e)-this.luminanace(t)}}};function vR(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/i.test(e)}function bR(e,t={}){let r={};const n=t.primaryColor?t.primaryColor:"dark"===e?"#f76b39":"#ff591e",a=gR.color.invert(n),o=gR.color.opacity(n,"0.4");if("dark"===e){const e=t.bg1?t.bg1:"#2a2b2c",i=t.fg1?t.fg1:"#bbb",s=t.bg2?t.bg2:gR.color.brightness(e,5),l=t.bg3?t.bg3:gR.color.brightness(e,17),c=t.bg3?t.bg3:gR.color.brightness(e,35),p=t.fg2?t.fg2:gR.color.brightness(i,-15),d=t.fg3?t.fg3:gR.color.brightness(i,-20),u=t.fg3?t.fg3:gR.color.brightness(i,-65),h=t.inlineCodeFg?t.inlineCodeFg:"#aaa",f="#bbb",m="#eee",y=t.headerColor?t.headerColor:gR.color.brightness(e,10),g=t.navBgColor?t.navBgColor:gR.color.brightness(e,10);r={bg1:e,bg2:s,bg3:l,lightBg:c,fg1:i,fg2:p,fg3:d,lightFg:u,inlineCodeFg:h,primaryColor:n,primaryColorTrans:o,primaryColorInvert:a,selectionBg:f,selectionFg:m,overlayBg:"rgba(80, 80, 80, 0.4)",navBgColor:g,navTextColor:t.navTextColor?t.navTextColor:gR.color.opacity(gR.color.invert(g),"0.50"),navHoverBgColor:t.navHoverBgColor?t.navHoverBgColor:gR.color.brightness(g,-15),navHoverTextColor:t.navHoverTextColor?t.navHoverTextColor:gR.color.invert(g),navAccentColor:t.navAccentColor?t.navAccentColor:gR.color.brightness(n,25),headerColor:y,headerColorInvert:gR.color.invert(y),headerColorDarker:gR.color.brightness(y,-20),headerColorBorder:gR.color.brightness(y,10),borderColor:t.borderColor||gR.color.brightness(e,20),lightBorderColor:t.lightBorderColor||gR.color.brightness(e,15),codeBorderColor:t.codeBorderColor||gR.color.brightness(e,30),inputBg:t.inputBg||gR.color.brightness(e,-5),placeHolder:t.placeHolder||gR.color.opacity(i,"0.3"),hoverColor:t.hoverColor||gR.color.brightness(e,-10),red:t.red?t.red:"#F06560",lightRed:t.lightRed?t.lightRed:gR.color.brightness(e,-10),pink:t.pink?t.pink:"#ffb2b2",lightPink:t.lightPink||gR.color.brightness(e,-10),green:t.green||"#7ec699",lightGreen:t.lightGreen||gR.color.brightness(e,-10),blue:t.blue||"#71b7ff",lightBlue:t.lightBlue||gR.color.brightness(e,-10),orange:t.orange?t.orange:"#f08d49",lightOrange:t.lightOrange||gR.color.brightness(e,-10),yellow:t.yellow||"#827717",lightYellow:t.lightYellow||gR.color.brightness(e,-10),purple:t.purple||"#786FF1",brown:t.brown||"#D4AC0D",codeBg:t.codeBg||gR.color.opacity(gR.color.brightness(e,-15),.7),codeFg:t.codeFg||"#aaa",codePropertyColor:t.codePropertyColor||"#f8c555",codeKeywordColor:t.codeKeywordColor||"#cc99cd",codeOperatorColor:t.codeOperatorColor||"#67cdcc"}}else{const e=t.bg1?t.bg1:"#fafbfc",i=t.fg1?t.fg1:"#444444",s=t.bg2?t.bg2:gR.color.brightness(e,-5),l=t.bg3?t.bg3:gR.color.brightness(e,-15),c=t.bg3?t.bg3:gR.color.brightness(e,-45),p=t.fg2?t.fg2:gR.color.brightness(i,17),d=t.fg3?t.fg3:gR.color.brightness(i,30),u=t.fg3?t.fg3:gR.color.brightness(i,70),h=t.inlineCodeFg?t.inlineCodeFg:"brown",f="#444",m="#eee",y=t.headerColor?t.headerColor:gR.color.brightness(e,-180),g=t.navBgColor?t.navBgColor:gR.color.brightness(e,-200);r={bg1:e,bg2:s,bg3:l,lightBg:c,fg1:i,fg2:p,fg3:d,lightFg:u,inlineCodeFg:h,primaryColor:n,primaryColorTrans:o,primaryColorInvert:a,selectionBg:f,selectionFg:m,overlayBg:"rgba(0, 0, 0, 0.4)",navBgColor:g,navTextColor:t.navTextColor?t.navTextColor:gR.color.opacity(gR.color.invert(g),"0.65"),navHoverBgColor:t.navHoverBgColor?t.navHoverBgColor:gR.color.brightness(g,-15),navHoverTextColor:t.navHoverTextColor?t.navHoverTextColor:gR.color.invert(g),navAccentColor:t.navAccentColor?t.navAccentColor:gR.color.brightness(n,25),headerColor:y,headerColorInvert:gR.color.invert(y),headerColorDarker:gR.color.brightness(y,-20),headerColorBorder:gR.color.brightness(y,10),borderColor:t.borderColor||gR.color.brightness(e,-38),lightBorderColor:t.lightBorderColor||gR.color.brightness(e,-23),codeBorderColor:t.codeBorderColor||"transparent",inputBg:t.inputBg||gR.color.brightness(e,10),placeHolder:t.placeHolder||gR.color.brightness(u,20),hoverColor:t.hoverColor||gR.color.brightness(e,-5),red:t.red||"#F06560",lightRed:t.lightRed||"#fff0f0",pink:t.pink?t.pink:"#990055",lightPink:t.lightPink?t.lightPink:"#ffb2b2",green:t.green||"#690",lightGreen:t.lightGreen||"#fbfff0",blue:t.blue||"#47AFE8",lightBlue:t.lightBlue||"#eff8fd",orange:t.orange||"#FF9900",lightOrange:t.lightOrange||"#fff5e6",yellow:t.yellow||"#827717",lightYellow:t.lightYellow||"#fff5cc",purple:t.purple||"#786FF1",brown:t.brown||"#D4AC0D",codeBg:t.codeBg||gR.color.opacity(gR.color.brightness(e,-15),.7),codeFg:t.codeFg||"#666",codePropertyColor:t.codePropertyColor||"#905",codeKeywordColor:t.codeKeywordColor||"#07a",codeOperatorColor:t.codeOperatorColor||"#9a6e3a"}}return z` `}function wR(e=!1,t=!0,r=!0,n=!1){if(!this.resolvedSpec)return"";"true"===this.persistAuth&&aI.call(this);const a={bg1:bR(this.bgColor)?this.bgColor:"",fg1:bR(this.textColor)?this.textColor:"",headerColor:bR(this.headerColor)?this.headerColor:"",primaryColor:bR(this.primaryColor)?this.primaryColor:"",navBgColor:bR(this.navBgColor)?this.navBgColor:"",navTextColor:bR(this.navTextColor)?this.navTextColor:"",navHoverBgColor:bR(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:bR(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:bR(this.navAccentColor)?this.navAccentColor:""};return this.resolvedSpec.specLoadError?e?z` - ${"dark"===this.theme?xR.call(this,"dark",a):xR.call(this,"light",a)} + `}function xR(e=!1,t=!0,r=!0,n=!1){if(!this.resolvedSpec)return"";"true"===this.persistAuth&&aI.call(this);const a={bg1:vR(this.bgColor)?this.bgColor:"",fg1:vR(this.textColor)?this.textColor:"",headerColor:vR(this.headerColor)?this.headerColor:"",primaryColor:vR(this.primaryColor)?this.primaryColor:"",navBgColor:vR(this.navBgColor)?this.navBgColor:"",navTextColor:vR(this.navTextColor)?this.navTextColor:"",navHoverBgColor:vR(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:vR(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:vR(this.navAccentColor)?this.navAccentColor:""};return this.resolvedSpec.specLoadError?e?z` + ${"dark"===this.theme?bR.call(this,"dark",a):bR.call(this,"light",a)}
${this.resolvedSpec.info.description}
`:z` - ${"dark"===this.theme?xR.call(this,"dark",a):xR.call(this,"light",a)} + ${"dark"===this.theme?bR.call(this,"dark",a):bR.call(this,"light",a)} - ${mR.call(this)} + ${fR.call(this)}
@@ -3288,7 +3327,7 @@ pre[class*="language-"] {
`:this.resolvedSpec.isSpecLoading?z` - ${"dark"===this.theme?xR.call(this,"dark",a):xR.call(this,"light",a)} + ${"dark"===this.theme?bR.call(this,"dark",a):bR.call(this,"light",a)}
@@ -3296,33 +3335,33 @@ pre[class*="language-"] {
`:z` - ${"dark"===this.theme?xR.call(this,"dark",a):xR.call(this,"light",a)} + ${"dark"===this.theme?bR.call(this,"dark",a):bR.call(this,"light",a)} - ${"false"===this.showHeader?"":mR.call(this)} + ${"false"===this.showHeader?"":fR.call(this)} - ${"false"===this.allowAdvancedSearch?"":gR.call(this)} + ${"false"===this.allowAdvancedSearch?"":yR.call(this)}
- ${"read"!==this.renderStyle&&"focused"!==this.renderStyle||"true"!==this.showSideNav||!this.resolvedSpec?"":nR.call(this)} + ${"read"!==this.renderStyle&&"focused"!==this.renderStyle||"true"!==this.showSideNav||!this.resolvedSpec?"":rR.call(this)} -
+
${!0===this.loading?z`
`:z` ${!0===this.loadFailed?z`
Unable to load the Spec
`:z`
- ${"focused"===this.renderStyle?z`${lR.call(this)}`:z` + ${"focused"===this.renderStyle?z`${sR.call(this)}`:z` ${"true"===this.showInfo?JI.call(this):""} ${"true"===this.allowServerSelection?XI.call(this):""} ${"true"===this.allowAuthentication?uI.call(this):""}
- ${"read"===this.renderStyle?HI.call(this):fR.call(this,t,r,n)} + ${"read"===this.renderStyle?HI.call(this):hR.call(this,t,r,n)} `}
`}`} @@ -3330,7 +3369,7 @@ pre[class*="language-"] {
- `}class $R extends ie{constructor(){super();const e={root:this.getRootNode().host,rootMargin:"-50px 0px -50px 0px",threshold:0};this.showSummaryWhenCollapsed=!0,this.isIntersectionObserverActive=!0,this.intersectionObserver=new IntersectionObserver((e=>{this.onIntersect(e)}),e)}static get properties(){return{headingText:{type:String,attribute:"heading-text"},gotoPath:{type:String,attribute:"goto-path"},updateRoute:{type:String,attribute:"update-route"},routePrefix:{type:String,attribute:"route-prefix"},specUrl:{type:String,attribute:"spec-url"},sortTags:{type:String,attribute:"sort-tags"},generateMissingTags:{type:String,attribute:"generate-missing-tags"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},specFile:{type:String,attribute:!1},layout:{type:String},renderStyle:{type:String,attribute:"render-style"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},onNavTagClick:{type:String,attribute:"on-nav-tag-click"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowAuthentication:{type:String,attribute:"allow-authentication"},allowTry:{type:String,attribute:"allow-try"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},allowAdvancedSearch:{type:String,attribute:"allow-advanced-search"},allowServerSelection:{type:String,attribute:"allow-server-selection"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showComponents:{type:String,attribute:"show-components"},pageDirection:{type:String,attribute:"page-direction"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},headerColor:{type:String,attribute:"header-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},cssFile:{type:String,attribute:"css-file"},cssClasses:{type:String,attribute:"css-classes"},navBgColor:{type:String,attribute:"nav-bg-color"},navTextColor:{type:String,attribute:"nav-text-color"},navHoverBgColor:{type:String,attribute:"nav-hover-bg-color"},navHoverTextColor:{type:String,attribute:"nav-hover-text-color"},navAccentColor:{type:String,attribute:"nav-accent-color"},navItemSpacing:{type:String,attribute:"nav-item-spacing"},showMethodInNavBar:{type:String,attribute:"show-method-in-nav-bar"},usePathInNavBar:{type:String,attribute:"use-path-in-nav-bar"},infoDescriptionHeadingsInNavBar:{type:String,attribute:"info-description-headings-in-navbar"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},loading:{type:Boolean},focusedElementId:{type:String},showAdvancedSearchDialog:{type:Boolean},advancedSearchMatches:{type:Object}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` + `}class wR extends ie{constructor(){super();const e={root:this.getRootNode().host,rootMargin:"-50px 0px -50px 0px",threshold:0};this.showSummaryWhenCollapsed=!0,this.isIntersectionObserverActive=!0,this.intersectionObserver=new IntersectionObserver((e=>{this.onIntersect(e)}),e)}static get properties(){return{headingText:{type:String,attribute:"heading-text"},gotoPath:{type:String,attribute:"goto-path"},updateRoute:{type:String,attribute:"update-route"},routePrefix:{type:String,attribute:"route-prefix"},specUrl:{type:String,attribute:"spec-url"},sortTags:{type:String,attribute:"sort-tags"},generateMissingTags:{type:String,attribute:"generate-missing-tags"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},specFile:{type:String,attribute:!1},layout:{type:String},renderStyle:{type:String,attribute:"render-style"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},onNavTagClick:{type:String,attribute:"on-nav-tag-click"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowAuthentication:{type:String,attribute:"allow-authentication"},allowTry:{type:String,attribute:"allow-try"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},allowAdvancedSearch:{type:String,attribute:"allow-advanced-search"},allowServerSelection:{type:String,attribute:"allow-server-selection"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showComponents:{type:String,attribute:"show-components"},pageDirection:{type:String,attribute:"page-direction"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},headerColor:{type:String,attribute:"header-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},cssFile:{type:String,attribute:"css-file"},cssClasses:{type:String,attribute:"css-classes"},navBgColor:{type:String,attribute:"nav-bg-color"},navTextColor:{type:String,attribute:"nav-text-color"},navHoverBgColor:{type:String,attribute:"nav-hover-bg-color"},navHoverTextColor:{type:String,attribute:"nav-hover-text-color"},navAccentColor:{type:String,attribute:"nav-accent-color"},navItemSpacing:{type:String,attribute:"nav-item-spacing"},showMethodInNavBar:{type:String,attribute:"show-method-in-nav-bar"},usePathInNavBar:{type:String,attribute:"use-path-in-nav-bar"},infoDescriptionHeadingsInNavBar:{type:String,attribute:"info-description-headings-in-navbar"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},loading:{type:Boolean},focusedElementId:{type:String},showAdvancedSearchDialog:{type:Boolean},advancedSearchMatches:{type:Object}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` :host { display:flex; flex-direction: column; @@ -3345,13 +3384,14 @@ pre[class*="language-"] { background-color:var(--bg); font-family:var(--font-regular); } - .body { + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } + .body { display:flex; height:100%; width:100%; overflow:hidden; } - .main-content { margin:0; padding: 0; @@ -3584,7 +3624,7 @@ pre[class*="language-"] { .section-gap--read-mode { padding: 24px 80px 12px 80px; } - }`,nt]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(0===e.offsetWidth&&""===e.style.width&&(e.style.width="100vw"),0===e.offsetHeight&&""===e.style.height&&(e.style.height="100vh"),"BODY"===e.tagName&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.layout&&"row, column,".includes(`${this.layout},`)||(this.layout="row"),this.renderStyle&&"read, view, focused,".includes(`${this.renderStyle},`)||(this.renderStyle="focused"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.defaultSchemaTab&&"example, schema, model,".includes(`${this.defaultSchemaTab},`)?"model"===this.defaultSchemaTab&&(this.defaultSchemaTab="schema"):this.defaultSchemaTab="example",(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.schemaHideReadOnly&&"default, never,".includes(`${this.schemaHideReadOnly},`)||(this.schemaHideReadOnly="default"),this.schemaHideWriteOnly&&"default, never,".includes(`${this.schemaHideWriteOnly},`)||(this.schemaHideWriteOnly="default"),this.fillRequestFieldsWithExample&&"true, false,".includes(`${this.fillRequestFieldsWithExample},`)||(this.fillRequestFieldsWithExample="true"),this.persistAuth&&"true, false,".includes(`${this.persistAuth},`)||(this.persistAuth="false"),this.onNavTagClick&&"expand-collapse, show-description,".includes(`${this.onNavTagClick},`)||(this.onNavTagClick="expand-collapse"),this.responseAreaHeight||(this.responseAreaHeight="400px"),this.allowSearch&&"true, false,".includes(`${this.allowSearch},`)||(this.allowSearch="true"),this.allowAdvancedSearch&&"true, false,".includes(`${this.allowAdvancedSearch},`)||(this.allowAdvancedSearch="true"),this.allowTry&&"true, false,".includes(`${this.allowTry},`)||(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),this.updateRoute&&"true, false,".includes(`${this.updateRoute},`)||(this.updateRoute="true"),this.routePrefix||(this.routePrefix="#"),this.sortTags&&"true, false,".includes(`${this.sortTags},`)||(this.sortTags="false"),this.generateMissingTags&&"true, false,".includes(`${this.generateMissingTags},`)||(this.generateMissingTags="false"),this.sortEndpointsBy&&"method, path, summary, none,".includes(`${this.sortEndpointsBy},`)||(this.sortEndpointsBy="path"),this.navItemSpacing&&"compact, relaxed, default,".includes(`${this.navItemSpacing},`)||(this.navItemSpacing="default"),this.showMethodInNavBar&&"false, as-plain-text, as-colored-text, as-colored-block,".includes(`${this.showMethodInNavBar},`)||(this.showMethodInNavBar="false"),this.usePathInNavBar&&"true, false,".includes(`${this.usePathInNavBar},`)||(this.usePathInNavBar="false"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.showInfo&&"true, false,".includes(`${this.showInfo},`)||(this.showInfo="true"),this.allowServerSelection&&"true, false,".includes(`${this.allowServerSelection},`)||(this.allowServerSelection="true"),this.allowAuthentication&&"true, false,".includes(`${this.allowAuthentication},`)||(this.allowAuthentication="true"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),this.showSideNav&&"true false".includes(this.showSideNav)||(this.showSideNav="true"),this.showComponents&&"true false".includes(this.showComponents)||(this.showComponents="false"),this.infoDescriptionHeadingsInNavBar&&"true, false,".includes(`${this.infoDescriptionHeadingsInNavBar},`)||(this.infoDescriptionHeadingsInNavBar="false"),this.fetchCredentials&&"omit, same-origin, include,".includes(`${this.fetchCredentials},`)||(this.fetchCredentials=""),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.showAdvancedSearchDialog||(this.showAdvancedSearchDialog=!1),this.cssFile||(this.cssFile=null),this.cssClasses||(this.cssClasses=""),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e}),window.addEventListener("hashchange",(()=>{const e=new RegExp(`^${this.routePrefix}`,"i"),t=window.location.hash.replace(e,"");this.scrollTo(t)}),!0)}disconnectedCallback(){this.intersectionObserver&&this.intersectionObserver.disconnect(),super.disconnectedCallback()}infoDescriptionHeadingRenderer(){const e=new We.Renderer;return e.heading=(e,t,r,n)=>`${e}`,e}render(){const e=document.querySelector(`link[href*="${this.cssFile}"]`);return e&&this.shadowRoot.appendChild(e.cloneNode()),wR.call(this)}observeExpandedContent(){this.shadowRoot.querySelectorAll(".observe-me").forEach((e=>{this.intersectionObserver.observe(e)}))}attributeChangedCallback(e,t,r){if("spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r),this.gotoPath&&!window.location.hash&&this.scrollTo(this.gotoPath)}),0),"render-style"===e&&("read"===r?window.setTimeout((()=>{this.observeExpandedContent()}),100):this.intersectionObserver.disconnect()),"api-key-name"===e||"api-key-location"===e||"api-key-value"===e){let t=!1,n="",a="",o="";if("api-key-name"===e?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(n=r,a=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),t=!0):"api-key-location"===e?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(a=r,n=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),t=!0):"api-key-value"===e&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=r,a=this.getAttribute("api-key-location"),n=this.getAttribute("api-key-name"),t=!0),t&&this.resolvedSpec){const e=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot));e?(e.name=n,e.in=a,e.value=o,e.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({securitySchemeId:ot,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:n,in:a,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSepcFileChange(e){this.setAttribute("spec-file",this.shadowRoot.getElementById("spec-file").value);const t=e.target.files[0],r=new FileReader;r.onload=()=>{try{const e=JSON.parse(r.result);this.loadSpec(e),this.shadowRoot.getElementById("spec-url").value=""}catch(e){console.error("RapiDoc: Unable to read or parse json")}},r.readAsText(t)}onFileLoadClick(){this.shadowRoot.getElementById("spec-file").click()}onSearchChange(e){this.matchPaths=e.target.value,this.resolvedSpec.tags.forEach((e=>e.paths.filter((t=>{this.matchPaths&<(this.matchPaths,t,this.matchType)&&(e.expanded=!0)})))),this.resolvedSpec.components.forEach((e=>e.subComponents.filter((e=>{e.expanded=!1,this.matchPaths&&!function(e,t){return t.name.toLowerCase().includes(e.toLowerCase())}(this.matchPaths,e)||(e.expanded=!0)})))),this.requestUpdate()}onClearSearch(){this.shadowRoot.getElementById("nav-bar-search").value="",this.matchPaths="",this.resolvedSpec.components.forEach((e=>e.subComponents.filter((e=>{e.expanded=!0}))))}onShowSearchModalClicked(){this.showAdvancedSearchDialog=!0}async onOpenSearchDialog(e){const t=e.detail.querySelector("input");await it(0),t&&t.focus()}async loadSpec(e){if(e){this.matchPaths="";try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1;const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}}async afterSpecParsedAndValidated(e){var t;for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find((e=>e.url===this.defaultApiServerUrl)))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const r=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(r),this.intersectionObserver.disconnect(),"read"===this.renderStyle&&(await it(100),this.observeExpandedContent());if(null===(t=window.location.hash)||void 0===t?void 0:t.substring(1)){const e=new RegExp(`^${this.routePrefix}`,"i"),t=window.location.hash.replace(e,"");"view"===this.renderStyle?this.expandAndGotoOperation(t,!0,!0):this.scrollTo(t)}else if("focused"===this.renderStyle&&!this.gotoPath){var n;const e=this.showInfo?"overview":null===(n=this.resolvedSpec.tags[0])||void 0===n?void 0:n.paths[0];this.scrollTo(e)}}expandAndGotoOperation(e,t=!0){if(!this.resolvedSpec)return;let r=!0;const n=-1===e.indexOf("#")?e:e.substring(1);if(n.startsWith("overview")||"servers"===n||"auth"===n)r=!1;else for(let t=0;t<(null===(a=this.resolvedSpec.tags)||void 0===a?void 0:a.length);t++){var a,o;const n=this.resolvedSpec.tags[t],i=null===(o=n.paths)||void 0===o?void 0:o.find((t=>t.elementId===e));i&&(i.expanded&&n.expanded?r=!1:(i.expanded=!0,n.expanded=!0))}t&&(r&&this.requestUpdate(),window.setTimeout((()=>{const e=this.shadowRoot.getElementById(n);e&&(e.scrollIntoView({behavior:"auto",block:"start"}),"true"===this.updateRoute&&window.history.replaceState(null,null,`${this.routePrefix||"#"}${n}`))}),r?150:0))}isValidTopId(e){return e.startsWith("overview")||"servers"===e||"auth"===e}isValidPathId(e){var t,r,n,a;return!("overview"!==e||!this.showInfo)||(!("servers"!==e||!this.allowServerSelection)||(!("auth"!==e||!this.allowAuthentication)||(e.startsWith("tag--")?null===(n=this.resolvedSpec)||void 0===n||null===(a=n.tags)||void 0===a?void 0:a.find((t=>t.elementId===e)):null===(t=this.resolvedSpec)||void 0===t||null===(r=t.tags)||void 0===r?void 0:r.find((t=>t.paths.find((t=>t.elementId===e)))))))}onIntersect(e){!1!==this.isIntersectionObserverActive&&e.forEach((e=>{if(e.isIntersecting&&e.intersectionRatio>0){const t=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active"),r=this.shadowRoot.getElementById(`link-${e.target.id}`);r&&("true"===this.updateRoute&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${this.routePrefix||"#"}${e.target.id}`),r.scrollIntoView({behavior:"auto",block:"center"}),r.classList.add("active")),t&&t.classList.remove("active")}}))}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}async scrollToEventTarget(e,t=!0){const r=e.currentTarget;if(r.dataset.contentId){if(this.isIntersectionObserverActive=!1,"focused"===this.renderStyle){const e=this.shadowRoot.querySelector("api-request");e&&e.beforerNavigationFocusedMode()}this.scrollTo(r.dataset.contentId,!0,t),setTimeout((()=>{this.isIntersectionObserverActive=!0}),300)}}async scrollTo(e,t=!0,r=!0){if("focused"===this.renderStyle&&(this.focusedElementId=e,await it(0)),"view"===this.renderStyle)this.expandAndGotoOperation(e,t,!0);else{let t=!1;const n=this.shadowRoot.getElementById(e);if(n?(t=!0,n.scrollIntoView({behavior:"auto",block:"start"})):t=!1,t){if("focused"===this.renderStyle){const e=this.shadowRoot.querySelector("api-request");e&&e.afterNavigationFocusedMode();const t=this.shadowRoot.querySelector("api-response");t&&t.resetSelection()}"true"===this.updateRoute&&window.history.replaceState(null,null,`${this.routePrefix||"#"}${e}`);const t=this.shadowRoot.getElementById(`link-${e}`);if(t){r&&t.scrollIntoView({behavior:"auto",block:"center"}),await it(0);const e=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active");e&&e.classList.remove("active"),t.classList.add("active")}}}}setHttpUserNameAndPassword(e,t,r){return eI.call(this,e,t,r)}setApiKey(e,t){return eI.call(this,e,"","",t)}removeAllSecurityKeys(){return tI.call(this)}setApiServer(e){return YI.call(this,e)}onAdvancedSearch(e,t){const r=e.target;clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>{let e;e="text"===r.type?r:r.closest(".advanced-search-options").querySelector("input[type=text]");const t=[...r.closest(".advanced-search-options").querySelectorAll("input:checked")].map((e=>e.id));this.advancedSearchMatches=function(e,t,r=[]){if(!e.trim()||0===r.length)return;const n=[];return t.forEach((t=>{t.paths.forEach((t=>{let a="";var o;if(r.includes("search-api-path")&&(a=t.path),r.includes("search-api-descr")&&(a=`${a} ${t.summary||t.description||""}`),r.includes("search-api-params")&&(a=`${a} ${(null===(o=t.parameters)||void 0===o?void 0:o.map((e=>e.name)).join(" "))||""}`),r.includes("search-api-request-body")&&t.requestBody){let e=new Set;for(const r in null===(i=t.requestBody)||void 0===i?void 0:i.content){var i,s,l;null!==(s=t.requestBody.content[r].schema)&&void 0!==s&&s.properties&&(e=ct(null===(l=t.requestBody.content[r].schema)||void 0===l?void 0:l.properties)),a=`${a} ${[...e].join(" ")}`}}r.includes("search-api-resp-descr")&&(a=`${a} ${Object.values(t.responses).map((e=>e.description||"")).join(" ")}`),a.toLowerCase().includes(e.trim().toLowerCase())&&n.push({elementId:t.elementId,method:t.method,path:t.path,summary:t.summary||t.description||"",deprecated:t.deprecated})}))})),n}(e.value,this.resolvedSpec.tags,t)}),t)}}customElements.define("rapi-doc",$R);customElements.define("rapi-doc-mini",class extends ie{constructor(){super(),this.isMini=!0,this.updateRoute="false",this.renderStyle="view",this.showHeader="false",this.allowAdvancedSearch="false"}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},layout:{type:String},pathsExpanded:{type:String,attribute:"paths-expanded"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},showSummaryWhenCollapsed:{type:String,attribute:"show-summary-when-collapsed"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},allowTry:{type:String,attribute:"allow-try"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},loading:{type:Boolean}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` + }`,nt]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(0===e.offsetWidth&&""===e.style.width&&(e.style.width="100vw"),0===e.offsetHeight&&""===e.style.height&&(e.style.height="100vh"),"BODY"===e.tagName&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.layout&&"row, column,".includes(`${this.layout},`)||(this.layout="row"),this.renderStyle&&"read, view, focused,".includes(`${this.renderStyle},`)||(this.renderStyle="focused"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.defaultSchemaTab&&"example, schema, model,".includes(`${this.defaultSchemaTab},`)?"model"===this.defaultSchemaTab&&(this.defaultSchemaTab="schema"):this.defaultSchemaTab="example",(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.schemaHideReadOnly&&"default, never,".includes(`${this.schemaHideReadOnly},`)||(this.schemaHideReadOnly="default"),this.schemaHideWriteOnly&&"default, never,".includes(`${this.schemaHideWriteOnly},`)||(this.schemaHideWriteOnly="default"),this.fillRequestFieldsWithExample&&"true, false,".includes(`${this.fillRequestFieldsWithExample},`)||(this.fillRequestFieldsWithExample="true"),this.persistAuth&&"true, false,".includes(`${this.persistAuth},`)||(this.persistAuth="false"),this.onNavTagClick&&"expand-collapse, show-description,".includes(`${this.onNavTagClick},`)||(this.onNavTagClick="expand-collapse"),this.responseAreaHeight||(this.responseAreaHeight="400px"),this.allowSearch&&"true, false,".includes(`${this.allowSearch},`)||(this.allowSearch="true"),this.allowAdvancedSearch&&"true, false,".includes(`${this.allowAdvancedSearch},`)||(this.allowAdvancedSearch="true"),this.allowTry&&"true, false,".includes(`${this.allowTry},`)||(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),this.updateRoute&&"true, false,".includes(`${this.updateRoute},`)||(this.updateRoute="true"),this.routePrefix||(this.routePrefix="#"),this.sortTags&&"true, false,".includes(`${this.sortTags},`)||(this.sortTags="false"),this.generateMissingTags&&"true, false,".includes(`${this.generateMissingTags},`)||(this.generateMissingTags="false"),this.sortEndpointsBy&&"method, path, summary, none,".includes(`${this.sortEndpointsBy},`)||(this.sortEndpointsBy="path"),this.navItemSpacing&&"compact, relaxed, default,".includes(`${this.navItemSpacing},`)||(this.navItemSpacing="default"),this.showMethodInNavBar&&"false, as-plain-text, as-colored-text, as-colored-block,".includes(`${this.showMethodInNavBar},`)||(this.showMethodInNavBar="false"),this.usePathInNavBar&&"true, false,".includes(`${this.usePathInNavBar},`)||(this.usePathInNavBar="false"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.showInfo&&"true, false,".includes(`${this.showInfo},`)||(this.showInfo="true"),this.allowServerSelection&&"true, false,".includes(`${this.allowServerSelection},`)||(this.allowServerSelection="true"),this.allowAuthentication&&"true, false,".includes(`${this.allowAuthentication},`)||(this.allowAuthentication="true"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),this.showSideNav&&"true false".includes(this.showSideNav)||(this.showSideNav="true"),this.showComponents&&"true false".includes(this.showComponents)||(this.showComponents="false"),this.infoDescriptionHeadingsInNavBar&&"true, false,".includes(`${this.infoDescriptionHeadingsInNavBar},`)||(this.infoDescriptionHeadingsInNavBar="false"),this.fetchCredentials&&"omit, same-origin, include,".includes(`${this.fetchCredentials},`)||(this.fetchCredentials=""),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.showAdvancedSearchDialog||(this.showAdvancedSearchDialog=!1),this.cssFile||(this.cssFile=null),this.cssClasses||(this.cssClasses=""),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e}),window.addEventListener("hashchange",(()=>{const e=new RegExp(`^${this.routePrefix}`,"i"),t=window.location.hash.replace(e,"");this.scrollTo(t)}),!0)}disconnectedCallback(){this.intersectionObserver&&this.intersectionObserver.disconnect(),super.disconnectedCallback()}infoDescriptionHeadingRenderer(){const e=new We.Renderer;return e.heading=(e,t,r,n)=>`${e}`,e}render(){const e=document.querySelector(`link[href*="${this.cssFile}"]`);return e&&this.shadowRoot.appendChild(e.cloneNode()),xR.call(this)}observeExpandedContent(){this.shadowRoot.querySelectorAll(".observe-me").forEach((e=>{this.intersectionObserver.observe(e)}))}attributeChangedCallback(e,t,r){if("spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r),this.gotoPath&&!window.location.hash&&this.scrollTo(this.gotoPath)}),0),"render-style"===e&&("read"===r?window.setTimeout((()=>{this.observeExpandedContent()}),100):this.intersectionObserver.disconnect()),"api-key-name"===e||"api-key-location"===e||"api-key-value"===e){let t=!1,n="",a="",o="";if("api-key-name"===e?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(n=r,a=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),t=!0):"api-key-location"===e?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(a=r,n=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),t=!0):"api-key-value"===e&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=r,a=this.getAttribute("api-key-location"),n=this.getAttribute("api-key-name"),t=!0),t&&this.resolvedSpec){const e=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot));e?(e.name=n,e.in=a,e.value=o,e.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({securitySchemeId:ot,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:n,in:a,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSepcFileChange(e){this.setAttribute("spec-file",this.shadowRoot.getElementById("spec-file").value);const t=e.target.files[0],r=new FileReader;r.onload=()=>{try{const e=JSON.parse(r.result);this.loadSpec(e),this.shadowRoot.getElementById("spec-url").value=""}catch(e){console.error("RapiDoc: Unable to read or parse json")}},r.readAsText(t)}onFileLoadClick(){this.shadowRoot.getElementById("spec-file").click()}onSearchChange(e){this.matchPaths=e.target.value,this.resolvedSpec.tags.forEach((e=>e.paths.filter((t=>{this.matchPaths&<(this.matchPaths,t,this.matchType)&&(e.expanded=!0)})))),this.resolvedSpec.components.forEach((e=>e.subComponents.filter((e=>{e.expanded=!1,this.matchPaths&&!function(e,t){return t.name.toLowerCase().includes(e.toLowerCase())}(this.matchPaths,e)||(e.expanded=!0)})))),this.requestUpdate()}onClearSearch(){this.shadowRoot.getElementById("nav-bar-search").value="",this.matchPaths="",this.resolvedSpec.components.forEach((e=>e.subComponents.filter((e=>{e.expanded=!0}))))}onShowSearchModalClicked(){this.showAdvancedSearchDialog=!0}async onOpenSearchDialog(e){const t=e.detail.querySelector("input");await it(0),t&&t.focus()}async loadSpec(e){if(e){this.matchPaths="";try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1;const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}}async afterSpecParsedAndValidated(e){var t;for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find((e=>e.url===this.defaultApiServerUrl)))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const r=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(r),this.intersectionObserver.disconnect(),"read"===this.renderStyle&&(await it(100),this.observeExpandedContent());if(null===(t=window.location.hash)||void 0===t?void 0:t.substring(1)){const e=new RegExp(`^${this.routePrefix}`,"i"),t=window.location.hash.replace(e,"");"view"===this.renderStyle?this.expandAndGotoOperation(t,!0,!0):this.scrollTo(t)}else if("focused"===this.renderStyle&&!this.gotoPath){var n;const e=this.showInfo?"overview":null===(n=this.resolvedSpec.tags[0])||void 0===n?void 0:n.paths[0];this.scrollTo(e)}}expandAndGotoOperation(e,t=!0){if(!this.resolvedSpec)return;let r=!0;const n=-1===e.indexOf("#")?e:e.substring(1);if(n.startsWith("overview")||"servers"===n||"auth"===n)r=!1;else for(let t=0;t<(null===(a=this.resolvedSpec.tags)||void 0===a?void 0:a.length);t++){var a,o;const n=this.resolvedSpec.tags[t],i=null===(o=n.paths)||void 0===o?void 0:o.find((t=>t.elementId===e));i&&(i.expanded&&n.expanded?r=!1:(i.expanded=!0,n.expanded=!0))}t&&(r&&this.requestUpdate(),window.setTimeout((()=>{const e=this.shadowRoot.getElementById(n);e&&(e.scrollIntoView({behavior:"auto",block:"start"}),"true"===this.updateRoute&&window.history.replaceState(null,null,`${this.routePrefix||"#"}${n}`))}),r?150:0))}isValidTopId(e){return e.startsWith("overview")||"servers"===e||"auth"===e}isValidPathId(e){var t,r,n,a;return!("overview"!==e||!this.showInfo)||(!("servers"!==e||!this.allowServerSelection)||(!("auth"!==e||!this.allowAuthentication)||(e.startsWith("tag--")?null===(n=this.resolvedSpec)||void 0===n||null===(a=n.tags)||void 0===a?void 0:a.find((t=>t.elementId===e)):null===(t=this.resolvedSpec)||void 0===t||null===(r=t.tags)||void 0===r?void 0:r.find((t=>t.paths.find((t=>t.elementId===e)))))))}onIntersect(e){!1!==this.isIntersectionObserverActive&&e.forEach((e=>{if(e.isIntersecting&&e.intersectionRatio>0){const t=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active"),r=this.shadowRoot.getElementById(`link-${e.target.id}`);r&&("true"===this.updateRoute&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${this.routePrefix||"#"}${e.target.id}`),r.scrollIntoView({behavior:"auto",block:"center"}),r.classList.add("active")),t&&t.classList.remove("active")}}))}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}async scrollToEventTarget(e,t=!0){if("click"!==e.type&&("keyup"!==e.type||13!==e.keyCode))return;const r=e.target;if(r.dataset.contentId){if(this.isIntersectionObserverActive=!1,"focused"===this.renderStyle){const e=this.shadowRoot.querySelector("api-request");e&&e.beforerNavigationFocusedMode()}this.scrollTo(r.dataset.contentId,!0,t),setTimeout((()=>{this.isIntersectionObserverActive=!0}),300)}}async scrollTo(e,t=!0,r=!0){if("focused"===this.renderStyle&&(this.focusedElementId=e,await it(0)),"view"===this.renderStyle)this.expandAndGotoOperation(e,t,!0);else{let t=!1;const n=this.shadowRoot.getElementById(e);if(n?(t=!0,n.scrollIntoView({behavior:"auto",block:"start"})):t=!1,t){if("focused"===this.renderStyle){const e=this.shadowRoot.querySelector("api-request");e&&e.afterNavigationFocusedMode();const t=this.shadowRoot.querySelector("api-response");t&&t.resetSelection()}"true"===this.updateRoute&&window.history.replaceState(null,null,`${this.routePrefix||"#"}${e}`);const t=this.shadowRoot.getElementById(`link-${e}`);if(t){r&&t.scrollIntoView({behavior:"auto",block:"center"}),await it(0);const e=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active");e&&e.classList.remove("active"),t.classList.add("active")}}}}setHttpUserNameAndPassword(e,t,r){return eI.call(this,e,t,r)}setApiKey(e,t){return eI.call(this,e,"","",t)}removeAllSecurityKeys(){return tI.call(this)}setApiServer(e){return YI.call(this,e)}onAdvancedSearch(e,t){const r=e.target;clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>{let e;e="text"===r.type?r:r.closest(".advanced-search-options").querySelector("input[type=text]");const t=[...r.closest(".advanced-search-options").querySelectorAll("input:checked")].map((e=>e.id));this.advancedSearchMatches=function(e,t,r=[]){if(!e.trim()||0===r.length)return;const n=[];return t.forEach((t=>{t.paths.forEach((t=>{let a="";var o;if(r.includes("search-api-path")&&(a=t.path),r.includes("search-api-descr")&&(a=`${a} ${t.summary||t.description||""}`),r.includes("search-api-params")&&(a=`${a} ${(null===(o=t.parameters)||void 0===o?void 0:o.map((e=>e.name)).join(" "))||""}`),r.includes("search-api-request-body")&&t.requestBody){let e=new Set;for(const r in null===(i=t.requestBody)||void 0===i?void 0:i.content){var i,s,l;null!==(s=t.requestBody.content[r].schema)&&void 0!==s&&s.properties&&(e=ct(null===(l=t.requestBody.content[r].schema)||void 0===l?void 0:l.properties)),a=`${a} ${[...e].join(" ")}`}}r.includes("search-api-resp-descr")&&(a=`${a} ${Object.values(t.responses).map((e=>e.description||"")).join(" ")}`),a.toLowerCase().includes(e.trim().toLowerCase())&&n.push({elementId:t.elementId,method:t.method,path:t.path,summary:t.summary||t.description||"",deprecated:t.deprecated})}))})),n}(e.value,this.resolvedSpec.tags,t)}),t)}}customElements.define("rapi-doc",wR);customElements.define("rapi-doc-mini",class extends ie{constructor(){super(),this.isMini=!0,this.updateRoute="false",this.renderStyle="view",this.showHeader="false",this.allowAdvancedSearch="false"}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},layout:{type:String},pathsExpanded:{type:String,attribute:"paths-expanded"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},showSummaryWhenCollapsed:{type:String,attribute:"show-summary-when-collapsed"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},allowTry:{type:String,attribute:"allow-try"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},loading:{type:Boolean}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` :host { display:flex; flex-direction: column; @@ -3607,7 +3647,7 @@ pre[class*="language-"] { .only-large-screen-flex{ display:flex; } - }`]}connectedCallback(){if(super.connectedCallback(),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.showSummaryWhenCollapsed&&"true, false,".includes(`${this.showSummaryWhenCollapsed},`)||(this.showSummaryWhenCollapsed="true"),this.layout&&"row, column,".includes(`${this.layout},`)||(this.layout="row"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.defaultSchemaTab&&"example, schema, model,".includes(`${this.defaultSchemaTab},`)?"model"===this.defaultSchemaTab&&(this.defaultSchemaTab="schema"):this.defaultSchemaTab="example",this.pathsExpanded="true"===this.pathsExpanded,(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.fillRequestFieldsWithExample&&"true, false,".includes(`${this.fillRequestFieldsWithExample},`)||(this.fillRequestFieldsWithExample="true"),this.persistAuth&&"true, false,".includes(`${this.persistAuth},`)||(this.persistAuth="false"),this.responseAreaHeight||(this.responseAreaHeight="300px"),this.allowTry&&"true, false,".includes(`${this.allowTry},`)||(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),this.sortTags&&"true, false,".includes(`${this.sortTags},`)||(this.sortTags="false"),this.sortEndpointsBy&&"method, path, summary,".includes(`${this.sortEndpointsBy},`)||(this.sortEndpointsBy="path"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),this.fetchCredentials&&"omit, same-origin, include,".includes(`${this.fetchCredentials},`)||(this.fetchCredentials=""),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e})}render(){return wR.call(this,!0,!1,!1,this.pathsExpanded)}attributeChangedCallback(e,t,r){if("spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r)}),0),"api-key-name"===e||"api-key-location"===e||"api-key-value"===e){let t=!1,n="",a="",o="";if("api-key-name"===e?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(n=r,a=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),t=!0):"api-key-location"===e?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(a=r,n=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),t=!0):"api-key-value"===e&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=r,a=this.getAttribute("api-key-location"),n=this.getAttribute("api-key-name"),t=!0),t&&this.resolvedSpec){const e=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot));e?(e.name=n,e.in=a,e.value=o,e.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({apiKeyId:ot,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:n,in:a,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}setHttpUserNameAndPassword(e,t,r){return eI.call(this,e,t,r)}setApiKey(e,t){return eI.call(this,e,"","",t)}removeAllSecurityKeys(){return tI.call(this)}setApiServer(e){return YI.call(this,e)}async afterSpecParsedAndValidated(e){for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find((e=>e.url===this.defaultApiServerUrl)))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}});class kR extends HTMLElement{connectedCallback(){this.receiveAuthParms(),window.addEventListener("storage",(e=>this.receiveStorage(e)),!0)}receiveAuthParms(){let e={};if(document.location.search){const t=new URLSearchParams(document.location.search);e={code:t.get("code"),error:t.get("error"),state:t.get("state"),responseType:"code"}}else if(window.location.hash){e={token_type:this.parseQueryString(window.location.hash.substring(1),"token_type"),access_token:this.parseQueryString(window.location.hash.substring(1),"access_token"),responseType:"token"}}window.opener?window.opener.postMessage(e,this.target):sessionStorage.setItem("rapidoc-oauth-data",JSON.stringify(e))}relayAuthParams(e){if(window.parent&&"rapidoc-oauth-data"===e.key){const t=JSON.parse(e.newValue);window.parent.postMessage(t,this.target)}}parseQueryString(e,t){const r=e.split("&");for(let e=0;e{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.showSummaryWhenCollapsed&&"true, false,".includes(`${this.showSummaryWhenCollapsed},`)||(this.showSummaryWhenCollapsed="true"),this.layout&&"row, column,".includes(`${this.layout},`)||(this.layout="row"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.defaultSchemaTab&&"example, schema, model,".includes(`${this.defaultSchemaTab},`)?"model"===this.defaultSchemaTab&&(this.defaultSchemaTab="schema"):this.defaultSchemaTab="example",this.pathsExpanded="true"===this.pathsExpanded,(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.fillRequestFieldsWithExample&&"true, false,".includes(`${this.fillRequestFieldsWithExample},`)||(this.fillRequestFieldsWithExample="true"),this.persistAuth&&"true, false,".includes(`${this.persistAuth},`)||(this.persistAuth="false"),this.responseAreaHeight||(this.responseAreaHeight="300px"),this.allowTry&&"true, false,".includes(`${this.allowTry},`)||(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),this.sortTags&&"true, false,".includes(`${this.sortTags},`)||(this.sortTags="false"),this.sortEndpointsBy&&"method, path, summary,".includes(`${this.sortEndpointsBy},`)||(this.sortEndpointsBy="path"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),this.fetchCredentials&&"omit, same-origin, include,".includes(`${this.fetchCredentials},`)||(this.fetchCredentials=""),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e})}render(){return xR.call(this,!0,!1,!1,this.pathsExpanded)}attributeChangedCallback(e,t,r){if("spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r)}),0),"api-key-name"===e||"api-key-location"===e||"api-key-value"===e){let t=!1,n="",a="",o="";if("api-key-name"===e?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(n=r,a=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),t=!0):"api-key-location"===e?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(a=r,n=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),t=!0):"api-key-value"===e&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=r,a=this.getAttribute("api-key-location"),n=this.getAttribute("api-key-name"),t=!0),t&&this.resolvedSpec){const e=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot));e?(e.name=n,e.in=a,e.value=o,e.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({apiKeyId:ot,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:n,in:a,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}setHttpUserNameAndPassword(e,t,r){return eI.call(this,e,t,r)}setApiKey(e,t){return eI.call(this,e,"","",t)}removeAllSecurityKeys(){return tI.call(this)}setApiServer(e){return YI.call(this,e)}async afterSpecParsedAndValidated(e){for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find((e=>e.url===this.defaultApiServerUrl)))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}});class $R extends HTMLElement{connectedCallback(){this.receiveAuthParms(),window.addEventListener("storage",(e=>this.receiveStorage(e)),!0)}receiveAuthParms(){let e={};if(document.location.search){const t=new URLSearchParams(document.location.search);e={code:t.get("code"),error:t.get("error"),state:t.get("state"),responseType:"code"}}else if(window.location.hash){e={token_type:this.parseQueryString(window.location.hash.substring(1),"token_type"),access_token:this.parseQueryString(window.location.hash.substring(1),"access_token"),responseType:"token"}}window.opener?window.opener.postMessage(e,this.target):sessionStorage.setItem("rapidoc-oauth-data",JSON.stringify(e))}relayAuthParams(e){if(window.parent&&"rapidoc-oauth-data"===e.key){const t=JSON.parse(e.newValue);window.parent.postMessage(t,this.target)}}parseQueryString(e,t){const r=e.split("&");for(let e=0;e
@@ -3630,7 +3670,7 @@ pre[class*="language-"] {
`))} - `}function AR(){return z` + `}function SR(){return z` ${"true"===this.showInfo?JI.call(this):""}
${this.resolvedSpec.schemaAndExamples.map((e=>{var t;const r=FI(e.schema,"json",e.examples,e.example,!0,!1,"json",!0);return e.selectedExample=null===(t=r[0])||void 0===t?void 0:t.exampleId,z` @@ -3668,13 +3708,13 @@ pre[class*="language-"] {
`}))} - `}function OR(e=!1){if(!this.resolvedSpec)return"";const t={bg1:bR(this.bgColor)?this.bgColor:"",fg1:bR(this.textColor)?this.textColor:"",headerColor:bR(this.headerColor)?this.headerColor:"",primaryColor:bR(this.primaryColor)?this.primaryColor:"",navBgColor:bR(this.navBgColor)?this.navBgColor:"",navTextColor:bR(this.navTextColor)?this.navTextColor:"",navHoverBgColor:bR(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:bR(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:bR(this.navAccentColor)?this.navAccentColor:""};return this.resolvedSpec.specLoadError?e?z` - ${"dark"===this.theme?xR.call(this,"dark",t):xR.call(this,"light",t)} + `}function AR(e=!1){if(!this.resolvedSpec)return"";const t={bg1:vR(this.bgColor)?this.bgColor:"",fg1:vR(this.textColor)?this.textColor:"",headerColor:vR(this.headerColor)?this.headerColor:"",primaryColor:vR(this.primaryColor)?this.primaryColor:"",navBgColor:vR(this.navBgColor)?this.navBgColor:"",navTextColor:vR(this.navTextColor)?this.navTextColor:"",navHoverBgColor:vR(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:vR(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:vR(this.navAccentColor)?this.navAccentColor:""};return this.resolvedSpec.specLoadError?e?z` + ${"dark"===this.theme?bR.call(this,"dark",t):bR.call(this,"light",t)}
${this.resolvedSpec.info.description}
`:z` - ${"dark"===this.theme?xR.call(this,"dark",t):xR.call(this,"light",t)} + ${"dark"===this.theme?bR.call(this,"dark",t):bR.call(this,"light",t)} - ${mR.call(this)} + ${fR.call(this)}

Header

@@ -3684,7 +3724,7 @@ pre[class*="language-"] {
`:this.resolvedSpec.isSpecLoading?z` - ${"dark"===this.theme?xR.call(this,"dark",t):xR.call(this,"light",t)} + ${"dark"===this.theme?bR.call(this,"dark",t):bR.call(this,"light",t)}
@@ -3692,15 +3732,15 @@ pre[class*="language-"] {
`:z` - ${"dark"===this.theme?xR.call(this,"dark",t):xR.call(this,"light",t)} + ${"dark"===this.theme?bR.call(this,"dark",t):bR.call(this,"light",t)} - ${"false"===this.showHeader?"":mR.call(this)} + ${"false"===this.showHeader?"":fR.call(this)}
- ${SR.call(this)} + ${kR.call(this)}
@@ -3709,14 +3749,14 @@ pre[class*="language-"] { ${!0===this.loading?z`
`:z` ${!0===this.loadFailed?z`
Unable to load the Spec
`:z`
- ${AR.call(this)} + ${SR.call(this)}
`}`}
- `}customElements.define("oauth-receiver",kR);customElements.define("json-schema-viewer",class extends ie{constructor(){super(),this.isMini=!1,this.updateRoute="false",this.renderStyle="focused",this.showHeader="true",this.allowAdvancedSearch="false",this.selectedExampleForEachSchema={}}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},loading:{type:Boolean}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` + `}customElements.define("oauth-receiver",$R);customElements.define("json-schema-viewer",class extends ie{constructor(){super(),this.isMini=!1,this.updateRoute="false",this.renderStyle="focused",this.showHeader="true",this.allowAdvancedSearch="false",this.selectedExampleForEachSchema={}}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},loading:{type:Boolean}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` :host { display:flex; flex-direction: column; @@ -3802,5 +3842,5 @@ pre[class*="language-"] { .only-large-screen-flex{ display:flex; } - }`]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(0===e.offsetWidth&&""===e.style.width&&(e.style.width="100vw"),0===e.offsetHeight&&""===e.style.height&&(e.style.height="100vh"),"BODY"===e.tagName&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.renderStyle="focused",this.pathsExpanded="true"===this.pathsExpanded,this.showInfo&&"true, false,".includes(`${this.showInfo},`)||(this.showInfo="true"),this.showSideNav&&"true false".includes(this.showSideNav)||(this.showSideNav="true"),this.showHeader&&"true, false,".includes(`${this.showHeader},`)||(this.showHeader="true"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.allowSearch&&"true, false,".includes(`${this.allowSearch},`)||(this.allowSearch="true"),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e})}render(){return OR.call(this,!0,!1,!1,this.pathsExpanded)}attributeChangedCallback(e,t,r){"spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r)}),0),super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSearchChange(e){this.matchPaths=e.target.value}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}async afterSpecParsedAndValidated(e){this.resolvedSpec=e;const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}onSelectExample(e){[...e.target.closest(".json-schema-example-panel").querySelectorAll(".example")].forEach((t=>{t.style.display=t.dataset.example===e.target.value?"flex":"none"}))}async scrollToEventTarget(e){const t=e.currentTarget;if(!t.dataset.contentId)return;const r=this.shadowRoot.getElementById(t.dataset.contentId);r&&r.scrollIntoView({behavior:"auto",block:"start"})}})},874:()=>{!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,i=0;i{!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,r){return"(?:"+t[+r]+")"}))}function r(e,r,n){return RegExp(t(e,r),n||"")}function n(e,t){for(var r=0;r>/g,(function(){return"(?:"+e+")"}));return e.replace(/<>/g,"[^\\s\\S]")}var a="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",o="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",s="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(o),p=RegExp(l(a+" "+o+" "+i+" "+s)),d=l(o+" "+i+" "+s),u=l(a+" "+o+" "+s),h=n(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),f=n(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,y=t(/<<0>>(?:\s*<<1>>)?/.source,[m,h]),g=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,y]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[g,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[h,f,v]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),$=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,g,v]),k={keyword:p,punctuation:/[<>()?,.:[\]]/},S=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,A=/"(?:\\.|[^\\"\r\n])*"/.source,O=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[O]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[g]),lookbehind:!0,inside:k},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,$]),lookbehind:!0,inside:k},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[c,y]),lookbehind:!0,inside:k},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[g]),lookbehind:!0,inside:k},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:k},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[$,u,m]),inside:k}],keyword:p,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:k},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[$,g]),inside:k,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[$]),lookbehind:!0,inside:k,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,h]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(h),alias:"class-name",inside:k}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,y,m,$,p.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[y,f]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:p,"class-name":{pattern:RegExp($),greedy:!0,inside:k},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var E=A+"|"+S,T=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[E]),C=n(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[T]),2),j=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,_=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[g,C]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[j,_]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[j]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[C]),inside:e.languages.csharp},"class-name":{pattern:RegExp(g),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var P=/:[^}\r\n]+/.source,I=n(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[T]),2),R=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[I,P]),L=n(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[E]),2),D=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,P]);function F(t,n){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[n,P]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[R]),lookbehind:!0,greedy:!0,inside:F(R,I)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[D]),lookbehind:!0,greedy:!0,inside:F(D,L)}],char:{pattern:RegExp(S),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},251:()=>{!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(Prism)},46:()=>{Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"]},57:()=>{!function(e){function t(e){return RegExp("(^(?:"+e+"):[ \t]*(?![ \t]))[^]+","i")}e.languages.http={"request-line":{pattern:/^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:e.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[\d.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[\d.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[\d.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},header:{pattern:/^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,inside:{"header-value":[{pattern:t(/Content-Security-Policy/.source),lookbehind:!0,alias:["csp","languages-csp"],inside:e.languages.csp},{pattern:t(/Public-Key-Pins(?:-Report-Only)?/.source),lookbehind:!0,alias:["hpkp","languages-hpkp"],inside:e.languages.hpkp},{pattern:t(/Strict-Transport-Security/.source),lookbehind:!0,alias:["hsts","languages-hsts"],inside:e.languages.hsts},{pattern:t(/[^:]+/.source),lookbehind:!0}],"header-name":{pattern:/^[^:]+/,alias:"keyword"},punctuation:/^:/}}};var r,n=e.languages,a={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css,"text/plain":n.plain},o={"application/json":!0,"application/xml":!0};function i(e){var t=e.replace(/^[a-z]+\//,"");return"(?:"+e+"|"+("\\w+/(?:[\\w.-]+\\+)+"+t+"(?![+\\w.-])")+")"}for(var s in a)if(a[s]){r=r||{};var l=o[s]?i(s):s;r[s.replace(/\//g,"-")]={pattern:RegExp("("+/content-type:\s*/.source+l+/(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source+")"+/[^ \t\w-][\s\S]*/.source,"i"),lookbehind:!0,inside:a[s]}}r&&e.languages.insertBefore("http","header",r)}(Prism)},503:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,n={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[n,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:n.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:n.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":n,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:n.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:n.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},277:()=>{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},366:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},358:()=>{!function(e){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,n="(?:"+r.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var r=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return e}));return RegExp(r,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return n}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)},660:(e,t,r)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,n={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);k+=$.value.length,$=$.next){var S=$.value;if(t.length>e.length)return;if(!(S instanceof o)){var A,O=1;if(v){if(!(A=i(w,k,e,g))||A.index>=e.length)break;var E=A.index,T=A.index+A[0].length,C=k;for(C+=$.value.length;E>=C;)C+=($=$.next).value.length;if(k=C-=$.value.length,$.value instanceof o)continue;for(var j=$;j!==t.tail&&(Cd.reach&&(d.reach=R);var L=$.prev;if(P&&(L=c(t,L,P),k+=P.length),p(t,L,O),$=c(t,L,new o(u,y?a.tokenize(_,y):_,b,_)),I&&c(t,$,I),O>1){var D={cause:u+","+f,reach:R};s(e,t,r,$.prev,k,D),d&&D.reach>d.reach&&(d.reach=D.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,r){var n=t.next,a={value:r,prev:t,next:n};return t.next=a,n.prev=a,e.length++,a}function p(e,t,r){for(var n=t.next,a=0;a"+o.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var r=JSON.parse(t.data),n=r.language,o=r.code,i=r.immediateClose;e.postMessage(a.highlight(o,a.languages[n],n)),i&&e.close()}),!1),a):a;var d=a.util.currentScript();function u(){a.manual||a.highlightAll()}if(d&&(a.filename=d.src,d.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&d&&d.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return a}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=n),void 0!==r.g&&(r.g.Prism=n),n.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:r}};a["language-"+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(void 0!==n&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",r="loading",a="loaded",o='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])';n.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),n.hooks.add("before-sanity-check",(function(i){var s=i.element;if(s.matches(o)){i.code="",s.setAttribute(t,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),p=i.language;if("none"===p){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];p=e[d]||d}n.util.setLanguage(l,p),n.util.setLanguage(s,p);var u=n.plugins.autoloader;u&&u.loadLanguages(p),function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4==n.readyState&&(n.status<400&&n.responseText?t(n.responseText):n.status>=400?r("✖ Error "+n.status+" while fetching file: "+n.statusText):r("✖ Error: File does not exist or is empty"))},n.send(null)}(c,(function(e){s.setAttribute(t,a);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var r=Number(t[1]),n=t[2],a=t[3];return n?a?[r,Number(a)]:[r,void 0]:[r,r]}}(s.getAttribute("data-range"));if(r){var o=e.split(/\r\n?|\n/g),i=r[0],c=null==r[1]?o.length:r[1];i<0&&(i+=o.length),i=Math.max(0,Math.min(i-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),e=o.slice(i,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(i+1))}l.textContent=e,n.highlightElement(l)}),(function(e){s.setAttribute(t,"failed"),l.textContent=e}))}})),n.plugins.fileHighlight={highlight:function(e){for(var t,r=(e||document).querySelectorAll(o),a=0;t=r[a++];)n.highlightElement(t)}};var i=!1;n.fileHighlight=function(){i||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),i=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},464:e=>{"use strict";var t,r="";e.exports=function(e,n){if("string"!=typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var a=e.length*n;if(t!==e||void 0===t)t=e,r="";else if(r.length>=a)return r.substr(0,a);for(;a>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,a)}},131:(e,t,r)=>{"use strict";var n=r(464),a=function(e){return/<\/+[^>]+>/.test(e)},o=function(e){return/<[^>]+\/>/.test(e)};function i(e){return e.split(/(<\/?[^>]+>)/g).filter((function(e){return""!==e.trim()})).map((function(e){return{value:e,type:s(e)}}))}function s(e){return a(e)?"ClosingTag":function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!a(e)&&!o(e)}(e)?"OpeningTag":o(e)?"SelfClosingTag":"Text"}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.indentor,a=t.textNodesOnSameLine,o=0,s=[];r=r||" ";var l=i(e).map((function(e,t,i){var l=e.value,c=e.type;"ClosingTag"===c&&o--;var p=n(r,o),d=p+l;if("OpeningTag"===c&&o++,a){var u=i[t-1],h=i[t-2];"ClosingTag"===c&&"Text"===u.type&&"OpeningTag"===h.type&&(d=""+p+h.value+u.value+l,s.push(t-2,t-1))}return d}));return s.forEach((function(e){return l[e]=null})),l.filter((function(e){return!!e})).join("\n")}}},n={};function a(e){var t=n[e];if(void 0!==t){if(void 0!==t.error)throw t.error;return t.exports}var o=n[e]={exports:{}};try{var i={id:e,module:o,factory:r[e],require:a};a.i.forEach((function(e){e(i)})),o=i.module,i.factory.call(o.exports,o,o.exports,i.require)}catch(e){throw o.error=e,e}return o.exports}a.m=r,a.c=n,a.i=[],a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.hu=e=>e+"."+a.h()+".hot-update.js",a.hmrF=()=>"main."+a.h()+".hot-update.json",a.h=()=>"a9b439cc52935489ce5a",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="rapidoc:",a.l=(r,n,o,i)=>{if(e[r])e[r].push(n);else{var s,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),p=0;p{s.onerror=s.onload=null,clearTimeout(h);var a=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((e=>e(n))),t)return t(n)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),l&&document.head.appendChild(s)}},(()=>{var e,t,r,n={},o=a.c,i=[],s=[],l="idle",c=0,p=[];function d(e){l=e;for(var t=[],r=0;r0)return d("abort").then((function(){throw a[0]}));var o=d("dispose");n.forEach((function(e){e.dispose&&e.dispose()}));var i,s=d("apply"),l=function(e){i||(i=e)},c=[];return n.forEach((function(e){if(e.apply){var t=e.apply(l);if(t)for(var r=0;r=0&&v._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,l){case"idle":t=[],Object.keys(a.hmrI).forEach((function(e){a.hmrI[e](m,t)})),d("ready");break;case"ready":Object.keys(a.hmrI).forEach((function(e){a.hmrI[e](m,t)}));break;case"prepare":case"check":case"dispose":case"apply":(r=r||[]).push(m)}},check:h,apply:f,status:function(e){if(!e)return l;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var t=s.indexOf(e);t>=0&&s.splice(t,1)},data:n[m]},e=void 0,v),b.parents=i,b.children=[],i=[],p.require=x})),a.hmrC={},a.hmrI={}})(),a.p="",(()=>{var e,t,r,n,o,i=a.hmrS_jsonp=a.hmrS_jsonp||{179:0},s={};function l(t,r){return e=r,new Promise(((e,r)=>{s[t]=e;var n=a.p+a.hu(t),o=new Error;a.l(n,(e=>{if(s[t]){s[t]=void 0;var n=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src;o.message="Loading hot update chunk "+t+" failed.\n("+n+": "+a+")",o.name="ChunkLoadError",o.type=n,o.request=a,r(o)}}))}))}function c(e){function s(e){for(var t=[e],r={},n=t.map((function(e){return{chain:[e],id:e}}));n.length>0;){var o=n.pop(),i=o.id,s=o.chain,c=a.c[i];if(c&&(!c.hot._selfAccepted||c.hot._selfInvalidated)){if(c.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:i};if(c.hot._main)return{type:"unaccepted",chain:s,moduleId:i};for(var p=0;p ")),f.type){case"self-declined":e.onDeclined&&e.onDeclined(f),e.ignoreDeclined||(y=new Error("Aborted because of self decline: "+f.moduleId+b));break;case"declined":e.onDeclined&&e.onDeclined(f),e.ignoreDeclined||(y=new Error("Aborted because of declined dependency: "+f.moduleId+" in "+f.parentId+b));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(f),e.ignoreUnaccepted||(y=new Error("Aborted because "+h+" is not accepted"+b));break;case"accepted":e.onAccepted&&e.onAccepted(f),g=!0;break;case"disposed":e.onDisposed&&e.onDisposed(f),v=!0;break;default:throw new Error("Unexception type "+f.type)}if(y)return{error:y};if(g)for(h in d[h]=m,l(p,f.outdatedModules),f.outdatedDependencies)a.o(f.outdatedDependencies,h)&&(c[h]||(c[h]=[]),l(c[h],f.outdatedDependencies[h]));v&&(l(p,[f.moduleId]),d[h]=u)}r=void 0;for(var x,w=[],$=0;$0;){var o=r.pop(),s=a.c[o];if(s){var l={},d=s.hot._disposeHandlers;for($=0;$=0&&u.parents.splice(e,1))}}}for(var h in c)if(a.o(c,h)&&(s=a.c[h]))for(x=c[h],$=0;$=0&&s.children.splice(e,1)},apply:function(t){for(var r in d)a.o(d,r)&&(a.m[r]=d[r]);for(var n=0;n{for(var l in n)a.o(n,l)&&(r[l]=n[l],e&&e.push(l));i&&o.push(i),s[t]&&(s[t](),s[t]=void 0)},a.hmrI.jsonp=function(e,t){r||(r={},o=[],n=[],t.push(c)),a.o(r,e)||(r[e]=a.m[e])},a.hmrC.jsonp=function(e,s,p,d,u,h){u.push(c),t={},n=s,r=p.reduce((function(e,t){return e[t]=!1,e}),{}),o=[],e.forEach((function(e){a.o(i,e)&&void 0!==i[e]?(d.push(l(e,h)),t[e]=!0):t[e]=!1})),a.f&&(a.f.jsonpHmr=function(e,r){t&&a.o(t,e)&&!t[e]&&(r.push(l(e)),t[e]=!0)})},a.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(a.p+a.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})();a(656)})(); + }`]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(0===e.offsetWidth&&""===e.style.width&&(e.style.width="100vw"),0===e.offsetHeight&&""===e.style.height&&(e.style.height="100vh"),"BODY"===e.tagName&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.renderStyle="focused",this.pathsExpanded="true"===this.pathsExpanded,this.showInfo&&"true, false,".includes(`${this.showInfo},`)||(this.showInfo="true"),this.showSideNav&&"true false".includes(this.showSideNav)||(this.showSideNav="true"),this.showHeader&&"true, false,".includes(`${this.showHeader},`)||(this.showHeader="true"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.allowSearch&&"true, false,".includes(`${this.allowSearch},`)||(this.allowSearch="true"),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e})}render(){return AR.call(this,!0,!1,!1,this.pathsExpanded)}attributeChangedCallback(e,t,r){"spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r)}),0),super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSearchChange(e){this.matchPaths=e.target.value}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}async afterSpecParsedAndValidated(e){this.resolvedSpec=e;const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}onSelectExample(e){[...e.target.closest(".json-schema-example-panel").querySelectorAll(".example")].forEach((t=>{t.style.display=t.dataset.example===e.target.value?"flex":"none"}))}async scrollToEventTarget(e){const t=e.currentTarget;if(!t.dataset.contentId)return;const r=this.shadowRoot.getElementById(t.dataset.contentId);r&&r.scrollIntoView({behavior:"auto",block:"start"})}})},874:()=>{!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,i=0;i{!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,r){return"(?:"+t[+r]+")"}))}function r(e,r,n){return RegExp(t(e,r),n||"")}function n(e,t){for(var r=0;r>/g,(function(){return"(?:"+e+")"}));return e.replace(/<>/g,"[^\\s\\S]")}var a="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",o="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",s="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(o),p=RegExp(l(a+" "+o+" "+i+" "+s)),d=l(o+" "+i+" "+s),u=l(a+" "+o+" "+s),h=n(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),f=n(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,y=t(/<<0>>(?:\s*<<1>>)?/.source,[m,h]),g=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,y]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[g,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[h,f,v]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),$=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,g,v]),k={keyword:p,punctuation:/[<>()?,.:[\]]/},S=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,A=/"(?:\\.|[^\\"\r\n])*"/.source,O=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[O]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[g]),lookbehind:!0,inside:k},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,$]),lookbehind:!0,inside:k},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[c,y]),lookbehind:!0,inside:k},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[g]),lookbehind:!0,inside:k},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:k},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[$,u,m]),inside:k}],keyword:p,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:k},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[$,g]),inside:k,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[$]),lookbehind:!0,inside:k,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,h]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(h),alias:"class-name",inside:k}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,y,m,$,p.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[y,f]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:p,"class-name":{pattern:RegExp($),greedy:!0,inside:k},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var E=A+"|"+S,T=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[E]),C=n(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[T]),2),j=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,_=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[g,C]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[j,_]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[j]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[C]),inside:e.languages.csharp},"class-name":{pattern:RegExp(g),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var P=/:[^}\r\n]+/.source,I=n(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[T]),2),R=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[I,P]),L=n(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[E]),2),D=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,P]);function F(t,n){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[n,P]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[R]),lookbehind:!0,greedy:!0,inside:F(R,I)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[D]),lookbehind:!0,greedy:!0,inside:F(D,L)}],char:{pattern:RegExp(S),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},251:()=>{!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(Prism)},46:()=>{Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"]},57:()=>{!function(e){function t(e){return RegExp("(^(?:"+e+"):[ \t]*(?![ \t]))[^]+","i")}e.languages.http={"request-line":{pattern:/^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:e.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[\d.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[\d.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[\d.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},header:{pattern:/^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,inside:{"header-value":[{pattern:t(/Content-Security-Policy/.source),lookbehind:!0,alias:["csp","languages-csp"],inside:e.languages.csp},{pattern:t(/Public-Key-Pins(?:-Report-Only)?/.source),lookbehind:!0,alias:["hpkp","languages-hpkp"],inside:e.languages.hpkp},{pattern:t(/Strict-Transport-Security/.source),lookbehind:!0,alias:["hsts","languages-hsts"],inside:e.languages.hsts},{pattern:t(/[^:]+/.source),lookbehind:!0}],"header-name":{pattern:/^[^:]+/,alias:"keyword"},punctuation:/^:/}}};var r,n=e.languages,a={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css,"text/plain":n.plain},o={"application/json":!0,"application/xml":!0};function i(e){var t=e.replace(/^[a-z]+\//,"");return"(?:"+e+"|"+("\\w+/(?:[\\w.-]+\\+)+"+t+"(?![+\\w.-])")+")"}for(var s in a)if(a[s]){r=r||{};var l=o[s]?i(s):s;r[s.replace(/\//g,"-")]={pattern:RegExp("("+/content-type:\s*/.source+l+/(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source+")"+/[^ \t\w-][\s\S]*/.source,"i"),lookbehind:!0,inside:a[s]}}r&&e.languages.insertBefore("http","header",r)}(Prism)},503:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,n={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[n,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:n.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:n.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":n,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:n.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:n.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},277:()=>{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},366:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},358:()=>{!function(e){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,n="(?:"+r.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var r=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return e}));return RegExp(r,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return n}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)},660:(e,t,r)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,n={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);k+=$.value.length,$=$.next){var S=$.value;if(t.length>e.length)return;if(!(S instanceof o)){var A,O=1;if(v){if(!(A=i(w,k,e,g))||A.index>=e.length)break;var E=A.index,T=A.index+A[0].length,C=k;for(C+=$.value.length;E>=C;)C+=($=$.next).value.length;if(k=C-=$.value.length,$.value instanceof o)continue;for(var j=$;j!==t.tail&&(Cd.reach&&(d.reach=R);var L=$.prev;if(P&&(L=c(t,L,P),k+=P.length),p(t,L,O),$=c(t,L,new o(u,y?a.tokenize(_,y):_,b,_)),I&&c(t,$,I),O>1){var D={cause:u+","+f,reach:R};s(e,t,r,$.prev,k,D),d&&D.reach>d.reach&&(d.reach=D.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,r){var n=t.next,a={value:r,prev:t,next:n};return t.next=a,n.prev=a,e.length++,a}function p(e,t,r){for(var n=t.next,a=0;a"+o.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var r=JSON.parse(t.data),n=r.language,o=r.code,i=r.immediateClose;e.postMessage(a.highlight(o,a.languages[n],n)),i&&e.close()}),!1),a):a;var d=a.util.currentScript();function u(){a.manual||a.highlightAll()}if(d&&(a.filename=d.src,d.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&d&&d.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return a}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=n),void 0!==r.g&&(r.g.Prism=n),n.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:r}};a["language-"+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(void 0!==n&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",r="loading",a="loaded",o='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])';n.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),n.hooks.add("before-sanity-check",(function(i){var s=i.element;if(s.matches(o)){i.code="",s.setAttribute(t,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),p=i.language;if("none"===p){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];p=e[d]||d}n.util.setLanguage(l,p),n.util.setLanguage(s,p);var u=n.plugins.autoloader;u&&u.loadLanguages(p),function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4==n.readyState&&(n.status<400&&n.responseText?t(n.responseText):n.status>=400?r("✖ Error "+n.status+" while fetching file: "+n.statusText):r("✖ Error: File does not exist or is empty"))},n.send(null)}(c,(function(e){s.setAttribute(t,a);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var r=Number(t[1]),n=t[2],a=t[3];return n?a?[r,Number(a)]:[r,void 0]:[r,r]}}(s.getAttribute("data-range"));if(r){var o=e.split(/\r\n?|\n/g),i=r[0],c=null==r[1]?o.length:r[1];i<0&&(i+=o.length),i=Math.max(0,Math.min(i-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),e=o.slice(i,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(i+1))}l.textContent=e,n.highlightElement(l)}),(function(e){s.setAttribute(t,"failed"),l.textContent=e}))}})),n.plugins.fileHighlight={highlight:function(e){for(var t,r=(e||document).querySelectorAll(o),a=0;t=r[a++];)n.highlightElement(t)}};var i=!1;n.fileHighlight=function(){i||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),i=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},464:e=>{"use strict";var t,r="";e.exports=function(e,n){if("string"!=typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var a=e.length*n;if(t!==e||void 0===t)t=e,r="";else if(r.length>=a)return r.substr(0,a);for(;a>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,a)}},131:(e,t,r)=>{"use strict";var n=r(464),a=function(e){return/<\/+[^>]+>/.test(e)},o=function(e){return/<[^>]+\/>/.test(e)};function i(e){return e.split(/(<\/?[^>]+>)/g).filter((function(e){return""!==e.trim()})).map((function(e){return{value:e,type:s(e)}}))}function s(e){return a(e)?"ClosingTag":function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!a(e)&&!o(e)}(e)?"OpeningTag":o(e)?"SelfClosingTag":"Text"}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.indentor,a=t.textNodesOnSameLine,o=0,s=[];r=r||" ";var l=i(e).map((function(e,t,i){var l=e.value,c=e.type;"ClosingTag"===c&&o--;var p=n(r,o),d=p+l;if("OpeningTag"===c&&o++,a){var u=i[t-1],h=i[t-2];"ClosingTag"===c&&"Text"===u.type&&"OpeningTag"===h.type&&(d=""+p+h.value+u.value+l,s.push(t-2,t-1))}return d}));return s.forEach((function(e){return l[e]=null})),l.filter((function(e){return!!e})).join("\n")}}},n={};function a(e){var t=n[e];if(void 0!==t){if(void 0!==t.error)throw t.error;return t.exports}var o=n[e]={exports:{}};try{var i={id:e,module:o,factory:r[e],require:a};a.i.forEach((function(e){e(i)})),o=i.module,i.factory.call(o.exports,o,o.exports,i.require)}catch(e){throw o.error=e,e}return o.exports}a.m=r,a.c=n,a.i=[],a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.hu=e=>e+"."+a.h()+".hot-update.js",a.hmrF=()=>"main."+a.h()+".hot-update.json",a.h=()=>"f1b027d929a1ed21ea97",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="rapidoc:",a.l=(r,n,o,i)=>{if(e[r])e[r].push(n);else{var s,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),p=0;p{s.onerror=s.onload=null,clearTimeout(h);var a=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((e=>e(n))),t)return t(n)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),l&&document.head.appendChild(s)}},(()=>{var e,t,r,n={},o=a.c,i=[],s=[],l="idle",c=0,p=[];function d(e){l=e;for(var t=[],r=0;r0)return d("abort").then((function(){throw a[0]}));var o=d("dispose");n.forEach((function(e){e.dispose&&e.dispose()}));var i,s=d("apply"),l=function(e){i||(i=e)},c=[];return n.forEach((function(e){if(e.apply){var t=e.apply(l);if(t)for(var r=0;r=0&&v._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,l){case"idle":t=[],Object.keys(a.hmrI).forEach((function(e){a.hmrI[e](m,t)})),d("ready");break;case"ready":Object.keys(a.hmrI).forEach((function(e){a.hmrI[e](m,t)}));break;case"prepare":case"check":case"dispose":case"apply":(r=r||[]).push(m)}},check:h,apply:f,status:function(e){if(!e)return l;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var t=s.indexOf(e);t>=0&&s.splice(t,1)},data:n[m]},e=void 0,v),b.parents=i,b.children=[],i=[],p.require=x})),a.hmrC={},a.hmrI={}})(),a.p="",(()=>{var e,t,r,n,o,i=a.hmrS_jsonp=a.hmrS_jsonp||{179:0},s={};function l(t,r){return e=r,new Promise(((e,r)=>{s[t]=e;var n=a.p+a.hu(t),o=new Error;a.l(n,(e=>{if(s[t]){s[t]=void 0;var n=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src;o.message="Loading hot update chunk "+t+" failed.\n("+n+": "+a+")",o.name="ChunkLoadError",o.type=n,o.request=a,r(o)}}))}))}function c(e){function s(e){for(var t=[e],r={},n=t.map((function(e){return{chain:[e],id:e}}));n.length>0;){var o=n.pop(),i=o.id,s=o.chain,c=a.c[i];if(c&&(!c.hot._selfAccepted||c.hot._selfInvalidated)){if(c.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:i};if(c.hot._main)return{type:"unaccepted",chain:s,moduleId:i};for(var p=0;p ")),f.type){case"self-declined":e.onDeclined&&e.onDeclined(f),e.ignoreDeclined||(y=new Error("Aborted because of self decline: "+f.moduleId+b));break;case"declined":e.onDeclined&&e.onDeclined(f),e.ignoreDeclined||(y=new Error("Aborted because of declined dependency: "+f.moduleId+" in "+f.parentId+b));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(f),e.ignoreUnaccepted||(y=new Error("Aborted because "+h+" is not accepted"+b));break;case"accepted":e.onAccepted&&e.onAccepted(f),g=!0;break;case"disposed":e.onDisposed&&e.onDisposed(f),v=!0;break;default:throw new Error("Unexception type "+f.type)}if(y)return{error:y};if(g)for(h in d[h]=m,l(p,f.outdatedModules),f.outdatedDependencies)a.o(f.outdatedDependencies,h)&&(c[h]||(c[h]=[]),l(c[h],f.outdatedDependencies[h]));v&&(l(p,[f.moduleId]),d[h]=u)}r=void 0;for(var x,w=[],$=0;$0;){var o=r.pop(),s=a.c[o];if(s){var l={},d=s.hot._disposeHandlers;for($=0;$=0&&u.parents.splice(e,1))}}}for(var h in c)if(a.o(c,h)&&(s=a.c[h]))for(x=c[h],$=0;$=0&&s.children.splice(e,1)},apply:function(t){for(var r in d)a.o(d,r)&&(a.m[r]=d[r]);for(var n=0;n{for(var l in n)a.o(n,l)&&(r[l]=n[l],e&&e.push(l));i&&o.push(i),s[t]&&(s[t](),s[t]=void 0)},a.hmrI.jsonp=function(e,t){r||(r={},o=[],n=[],t.push(c)),a.o(r,e)||(r[e]=a.m[e])},a.hmrC.jsonp=function(e,s,p,d,u,h){u.push(c),t={},n=s,r=p.reduce((function(e,t){return e[t]=!1,e}),{}),o=[],e.forEach((function(e){a.o(i,e)&&void 0!==i[e]?(d.push(l(e,h)),t[e]=!0):t[e]=!1})),a.f&&(a.f.jsonpHmr=function(e,r){t&&a.o(t,e)&&!t[e]&&(r.push(l(e)),t[e]=!0)})},a.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(a.p+a.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})();a(656)})(); //# sourceMappingURL=rapidoc-min.js.map \ No newline at end of file diff --git a/dist/rapidoc-min.js.gz b/dist/rapidoc-min.js.gz index f800308b..6e4b1e71 100644 Binary files a/dist/rapidoc-min.js.gz and b/dist/rapidoc-min.js.gz differ diff --git a/dist/rapidoc-min.js.map b/dist/rapidoc-min.js.map index 07471d2f..0f5dda42 100644 --- a/dist/rapidoc-min.js.map +++ b/dist/rapidoc-min.js.map @@ -1 +1 @@ -{"version":3,"file":"rapidoc-min.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACDA;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;ACKA;;ACKA;ACgRA;AACA;AACA;AAIA;AAIA;AAIA;AAEA;;;AAIA;;AAEA;AACA;AACA;AACA;;;;;AAKA;AAGA;;AAGA;AACA;AACA;;AAIA;;AAGA;AACA;;;;AAIA;AAGA;AACA;;;AAIA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AAGA;;AAGA;AACA;;;AAKA;;AAKA;AAuBA;;;;AAIA;AAEA;;AAEA;;AAIA;;AAGA;AACA;;;AAGA;AACA;AAEA;AACA;AACA;;AAIA;;AAGA;AACA;;AAIA;;AAGA;;;AAMA;AAEA;;;AAGA;AACA;AACA;AAGA;AAGA;;;;;AAMA;AACA;;AAEA;;;AAGA;;AAEA;;;AAKA;;;AAIA;;;AAaA;;AAIA;;;AAtGA;;;AAqJA;AACA;AAEA;;;AAGA;;;AAMA;;AAEA;;;;;AAOA;;AAEA;AAKA;;AAGA;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;;;AAMA;;;AAvFA;;;AC9eA;;AAYA;;AAEA;AACA;AACA;AACA;AACA;;AAIA;;AC1BA;;AAEA;AACA;;;AAGA;;;AAGA;;AAEA;;AAEA;;;;AAIA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AAQA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOA;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;ACtEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkFA;;;AAUA;;AAEA;;AAGA;AAYA;;AAEA;;AAEA;AACA;;;AAIA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0OA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAvQA;AAQA;;AAEA;AACA;;AAGA;AACA;;AAEA;;AAIA;AACA;AAEA;;AASA;AA0BA;AACA;AASA;AA0DA;AACA;AACA;AAMA;AACA;AACA;AAGA;;AAEA;;AAEA;AACA;AAGA;AACA;AAwBA;;;AAIA;AASA;AA4BA;AACA;AACA;AACA;AAMA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;;AAIA;;AC3TA;AACA;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACgEA;AAOA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAIA;AAmDA;;;;AAIA;AACA;AACA;AACA;AAMA;AACA;AAEA;AAIA;AACA;AAKA;;AAEA;AACA;AACA;;AAEA;AAEA;AJ5GA;AIgMA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAMA;AAEA;AACA;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAKA;;AAIA;AAOA;AACA;;AAEA;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;;;;;;AAOA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAGA;AAGA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;;AAGA;;;AAKA;;AAEA;AACA;;;AAIA;AAGA;;;AAGA;;AAGA;AAuEA;AACA;AACA;AACA;;;AAOA;AAqBA;;AAEA;AAGA;AACA;AACA;;;;AAKA;AAGA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;;;;;;AAOA;AACA;AACA;;AAEA;;;;;;AAQA;;AAoBA;;AAOA;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAIA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAKA;AAIA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;;AAIA;;;AAmBA;AAiBA;AACA;;;AAGA;AACA;;;;;;AAMA;AACA;AACA;AACA;;;;AAKA;AACA;;AAEA;AACA;AACA;AACA;;;;AAMA;AAgBA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AAGA;;;;;;AAMA;AACA;;;;;;;;AAQA;;;AAIA;AACA;AACA;;;AAGA;;;AAGA;AAEA;AAGA;AAEA;;AAEA;;;AAGA;AACA;AACA;;AAEA;;;AAOA;;AAIA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;;AAIA;;;AAMA;;;;AAMA;AACA;;;AAKA;;AAGA;;AAGA;;AAIA;;;;AAIA;AACA;;;AAGA;AAEA;;AAuBA;;AAEA;;;AAGA;AAIA;AACA;AACA;;AAEA;AAEA;AACA;;;AAGA;AAIA;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AAOA;AACA;;AAIA;;AAEA;AACA;;;AAIA;;AAEA;;AAMA;;;;AAIA;;;;AAIA;AAEA;AAEA;AAIA;;;AAOA;AAGA;;;AAGA;;AAEA;AAGA;;AAEA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjgCA;AAQA;;AAEA;AACA;;AAGA;AACA;;AAEA;;AAIA;;;;;;;AAOA;AAEA;;;AAUA;AAyBA;AACA;AACA;AAUA;AAsCA;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AAGA;AAMA;;AAEA;AACA;AACA;;AAEA;AACA;AAEA;;;;AAKA;;;AAGA;;;AAMA;AAGA;AACA;AAwBA;;;AASA;AAWA;AACA;AAGA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAIA;ACzQA;AACA;AACA;;AAGA;AACA;;AAGA;;;;;AAKA;AACA;;AAIA;AAGA;AACA;AACA;;AAGA;;AAKA;AAGA;AACA;;AAIA;AACA;;;AAIA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAGA;AAGA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAOA;AAKA;AACA;AACA;AACA;;AAEA;;;;AASA;;;AAhBA;;AChKA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;;AAGA;AACA;AACA;AACA;;AAEA;;;AAKA;;AAQA;AACA;AACA;AACA;;AAGA;AACA;;;AAKA;AAKA;AACA;AACA;;AAEA;;;;AAIA;;;AAVA;;AC5CA;AACA;;AAGA;AACA;;AAEA;AAFA;;;AAOA;AAEA;AACA;AAGA;AAIA;AAEA;AAMA;AAIA;;AAGA;AACA;AAIA;;;;AAMA;;AASA;;AAKA;;;ACtCA;;AAEA;;AAEA;;AAGA;AACA;;AAEA;;;AAIA;AACA;AACA;;AAGA;AACA;;AAGA;;;;;AAMA;AACA;AACA;;;;AAIA;;;AAMA;AAOA;;;AAGA;AAGA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;;;;AAbA;AAkBA;;;AAGA;AAEA;;;;AC7DA;AACA;;AAEA;AAGA;AACA;;;;;;;AASA;;;;;AAKA;AAEA;;AAEA;;AAKA;AAGA;;;;;;AAQA;AACA;AAGA;AAEA;AAEA;AACA;;AAIA;;AAEA;AACA;AACA;AACA;;AAEA;;;AAIA;AACA;AAEA;;AA1BA;;AAgCA;AAIA;;AAKA;;AAEA;AAEA;AACA;;;;;;AAQA;AAGA;AACA;;;AAKA;AACA;AACA;AACA;;AAQA;AACA;;;;AASA;AAEA;;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAIA;;AAEA;;;AAQA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;;;;;AAQA;;;AAIA;;;;;AAMA;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAUA;;AC5OA;AAEA;AAiBA;AACA;;AAGA;AAMA;AAIA;;;AAsBA;AC5BA;AACA;AACA;AACA;AACA;;AAEA;;;AAIA;AAGA;;AAGA;;AAKA;AAqBA;;AAEA;AAMA;;AAGA;;AAKA;;AAIA;AACA;AAEA;AACA;AAEA;AACA;AAGA;AAGA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;;;;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAOA;AAKA;;AAGA;;;;AAIA;;;;AAIA;AAGA;AACA;AAEA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AAMA;AACA;AACA;;;AAIA;;AAGA;AAMA;AACA;AACA;;;;AAnDA;;;;ACrLA;AAEA;;;;;;;;;;;;;ACOA;;;AAGA;;;;;;;AASA;AACA;;;;;AAMA;;;;;AAOA;AACA;;;AAGA;;;AAIA;AAGA;;;;AAKA;AAGA;;;;;ADtDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AE4EA;AAOA;AACA;AACA;;;AAGA;;;AAIA;AAgDA;AAEA;AACA;;AAIA;AAQA;AACA;;;AAGA;AACA;;;AAOA;AACA;;AAEA;AACA;;AAKA;;AAIA;AACA;AACA;;AAEA;;AAKA;AAEA;AACA;AAEA;;;AAIA;AAIA;;;AAMA;;;AAGA;;;AAGA;;;AAGA;;;AAGA;;;AAGA;AAEA;AAIA;AACA;AAEA;AAkBA;AAEA;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;;AAEA;;;;;AAxCA;AACA;AAgDA;AASA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAvBA;AACA;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpUA;;;AAOA;;;;;;;;;AASA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;;;AAMA;;;AAGA;AACA;;AAEA;;AASA;AACA;AACA;;;;AAMA;ACvBA;;;;AAKA;AACA;;;;;;AAMA;;;;;;;AC2IA;AACA;AACA;;AAEA;;AAMA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAGA;ACtPA;AACA;AAGA;AACA;;AAEA;;;;AAIA;AACA;;;AAKA;AAEA;;;AAGA;;;;AAOA;AACA;;;AAGA;;;AAGA;;AAEA;;AAEA;;;;;AASA;AACA;AAGA;AAGA;AACA;AAGA;AACA;AACA;;;;AAIA;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACoRA;;;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;ACnRA;;;;;;;;;ACvGA;;;;;;AAMA;AACA;AACA;;AAIA;;;;AAMA;AAKA;;AAEA;AAIA;;AAEA;AACA;;;;;AAKA;AACA;AACA;AACA;;;;;;AAMA;AAEA;AACA;AACA;;AAGA;AAGA;;AAEA;AACA;;AAEA;;;;AAKA;;AAKA;AAwBA;AACA;AAGA;AACA;;AAEA;;;;;AAKA;AACA;;;AAKA;AAEA;;;AAGA;;;;AAOA;AACA;;;AAGA;;AAEA;;;AAGA;;;;;AAKA;AACA;AAGA;AAGA;AACA;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACRA","sources":["webpack://rapidoc/./src/styles/input-styles.js","webpack://rapidoc/./src/styles/flex-styles.js","webpack://rapidoc/./src/styles/table-styles.js","webpack://rapidoc/./src/styles/endpoint-styles.js","webpack://rapidoc/./src/styles/prism-styles.js","webpack://rapidoc/./src/styles/tab-styles.js","webpack://rapidoc/./src/styles/nav-styles.js","webpack://rapidoc/./src/styles/info-styles.js","webpack://rapidoc/./src/styles/custom-styles.js","webpack://rapidoc/./src/utils/common-utils.js","webpack://rapidoc/./src/templates/security-scheme-template.js","webpack://rapidoc/./src/templates/code-samples-template.js","webpack://rapidoc/./src/templates/callback-template.js","webpack://rapidoc/./src/utils/schema-utils.js","webpack://rapidoc/./src/components/json-tree.js","webpack://rapidoc/./src/components/schema-tree.js","webpack://rapidoc/./src/components/tag-input.js","webpack://rapidoc/./src/components/api-request.js","webpack://rapidoc/./src/components/schema-table.js","webpack://rapidoc/./src/templates/expanded-endpoint-template.js","webpack://rapidoc/./src/templates/components-template.js","webpack://rapidoc/./src/templates/overview-template.js","webpack://rapidoc/./src/templates/server-template.js","webpack://rapidoc/./src/templates/navbar-template.js","webpack://rapidoc/./src/templates/focused-endpoint-template.js","webpack://rapidoc/./src/templates/endpoint-template.js","webpack://rapidoc/./src/templates/logo-template.js","webpack://rapidoc/./src/templates/header-template.js","webpack://rapidoc/./src/components/api-response.js","webpack://rapidoc/./src/templates/advance-search-template.js","webpack://rapidoc/./src/components/dialog-box.js","webpack://rapidoc/./src/utils/theme.js","webpack://rapidoc/./src/templates/main-body-template.js","webpack://rapidoc/./src/rapidoc.js","webpack://rapidoc/./src/rapidoc-mini.js","webpack://rapidoc/./src/templates/json-schema-viewer-template.js","webpack://rapidoc/./src/json-schema-viewer.js"],"sourcesContent":["import { css } from 'lit';\n\n/* eslint-disable max-len */\nexport default css`\n/* Button */\n.m-btn {\n border-radius: var(--border-radius);\n font-weight: 600;\n display: inline-block;\n padding: 6px 16px;\n font-size: var(--font-size-small);\n outline: 0;\n line-height: 1;\n text-align: center;\n white-space: nowrap;\n border: 2px solid var(--primary-color);\n background-color:transparent;\n transition: background-color 0.2s;\n user-select: none;\n cursor: pointer;\n box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);\n}\n.m-btn.primary {\n background-color: var(--primary-color);\n color: var(--primary-color-invert);\n}\n.m-btn.thin-border { border-width: 1px; }\n.m-btn.large { padding:8px 14px; }\n.m-btn.small { padding:5px 12px; }\n.m-btn.tiny { padding:5px 6px; }\n.m-btn.circle { border-radius: 50%; }\n.m-btn:hover { \n background-color: var(--primary-color);\n color: var(--primary-color-invert);\n}\n.m-btn.nav { border: 2px solid var(--nav-accent-color); }\n.m-btn.nav:hover { \n background-color: var(--nav-accent-color);\n}\n.m-btn:disabled{ \n background-color: var(--bg3);\n color: var(--fg3);\n border-color: var(--fg3);\n cursor: not-allowed;\n opacity: 0.4;\n}\n.toolbar-btn{\n cursor: pointer;\n padding: 4px;\n margin:0 2px;\n font-size: var(--font-size-small);\n min-width: 50px;\n color: var(--primary-color-invert);\n border-radius: 2px;\n border: none;\n background-color: var(--primary-color);\n}\n\ninput, textarea, select, button, pre {\n color:var(--fg);\n outline: none;\n background-color: var(--input-bg);\n border: 1px solid var(--border-color);\n border-radius: var(--border-radius);\n}\nbutton {\n font-family: var(--font-regular);\n}\n\n/* Form Inputs */\npre,\nselect,\ntextarea,\ninput[type=\"file\"],\ninput[type=\"text\"],\ninput[type=\"password\"] {\n font-family: var(--font-mono);\n font-weight: 400;\n font-size: var(--font-size-small);\n transition: border .2s;\n padding: 6px 5px;\n}\n\nselect {\n font-family: var(--font-regular);\n padding: 5px 30px 5px 5px;\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20d%3D%22M10.3%203.3L6%207.6%201.7%203.3A1%201%200%2000.3%204.7l5%205a1%201%200%20001.4%200l5-5a1%201%200%2010-1.4-1.4z%22%20fill%3D%22%23777777%22%2F%3E%3C%2Fsvg%3E\"); \n background-position: calc(100% - 5px) center;\n background-repeat: no-repeat; \n background-size: 10px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n}\n\nselect:hover {\n border-color: var(--primary-color);\n}\n\ntextarea::placeholder,\ninput[type=\"text\"]::placeholder,\ninput[type=\"password\"]::placeholder {\n color: var(--placeholder-color);\n opacity:1;\n}\n\nselect:focus,\ntextarea:focus,\ninput[type=\"text\"]:focus,\ninput[type=\"password\"]:focus,\ntextarea:active,\ninput[type=\"text\"]:active,\ninput[type=\"password\"]:active {\n border:1px solid var(--primary-color);\n}\n\ninput[type=\"file\"]{\n font-family: var(--font-regular);\n padding:2px;\n cursor:pointer;\n border: 1px solid var(--primary-color);\n min-height: calc(var(--font-size-small) + 18px);\n}\n\ninput[type=\"file\"]::-webkit-file-upload-button {\n font-family: var(--font-regular);\n font-size: var(--font-size-small);\n outline: none;\n cursor:pointer;\n padding: 3px 8px;\n border: 1px solid var(--primary-color);\n background-color: var(--primary-color);\n color: var(--primary-color-invert);\n border-radius: var(--border-radius);;\n -webkit-appearance: none;\n}\n\npre,\ntextarea {\n scrollbar-width: thin;\n scrollbar-color: var(--border-color) var(--input-bg);\n}\n\npre::-webkit-scrollbar,\ntextarea::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\n\npre::-webkit-scrollbar-track,\ntextarea::-webkit-scrollbar-track {\n background:var(--input-bg);\n}\n \npre::-webkit-scrollbar-thumb,\ntextarea::-webkit-scrollbar-thumb {\n border-radius: 2px;\n background-color: var(--border-color);\n}\n\n.link {\n font-size:var(--font-size-small);\n text-decoration: underline;\n color:var(--blue);\n font-family:var(--font-mono);\n margin-bottom:2px;\n}\n\ninput[type=\"checkbox\"]:focus{\n outline:0;\n}\n\n/* Toggle Body */\ninput[type=\"checkbox\"] {\n appearance: none;\n display: inline-block;\n background-color: var(--light-bg);\n border: 1px solid var(--light-bg);\n border-radius: 9px;\n cursor: pointer;\n height: 18px;\n position: relative;\n transition: border .25s .15s, box-shadow .25s .3s, padding .25s;\n min-width: 36px;\n width: 36px;\n vertical-align: top;\n}\n/* Toggle Thumb */\ninput[type=\"checkbox\"]:after {\n position: absolute;\n background-color: var(--bg);\n border: 1px solid var(--light-bg);\n border-radius: 8px;\n content: '';\n top: 0px;\n left: 0px;\n right: 16px;\n display: block;\n height: 16px;\n transition: border .25s .15s, left .25s .1s, right .15s .175s;\n}\n\n/* Toggle Body - Checked */\ninput[type=\"checkbox\"]:checked {\n box-shadow: inset 0 0 0 13px var(--green);\n border-color: var(--green);\n}\n/* Toggle Thumb - Checked*/\ninput[type=\"checkbox\"]:checked:after {\n border: 1px solid var(--green);\n left: 16px;\n right: 1px;\n transition: border .25s, left .15s .25s, right .25s .175s;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.row, .col{\n display:flex;\n} \n.row {\n align-items:center;\n flex-direction: row;\n}\n.col {\n align-items:stretch;\n flex-direction: column;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.m-table {\n border-spacing: 0; \n border-collapse: separate;\n border: 1px solid var(--light-border-color);\n border-radius: var(--border-radius);\n margin: 0;\n max-width: 100%;\n direction: ltr;\n}\n.m-table tr:first-child td,\n.m-table tr:first-child th {\n border-top: 0 none;\n}\n.m-table td, \n.m-table th {\n font-size: var(--font-size-small);\n line-height: calc(var(--font-size-small) + 4px);\n padding: 4px 5px 4px;\n vertical-align: top;\n}\n\n.m-table.padded-12 td, \n.m-table.padded-12 th {\n padding: 12px;\n}\n\n.m-table td:not([align]), \n.m-table th:not([align]) {\n text-align: left;\n}\n\n.m-table th {\n color: var(--fg2);\n font-size: var(--font-size-small);\n line-height: calc(var(--font-size-small) + 18px);\n font-weight: 600;\n letter-spacing: normal;\n background-color: var(--bg2);\n vertical-align: bottom;\n border-bottom: 1px solid var(--light-border-color);\n}\n\n.m-table > tbody > tr > td,\n.m-table > tr > td {\n border-top: 1px solid var(--light-border-color);\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.table-title {\n font-size:var(--font-size-small);\n font-weight:bold;\n vertical-align: middle;\n margin: 12px 0 4px 0;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.only-large-screen { display:none; }\n.endpoint-head .path{\n display: flex;\n font-family:var(--font-mono);\n font-size: var(--font-size-small);\n align-items: center;\n overflow-wrap: break-word;\n word-break: break-all;\n}\n\n.endpoint-head .descr {\n font-size: var(--font-size-small);\n color:var(--light-fg);\n font-weight:400;\n align-items: center;\n overflow-wrap: break-word;\n word-break: break-all;\n display:none;\n}\n\n.m-endpoint.expanded{margin-bottom:16px; }\n.m-endpoint > .endpoint-head{\n border-width:1px 1px 1px 5px;\n border-style:solid;\n border-color:transparent;\n border-top-color:var(--light-border-color);\n display:flex;\n padding:6px 16px;\n align-items: center;\n cursor: pointer;\n}\n.m-endpoint > .endpoint-head.put:hover,\n.m-endpoint > .endpoint-head.put.expanded{\n border-color:var(--orange); \n background-color:var(--light-orange); \n}\n.m-endpoint > .endpoint-head.post:hover,\n.m-endpoint > .endpoint-head.post.expanded {\n border-color:var(--green); \n background-color:var(--light-green); \n}\n.m-endpoint > .endpoint-head.get:hover,\n.m-endpoint > .endpoint-head.get.expanded {\n border-color:var(--blue); \n background-color:var(--light-blue); \n}\n.m-endpoint > .endpoint-head.delete:hover,\n.m-endpoint > .endpoint-head.delete.expanded {\n border-color:var(--red); \n background-color:var(--light-red); \n}\n\n.m-endpoint > .endpoint-head.head:hover,\n.m-endpoint > .endpoint-head.head.expanded,\n.m-endpoint > .endpoint-head.patch:hover,\n.m-endpoint > .endpoint-head.patch.expanded,\n.m-endpoint > .endpoint-head.options:hover,\n.m-endpoint > .endpoint-head.options.expanded {\n border-color:var(--yellow); \n background-color:var(--light-yellow); \n}\n\n.m-endpoint > .endpoint-head.deprecated:hover,\n.m-endpoint > .endpoint-head.deprecated.expanded {\n border-color:var(--border-color); \n filter:opacity(0.6);\n}\n\n.m-endpoint .endpoint-body {\n flex-wrap:wrap;\n padding:16px 0px 0 0px;\n border-width:0px 1px 1px 5px;\n border-style:solid;\n box-shadow: 0px 4px 3px -3px rgba(0, 0, 0, 0.15);\n}\n.m-endpoint .endpoint-body.delete{ border-color:var(--red); }\n.m-endpoint .endpoint-body.put{ border-color:var(--orange); }\n.m-endpoint .endpoint-body.post{border-color:var(--green);}\n.m-endpoint .endpoint-body.get{ border-color:var(--blue); }\n.m-endpoint .endpoint-body.head,\n.m-endpoint .endpoint-body.patch,\n.m-endpoint .endpoint-body.options { \n border-color:var(--yellow); \n}\n\n.m-endpoint .endpoint-body.deprecated{ \n border-color:var(--border-color);\n filter:opacity(0.6);\n}\n\n.endpoint-head .deprecated{\n color: var(--light-fg);\n filter:opacity(0.6);\n}\n\n.summary{\n padding:8px 8px;\n}\n.summary .title{\n font-size:calc(var(--font-size-regular) + 2px);\n margin-bottom: 6px;\n word-break: break-all;\n}\n\n.endpoint-head .method{\n padding:2px 5px;\n vertical-align: middle;\n font-size:var(--font-size-small);\n height: calc(var(--font-size-small) + 16px);\n line-height: calc(var(--font-size-small) + 8px);\n width: 60px;\n border-radius: 2px;\n display:inline-block;\n text-align: center;\n font-weight: bold;\n text-transform:uppercase;\n margin-right:5px;\n}\n.endpoint-head .method.delete{ border: 2px solid var(--red);}\n.endpoint-head .method.put{ border: 2px solid var(--orange); }\n.endpoint-head .method.post{ border: 2px solid var(--green); }\n.endpoint-head .method.get{ border: 2px solid var(--blue); }\n.endpoint-head .method.get.deprecated{ border: 2px solid var(--border-color); }\n.endpoint-head .method.head,\n.endpoint-head .method.patch,\n.endpoint-head .method.options { \n border: 2px solid var(--yellow); \n}\n\n.req-resp-container {\n display: flex;\n margin-top:16px;\n align-items: stretch;\n flex-wrap: wrap;\n flex-direction: column;\n border-top:1px solid var(--light-border-color);\n}\n\n.view-mode-request,\napi-response.view-mode {\n flex:1; \n min-height:100px;\n padding:16px 8px;\n overflow:hidden;\n}\n.view-mode-request {\n border-width:0 0 1px 0;\n border-style:dashed;\n}\n\n.head .view-mode-request,\n.patch .view-mode-request,\n.options .view-mode-request { \n border-color:var(--yellow); \n}\n.put .view-mode-request { \n border-color:var(--orange); \n}\n.post .view-mode-request { \n border-color:var(--green); \n}\n.get .view-mode-request { \n border-color:var(--blue); \n}\n.delete .view-mode-request { \n border-color:var(--red); \n}\n\n@media only screen and (min-width: 1024px) {\n .only-large-screen { display:block; }\n .endpoint-head .path{\n font-size: var(--font-size-regular);\n }\n .endpoint-head .descr{\n display: flex;\n }\n .endpoint-head .m-markdown-small,\n .descr .m-markdown-small{\n display:block;\n }\n .req-resp-container{\n flex-direction: var(--layout, row);\n flex-wrap: nowrap;\n }\n api-response.view-mode {\n padding:16px;\n }\n .view-mode-request.row-layout {\n border-width:0 1px 0 0;\n padding:16px;\n }\n .summary{\n padding:8px 16px;\n }\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\ncode[class*=\"language-\"],\npre[class*=\"language-\"] {\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n line-height: 1.5;\n tab-size: 2;\n\n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\n\n/* Code blocks */\npre[class*=\"language-\"] {\n padding: 1em;\n margin: .5em 0;\n overflow: auto;\n}\n\n/* Inline code */\n:not(pre) > code[class*=\"language-\"] {\n white-space: normal;\n}\n\n.token.comment,\n.token.block-comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n color: var(--light-fg)\n}\n\n.token.punctuation {\n color: var(--fg);\n}\n\n.token.tag,\n.token.attr-name,\n.token.namespace,\n.token.deleted {\n color:var(--pink);\n}\n\n.token.function-name {\n color: var(--blue);\n}\n\n.token.boolean,\n.token.number,\n.token.function {\n color: var(--red);\n}\n\n.token.property,\n.token.class-name,\n.token.constant,\n.token.symbol {\n color: var(--code-property-color);\n}\n\n.token.selector,\n.token.important,\n.token.atrule,\n.token.keyword,\n.token.builtin {\n color: var(--code-keyword-color);\n}\n\n.token.string,\n.token.char,\n.token.attr-value,\n.token.regex,\n.token.variable { \n color: var(--green);\n}\n\n.token.operator,\n.token.entity,\n.token.url {\n color: var(--code-operator-color);\n}\n\n.token.important,\n.token.bold {\n font-weight: bold;\n}\n.token.italic {\n font-style: italic;\n}\n\n.token.entity {\n cursor: help;\n}\n\n.token.inserted {\n color: green;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.tab-panel {\n border: none;\n}\n.tab-buttons {\n height:30px;\n border-bottom: 1px solid var(--light-border-color) ;\n align-items: stretch;\n overflow-y: hidden;\n overflow-x: auto;\n scrollbar-width: thin;\n}\n.tab-buttons::-webkit-scrollbar {\n height: 1px;\n background-color: var(--border-color);\n}\n.tab-btn {\n border: none;\n border-bottom: 3px solid transparent; \n color: var(--light-fg);\n background-color: transparent;\n white-space: nowrap;\n cursor:pointer;\n outline:none;\n font-family:var(--font-regular); \n font-size:var(--font-size-small);\n margin-right:16px;\n padding:1px;\n}\n.tab-btn.active {\n border-bottom: 3px solid var(--primary-color); \n font-weight:bold;\n color:var(--primary-color);\n}\n\n.tab-btn:hover {\n color:var(--primary-color);\n}\n.tab-content {\n margin:-1px 0 0 0;\n position:relative;\n min-height: 50px;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.nav-bar {\n width:0;\n height:100%;\n overflow: hidden;\n color:var(--nav-text-color);\n background-color: var(--nav-bg-color);\n background-blend-mode: multiply;\n line-height: calc(var(--font-size-small) + 4px);\n display:none;\n position:relative;\n flex-direction:column;\n flex-wrap:nowrap;\n word-break:break-word;\n}\n::slotted([slot=nav-logo]){\n padding:16px 16px 0 16px;\n}\n.nav-scroll {\n overflow-x: hidden;\n overflow-y: auto;\n overflow-y: overlay;\n scrollbar-width: thin;\n scrollbar-color: var(--nav-hover-bg-color) transparent;\n}\n\n.nav-bar-tag {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: row;\n}\n.nav-bar.read .nav-bar-tag-icon {\n display:none;\n}\n.nav-bar-paths-under-tag {\n overflow:hidden;\n transition: max-height .2s ease-out;\n}\n\n.nav-bar-tag-icon {\n color: var(--nav-text-color);\n font-size: 20px; \n}\n.nav-bar-tag-icon:hover {\n color:var(--nav-hover-text-color);\n}\n.nav-bar.focused .nav-bar-tag-and-paths.collapsed .nav-bar-tag-icon::after {\n content: '⌵';\n width:16px;\n height:16px;\n text-align: center;\n display: inline-block;\n transform: rotate(-90deg);\n transition: transform 0.2s ease-out 0s;\n}\n.nav-bar.focused .nav-bar-tag-and-paths.expanded .nav-bar-tag-icon::after {\n content: '⌵';\n width:16px;\n height:16px;\n text-align: center;\n display: inline-block;\n transition: transform 0.2s ease-out 0s;\n}\n.nav-scroll::-webkit-scrollbar {\n width: var(--scroll-bar-width, 8px);\n}\n.nav-scroll::-webkit-scrollbar-track {\n background:transparent;\n}\n.nav-scroll::-webkit-scrollbar-thumb {\n background-color: var(--nav-hover-bg-color);\n}\n\n.nav-bar-tag {\n font-size: var(--font-size-regular);\n color: var(--nav-accent-color);\n border-left:4px solid transparent;\n font-weight:bold;\n padding: 15px 15px 15px 10px;\n text-transform: capitalize;\n}\n\n.nav-bar-components,\n.nav-bar-h1,\n.nav-bar-h2,\n.nav-bar-info,\n.nav-bar-tag,\n.nav-bar-path {\n display:flex;\n cursor:pointer;\n border-left:4px solid transparent;\n}\n\n.nav-bar-h1,\n.nav-bar-h2,\n.nav-bar-path {\n font-size: calc(var(--font-size-small) + 1px);\n padding: var(--nav-item-padding);\n}\n.nav-bar-path.small-font {\n font-size: var(--font-size-small);\n}\n\n.nav-bar-info {\n font-size: var(--font-size-regular);\n padding: 16px 10px;\n font-weight:bold;\n}\n.nav-bar-section {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n font-size: var(--font-size-small);\n color: var(--nav-text-color);\n padding: var(--nav-item-padding);\n font-weight:bold;\n}\n.nav-bar-section.operations {\n cursor:pointer;\n}\n.nav-bar-section.operations:hover {\n color:var(--nav-hover-text-color);\n background-color:var(--nav-hover-bg-color);\n}\n\n.nav-bar-section:first-child {\n display: none;\n}\n.nav-bar-h2 {margin-left:12px;}\n\n.nav-bar-h1.active,\n.nav-bar-h2.active,\n.nav-bar-info.active,\n.nav-bar-tag.active,\n.nav-bar-path.active,\n.nav-bar-section.operations.active {\n border-left:4px solid var(--nav-accent-color);\n color:var(--nav-hover-text-color);\n}\n\n.nav-bar-h1:hover,\n.nav-bar-h2:hover,\n.nav-bar-info:hover,\n.nav-bar-tag:hover,\n.nav-bar-path:hover {\n color:var(--nav-hover-text-color);\n background-color:var(--nav-hover-bg-color);\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n#api-info {\n font-size: calc(var(--font-size-regular) - 1px);\n margin-top: 8px;\n margin-left: -15px;\n}\n\n#api-info span:before {\n content: \"|\";\n display: inline-block;\n opacity: 0.5;\n width: 15px;\n text-align: center;\n}\n#api-info span:first-child:before {\n content: \"\";\n width: 0px;\n}\n`;\n","import { css } from 'lit';\n\n/*\nThis file is reserved for any custom css that developers want to add to\ncustomize their theme. Simply add your css to this file and yarn build.\n*/\n\nexport default css`\n\n`;\n","/* For Delayed Event Handler Execution */\nexport function debounce(fn, delay) {\n let timeoutID = null;\n return (...args) => {\n clearTimeout(timeoutID);\n const that = this;\n timeoutID = setTimeout(() => {\n fn.apply(that, args);\n }, delay);\n };\n}\n\nexport const invalidCharsRegEx = /[\\s#:?&={}]/g; // used for generating valid html element ids by replacing the invalid chars with hyphen (-)\nexport const rapidocApiKey = '_rapidoc_api_key';\n\nexport function sleep(ms) {\n // eslint-disable-next-line no-promise-executor-return\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport function copyToClipboard(data, e) {\n const btnEl = e.currentTarget;\n const textArea = document.createElement('textarea');\n textArea.value = data;\n textArea.style.position = 'fixed'; // avoid scrolling to bottom\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n try {\n document.execCommand('copy');\n btnEl.innerText = 'Copied';\n setTimeout(() => {\n btnEl.innerText = 'Copy';\n }, 5000);\n } catch (err) {\n console.error('Unable to copy', err); // eslint-disable-line no-console\n }\n document.body.removeChild(textArea);\n}\n\nexport function getBaseUrlFromUrl(url) {\n const pathArray = url.split('/');\n return `${pathArray[0]}//${pathArray[2]}`;\n}\n\nexport async function wait(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nexport function componentIsInSearch(searchVal, component) {\n return component.name.toLowerCase().includes(searchVal.toLowerCase());\n}\n\nexport function pathIsInSearch(searchVal, path, matchType = 'includes') {\n if (matchType === 'includes') {\n const stringToSearch = `${path.method} ${path.path} ${path.summary || path.description || ''} ${path.operationId || ''}`.toLowerCase();\n return stringToSearch.includes(searchVal.toLowerCase());\n }\n const regex = new RegExp(searchVal, 'i');\n return regex.test(`${path.method} ${path.path}`);\n}\n\nexport function schemaKeys(schemaProps, result = new Set()) {\n if (!schemaProps) {\n return result;\n }\n Object.keys(schemaProps).forEach((key) => {\n result.add(key);\n if (schemaProps[key].properties) {\n schemaKeys(schemaProps[key].properties, result);\n } else if (schemaProps[key].items?.properties) {\n schemaKeys(schemaProps[key].items?.properties, result);\n }\n });\n return result;\n}\n\nexport function advancedSearch(searchVal, allSpecTags, searchOptions = []) {\n if (!searchVal.trim() || searchOptions.length === 0) {\n return;\n }\n\n const pathsMatched = [];\n allSpecTags.forEach((tag) => {\n tag.paths.forEach((path) => {\n let stringToSearch = '';\n if (searchOptions.includes('search-api-path')) {\n stringToSearch = path.path;\n }\n if (searchOptions.includes('search-api-descr')) {\n stringToSearch = `${stringToSearch} ${path.summary || path.description || ''}`;\n }\n if (searchOptions.includes('search-api-params')) {\n stringToSearch = `${stringToSearch} ${path.parameters?.map((v) => v.name).join(' ') || ''}`;\n }\n\n if (searchOptions.includes('search-api-request-body') && path.requestBody) {\n let schemaKeySet = new Set();\n for (const contentType in path.requestBody?.content) {\n if (path.requestBody.content[contentType].schema?.properties) {\n schemaKeySet = schemaKeys(path.requestBody.content[contentType].schema?.properties);\n }\n stringToSearch = `${stringToSearch} ${[...schemaKeySet].join(' ')}`;\n }\n }\n\n if (searchOptions.includes('search-api-resp-descr')) {\n stringToSearch = `${stringToSearch} ${Object.values(path.responses).map((v) => v.description || '').join(' ')}`;\n }\n\n if (stringToSearch.toLowerCase().includes(searchVal.trim().toLowerCase())) {\n pathsMatched.push({\n elementId: path.elementId,\n method: path.method,\n path: path.path,\n summary: path.summary || path.description || '',\n deprecated: path.deprecated,\n });\n }\n });\n });\n return pathsMatched;\n}\n\n/*\nexport function prettyXml(sourceXmlString) {\n const xmlDoc = new DOMParser().parseFromString(sourceXmlString, 'text/xml');\n const xsltDoc = new DOMParser().parseFromString([\n // describes how we want to modify the XML - indent everything\n `\n \n \n \n \n \n \n \n \n `,\n ].join('\\n'), 'application/xml');\n const xsltProcessor = new XSLTProcessor();\n xsltProcessor.importStylesheet(xsltDoc);\n const resultDoc = xsltProcessor.transformToDocument(xmlDoc);\n return new XMLSerializer().serializeToString(resultDoc);\n}\n*/\n\nexport function downloadResource(url, fileName) {\n if (url) {\n const a = document.createElement('a');\n document.body.appendChild(a);\n a.style = 'display: none';\n a.href = url;\n a.download = fileName;\n a.click();\n a.remove();\n }\n}\n\nexport function viewResource(url) {\n if (url) {\n const a = document.createElement('a');\n document.body.appendChild(a);\n a.style = 'display: none';\n a.href = url;\n a.target = '_blank';\n a.click();\n a.remove();\n }\n}\n","/* eslint-disable arrow-body-style */\nimport { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\n\nconst codeVerifier = '731DB1C3F7EA533B85E29492D26AA-1234567890-1234567890';\nconst codeChallenge = '4FatVDBJKPAo4JgLLaaQFMUcQPn5CrPRvLlaob9PTYc'; // Base64 encoded SHA-256\n\nconst localStorageKey = 'rapidoc';\n\nexport function applyApiKey(securitySchemeId, username = '', password = '', providedApikeyVal = '') {\n const securityObj = this.resolvedSpec.securitySchemes?.find((v) => (v.securitySchemeId === securitySchemeId));\n if (!securityObj) {\n return false;\n }\n let finalApiKeyValue = '';\n if (securityObj.scheme?.toLowerCase() === 'basic') {\n if (username) {\n finalApiKeyValue = `Basic ${btoa(`${username}:${password}`)}`;\n }\n } else if (providedApikeyVal) {\n securityObj.value = providedApikeyVal;\n finalApiKeyValue = `${securityObj.scheme?.toLowerCase() === 'bearer' ? 'Bearer ' : ''}${providedApikeyVal}`;\n }\n if (finalApiKeyValue) {\n securityObj.finalKeyValue = finalApiKeyValue;\n this.requestUpdate();\n return true;\n }\n return false;\n}\n\nexport function onClearAllApiKeys() {\n this.resolvedSpec.securitySchemes?.forEach((v) => {\n v.user = '';\n v.password = '';\n v.value = '';\n v.finalKeyValue = '';\n });\n this.requestUpdate();\n}\n\nfunction getPersistedApiKeys() {\n return JSON.parse(localStorage.getItem(localStorageKey)) || {};\n}\n\nfunction setPersistedApiKeys(obj) {\n localStorage.setItem(localStorageKey, JSON.stringify(obj));\n}\n\nexport function recoverPersistedApiKeys() {\n const rapidocLs = getPersistedApiKeys.call(this);\n Object.values(rapidocLs).forEach((p) => {\n applyApiKey.call(this, p.securitySchemeId, p.username, p.password, p.value);\n });\n}\n\nfunction onApiKeyChange(securitySchemeId) {\n let apiKeyValue = '';\n const securityObj = this.resolvedSpec.securitySchemes.find((v) => (v.securitySchemeId === securitySchemeId));\n if (securityObj) {\n const trEl = this.shadowRoot.getElementById(`security-scheme-${securitySchemeId}`);\n if (trEl) {\n if (securityObj.type && securityObj.scheme && securityObj.type === 'http' && securityObj.scheme.toLowerCase() === 'basic') {\n const userVal = trEl.querySelector('.api-key-user').value.trim();\n const passwordVal = trEl.querySelector('.api-key-password').value.trim();\n applyApiKey.call(this, securitySchemeId, userVal, passwordVal);\n } else {\n apiKeyValue = trEl.querySelector('.api-key-input').value.trim();\n applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);\n }\n if (this.persistAuth === 'true') {\n const rapidocLs = getPersistedApiKeys.call(this);\n rapidocLs[securitySchemeId] = securityObj;\n setPersistedApiKeys.call(this, rapidocLs);\n }\n }\n }\n}\n\n// Updates the OAuth Access Token (API key), so it reflects in UI and gets used in TRY calls\nfunction updateOAuthKey(securitySchemeId, accessToken, tokenType = 'Bearer') {\n const securityObj = this.resolvedSpec.securitySchemes.find((v) => (v.securitySchemeId === securitySchemeId));\n securityObj.finalKeyValue = `${(tokenType.toLowerCase() === 'bearer' ? 'Bearer' : (tokenType.toLowerCase() === 'mac' ? 'MAC' : tokenType))} ${accessToken}`;\n this.requestUpdate();\n}\n\n/* eslint-disable no-console */\n// Gets Access-Token in exchange of Authorization Code\nasync function fetchAccessToken(tokenUrl, clientId, clientSecret, redirectUrl, grantType, authCode, securitySchemeId, authFlowDivEl, sendClientSecretIn = 'header', scopes = null, username = null, password = null) {\n const respDisplayEl = authFlowDivEl ? authFlowDivEl.querySelector('.oauth-resp-display') : undefined;\n const urlFormParams = new URLSearchParams();\n const headers = new Headers();\n urlFormParams.append('grant_type', grantType);\n if (grantType === 'authorization_code') {\n urlFormParams.append('client_id', clientId);\n urlFormParams.append('client_secret', clientSecret);\n }\n if (grantType !== 'client_credentials' && grantType !== 'password') {\n urlFormParams.append('redirect_uri', redirectUrl);\n }\n if (authCode) {\n urlFormParams.append('code', authCode);\n urlFormParams.append('code_verifier', codeVerifier); // for PKCE\n }\n if (sendClientSecretIn === 'header') {\n headers.set('Authorization', `Basic ${btoa(`${clientId}:${clientSecret}`)}`);\n } else {\n urlFormParams.append('client_id', clientId);\n urlFormParams.append('client_secret', clientSecret);\n }\n if (grantType === 'password') {\n urlFormParams.append('username', username);\n urlFormParams.append('password', password);\n }\n if (scopes) {\n urlFormParams.append('scope', scopes);\n }\n\n try {\n const resp = await fetch(tokenUrl, { method: 'POST', headers, body: urlFormParams });\n const tokenResp = await resp.json();\n if (resp.ok) {\n if (tokenResp.token_type && tokenResp.access_token) {\n updateOAuthKey.call(this, securitySchemeId, tokenResp.access_token, tokenResp.token_type);\n if (respDisplayEl) {\n respDisplayEl.innerHTML = 'Access Token Received';\n }\n return true;\n }\n } else {\n if (respDisplayEl) {\n respDisplayEl.innerHTML = `${tokenResp.error_description || tokenResp.error_description || 'Unable to get access token'}`;\n }\n return false;\n }\n } catch (err) {\n if (respDisplayEl) {\n respDisplayEl.innerHTML = 'Failed to get access token';\n }\n return false;\n }\n}\n\n// Gets invoked when it receives the Authorization Code from the other window via message-event\nasync function onWindowMessageEvent(msgEvent, winObj, tokenUrl, clientId, clientSecret, redirectUrl, grantType, sendClientSecretIn, securitySchemeId, authFlowDivEl) {\n sessionStorage.removeItem('winMessageEventActive');\n winObj.close();\n if (msgEvent.data.fake) {\n return;\n }\n if (!msgEvent.data) {\n console.warn('RapiDoc: Received no data with authorization message');\n }\n if (msgEvent.data.error) {\n console.warn('RapiDoc: Error while receiving data');\n }\n if (msgEvent.data) {\n if (msgEvent.data.responseType === 'code') {\n // Authorization Code flow\n fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrl, grantType, msgEvent.data.code, securitySchemeId, authFlowDivEl, sendClientSecretIn);\n } else if (msgEvent.data.responseType === 'token') {\n // Implicit flow\n updateOAuthKey.call(this, securitySchemeId, msgEvent.data.access_token, msgEvent.data.token_type);\n }\n }\n}\n\n// code_challenge generator for PKCE flow\n// TODO: Implement dynamic generation of code-challenge based on code-verifier\n/*\nasync function generateCodeChallenge() {\n const encoder = new TextEncoder();\n const data = encoder.encode(codeVerifier);\n const sha256Hash = await window.crypto.subtle.digest('SHA-256', data); // returns Unit8Array\n // const utf8Decoder = new TextDecoder();\n // const b64EncodedSha256 = btoa(utf8Decoder.decode(sha256Hash));\n const b64EncodedSha256 = base64encode(sha256Hash);\n return b64EncodedSha256;\n}\n*/\n\nasync function onInvokeOAuthFlow(securitySchemeId, flowType, authUrl, tokenUrl, e) {\n const authFlowDivEl = e.target.closest('.oauth-flow');\n const clientId = authFlowDivEl.querySelector('.oauth-client-id') ? authFlowDivEl.querySelector('.oauth-client-id').value.trim() : '';\n const clientSecret = authFlowDivEl.querySelector('.oauth-client-secret') ? authFlowDivEl.querySelector('.oauth-client-secret').value.trim() : '';\n const username = authFlowDivEl.querySelector('.api-key-user') ? authFlowDivEl.querySelector('.api-key-user').value.trim() : '';\n const password = authFlowDivEl.querySelector('.api-key-password') ? authFlowDivEl.querySelector('.api-key-password').value.trim() : '';\n const sendClientSecretIn = authFlowDivEl.querySelector('.oauth-send-client-secret-in') ? authFlowDivEl.querySelector('.oauth-send-client-secret-in').value.trim() : 'header';\n const checkedScopeEls = [...authFlowDivEl.querySelectorAll('.scope-checkbox:checked')];\n const pkceCheckboxEl = authFlowDivEl.querySelector(`#${securitySchemeId}-pkce`);\n const state = (`${Math.random().toString(36).slice(2, 9)}random${Math.random().toString(36).slice(2, 9)}`);\n const nonce = (`${Math.random().toString(36).slice(2, 9)}random${Math.random().toString(36).slice(2, 9)}`);\n // const codeChallenge = await generateCodeChallenge(codeVerifier);\n const redirectUrlObj = new URL(`${window.location.origin}${window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'))}/${this.oauthReceiver}`);\n let grantType = '';\n let responseType = '';\n let newWindow;\n\n // clear previous error messages\n const errEls = [...authFlowDivEl.parentNode.querySelectorAll('.oauth-resp-display')];\n errEls.forEach((v) => { v.innerHTML = ''; });\n\n if (flowType === 'authorizationCode' || flowType === 'implicit') {\n const authUrlObj = new URL(authUrl);\n if (flowType === 'authorizationCode') {\n grantType = 'authorization_code';\n responseType = 'code';\n } else if (flowType === 'implicit') {\n responseType = 'token';\n }\n const authCodeParams = new URLSearchParams(authUrlObj.search);\n const selectedScopes = checkedScopeEls.map((v) => v.value).join(' ');\n if (selectedScopes) {\n authCodeParams.set('scope', selectedScopes);\n }\n authCodeParams.set('client_id', clientId);\n authCodeParams.set('redirect_uri', redirectUrlObj.toString());\n authCodeParams.set('response_type', responseType);\n authCodeParams.set('state', state);\n authCodeParams.set('nonce', nonce);\n if (pkceCheckboxEl && pkceCheckboxEl.checked) {\n authCodeParams.set('code_challenge', codeChallenge);\n authCodeParams.set('code_challenge_method', 'S256');\n }\n authCodeParams.set('show_dialog', true);\n authUrlObj.search = authCodeParams.toString();\n // If any older message-event-listener is active then fire a fake message to remove it (these are single time listeners)\n if (sessionStorage.getItem('winMessageEventActive') === 'true') {\n window.postMessage({ fake: true }, this);\n }\n setTimeout(() => {\n newWindow = window.open(authUrlObj.toString());\n if (!newWindow) {\n console.error(`RapiDoc: Unable to open ${authUrlObj.toString()} in a new window`);\n } else {\n sessionStorage.setItem('winMessageEventActive', 'true');\n window.addEventListener(\n 'message',\n (msgEvent) => onWindowMessageEvent.call(this, msgEvent, newWindow, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, sendClientSecretIn, securitySchemeId, authFlowDivEl),\n { once: true },\n );\n }\n }, 10);\n } else if (flowType === 'clientCredentials') {\n grantType = 'client_credentials';\n const selectedScopes = checkedScopeEls.map((v) => v.value).join(' ');\n fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, '', securitySchemeId, authFlowDivEl, sendClientSecretIn, selectedScopes);\n } else if (flowType === 'password') {\n grantType = 'password';\n const selectedScopes = checkedScopeEls.map((v) => v.value).join(' ');\n fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, '', securitySchemeId, authFlowDivEl, sendClientSecretIn, selectedScopes, username, password);\n }\n}\n/* eslint-enable no-console */\n\n/* eslint-disable indent */\n\nfunction oAuthFlowTemplate(flowName, clientId, clientSecret, securitySchemeId, authFlow, defaultScopes = [], receiveTokenIn = 'header') {\n let { authorizationUrl, tokenUrl, refreshUrl } = authFlow;\n const pkceOnly = authFlow['x-pkce-only'] || false;\n const isUrlAbsolute = (url) => (url.indexOf('://') > 0 || url.indexOf('//') === 0);\n if (refreshUrl && !isUrlAbsolute(refreshUrl)) {\n refreshUrl = `${this.selectedServer.computedUrl}/${refreshUrl.replace(/^\\//, '')}`;\n }\n if (tokenUrl && !isUrlAbsolute(tokenUrl)) {\n tokenUrl = `${this.selectedServer.computedUrl}/${tokenUrl.replace(/^\\//, '')}`;\n }\n if (authorizationUrl && !isUrlAbsolute(authorizationUrl)) {\n authorizationUrl = `${this.selectedServer.computedUrl}/${authorizationUrl.replace(/^\\//, '')}`;\n }\n let flowNameDisplay;\n if (flowName === 'authorizationCode') {\n flowNameDisplay = 'Authorization Code Flow';\n } else if (flowName === 'clientCredentials') {\n flowNameDisplay = 'Client Credentials Flow';\n } else if (flowName === 'implicit') {\n flowNameDisplay = 'Implicit Flow';\n } else if (flowName === 'password') {\n flowNameDisplay = 'Password Flow';\n } else {\n flowNameDisplay = flowName;\n }\n return html`\n
\n
${flowNameDisplay}
\n ${authorizationUrl\n ? html`
Auth URL ${authorizationUrl}
`\n : ''\n }\n ${tokenUrl\n ? html`
Token URL ${tokenUrl}
`\n : ''\n }\n ${refreshUrl\n ? html`
Refresh URL ${refreshUrl}
`\n : ''\n }\n ${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'implicit' || flowName === 'password'\n ? html`\n ${authFlow.scopes\n ? html`\n Scopes \n
\n ${Object.entries(authFlow.scopes).map((scopeAndDescr, index) => html`\n
\n \n \n
\n `)}\n
\n `\n : ''\n }\n ${flowName === 'password'\n ? html`\n
\n \n \n
`\n : ''\n }\n
\n ${flowName === 'authorizationCode'\n ? html`\n
\n \n \n
\n `\n : ''\n }\n \n ${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'password'\n ? html`\n \n `\n : ''\n }\n ${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'implicit' || flowName === 'password'\n ? html`\n `\n : ''\n }\n
\n
\n `\n : ''\n }\n
\n `;\n}\n\nfunction removeApiKey(securitySchemeId) {\n const securityObj = this.resolvedSpec.securitySchemes?.find((v) => (v.securitySchemeId === securitySchemeId));\n securityObj.user = '';\n securityObj.password = '';\n securityObj.value = '';\n securityObj.finalKeyValue = '';\n if (this.persistAuth === 'true') {\n const rapidocLs = getPersistedApiKeys.call(this);\n delete rapidocLs[securityObj.securitySchemeId];\n setPersistedApiKeys.call(this, rapidocLs);\n }\n this.requestUpdate();\n}\n\nexport default function securitySchemeTemplate() {\n if (!this.resolvedSpec) { return ''; }\n const providedApiKeys = this.resolvedSpec.securitySchemes?.filter((v) => (v.finalKeyValue));\n if (!providedApiKeys) {\n return;\n }\n return html`\n
\n
AUTHENTICATION
\n\n
\n ${providedApiKeys.length > 0\n ? html`\n
${providedApiKeys.length} API key applied
\n
\n `\n : html`
No API key applied
`\n }\n
\n ${this.resolvedSpec.securitySchemes && this.resolvedSpec.securitySchemes.length > 0\n ? html`\n \n ${this.resolvedSpec.securitySchemes.map((v) => html`\n \n \n \n ${v.type.toLowerCase() === 'oauth2'\n ? html`\n \n \n \n `\n : ''\n }\n `)}\n
\n
\n ${v.typeDisplay}\n ${v.finalKeyValue\n ? html`\n ${v.finalKeyValue ? 'Key Applied' : ''} \n \n `\n : ''\n }\n
\n ${v.description\n ? html`\n
\n ${unsafeHTML(marked(v.description || ''))}\n
`\n : ''\n }\n\n ${(v.type.toLowerCase() === 'apikey') || (v.type.toLowerCase() === 'http' && v.scheme.toLowerCase() === 'bearer')\n ? html`\n
\n ${v.type.toLowerCase() === 'apikey'\n ? html`Send ${v.name} in ${v.in}`\n : html`Send Authorization in header containing the word Bearer followed by a space and a Token String.`\n }\n
\n
\n ${v.in !== 'cookie'\n ? html`\n \n `\n : html` cookies cannot be set from here`\n }\n
`\n : ''\n }\n ${v.type.toLowerCase() === 'http' && v.scheme.toLowerCase() === 'basic'\n ? html`\n
\n Send Authorization in header containing the word Basic followed by a space and a base64 encoded string of username:password.\n
\n
\n \n \n \n
`\n : ''\n }\n
\n ${Object.keys(v.flows).map((f) => oAuthFlowTemplate\n .call(\n this,\n f,\n (v.flows[f]['x-client-id'] || v['x-client-id'] || ''),\n (v.flows[f]['x-client-secret'] || v['x-client-secret'] || ''),\n v.securitySchemeId,\n v.flows[f],\n (v.flows[f]['x-default-scopes'] || v['x-default-scopes']),\n (v.flows[f]['x-receive-token-in'] || v['x-receive-token-in']),\n ))}\n
`\n : ''\n }\n \n
\n`;\n}\n\nexport function pathSecurityTemplate(pathSecurity) {\n if (this.resolvedSpec.securitySchemes && pathSecurity) {\n const orSecurityKeys1 = [];\n if (Array.isArray(pathSecurity)) {\n if (pathSecurity.length === 0) {\n return '';\n }\n } else {\n return '';\n }\n pathSecurity.forEach((pSecurity) => {\n const andSecurityKeys1 = [];\n const andKeyTypes = [];\n if (Object.keys(pSecurity).length === 0) {\n orSecurityKeys1.push({\n securityTypes: 'None',\n securityDefs: [],\n });\n } else {\n Object.keys(pSecurity).forEach((pathSecurityKey) => {\n let pathScopes = '';\n const s = this.resolvedSpec.securitySchemes.find((ss) => ss.securitySchemeId === pathSecurityKey);\n if (pSecurity[pathSecurityKey] && Array.isArray(pSecurity[pathSecurityKey])) {\n pathScopes = pSecurity[pathSecurityKey].join(', ');\n }\n if (s) {\n andKeyTypes.push(s.typeDisplay);\n andSecurityKeys1.push({ ...s, ...({ scopes: pathScopes }) });\n }\n });\n orSecurityKeys1.push({\n securityTypes: andKeyTypes.length > 1 ? `${andKeyTypes[0]} + ${andKeyTypes.length - 1} more` : andKeyTypes[0],\n securityDefs: andSecurityKeys1,\n });\n }\n });\n return html`
\n
\n \n ${orSecurityKeys1.map((orSecurityItem1, i) => html`\n ${orSecurityItem1.securityTypes\n ? html`\n ${i !== 0 ? html`
OR
` : ''}\n
\n
\n ${this.updateRoute === 'true' && this.allowAuthentication === 'true'\n ? html` ${orSecurityItem1.securityTypes} `\n : html`${orSecurityItem1.securityTypes}`\n }\n
\n
\n ${orSecurityItem1.securityDefs.length > 1 ? html`
Requires all of the following
` : ''}\n
\n ${orSecurityItem1.securityDefs.map((andSecurityItem, j) => {\n const scopeHtml = html`${andSecurityItem.scopes !== ''\n ? html`\n
\n Required scopes:\n
\n
\n ${andSecurityItem.scopes.split(',').map((scope, cnt) => html`${cnt === 0 ? '' : '┃'}${scope}`)}\n
\n
`\n : ''\n }`;\n\n return html`\n ${andSecurityItem.type === 'oauth2'\n ? html`\n
\n ${orSecurityItem1.securityDefs.length > 1\n ? html`${j + 1}.  `\n : 'Needs'\n }\n OAuth Token ${andSecurityItem.securitySchemeId} in Authorization header\n ${scopeHtml}\n
`\n : andSecurityItem.type === 'http'\n ? html`\n
\n ${orSecurityItem1.securityDefs.length > 1 ? html`${j + 1}.  ` : html`Requires`}\n ${andSecurityItem.scheme === 'basic' ? 'Base 64 encoded username:password' : 'Bearer Token'} in Authorization header\n ${scopeHtml}\n
`\n : html`\n
\n ${orSecurityItem1.securityDefs.length > 1 ? html`${j + 1}.  ` : html`Requires`}\n Token in ${andSecurityItem.name} ${andSecurityItem.in}\n ${scopeHtml}\n
`\n }`;\n })}\n
\n
\n
\n `\n : ''\n }\n `)\n }\n
\n `;\n }\n return '';\n}\n\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport Prism from 'prismjs';\nimport { copyToClipboard } from '~/utils/common-utils';\n\n/* eslint-disable indent */\nexport default function codeSamplesTemplate(xCodeSamples) {\n return html`\n
CODE SAMPLES
\n
{\n if (!e.target.classList.contains('tab-btn')) { return; }\n const clickedTab = e.target.dataset.tab;\n\n const tabButtons = [...e.currentTarget.querySelectorAll('.tab-btn')];\n const tabContents = [...e.currentTarget.querySelectorAll('.tab-content')];\n tabButtons.forEach((tabBtnEl) => tabBtnEl.classList[tabBtnEl.dataset.tab === clickedTab ? 'add' : 'remove']('active'));\n tabContents.forEach((tabBodyEl) => { tabBodyEl.style.display = (tabBodyEl.dataset.tab === clickedTab ? 'block' : 'none'); });\n }\n }\">\n
\n ${xCodeSamples.map((v, i) => html``)}\n
\n ${xCodeSamples.map((v, i) => html`\n
\n \n
${Prism.languages[v.lang?.toLowerCase()] ? unsafeHTML(Prism.highlight(v.source, Prism.languages[v.lang?.toLowerCase()], v.lang?.toLowerCase())) : v.source}
\n
`)\n }\n
\n `;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\n\n/* eslint-disable indent */\nexport default function callbackTemplate(callbacks) {\n return html`\n
CALLBACKS
\n ${Object.entries(callbacks).map((kv) => html`\n
\n ${kv[0]}\n ${Object.entries(kv[1]).map((pathObj) => html`\n
\n
\n ${Object.entries(pathObj[1]).map((method) => html`\n
\n
\n
\n \n ${method[0]} \n
\n ${pathObj[0]} \n
\n
\n \n\n \n
\n
\n `)}\n
\n
\n `)}\n
\n `)}\n `;\n}\n/* eslint-enable indent */\n","// Takes a value as input and provides a printable string to replresent null values, spaces, blankstring etc\nexport function getPrintableVal(val) {\n if (val === undefined) {\n return '';\n }\n if (val === null) {\n return 'null';\n }\n if (val === '') {\n return '∅';\n }\n if (typeof val === 'boolean' || typeof val === 'number') {\n return `${val}`;\n }\n if (Array.isArray(val)) {\n return val.map((v) => (v === null ? 'null' : v === '' ? '∅' : v.toString().replace(/^ +| +$/g, (m) => '●'.repeat(m.length)) || '')).join(', ');\n }\n return val.toString().replace(/^ +| +$/g, (m) => '●'.repeat(m.length)) || '';\n}\n\n/* Generates an schema object containing type and constraint info */\nexport function getTypeInfo(schema) {\n if (!schema) {\n return;\n }\n let dataType = '';\n let constrain = '';\n // let examples;\n\n if (schema.$ref) {\n const n = schema.$ref.lastIndexOf('/');\n const schemaNode = schema.$ref.substring(n + 1);\n dataType = `{recursive: ${schemaNode}} `;\n } else if (schema.type) {\n dataType = Array.isArray(schema.type) ? schema.type.join(schema.length === 2 ? ' or ' : '┃') : schema.type;\n if (schema.format || schema.enum || schema.const) {\n dataType = dataType.replace('string', schema.enum ? 'enum' : schema.const ? 'const' : schema.format);\n }\n if (schema.nullable) {\n dataType += '┃null';\n }\n } else if (schema.const) {\n dataType = 'const';\n } else if (Object.keys(schema).length === 0) {\n dataType = 'any';\n } else {\n dataType = '{missing-type-info}';\n }\n\n const info = {\n type: dataType,\n format: schema.format || '',\n pattern: (schema.pattern && !schema.enum) ? schema.pattern : '',\n readOrWriteOnly: (schema.readOnly ? '🆁' : schema.writeOnly ? '🆆' : ''),\n deprecated: schema.deprecated ? '❌' : '',\n examples: schema.examples || schema.example,\n default: getPrintableVal(schema.default),\n description: schema.description || '',\n constrain: '',\n allowedValues: '',\n arrayType: '',\n html: '',\n };\n\n if (info.type === '{recursive}') {\n info.description = schema.$ref.substring(schema.$ref.lastIndexOf('/') + 1);\n } else if (info.type === '{missing-type-info}' || info.type === 'any') {\n info.description = info.description || '';\n }\n // Set Allowed Values\n info.allowedValues = schema.const\n ? schema.const\n : Array.isArray(schema.enum)\n ? schema.enum.map((v) => (getPrintableVal(v))).join('┃')\n : '';\n\n if (dataType === 'array' && schema.items) {\n const arrayItemType = schema.items?.type;\n const arrayItemDefault = getPrintableVal(schema.items.default);\n\n info.arrayType = `${schema.type} of ${Array.isArray(arrayItemType) ? arrayItemType.join('') : arrayItemType}`;\n info.default = arrayItemDefault;\n info.allowedValues = schema.items.const\n ? schema.const\n : Array.isArray(schema.items?.enum)\n ? schema.items.enum.map((v) => (getPrintableVal(v))).join('┃')\n : '';\n }\n if (dataType.match(/integer|number/g)) {\n if (schema.minimum !== undefined || schema.exclusiveMinimum !== undefined) {\n constrain += schema.minimum !== undefined ? `Min ${schema.minimum}` : `More than ${schema.exclusiveMinimum}`;\n }\n if (schema.maximum !== undefined || schema.exclusiveMaximum !== undefined) {\n constrain += schema.maximum !== undefined ? `${constrain ? '┃' : ''}Max ${schema.maximum}` : `${constrain ? '┃' : ''}Less than ${schema.exclusiveMaximum}`;\n }\n if (schema.multipleOf !== undefined) {\n constrain += `${constrain ? '┃' : ''} multiple of ${schema.multipleOf}`;\n }\n }\n if (dataType.match(/string/g)) {\n if (schema.minLength !== undefined && schema.maxLength !== undefined) {\n constrain += `${constrain ? '┃' : ''}${schema.minLength} to ${schema.maxLength} chars`;\n } else if (schema.minLength !== undefined) {\n constrain += `${constrain ? '┃' : ''}Min ${schema.minLength} chars`;\n } else if (schema.maxLength !== undefined) {\n constrain += `Max ${constrain ? '┃' : ''}${schema.maxLength} chars`;\n }\n }\n info.constrain = constrain;\n info.html = `${info.type}~|~${info.readOrWriteOnly}~|~${info.constrain}~|~${info.default}~|~${info.allowedValues}~|~${info.pattern}~|~${info.description}~|~${schema.title || ''}~|~${info.deprecated ? 'deprecated' : ''}`;\n return info;\n}\n\nexport function nestExampleIfPresent(example) {\n if (typeof example === 'boolean' || typeof example === 'number') {\n return {\n Example: { value: `${example}` },\n };\n }\n if (example === '') {\n return {\n Example: { value: '' },\n };\n }\n return example ? { Example: { value: example } } : example;\n}\n\n/**\n * Normalize example object in the following format (List of object which is used to render example links and fill the input boxes)\n * [{\n * exampleVal : 'value to be rendered on the input control (text-box)',\n * exampleList : [\n * value : '',\n * printableValue: '',\n * summary : '',\n * description : ''\n * ]\n * }]\n * */\nexport function normalizeExamples(examples, dataType = 'string') {\n if (!examples) {\n return {\n exampleVal: '',\n exampleList: [],\n };\n }\n if (examples.constructor === Object) {\n const exampleList = Object.values(examples)\n .filter((v) => (v['x-example-show-value'] !== false))\n .map((v) => ({\n value: (typeof v.value === 'boolean' || typeof v.value === 'number' ? `${v.value}` : (v.value || '')),\n printableValue: getPrintableVal(v.value),\n summary: v.summary || '',\n description: v.description || '',\n }));\n const exampleVal = exampleList.length > 0\n ? exampleList[0].value.toString()\n : '';\n return { exampleVal, exampleList };\n }\n\n // This is non-standard way to provide example but will support for now\n if (!Array.isArray(examples)) {\n examples = examples ? [examples] : [];\n }\n\n if (examples.length === 0) {\n return {\n exampleVal: '',\n exampleList: [],\n };\n }\n\n if (dataType === 'array') {\n const [exampleVal] = examples;\n const exampleList = examples.map((v) => ({\n value: v,\n printableValue: getPrintableVal(v),\n }));\n return { exampleVal, exampleList };\n }\n\n const exampleVal = examples[0].toString();\n const exampleList = examples.map((v) => ({\n value: v.toString(),\n printableValue: getPrintableVal(v),\n }));\n return { exampleVal, exampleList };\n}\n\nexport function anyExampleWithSummaryOrDescription(examples) {\n return examples.some((x) => x.summary?.length > 0 || x.description?.length > 0);\n}\n\nexport function getSampleValueByType(schemaObj) {\n const example = schemaObj.examples\n ? schemaObj.examples[0]\n : schemaObj.example === null\n ? null\n : schemaObj.example || undefined;\n if (example === '') { return ''; }\n if (example === null) { return null; }\n if (example === 0) { return 0; }\n if (example === false) { return false; }\n if (example instanceof Date) {\n switch (schemaObj.format.toLowerCase()) {\n case 'date':\n return example.toISOString().split('T')[0];\n case 'time':\n return example.toISOString().split('T')[1];\n default:\n return example.toISOString();\n }\n }\n if (example) { return example; }\n\n if (Object.keys(schemaObj).length === 0) {\n return null;\n }\n if (schemaObj.$ref) {\n // Indicates a Circular ref\n return schemaObj.$ref;\n }\n if (schemaObj.const === false || schemaObj.const === 0 || schemaObj.const === null || schemaObj.const === '') {\n return schemaObj.const;\n }\n if (schemaObj.const) {\n return schemaObj.const;\n }\n const typeValue = Array.isArray(schemaObj.type) ? schemaObj.type[0] : schemaObj.type;\n if (!typeValue) {\n return '?';\n }\n if (typeValue.match(/^integer|^number/g)) {\n const multipleOf = Number.isNaN(Number(schemaObj.multipleOf)) ? undefined : Number(schemaObj.multipleOf);\n const maximum = Number.isNaN(Number(schemaObj.maximum)) ? undefined : Number(schemaObj.maximum);\n const minimumPossibleVal = Number.isNaN(Number(schemaObj.minimum))\n ? Number.isNaN(Number(schemaObj.exclusiveMinimum))\n ? maximum || 0\n : Number(schemaObj.exclusiveMinimum) + (typeValue.startsWith('integer') ? 1 : 0.001)\n : Number(schemaObj.minimum);\n const finalVal = multipleOf\n ? multipleOf >= minimumPossibleVal\n ? multipleOf\n : minimumPossibleVal % multipleOf === 0\n ? minimumPossibleVal\n : Math.ceil(minimumPossibleVal / multipleOf) * multipleOf\n : minimumPossibleVal;\n return finalVal;\n }\n if (typeValue.match(/^boolean/g)) { return false; }\n if (typeValue.match(/^null/g)) { return null; }\n if (typeValue.match(/^string/g)) {\n if (schemaObj.enum) { return schemaObj.enum[0]; }\n if (schemaObj.const) { return schemaObj.const; }\n if (schemaObj.pattern) { return schemaObj.pattern; }\n if (schemaObj.format) {\n const u = `${Date.now().toString(16)}${Math.random().toString(16)}0`.repeat(16);\n switch (schemaObj.format.toLowerCase()) {\n case 'url':\n case 'uri':\n return 'http://example.com';\n case 'date':\n return (new Date(0)).toISOString().split('T')[0];\n case 'time':\n return (new Date(0)).toISOString().split('T')[1];\n case 'date-time':\n return (new Date(0)).toISOString();\n case 'duration':\n return 'P3Y6M4DT12H30M5S'; // P=Period 3-Years 6-Months 4-Days 12-Hours 30-Minutes 5-Seconds\n case 'email':\n case 'idn-email':\n return 'user@example.com';\n case 'hostname':\n case 'idn-hostname':\n return 'www.example.com';\n case 'ipv4':\n return '198.51.100.42';\n case 'ipv6':\n return '2001:0db8:5b96:0000:0000:426f:8e17:642a';\n case 'uuid':\n return [u.substr(0, 8), u.substr(8, 4), `4000-8${u.substr(13, 3)}`, u.substr(16, 12)].join('-');\n default:\n return '';\n }\n } else {\n const minLength = Number.isNaN(schemaObj.minLength) ? undefined : Number(schemaObj.minLength);\n const maxLength = Number.isNaN(schemaObj.maxLength) ? undefined : Number(schemaObj.maxLength);\n const finalLength = minLength || (maxLength > 6 ? 6 : maxLength || undefined);\n return finalLength ? 'A'.repeat(finalLength) : 'string';\n }\n }\n // If type cannot be determined\n return '?';\n}\n\n/*\njson2xml- TestCase\n {\n 'prop1' : 'one',\n 'prop2' : 'two',\n 'prop3' : [ 'a', 'b', 'c' ],\n 'prop4' : {\n 'ob1' : 'val-1',\n 'ob2' : 'val-2'\n }\n }\n \n simple\n \n <0> a \n <1> b \n <2> c \n \n \n val-1\n val-2\n \n \n*/\nexport function json2xml(obj, level = 1) {\n const indent = ' '.repeat(level);\n let xmlText = '';\n if (level === 1 && typeof obj !== 'object') {\n return `\\n${indent}${obj.toString()}`;\n }\n for (const prop in obj) {\n const tagNameOrProp = (obj[prop]['::XML_TAG'] || prop);\n let tagName = '';\n if (Array.isArray(obj[prop])) {\n tagName = tagNameOrProp[0]['::XML_TAG'] || `${prop}`;\n } else {\n tagName = tagNameOrProp;\n }\n if (prop.startsWith('::')) {\n continue;\n }\n if (Array.isArray(obj[prop])) {\n xmlText = `${xmlText}\\n${indent}<${tagName}> ${json2xml(obj[prop], level + 1)}\\n${indent}`;\n } else if (typeof obj[prop] === 'object') {\n xmlText = `${xmlText}\\n${indent}<${tagName}> ${json2xml(obj[prop], level + 1)}\\n${indent}`;\n } else {\n xmlText = `${xmlText}\\n${indent}<${tagName}> ${obj[prop].toString()} `;\n }\n }\n return xmlText;\n}\n\nfunction addSchemaInfoToExample(schema, obj) {\n if (typeof obj !== 'object' || obj === null) {\n return;\n }\n if (schema.title) {\n obj['::TITLE'] = schema.title;\n }\n if (schema.description) {\n obj['::DESCRIPTION'] = schema.description;\n }\n if (schema.xml?.name) {\n obj['::XML_TAG'] = schema.xml?.name;\n }\n if (schema.xml?.wrapped) {\n obj['::XML_WRAP'] = schema.xml?.wrapped.toString();\n }\n}\n\nfunction removeTitlesAndDescriptions(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return;\n }\n delete obj['::TITLE'];\n delete obj['::DESCRIPTION'];\n delete obj['::XML_TAG'];\n delete obj['::XML_WRAP'];\n for (const k in obj) {\n removeTitlesAndDescriptions(obj[k]);\n }\n}\n\nfunction addPropertyExampleToObjectExamples(example, obj, propertyKey) {\n for (const key in obj) {\n obj[key][propertyKey] = example;\n }\n}\n\nfunction mergePropertyExamples(obj, propertyName, propExamples) {\n // Create an example for each variant of the propertyExample, merging them with the current (parent) example\n let i = 0;\n const maxCombinations = 10;\n const mergedObj = {};\n for (const exampleKey in obj) {\n for (const propExampleKey in propExamples) {\n mergedObj[`example-${i}`] = { ...obj[exampleKey] };\n mergedObj[`example-${i}`][propertyName] = propExamples[propExampleKey];\n i++;\n if (i >= maxCombinations) {\n break;\n }\n }\n if (i >= maxCombinations) {\n break;\n }\n }\n return mergedObj;\n}\n\n/* For changing JSON-Schema to a Sample Object, as per the schema (to generate examples based on schema) */\nexport function schemaToSampleObj(schema, config = { }) {\n let obj = {};\n if (!schema) {\n return;\n }\n\n if (schema.allOf) {\n const objWithAllProps = {};\n\n if (schema.allOf.length === 1 && !schema.allOf[0]?.properties && !schema.allOf[0]?.items) {\n // If allOf has single item and the type is not an object or array, then its a primitive\n if (schema.allOf[0].$ref) {\n return '{ }';\n }\n if (schema.allOf[0].readOnly && config.includeReadOnly) {\n const tempSchema = schema.allOf[0];\n return getSampleValueByType(tempSchema);\n }\n return;\n }\n\n schema.allOf.forEach((v) => {\n if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {\n const partialObj = schemaToSampleObj(v, config);\n Object.assign(objWithAllProps, partialObj);\n } else if (v.type === 'array' || v.items) {\n const partialObj = [schemaToSampleObj(v, config)];\n Object.assign(objWithAllProps, partialObj);\n } else if (v.type) {\n const prop = `prop${Object.keys(objWithAllProps).length}`;\n objWithAllProps[prop] = getSampleValueByType(v);\n } else {\n return '';\n }\n });\n\n obj = objWithAllProps;\n } else if (schema.oneOf) {\n // 1. First create example with scheme.properties\n const objWithSchemaProps = {};\n if (schema.properties) {\n for (const propertyName in schema.properties) {\n if (schema.properties[propertyName].properties || schema.properties[propertyName].properties?.items) {\n objWithSchemaProps[propertyName] = schemaToSampleObj(schema.properties[propertyName], config);\n } else {\n objWithSchemaProps[propertyName] = getSampleValueByType(schema.properties[propertyName]);\n }\n }\n }\n\n if (schema.oneOf.length > 0) {\n /*\n oneOf:\n - type: object\n properties:\n option1_PropA:\n type: string\n option1_PropB:\n type: string\n - type: object\n properties:\n option2_PropX:\n type: string\n properties:\n prop1:\n type: string\n prop2:\n type: string\n minLength: 10\n\n The aboove Schem should generate the following 2 examples\n\n Example-1\n {\n prop1: 'string',\n prop2: 'AAAAAAAAAA', <-- min-length 10\n option1_PropA: 'string',\n option1_PropB: 'string'\n }\n\n Example-2\n {\n prop1: 'string',\n prop2: 'AAAAAAAAAA', <-- min-length 10\n option2_PropX: 'string'\n }\n */\n let i = 0;\n // Merge all examples of each oneOf-schema\n for (const key in schema.oneOf) {\n const oneOfSamples = schemaToSampleObj(schema.oneOf[key], config);\n for (const sampleKey in oneOfSamples) {\n // 2. In the final example include a one-of item along with properties\n let finalExample;\n if (Object.keys(objWithSchemaProps).length > 0) {\n if (oneOfSamples[sampleKey] === null || typeof oneOfSamples[sampleKey] !== 'object') {\n // This doesn't really make sense since every oneOf schema _should_ be an object if there are common properties, so we'll skip this\n continue;\n } else {\n finalExample = Object.assign(oneOfSamples[sampleKey], objWithSchemaProps);\n }\n } else {\n finalExample = oneOfSamples[sampleKey];\n }\n obj[`example-${i}`] = finalExample;\n addSchemaInfoToExample(schema.oneOf[key], obj[`example-${i}`]);\n i++;\n }\n }\n }\n } else if (schema.anyOf) {\n // First generate values for regular properties\n let commonObj;\n if (schema.type === 'object' || schema.properties) {\n commonObj = { 'example-0': {} };\n for (const propertyName in schema.properties) {\n if (schema.example) {\n commonObj = schema;\n break;\n }\n if (schema.properties[propertyName].deprecated && !config.includeDeprecated) { continue; }\n if (schema.properties[propertyName].readOnly && !config.includeReadOnly) { continue; }\n if (schema.properties[propertyName].writeOnly && !config.includeWriteOnly) { continue; }\n commonObj = mergePropertyExamples(commonObj, propertyName, schemaToSampleObj(schema.properties[propertyName], config));\n }\n }\n\n // Combine every variant of the regular properties with every variant of the anyOf samples\n let i = 0;\n for (const key in schema.anyOf) {\n const anyOfSamples = schemaToSampleObj(schema.anyOf[key], config);\n for (const sampleKey in anyOfSamples) {\n if (typeof commonObj !== 'undefined') {\n for (const commonKey in commonObj) {\n obj[`example-${i}`] = { ...commonObj[commonKey], ...anyOfSamples[sampleKey] };\n }\n } else {\n obj[`example-${i}`] = anyOfSamples[sampleKey];\n }\n addSchemaInfoToExample(schema.anyOf[key], obj[`example-${i}`]);\n i++;\n }\n }\n } else if (schema.type === 'object' || schema.properties) {\n obj['example-0'] = {};\n addSchemaInfoToExample(schema, obj['example-0']);\n if (schema.example) {\n obj['example-0'] = schema.example;\n } else {\n for (const propertyName in schema.properties) {\n if (schema.properties[propertyName]?.deprecated && !config.includeDeprecated) { continue; }\n if (schema.properties[propertyName]?.readOnly && !config.includeReadOnly) { continue; }\n if (schema.properties[propertyName]?.writeOnly && !config.includeWriteOnly) { continue; }\n if (schema.properties[propertyName]?.type === 'array' || schema.properties[propertyName]?.items) {\n if (schema.properties[propertyName].example) {\n addPropertyExampleToObjectExamples(schema.properties[propertyName].example, obj, propertyName);\n } else if (schema.properties[propertyName]?.items?.example) { // schemas and properties support single example but not multiple examples.\n addPropertyExampleToObjectExamples([schema.properties[propertyName].items.example], obj, propertyName);\n } else {\n const itemSamples = schemaToSampleObj(schema.properties[propertyName].items, config);\n if (config.useXmlTagForProp) {\n const xmlTagName = schema.properties[propertyName].xml?.name || propertyName;\n if (schema.properties[propertyName].xml?.wrapped) {\n const wrappedItemSample = JSON.parse(`{ \"${xmlTagName}\" : { \"${xmlTagName}\" : ${JSON.stringify(itemSamples['example-0'])} } }`);\n obj = mergePropertyExamples(obj, xmlTagName, wrappedItemSample);\n } else {\n obj = mergePropertyExamples(obj, xmlTagName, itemSamples);\n }\n } else {\n const arraySamples = [];\n for (const key in itemSamples) {\n arraySamples[key] = [itemSamples[key]];\n }\n obj = mergePropertyExamples(obj, propertyName, arraySamples);\n }\n }\n continue;\n }\n obj = mergePropertyExamples(obj, propertyName, schemaToSampleObj(schema.properties[propertyName], config));\n }\n }\n } else if (schema.type === 'array' || schema.items) {\n if (schema.items || schema.example) {\n if (schema.example) {\n obj['example-0'] = schema.example;\n } else if (schema.items?.example) { // schemas and properties support single example but not multiple examples.\n obj['example-0'] = [schema.items.example];\n } else {\n const samples = schemaToSampleObj(schema.items, config);\n let i = 0;\n for (const key in samples) {\n obj[`example-${i}`] = [samples[key]];\n addSchemaInfoToExample(schema.items, obj[`example-${i}`]);\n i++;\n }\n }\n } else {\n obj['example-0'] = [];\n }\n } else {\n return { 'example-0': getSampleValueByType(schema) };\n }\n return obj;\n}\n\nfunction generateMarkdownForArrayAndObjectDescription(schema, level = 0) {\n let markdown = '';\n if (schema.title) {\n markdown = `**${schema.title}:** `;\n }\n if (schema.description) {\n markdown = `${markdown} ${schema.description} ${schema.minItems || schema.maxItems ? '
' : ''}`;\n }\n if (schema.minItems) {\n markdown = `${markdown} **Min Items:** ${schema.minItems}`;\n }\n if (schema.maxItems) {\n markdown = `${markdown} **Max Items:** ${schema.maxItems}`;\n }\n if (level > 0 && schema.items?.description) {\n let itemsMarkdown = '';\n if (schema.items.minProperties) {\n itemsMarkdown = `**Min Properties:** ${schema.items.minProperties}`;\n }\n if (schema.items.maxProperties) {\n itemsMarkdown = `${itemsMarkdown} **Max Properties:** ${schema.items.maxProperties}`;\n }\n markdown = `${markdown} ⮕ ${itemsMarkdown} [ ${schema.items.description} ] `;\n }\n return markdown;\n}\n/**\n * For changing OpenAPI-Schema to an Object Notation,\n * This Object would further be an input to UI Components to generate an Object-Tree\n * @param {object} schema - Schema object from OpenAPI spec\n * @param {object} obj - recursivly pass this object to generate object notation\n * @param {number} level - recursion level\n * @param {string} suffix - used for suffixing property names to avoid duplicate props during object composion\n */\nexport function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {\n if (!schema) {\n return;\n }\n if (schema.allOf) {\n const objWithAllProps = {};\n if (schema.allOf.length === 1 && !schema.allOf[0].properties && !schema.allOf[0].items) {\n // If allOf has single item and the type is not an object or array, then its a primitive\n const tempSchema = schema.allOf[0];\n return `${getTypeInfo(tempSchema).html}`;\n }\n // If allOf is an array of multiple elements, then all the keys makes a single object\n schema.allOf.map((v, i) => {\n if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {\n const propSuffix = (v.anyOf || v.oneOf) && i > 0 ? i : '';\n const partialObj = schemaInObjectNotation(v, {}, (level + 1), propSuffix);\n Object.assign(objWithAllProps, partialObj);\n } else if (v.type === 'array' || v.items) {\n const partialObj = schemaInObjectNotation(v, {}, (level + 1));\n Object.assign(objWithAllProps, partialObj);\n } else if (v.type) {\n const prop = `prop${Object.keys(objWithAllProps).length}`;\n const typeObj = getTypeInfo(v);\n objWithAllProps[prop] = `${typeObj.html}`;\n } else {\n return '';\n }\n });\n obj = objWithAllProps;\n } else if (schema.anyOf || schema.oneOf) {\n obj['::description'] = schema.description || '';\n // 1. First iterate the regular properties\n if (schema.type === 'object' || schema.properties) {\n obj['::description'] = schema.description || '';\n obj['::type'] = 'object';\n // obj['::deprecated'] = schema.deprecated || false;\n for (const key in schema.properties) {\n if (schema.required && schema.required.includes(key)) {\n obj[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n } else {\n obj[key] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n }\n }\n }\n // 2. Then show allof/anyof objects\n const objWithAnyOfProps = {};\n const xxxOf = schema.anyOf ? 'anyOf' : 'oneOf';\n schema[xxxOf].forEach((v, index) => {\n if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {\n const partialObj = schemaInObjectNotation(v, {});\n objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;\n objWithAnyOfProps['::type'] = 'xxx-of-option';\n } else if (v.type === 'array' || v.items) {\n // This else-if block never seems to get executed\n const partialObj = schemaInObjectNotation(v, {});\n objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;\n objWithAnyOfProps['::type'] = 'xxx-of-array';\n } else {\n const prop = `::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`;\n objWithAnyOfProps[prop] = `${getTypeInfo(v).html}`;\n objWithAnyOfProps['::type'] = 'xxx-of-option';\n }\n });\n obj[(schema.anyOf ? `::ANY~OF ${suffix}` : `::ONE~OF ${suffix}`)] = objWithAnyOfProps;\n // obj['::type'] = 'object';\n obj['::type'] = 'object';\n } else if (Array.isArray(schema.type)) {\n // When a property has multiple types, then check further if any of the types are array or object, if yes then modify the schema using one-of\n // Clone the schema - as it will be modified to replace multi-data-types with one-of;\n const subSchema = JSON.parse(JSON.stringify(schema));\n const primitiveType = [];\n const complexTypes = [];\n subSchema.type.forEach((v) => {\n if (v.match(/integer|number|string|null|boolean/g)) {\n primitiveType.push(v);\n } else if (v === 'array' && typeof subSchema.items?.type === 'string' && subSchema.items?.type.match(/integer|number|string|null|boolean/g)) {\n // Array with primitive types should also be treated as primitive type\n if (subSchema.items.type === 'string' && subSchema.items.format) {\n primitiveType.push(`[${subSchema.items.format}]`);\n } else {\n primitiveType.push(`[${subSchema.items.type}]`);\n }\n } else {\n complexTypes.push(v);\n }\n });\n let multiPrimitiveTypes;\n if (primitiveType.length > 0) {\n subSchema.type = primitiveType.join(primitiveType.length === 2 ? ' or ' : '┃');\n multiPrimitiveTypes = getTypeInfo(subSchema);\n if (complexTypes.length === 0) {\n return `${multiPrimitiveTypes?.html || ''}`;\n }\n }\n if (complexTypes.length > 0) {\n obj['::type'] = 'object';\n const multiTypeOptions = {\n '::type': 'xxx-of-option',\n };\n\n // Generate ONE-OF options for complexTypes\n complexTypes.forEach((v, i) => {\n if (v === 'null') {\n multiTypeOptions[`::OPTION~${i + 1}`] = 'NULL~|~~|~~|~~|~~|~~|~~|~~|~';\n } else if ('integer, number, string, boolean,'.includes(`${v},`)) {\n subSchema.type = Array.isArray(v) ? v.join('┃') : v;\n const primitiveTypeInfo = getTypeInfo(subSchema);\n multiTypeOptions[`::OPTION~${i + 1}`] = primitiveTypeInfo.html;\n } else if (v === 'object') {\n // If object type iterate all the properties and create an object-type-option\n const objTypeOption = {\n '::title': schema.title || '',\n '::description': schema.description || '',\n '::type': 'object',\n '::deprecated': schema.deprecated || false,\n };\n for (const key in schema.properties) {\n if (schema.required && schema.required.includes(key)) {\n objTypeOption[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n } else {\n objTypeOption[key] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n }\n }\n multiTypeOptions[`::OPTION~${i + 1}`] = objTypeOption;\n } else if (v === 'array') {\n multiTypeOptions[`::OPTION~${i + 1}`] = {\n '::title': schema.title || '',\n '::description': schema.description || '',\n '::type': 'array',\n '::props': schemaInObjectNotation(schema.items, {}, (level + 1)),\n };\n }\n });\n multiTypeOptions[`::OPTION~${complexTypes.length + 1}`] = multiPrimitiveTypes?.html || '';\n obj['::ONE~OF'] = multiTypeOptions;\n }\n } else if (schema.type === 'object' || schema.properties) { // If Object\n obj['::title'] = schema.title || '';\n obj['::description'] = generateMarkdownForArrayAndObjectDescription(schema, level);\n obj['::type'] = 'object';\n if ((Array.isArray(schema.type) && schema.type.includes('null')) || schema.nullable) {\n obj['::dataTypeLabel'] = 'object or null';\n }\n obj['::deprecated'] = schema.deprecated || false;\n obj['::readwrite'] = schema.readOnly ? 'readonly' : schema.writeOnly ? 'writeonly' : '';\n for (const key in schema.properties) {\n if (schema.required && schema.required.includes(key)) {\n obj[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n } else {\n obj[key] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n }\n }\n if (schema.additionalProperties) {\n obj[''] = schemaInObjectNotation(schema.additionalProperties, {});\n }\n } else if (schema.type === 'array' || schema.items) { // If Array\n obj['::title'] = schema.title || '';\n obj['::description'] = generateMarkdownForArrayAndObjectDescription(schema, level);\n obj['::type'] = 'array';\n if ((Array.isArray(schema.type) && schema.type.includes('null')) || schema.nullable) {\n obj['::dataTypeLabel'] = 'array or null';\n }\n obj['::deprecated'] = schema.deprecated || false;\n obj['::readwrite'] = schema.readOnly ? 'readonly' : schema.writeOnly ? 'writeonly' : '';\n if (schema.items?.items) {\n obj['::array-type'] = schema.items.items.type;\n }\n obj['::props'] = schemaInObjectNotation(schema.items, {}, (level + 1));\n } else {\n const typeObj = getTypeInfo(schema);\n if (typeObj?.html) {\n return `${typeObj.html}`;\n }\n return '';\n }\n return obj;\n}\n\n/* Create Example object */\nexport function generateExample(schema, mimeType, examples = '', example = '', includeReadOnly = true, includeWriteOnly = true, outputType = 'json', includeGeneratedExample = false) {\n const finalExamples = [];\n // First check if examples is provided\n if (examples) {\n for (const eg in examples) {\n let egContent = '';\n let egFormat = 'json';\n if (mimeType?.toLowerCase().includes('json')) {\n if (outputType === 'text') {\n egContent = typeof examples[eg].value === 'string' ? examples[eg].value : JSON.stringify(examples[eg].value, undefined, 2);\n egFormat = 'text';\n } else {\n egContent = examples[eg].value;\n if (typeof examples[eg].value === 'string') {\n try {\n // const fixedJsonString = examples[eg].value.replace((/([\\w]+)(:)/g), '\"$1\"$2').replace((/'/g), '\"');\n const fixedJsonString = examples[eg].value;\n egContent = JSON.parse(fixedJsonString);\n egFormat = 'json';\n } catch (err) {\n egFormat = 'text';\n egContent = examples[eg].value;\n }\n }\n }\n } else {\n egContent = examples[eg].value;\n egFormat = 'text';\n }\n\n finalExamples.push({\n exampleId: eg,\n exampleSummary: examples[eg].summary || eg,\n exampleDescription: examples[eg].description || '',\n exampleType: mimeType,\n exampleValue: egContent,\n exampleFormat: egFormat,\n });\n }\n } else if (example) {\n let egContent = '';\n let egFormat = 'json';\n if (mimeType?.toLowerCase().includes('json')) {\n if (outputType === 'text') {\n egContent = typeof example === 'string' ? example : JSON.stringify(example, undefined, 2);\n egFormat = 'text';\n } else if (typeof example === 'object') {\n egContent = example;\n egFormat = 'json';\n } else if (typeof example === 'string') {\n try {\n egContent = JSON.parse(example);\n egFormat = 'json';\n } catch (err) {\n egFormat = 'text';\n egContent = example;\n }\n }\n } else {\n egContent = example;\n egFormat = 'text';\n }\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: '',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: egContent,\n exampleFormat: egFormat,\n });\n }\n // If schema-level examples are not provided or includeGeneratedExample === true then generate one based on the schema field types\n if (finalExamples.length === 0 || includeGeneratedExample === true) {\n if (schema) {\n if (schema.example) {\n // Note: Deprecated: The 'example' property has been deprecated in 3.1.0 in favor of the JSON Schema 'examples' keyword\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: '',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: schema.example,\n exampleFormat: ((mimeType?.toLowerCase().includes('json') && typeof schema.example === 'object') ? 'json' : 'text'),\n });\n } else if (mimeType?.toLowerCase().includes('json') || mimeType?.toLowerCase().includes('text') || mimeType?.toLowerCase().includes('*/*') || mimeType?.toLowerCase().includes('xml')) {\n let xmlRootStart = '';\n let xmlRootEnd = '';\n let exampleFormat = '';\n let exampleValue = '';\n if (mimeType?.toLowerCase().includes('xml')) {\n xmlRootStart = schema.xml?.name ? `<${schema.xml.name} ${schema.xml.namespace ? `xmlns=\"${schema.xml.namespace}\"` : ''}>` : '';\n xmlRootEnd = schema.xml?.name ? `` : '';\n exampleFormat = 'text';\n } else {\n exampleFormat = outputType;\n }\n const samples = schemaToSampleObj(schema, { includeReadOnly, includeWriteOnly, deprecated: true, useXmlTagForProp: true });\n let i = 0;\n for (const samplesKey in samples) {\n if (!samples[samplesKey]) {\n continue;\n }\n const summary = samples[samplesKey]['::TITLE'] || `Example ${++i}`;\n const description = samples[samplesKey]['::DESCRIPTION'] || '';\n if (mimeType?.toLowerCase().includes('xml')) {\n exampleValue = `\\n${xmlRootStart}${json2xml(samples[samplesKey], 1)}\\n${xmlRootEnd}`;\n } else {\n removeTitlesAndDescriptions(samples[samplesKey]);\n exampleValue = outputType === 'text' ? JSON.stringify(samples[samplesKey], null, 2) : samples[samplesKey];\n }\n\n finalExamples.push({\n exampleId: samplesKey,\n exampleSummary: summary,\n exampleDescription: description,\n exampleType: mimeType,\n exampleFormat,\n exampleValue,\n });\n }\n } else if (mimeType?.toLowerCase().includes('jose')) {\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: 'Base64 Encoded',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: schema.pattern || 'bXJpbg==',\n exampleFormat: 'text',\n });\n } else {\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: '',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: '',\n exampleFormat: 'text',\n });\n }\n } else {\n // No Example or Schema provided (should never reach here)\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: '',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: '',\n exampleFormat: 'text',\n });\n }\n }\n return finalExamples;\n}\n\nfunction getSerializeStyleForContentType(contentType) {\n if (contentType === 'application/json') {\n return 'json';\n }\n if (contentType === 'application/xml') {\n return 'xml';\n }\n return null;\n}\n\nexport function getSchemaFromParam(param) {\n if (param.schema) {\n return [param.schema, null, null];\n }\n if (param.content) {\n // we gonna use the first content-encoding\n for (const contentType of Object.keys(param.content)) {\n if (param.content[contentType].schema) {\n return [param.content[contentType].schema, getSerializeStyleForContentType(contentType), param.content[contentType]];\n }\n }\n }\n return [null, null, null];\n}\n","import { LitElement, html, css } from 'lit';\nimport { copyToClipboard } from '~/utils/common-utils';\nimport FontStyles from '~/styles/font-styles';\nimport BorderStyles from '~/styles/border-styles';\nimport InputStyles from '~/styles/input-styles';\nimport CustomStyles from '~/styles/custom-styles';\n\nexport default class JsonTree extends LitElement {\n static get properties() {\n return {\n data: { type: Object },\n renderStyle: { type: String, attribute: 'render-style' },\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n BorderStyles,\n InputStyles,\n css`\n :host{\n display:flex;\n }\n .json-tree {\n position: relative;\n font-family: var(--font-mono);\n font-size: var(--font-size-small);\n display:inline-block;\n overflow:hidden;\n word-break: break-all;\n flex:1;\n line-height: calc(var(--font-size-small) + 6px);\n min-height: 40px;\n direction: ltr; \n text-align: left;\n }\n\n .open-bracket {\n display:inline-block;\n padding: 0 20px 0 0;\n cursor:pointer;\n border: 1px solid transparent;\n border-radius:3px;\n }\n .close-bracket {\n border: 1px solid transparent;\n border-radius:3px;\n display:inline-block;\n }\n .open-bracket:hover {\n color:var(--primary-color);\n background-color:var(--hover-color);\n border: 1px solid var(--border-color);\n }\n .open-bracket.expanded:hover ~ .inside-bracket {\n border-left: 1px solid var(--fg3);\n }\n .open-bracket.expanded:hover ~ .close-bracket {\n color:var(--primary-color);\n }\n .inside-bracket {\n padding-left:12px;\n overflow: hidden;\n border-left:1px dotted var(--border-color);\n }\n .open-bracket.collapsed + .inside-bracket,\n .open-bracket.collapsed + .inside-bracket + .close-bracket {\n display:none;\n }\n\n .string{color:var(--green);}\n .number{color:var(--blue);}\n .null{color:var(--red);}\n .boolean{color:var(--purple);}\n .object{color:var(--fg)}\n .toolbar {\n position: absolute;\n top:5px;\n right:6px;\n display:flex;\n padding:2px;\n align-items: center;\n }`,\n CustomStyles,\n ];\n }\n\n /* eslint-disable indent */\n render() {\n return html`\n
\n
\n \n
\n ${this.generateTree(this.data, true)}\n
\n `;\n }\n\n generateTree(data, isLast = false) {\n if (data === null) {\n return html`
null
`;\n }\n if (typeof data === 'object' && (data instanceof Date === false)) {\n const detailType = Array.isArray(data) ? 'array' : 'pure_object';\n if (Object.keys(data).length === 0) {\n return html`${(Array.isArray(data) ? '[ ],' : '{ },')}`;\n }\n return html`\n
${detailType === 'array' ? '[' : '{'}
\n
\n ${Object.keys(data).map((key, i, a) => html`\n
\n ${detailType === 'pure_object' ? html`\"${key}\":` : ''}\n ${this.generateTree(data[key], i === (a.length - 1))}\n
`)\n }\n
\n
${detailType === 'array' ? ']' : '}'}${isLast ? '' : ','}
\n `;\n }\n\n return (typeof data === 'string' || data instanceof Date)\n ? html`\"${data}\"${isLast ? '' : ','}`\n : html`${data}${isLast ? '' : ','}`;\n }\n /* eslint-enable indent */\n\n toggleExpand(e) {\n const openBracketEl = e.target;\n if (openBracketEl.classList.contains('expanded')) {\n openBracketEl.classList.replace('expanded', 'collapsed');\n e.target.innerHTML = e.target.classList.contains('array') ? '[...]' : '{...}';\n } else {\n openBracketEl.classList.replace('collapsed', 'expanded');\n e.target.innerHTML = e.target.classList.contains('array') ? '[' : '{';\n }\n }\n}\n// Register the element with the browser\ncustomElements.define('json-tree', JsonTree);\n","import { LitElement, html, css } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport FontStyles from '~/styles/font-styles';\nimport SchemaStyles from '~/styles/schema-styles';\nimport BorderStyles from '~/styles/border-styles';\nimport CustomStyles from '~/styles/custom-styles';\n\nexport default class SchemaTree extends LitElement {\n static get properties() {\n return {\n data: { type: Object },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true false'.includes(this.schemaDescriptionExpanded)) { this.schemaDescriptionExpanded = 'false'; }\n if (!this.schemaHideReadOnly || !'true false'.includes(this.schemaHideReadOnly)) { this.schemaHideReadOnly = 'true'; }\n if (!this.schemaHideWriteOnly || !'true false'.includes(this.schemaHideWriteOnly)) { this.schemaHideWriteOnly = 'true'; }\n }\n\n static get styles() {\n return [\n FontStyles,\n SchemaStyles,\n BorderStyles,\n css`\n .tree {\n font-size:var(--font-size-small);\n text-align: left;\n direction: ltr;\n line-height:calc(var(--font-size-small) + 6px);\n }\n .tree .tr:hover{\n background-color:var(--hover-color);\n }\n .collapsed-descr .tr {\n max-height:calc(var(--font-size-small) + 8px);\n }\n .collapsed-descr .m-markdown-small p {\n line-height:calc(var(--font-size-small) + 6px);\n }\n\n .tree .key {\n max-width: 300px;\n }\n .key.deprecated .key-label {\n color: var(--red);\n }\n .tr.expanded:hover > .td.key > .open-bracket {\n color: var(--primary-color);\n }\n .tr.expanded:hover + .inside-bracket {\n border-left: 1px solid var(--fg3);\n }\n .tr.expanded:hover + .inside-bracket + .close-bracket {\n color: var(--primary-color);\n }\n .inside-bracket.xxx-of-option {\n border-left: 1px solid transparent;\n }\n .open-bracket{\n display:inline-block;\n padding: 0 20px 0 0;\n cursor:pointer;\n border: 1px solid transparent;\n border-radius:3px;\n }\n .open-bracket:hover {\n color:var(--primary-color);\n background-color:var(--hover-color);\n border: 1px solid var(--border-color);\n }\n .close-bracket{\n display:inline-block;\n font-family: var(--font-mono);\n }\n .tr.collapsed + .inside-bracket,\n .tr.collapsed + .inside-bracket + .close-bracket{\n overflow: hidden;\n display:none;\n }\n .inside-bracket.object,\n .inside-bracket.array {\n border-left: 1px dotted var(--border-color);\n }`,\n CustomStyles,\n ];\n }\n\n /* eslint-disable indent */\n render() {\n return html`\n
\n
\n
${this.data?.['::type'] || ''}
\n ${this.allowSchemaDescriptionExpandToggle === 'true'\n ? html`\n
\n
\n ${this.schemaDescriptionExpanded === 'true' ? 'Single line description' : 'Multiline description'}\n
\n `\n : ''\n }\n
\n ${unsafeHTML(marked(this.data?.['::description'] || ''))}\n ${this.data\n ? html`\n ${this.generateTree(\n this.data['::type'] === 'array' ? this.data['::props'] : this.data,\n this.data['::type'],\n this.data['::array-type'] || '',\n )}`\n : html` Schema not found `\n }\n
\n `;\n }\n\n generateTree(data, dataType = 'object', arrayType = '', key = '', description = '', schemaLevel = 0, indentLevel = 0, readOrWrite = '') {\n if (this.schemaHideReadOnly === 'true') {\n if (dataType === 'array') {\n if (readOrWrite === 'readonly') {\n return;\n }\n }\n if (data && data['::readwrite'] === 'readonly') {\n return;\n }\n }\n if (this.schemaHideWriteOnly === 'true') {\n if (dataType === 'array') {\n if (readOrWrite === 'writeonly') {\n return;\n }\n }\n if (data && data['::readwrite'] === 'writeonly') {\n return;\n }\n }\n\n if (!data) {\n return html`
\n ${key.replace('::OPTION~', '')}\n ${\n dataType === 'array'\n ? html` [ ] `\n : dataType === 'object'\n ? html` { } `\n : html` schema undefined `\n }\n
`;\n }\n if (Object.keys(data).length === 0) {\n return html`${key}:{ }`;\n }\n let keyLabel = '';\n let keyDescr = '';\n if (key.startsWith('::ONE~OF') || key.startsWith('::ANY~OF')) {\n keyLabel = key.replace('::', '').replace('~', ' ');\n } else if (key.startsWith('::OPTION')) {\n const parts = key.split('~');\n keyLabel = parts[1]; // eslint-disable-line prefer-destructuring\n keyDescr = parts[2]; // eslint-disable-line prefer-destructuring\n } else {\n keyLabel = key;\n }\n\n const leftPadding = 12;\n const minFieldColWidth = 400 - (indentLevel * leftPadding);\n let openBracket = '';\n let closeBracket = '';\n const newSchemaLevel = data['::type']?.startsWith('xxx-of') ? schemaLevel : (schemaLevel + 1);\n // const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' ? indentLevel : (indentLevel + 1);\n const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : (indentLevel + 1);\n if (data['::type'] === 'object') {\n if (dataType === 'array') {\n if (schemaLevel < this.schemaExpandLevel) {\n openBracket = html`[{`;\n } else {\n openBracket = html`[{...}]`;\n }\n closeBracket = '}]';\n } else {\n if (schemaLevel < this.schemaExpandLevel) {\n openBracket = html`{`;\n } else {\n openBracket = html`{...}`;\n }\n closeBracket = '}';\n }\n } else if (data['::type'] === 'array') {\n if (dataType === 'array') {\n const arrType = arrayType !== 'object' ? arrayType : '';\n if (schemaLevel < this.schemaExpandLevel) {\n openBracket = html`[[ ${arrType} `;\n } else {\n openBracket = html`[[...]]`;\n }\n closeBracket = ']]';\n } else {\n if (schemaLevel < this.schemaExpandLevel) {\n openBracket = html`[`;\n } else {\n openBracket = html`[...]`;\n }\n closeBracket = ']';\n }\n }\n if (typeof data === 'object') {\n return html`\n
\n
\n ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION')\n ? html` ${keyLabel}${keyDescr}`\n : keyLabel === '::props' || keyLabel === '::ARRAY~OF'\n ? ''\n : schemaLevel > 0\n ? html`\n ${data['::deprecated'] ? '✗' : ''}\n ${keyLabel.replace(/\\*$/, '')}${keyLabel.endsWith('*') ? html`*` : ''}${readOrWrite === 'readonly' ? html` 🆁` : readOrWrite === 'writeonly' ? html` 🆆` : readOrWrite}:\n `\n : ''\n }\n ${openBracket}\n
\n
${unsafeHTML(marked(description || ''))}
\n
\n
\n ${Array.isArray(data) && data[0]\n ? html`${this.generateTree(data[0], 'xxx-of-option', '', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel, data[0]['::readwrite'])}`\n : html`\n ${Object.keys(data).map((dataKey) => html`\n ${['::title', '::description', '::type', '::props', '::deprecated', '::array-type', '::readwrite', '::dataTypeLabel'].includes(dataKey)\n ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object'\n ? html`${this.generateTree(\n data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey],\n data[dataKey]['::type'],\n data[dataKey]['::array-type'] || '',\n dataKey,\n data[dataKey]['::description'],\n newSchemaLevel,\n newIndentLevel,\n data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '',\n )}`\n : ''\n : html`${this.generateTree(\n data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey],\n data[dataKey]['::type'],\n data[dataKey]['::array-type'] || '',\n dataKey,\n data[dataKey]?.['::description'] || '',\n newSchemaLevel,\n newIndentLevel,\n data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '',\n )}`\n }\n `)}\n `\n }\n
\n ${data['::type'] && data['::type'].includes('xxx-of')\n ? ''\n : html`
${closeBracket}
`\n }\n `;\n }\n\n // For Primitive types and array of Primitives\n // eslint-disable-next-line no-unused-vars\n const [type, primitiveReadOrWrite, constraint, defaultValue, allowedValues, pattern, schemaDescription, schemaTitle, deprecated] = data.split('~|~');\n if (primitiveReadOrWrite === '🆁' && this.schemaHideReadOnly === 'true') {\n return;\n }\n if (primitiveReadOrWrite === '🆆' && this.schemaHideWriteOnly === 'true') {\n return;\n }\n const dataTypeCss = type.replace(/┃.*/g, '').replace(/[^a-zA-Z0-9+]/g, '').substring(0, 4).toLowerCase();\n\n let finalReadWriteText = '';\n let finalReadWriteTip = '';\n if (dataType === 'array') {\n if (readOrWrite === 'readonly') {\n finalReadWriteText = '🆁';\n finalReadWriteTip = 'Read-Only';\n } else if (readOrWrite === 'writeonly') {\n finalReadWriteText = '🆆';\n finalReadWriteTip = 'Write-Only';\n }\n } else if (primitiveReadOrWrite === '🆁') {\n finalReadWriteText = '🆁';\n finalReadWriteTip = 'Read-Only';\n } else if (primitiveReadOrWrite === '🆆') {\n finalReadWriteText = '🆆';\n finalReadWriteTip = 'Write-Only';\n }\n\n return html`\n
\n
\n ${deprecated ? html`` : ''}\n ${keyLabel.endsWith('*')\n ? html`${keyLabel.substring(0, keyLabel.length - 1)}*:`\n : key.startsWith('::OPTION')\n ? html`${keyLabel}${keyDescr}`\n : html`${keyLabel}:`\n }\n \n ${dataType === 'array' ? `[${type}]` : `${type}`}\n ${finalReadWriteText}\n \n
\n
\n ${html`${unsafeHTML(marked(dataType === 'array' ? description : schemaDescription))}`}\n ${constraint ? html`
Constraints: ${constraint}
` : ''}\n ${defaultValue ? html`
Default: ${defaultValue}
` : ''}\n ${allowedValues ? html`
${type === 'const' ? 'Value' : 'Allowed'}: ${allowedValues}
` : ''}\n ${pattern ? html`
Pattern: ${pattern}
` : ''}\n
\n
\n `;\n }\n /* eslint-enable indent */\n\n toggleObjectExpand(e) {\n const rowEl = e.target.closest('.tr');\n if (rowEl.classList.contains('expanded')) {\n rowEl.classList.replace('expanded', 'collapsed');\n e.target.innerHTML = e.target.classList.contains('array-of-object')\n ? '[{...}]'\n : e.target.classList.contains('array-of-array')\n ? '[[...]]'\n : e.target.classList.contains('array')\n ? '[...]'\n : '{...}';\n } else {\n rowEl.classList.replace('collapsed', 'expanded');\n e.target.innerHTML = e.target.classList.contains('array-of-object')\n ? '[{'\n : e.target.classList.contains('array-of-array')\n ? `[[ ${e.target.dataset.arrayType}`\n : e.target.classList.contains('object')\n ? '{'\n : '[';\n }\n }\n}\ncustomElements.define('schema-tree', SchemaTree);\n","import { LitElement, html, css } from 'lit';\n\nexport default class TagInput extends LitElement {\n /* eslint-disable indent */\n render() {\n let tagItemTmpl = '';\n if (Array.isArray(this.value)) {\n tagItemTmpl = html`${this.value\n .filter((v) => typeof v === 'string' && v.trim() !== '')\n .map((v) => html`${v}`)\n }`;\n }\n return html`\n
\n ${tagItemTmpl}\n this.afterPaste(e)}\" @keydown=\"${this.afterKeyDown}\" @blur=\"${this.onBlur}\" placeholder=\"${this.placeholder || ''}\">\n
\n `;\n }\n /* eslint-enable indent */\n\n static get properties() {\n return {\n placeholder: { type: String },\n value: { type: Array, attribute: 'value' },\n };\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'value') {\n if (newVal && oldVal !== newVal) {\n this.value = newVal.split(',').filter((v) => v.trim() !== '');\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n afterPaste(e) {\n const clipboardData = e.clipboardData || window.clipboardData;\n const pastedData = clipboardData.getData('Text');\n const pastedArray = pastedData ? pastedData.split(',').filter((v) => v.trim() !== '') : '';\n if (pastedArray) {\n if (Array.isArray(this.value)) {\n this.value = [...this.value, ...pastedArray];\n } else {\n this.value = pastedArray;\n }\n }\n e.preventDefault();\n }\n\n afterKeyDown(e) {\n if (e.keyCode === 13) {\n e.stopPropagation();\n e.preventDefault();\n if (e.target.value) {\n if (Array.isArray(this.value)) {\n this.value = [...this.value, e.target.value];\n } else {\n this.value = [e.target.value];\n }\n e.target.value = '';\n }\n } else if (e.keyCode === 8) {\n if (e.target.value.length === 0) {\n if (Array.isArray(this.value) && this.value.length > 0) {\n this.value.splice(-1);\n this.value = [...this.value];\n }\n }\n }\n }\n\n onBlur(e) {\n if (e.target.value) {\n if (Array.isArray(this.value)) {\n this.value = [...this.value, e.target.value];\n } else {\n this.value = [e.target.value];\n }\n e.target.value = '';\n }\n }\n\n static get styles() {\n return [css`\n .tags{\n display:flex;\n flex-wrap: wrap;\n outline: none;\n padding:0;\n border-radius:var(--border-radius);\n border:1px solid var(--border-color);\n cursor:text;\n overflow:hidden;\n background:var(--input-bg);\n }\n .tag, .editor {\n padding:3px;\n margin:2px;\n }\n .tag{\n border:1px solid var(--border-color);\n background-color:var(--bg3);\n color:var(--fg3);\n border-radius:var(--border-radius);\n word-break: break-all;\n font-size: var(--font-size-small);\n }\n .tag:hover ~ #cursor {\n display: block;\n }\n .editor{\n flex:1;\n border:1px solid transparent;\n color:var(--fg);\n min-width:60px;\n outline: none;\n line-height: inherit;\n font-family:inherit;\n background:transparent;\n font-size: calc(var(--font-size-small) + 1px);\n }\n .editor::placeholder {\n color: var(--placeholder-color);\n opacity:1;\n }\n `];\n }\n}\n// Register the element with the browser\ncustomElements.define('tag-input', TagInput);\n","import { LitElement, html, css } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { guard } from 'lit/directives/guard.js'; // eslint-disable-line import/extensions\nimport { live } from 'lit/directives/live.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport formatXml from 'xml-but-prettier';\nimport Prism from 'prismjs';\nimport TableStyles from '~/styles/table-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport InputStyles from '~/styles/input-styles';\nimport FontStyles from '~/styles/font-styles';\nimport BorderStyles from '~/styles/border-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport PrismStyles from '~/styles/prism-styles';\nimport CustomStyles from '~/styles/custom-styles';\nimport { copyToClipboard, downloadResource, viewResource } from '~/utils/common-utils';\nimport { schemaInObjectNotation,\n getTypeInfo,\n generateExample,\n normalizeExamples,\n getSchemaFromParam,\n json2xml,\n nestExampleIfPresent,\n anyExampleWithSummaryOrDescription } from '~/utils/schema-utils';\nimport '~/components/json-tree';\nimport '~/components/schema-tree';\nimport '~/components/tag-input';\n\nexport default class ApiRequest extends LitElement {\n constructor() {\n super();\n this.responseMessage = '';\n this.responseStatus = 'success';\n this.responseHeaders = '';\n this.responseText = '';\n this.responseUrl = '';\n this.curlSyntax = '';\n this.activeResponseTab = 'response'; // allowed values: response, headers, curl\n this.selectedRequestBodyType = '';\n this.selectedRequestBodyExample = '';\n this.activeParameterSchemaTabs = {};\n }\n\n static get properties() {\n return {\n serverUrl: { type: String, attribute: 'server-url' },\n servers: { type: Array },\n method: { type: String },\n path: { type: String },\n security: { type: Array },\n parameters: { type: Array },\n request_body: { type: Object },\n api_keys: { type: Array },\n parser: { type: Object },\n accept: { type: String },\n callback: { type: String },\n webhook: { type: String },\n responseMessage: { type: String, attribute: false },\n responseText: { type: String, attribute: false },\n responseHeaders: { type: String, attribute: false },\n responseStatus: { type: String, attribute: false },\n responseUrl: { type: String, attribute: false },\n fillRequestFieldsWithExample: { type: String, attribute: 'fill-request-fields-with-example' },\n allowTry: { type: String, attribute: 'allow-try' },\n renderStyle: { type: String, attribute: 'render-style' },\n schemaStyle: { type: String, attribute: 'schema-style' },\n activeSchemaTab: { type: String, attribute: 'active-schema-tab' },\n activeParameterSchemaTabs: {\n type: Object,\n converter: {\n fromAttribute: (attr) => JSON.parse(attr),\n toAttribute: (prop) => JSON.stringify(prop),\n },\n attribute: 'active-parameter-schema-tabs',\n },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n fetchCredentials: { type: String, attribute: 'fetch-credentials' },\n\n // properties for internal tracking\n activeResponseTab: { type: String }, // internal tracking of response-tab not exposed as a attribute\n selectedRequestBodyType: { type: String, attribute: 'selected-request-body-type' }, // internal tracking of selected request-body type\n selectedRequestBodyExample: { type: String, attribute: 'selected-request-body-example' }, // internal tracking of selected request-body example\n };\n }\n\n static get styles() {\n return [\n TableStyles,\n InputStyles,\n FontStyles,\n FlexStyles,\n BorderStyles,\n TabStyles,\n PrismStyles,\n css`\n *, *:before, *:after { box-sizing: border-box; }\n \n .read-mode {\n margin-top: 24px;\n }\n .param-name,\n .param-type {\n margin: 1px 0;\n text-align: right;\n line-height: var(--font-size-small);\n }\n .param-name {\n color: var(--fg); \n font-family: var(--font-mono);\n }\n .param-name.deprecated { \n color: var(--red);\n }\n .param-type{\n color: var(--light-fg); \n font-family: var(--font-regular);\n }\n .param-constraint{\n min-width:100px;\n }\n .param-constraint:empty{\n display:none;\n }\n .top-gap{margin-top:24px;}\n\n .textarea {\n min-height:220px; \n padding:5px;\n resize:vertical;\n direction: ltr;\n }\n .example:first-child {\n margin-top: -9px;\n }\n\n .response-message{\n font-weight:bold;\n text-overflow: ellipsis;\n }\n .response-message.error {\n color:var(--red);\n }\n .response-message.success {\n color:var(--blue);\n }\n\n .file-input-container {\n align-items:flex-end;\n }\n .file-input-container .input-set:first-child .file-input-remove-btn{\n visibility:hidden;\n }\n\n .file-input-remove-btn{\n font-size:16px;\n color:var(--red);\n outline: none;\n border: none;\n background:none;\n cursor:pointer;\n }\n\n .v-tab-btn {\n font-size: var(--smal-font-size);\n height:24px; \n border:none; \n background:none; \n opacity: 0.3;\n cursor: pointer;\n padding: 4px 8px;\n }\n .v-tab-btn.active {\n font-weight: bold;\n background: var(--bg);\n opacity: 1;\n }\n\n @media only screen and (min-width: 768px) {\n .textarea {\n padding:8px;\n }\n }\n\n @media only screen and (max-width: 470px) {\n .hide-in-small-screen {\n display:none;\n }\n }\n `,\n CustomStyles,\n ];\n }\n\n render() {\n return html`\n
\n
\n ${this.callback === 'true' ? 'CALLBACK REQUEST' : 'REQUEST'}\n
\n
\n ${guard([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('path'))}\n ${guard([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('query'))}\n ${this.requestBodyTemplate()}\n ${guard([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('header'))}\n ${guard([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('cookie'))}\n ${this.allowTry === 'false' ? '' : html`${this.apiCallTemplate()}`}\n
\n
\n `;\n }\n\n /*\n async updated(changedProperties) {\n // In focused mode after rendering the request component, update the text-areas(which contains examples) using\n // the original values from hidden textareas\n // This is done coz, user may update the dom by editing the textarea's and once the DOM is updated externally change detection wont happen, therefore update the values manually\n if (this.renderStyle === 'focused') {\n if (changedProperties.size === 1 && changedProperties.has('activeSchemaTab')) {\n // dont update example as only tabs is switched\n } else {\n this.requestUpdate();\n }\n }\n }\n */\n\n async saveExampleState() {\n if (this.renderStyle === 'focused') {\n const reqBodyTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea.request-body-param-user-input')];\n reqBodyTextAreaEls.forEach((el) => {\n el.dataset.user_example = el.value;\n });\n const exampleTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea[data-ptype=\"form-data\"]')];\n exampleTextAreaEls.forEach((el) => {\n el.dataset.user_example = el.value;\n });\n this.requestUpdate();\n }\n }\n\n async updateExamplesFromDataAttr() {\n // In focused mode after rendering the request component, update the text-areas(which contains examples) using\n // the original values from hidden textareas\n // This is done coz, user may update the dom by editing the textarea's and once the DOM is updated externally change detection wont happen, therefore update the values manually\n if (this.renderStyle === 'focused') {\n const reqBodyTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea.request-body-param-user-input')];\n reqBodyTextAreaEls.forEach((el) => {\n el.value = el.dataset.user_example || el.dataset.example;\n });\n const exampleTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea[data-ptype=\"form-data\"]')];\n exampleTextAreaEls.forEach((el) => {\n el.value = el.dataset.user_example || el.dataset.example;\n });\n this.requestUpdate();\n }\n }\n\n /* eslint-disable indent */\n renderExample(example, paramType, paramName) {\n return html`\n ${paramType === 'array' ? '[' : ''}\n {\n const inputEl = e.target.closest('table').querySelector(`[data-pname=\"${paramName}\"]`);\n if (inputEl) {\n inputEl.value = e.target.dataset.exampleType === 'array' ? e.target.dataset.example.split('~|~') : e.target.dataset.example;\n }\n }}\"\n > ${example.printableValue || example.value} \n ${paramType === 'array' ? '] ' : ''}\n `;\n }\n\n renderShortFormatExamples(examples, paramType, paramName) {\n return html`${examples.map((x, i) => html`\n ${i === 0 ? '' : '┃'}\n ${this.renderExample(x, paramType, paramName)}`)}`;\n }\n\n renderLongFormatExamples(exampleList, paramType, paramName) {\n return html`
    \n ${exampleList.map((v) => html`\n
  • \n ${this.renderExample(v, paramType, paramName)}\n ${v.summary?.length > 0 ? html`(${v.summary})` : ''}\n ${v.description?.length > 0 ? html`

    ${unsafeHTML(marked(v.description))}

    ` : ''}\n
  • \n `)}\n
`;\n }\n\n exampleListTemplate(paramName, paramType, exampleList = []) {\n return html` ${\n exampleList.length > 0\n ? html`Examples: \n ${anyExampleWithSummaryOrDescription(exampleList)\n ? this.renderLongFormatExamples(exampleList, paramType, paramName)\n : this.renderShortFormatExamples(exampleList, paramType, paramName)}`\n : ''\n }`;\n }\n\n inputParametersTemplate(paramType) {\n const filteredParams = this.parameters ? this.parameters.filter((param) => param.in === paramType) : [];\n if (filteredParams.length === 0) {\n return '';\n }\n let title = '';\n if (paramType === 'path') {\n title = 'PATH PARAMETERS';\n } else if (paramType === 'query') {\n title = 'QUERY-STRING PARAMETERS';\n } else if (paramType === 'header') {\n title = 'REQUEST HEADERS';\n } else if (paramType === 'cookie') {\n title = 'COOKIES';\n }\n\n const tableRows = [];\n for (const param of filteredParams) {\n const [declaredParamSchema, serializeStyle, mimeTypeElem] = getSchemaFromParam(param);\n if (!declaredParamSchema) {\n continue; // eslint-disable-line no-continue\n }\n const paramSchema = getTypeInfo(declaredParamSchema);\n if (!paramSchema) {\n continue; // eslint-disable-line no-continue\n }\n const schemaAsObj = schemaInObjectNotation(declaredParamSchema, {});\n // let exampleVal = '';\n // let exampleList = [];\n let paramStyle = 'form';\n let paramExplode = true;\n let paramAllowReserved = false;\n if (paramType === 'query') {\n if (param.style && 'form spaceDelimited pipeDelimited'.includes(param.style)) {\n paramStyle = param.style;\n } else if (serializeStyle) {\n paramStyle = serializeStyle;\n }\n if (typeof param.explode === 'boolean') {\n paramExplode = param.explode;\n }\n if (typeof param.allowReserved === 'boolean') {\n paramAllowReserved = param.allowReserved;\n }\n }\n // openapi 3.1.0 spec based examples (which must be Object(string : { value:any, summary?: string, description?: string})\n const example = normalizeExamples(\n (param.examples\n || nestExampleIfPresent(param.example)\n || nestExampleIfPresent(mimeTypeElem?.example)\n || mimeTypeElem?.examples\n || paramSchema.examples\n || nestExampleIfPresent(paramSchema.example)\n ),\n paramSchema.type,\n );\n if (!example.exampleVal && paramSchema.type === 'object') {\n example.exampleVal = generateExample(\n declaredParamSchema,\n serializeStyle || 'json',\n '',\n '',\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n true,\n 'text',\n false,\n )[0].exampleValue;\n }\n const labelColWidth = 'read focused'.includes(this.renderStyle) ? '200px' : '160px';\n tableRows.push(html`\n \n \n
\n ${param.deprecated ? html`` : ''}\n ${param.required ? html`*` : ''}\n ${param.name}\n
\n
\n ${paramSchema.type === 'array'\n ? `${paramSchema.arrayType}`\n : `${paramSchema.format ? paramSchema.format : paramSchema.type}`\n }\n
\n \n ${this.allowTry === 'true'\n ? html`\n \n ${paramSchema.type === 'array'\n ? html`\n \n `\n : paramSchema.type === 'object'\n ? html`\n
\n
{\n if (e.target.tagName.toLowerCase() === 'button') {\n const newState = { ...this.activeParameterSchemaTabs };\n newState[param.name] = e.target.dataset.tab;\n this.activeParameterSchemaTabs = newState;\n }\n }}\">\n \n \n
\n ${this.activeParameterSchemaTabs[param.name] === 'example'\n ? html`
\n \n
`\n : html`\n
\n \n
`\n }\n
`\n : html`\n `\n }\n `\n : ''\n }\n ${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues || paramSchema.pattern\n ? html`\n \n
\n ${paramSchema.default ? html`Default: ${paramSchema.default}
` : ''}\n ${paramSchema.pattern ? html`Pattern: ${paramSchema.pattern}
` : ''}\n ${paramSchema.constrain ? html`${paramSchema.constrain}
` : ''}\n ${paramSchema.allowedValues && paramSchema.allowedValues.split('┃').map((v, i) => html`\n ${i > 0 ? '┃' : html`Allowed: `}\n ${html`\n {\n const inputEl = e.target.closest('table').querySelector(`[data-pname=\"${param.name}\"]`);\n if (inputEl) {\n if (e.target.dataset.type === 'array') {\n inputEl.value = [e.target.dataset.enum];\n } else {\n inputEl.value = e.target.dataset.enum;\n }\n }\n }}\"\n >${v}`\n }`)}\n
\n `\n : html``\n }\n \n \n ${this.allowTry === 'true' ? html` ` : ''}\n \n ${unsafeHTML(marked(param.description || ''))}\n ${this.exampleListTemplate.call(this, param.name, paramSchema.type, example.exampleList)}\n \n \n `);\n }\n\n return html`\n
${title}
\n
\n \n ${tableRows}\n
\n
`;\n }\n\n // This method is called before navigation change in focusd mode\n async beforerNavigationFocusedMode() {\n // this.saveExampleState();\n }\n\n // This method is called after navigation change in focusd mode\n async afterNavigationFocusedMode() {\n this.selectedRequestBodyType = '';\n this.selectedRequestBodyExample = '';\n this.updateExamplesFromDataAttr();\n this.clearResponseData();\n }\n\n // Request-Body Event Handlers\n onSelectExample(e) {\n this.selectedRequestBodyExample = e.target.value;\n const exampleDropdownEl = e.target;\n window.setTimeout((selectEl) => {\n const readOnlyExampleEl = selectEl.closest('.example-panel').querySelector('.request-body-param');\n const userInputExampleTextareaEl = selectEl.closest('.example-panel').querySelector('.request-body-param-user-input');\n userInputExampleTextareaEl.value = readOnlyExampleEl.innerText;\n }, 0, exampleDropdownEl);\n }\n\n onMimeTypeChange(e) {\n this.selectedRequestBodyType = e.target.value;\n const mimeDropdownEl = e.target;\n this.selectedRequestBodyExample = '';\n window.setTimeout((selectEl) => {\n const readOnlyExampleEl = selectEl.closest('.request-body-container').querySelector('.request-body-param');\n if (readOnlyExampleEl) {\n const userInputExampleTextareaEl = selectEl.closest('.request-body-container').querySelector('.request-body-param-user-input');\n userInputExampleTextareaEl.value = readOnlyExampleEl.innerText;\n }\n }, 0, mimeDropdownEl);\n }\n\n requestBodyTemplate() {\n if (!this.request_body) {\n return '';\n }\n if (Object.keys(this.request_body).length === 0) {\n return '';\n }\n\n // Variable to store partial HTMLs\n let reqBodyTypeSelectorHtml = '';\n let reqBodyFileInputHtml = '';\n let reqBodyFormHtml = '';\n let reqBodySchemaHtml = '';\n let reqBodyExampleHtml = '';\n\n const requestBodyTypes = [];\n const { content } = this.request_body;\n for (const mimeType in content) {\n requestBodyTypes.push({\n mimeType,\n schema: content[mimeType].schema,\n example: content[mimeType].example,\n examples: content[mimeType].examples,\n });\n if (!this.selectedRequestBodyType) {\n this.selectedRequestBodyType = mimeType;\n }\n }\n // MIME Type selector\n reqBodyTypeSelectorHtml = requestBodyTypes.length === 1\n ? ''\n : html`\n \n `;\n\n // For Loop - Main\n requestBodyTypes.forEach((reqBody) => {\n let schemaAsObj;\n let reqBodyExamples = [];\n\n if (this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') || this.selectedRequestBodyType.includes('jose')) {\n // Generate Example\n if (reqBody.mimeType === this.selectedRequestBodyType) {\n reqBodyExamples = generateExample(\n reqBody.schema,\n reqBody.mimeType,\n reqBody.examples,\n reqBody.example,\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n 'text',\n false,\n );\n if (!this.selectedRequestBodyExample) {\n this.selectedRequestBodyExample = (reqBodyExamples.length > 0 ? reqBodyExamples[0].exampleId : '');\n }\n reqBodyExampleHtml = html`\n ${reqBodyExampleHtml}\n
\n ${reqBodyExamples.length === 1\n ? ''\n : html`\n \n `\n }\n ${reqBodyExamples\n .filter((v) => v.exampleId === this.selectedRequestBodyExample)\n .map((v) => html`\n
\n ${v.exampleSummary && v.exampleSummary.length > 80 ? html`
${v.exampleSummary}
` : ''}\n ${v.exampleDescription ? html`
${unsafeHTML(marked(v.exampleDescription || ''))}
` : ''}\n \n
${(v.exampleFormat === 'text' ? v.exampleValue : JSON.stringify(v.exampleValue, null, 2))}
\n\n \n \n
\n `)}\n\n
\n `;\n }\n } else if (this.selectedRequestBodyType.includes('form-urlencoded') || this.selectedRequestBodyType.includes('form-data')) {\n if (reqBody.mimeType === this.selectedRequestBodyType) {\n const ex = generateExample(\n reqBody.schema,\n reqBody.mimeType,\n reqBody.examples,\n reqBody.example,\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n 'text',\n false,\n );\n if (reqBody.schema) {\n reqBodyFormHtml = this.formDataTemplate(reqBody.schema, reqBody.mimeType, (ex[0] ? ex[0].exampleValue : ''));\n }\n }\n } else if ((/^audio\\/|^image\\/|^video\\/|^font\\/|tar$|zip$|7z$|rtf$|msword$|excel$|\\/pdf$|\\/octet-stream$/.test(this.selectedRequestBodyType))) {\n if (reqBody.mimeType === this.selectedRequestBodyType) {\n reqBodyFileInputHtml = html`\n
\n \n
\n `;\n }\n }\n\n // Generate Schema\n if (reqBody.mimeType.includes('json') || reqBody.mimeType.includes('xml') || reqBody.mimeType.includes('text') || this.selectedRequestBodyType.includes('jose')) {\n schemaAsObj = schemaInObjectNotation(reqBody.schema, {});\n if (this.schemaStyle === 'table') {\n reqBodySchemaHtml = html`\n ${reqBodySchemaHtml}\n \n `;\n } else if (this.schemaStyle === 'tree') {\n reqBodySchemaHtml = html`\n ${reqBodySchemaHtml}\n \n `;\n }\n }\n });\n\n return html`\n
\n
\n REQUEST BODY ${this.request_body.required ? html`*` : ''} \n ${this.selectedRequestBodyType}\n \n ${reqBodyTypeSelectorHtml}\n
\n ${this.request_body.description ? html`
${unsafeHTML(marked(this.request_body.description))}
` : ''}\n \n ${(this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') || this.selectedRequestBodyType.includes('jose'))\n ? html`\n
\n
{ if (e.target.tagName.toLowerCase() === 'button') { this.activeSchemaTab = e.target.dataset.tab; } }}\">\n \n \n
\n ${html`
${reqBodyExampleHtml}
`}\n ${html`
${reqBodySchemaHtml}
`}\n
`\n : html` \n ${reqBodyFileInputHtml}\n ${reqBodyFormHtml}`\n }\n
\n `;\n }\n\n formDataParamAsObjectTemplate(fieldName, fieldSchema, mimeType) {\n // This template is used when form-data param should be send as a object (application/json, application/xml)\n const formdataPartSchema = schemaInObjectNotation(fieldSchema, {});\n const formdataPartExample = generateExample(\n fieldSchema,\n 'json',\n fieldSchema.examples,\n fieldSchema.example,\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n 'text',\n false,\n );\n\n return html`\n
\n
\n
{\n if (e.target.classList.contains('v-tab-btn')) {\n const { tab } = e.target.dataset;\n if (tab) {\n const tabPanelEl = e.target.closest('.tab-panel');\n const selectedTabBtnEl = tabPanelEl.querySelector(`.v-tab-btn[data-tab=\"${tab}\"]`);\n const otherTabBtnEl = [...tabPanelEl.querySelectorAll(`.v-tab-btn:not([data-tab=\"${tab}\"])`)];\n const selectedTabContentEl = tabPanelEl.querySelector(`.tab-content[data-tab=\"${tab}\"]`);\n const otherTabContentEl = [...tabPanelEl.querySelectorAll(`.tab-content:not([data-tab=\"${tab}\"])`)];\n selectedTabBtnEl.classList.add('active');\n selectedTabContentEl.style.display = 'block';\n otherTabBtnEl.forEach((el) => { el.classList.remove('active'); });\n otherTabContentEl.forEach((el) => { el.style.display = 'none'; });\n }\n }\n if (e.target.tagName.toLowerCase() === 'button') { this.activeSchemaTab = e.target.dataset.tab; }\n }}\">\n \n \n
\n
\n ${html`\n
\n \n
`\n }\n ${html`\n
\n \n
`\n }\n
\n `;\n }\n\n formDataTemplate(schema, mimeType, exampleValue = '') {\n const formDataTableRows = [];\n if (schema.properties) {\n for (const fieldName in schema.properties) {\n const fieldSchema = schema.properties[fieldName];\n if (fieldSchema.readOnly) {\n continue;\n }\n const fieldExamples = fieldSchema.examples || fieldSchema.example || '';\n const fieldType = fieldSchema.type;\n const paramSchema = getTypeInfo(fieldSchema);\n const labelColWidth = 'read focused'.includes(this.renderStyle) ? '200px' : '160px';\n const example = normalizeExamples((paramSchema.examples || paramSchema.example), paramSchema.type);\n formDataTableRows.push(html`\n \n \n
\n ${fieldName}${(schema.required?.includes(fieldName) || fieldSchema.required) ? html`*` : ''}\n
\n
${paramSchema.type}
\n \n \n ${fieldType === 'array'\n ? fieldSchema.items?.format === 'binary'\n ? html`\n
this.onAddRemoveFileInput(e, fieldName, mimeType)}\">\n
\n \n \n
\n \n
\n `\n : html`\n \n \n `\n : html`\n ${fieldType === 'object'\n ? this.formDataParamAsObjectTemplate.call(this, fieldName, fieldSchema, mimeType)\n : html`\n ${this.allowTry === 'true'\n ? html``\n : ''\n }\n `\n }`\n }\n \n ${fieldType === 'object'\n ? ''\n : html`\n \n ${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues || paramSchema.pattern\n ? html`\n
\n ${paramSchema.default ? html`Default: ${paramSchema.default}
` : ''}\n ${paramSchema.pattern ? html`Pattern: ${paramSchema.pattern}
` : ''}\n ${paramSchema.constrain ? html`${paramSchema.constrain}
` : ''}\n ${paramSchema.allowedValues && paramSchema.allowedValues.split('┃').map((v, i) => html`\n ${i > 0 ? '┃' : html`Allowed: `}\n ${html`\n {\n const inputEl = e.target.closest('table').querySelector(`[data-pname=\"${fieldName}\"]`);\n if (inputEl) {\n if (e.target.dataset.type === 'array') {\n inputEl.value = [e.target.dataset.enum];\n } else {\n inputEl.value = e.target.dataset.enum;\n }\n }\n }}\"\n > \n ${v} \n `\n }`)\n }\n
`\n : ''\n }\n `\n }\n \n ${fieldType === 'object'\n ? ''\n : html`\n \n \n \n ${unsafeHTML(marked(fieldSchema.description || ''))}\n ${this.exampleListTemplate.call(this, fieldName, paramSchema.type, example.exampleList)}\n \n \n `\n }`);\n }\n return html`\n \n ${formDataTableRows}\n
\n `;\n }\n\n return html`\n \n ${schema.description ? html`${unsafeHTML(marked(schema.description))}` : ''}\n `;\n }\n\n apiResponseTabTemplate() {\n let responseFormat = '';\n let responseContent = '';\n if (!this.responseIsBlob) {\n if (this.responseHeaders.includes('application/x-ndjson')) {\n responseFormat = 'json';\n const prismLines = this.responseText.split('\\n').map((q) => Prism.highlight(q, Prism.languages[responseFormat], responseFormat)).join('\\n');\n responseContent = html`${unsafeHTML(prismLines)}`;\n } else if (this.responseHeaders.includes('json')) {\n responseFormat = 'json';\n responseContent = html`${unsafeHTML(Prism.highlight(this.responseText, Prism.languages[responseFormat], responseFormat))}`;\n } else if (this.responseHeaders.includes('html') || this.responseHeaders.includes('xml')) {\n responseFormat = 'html';\n responseContent = html`${unsafeHTML(Prism.highlight(this.responseText, Prism.languages[responseFormat], responseFormat))}`;\n } else {\n responseFormat = 'text';\n responseContent = html`${this.responseText}`;\n }\n }\n return html`\n
\n
Response Status: ${this.responseMessage}
\n
\n \n
\n
\n
{\n if (e.target.classList.contains('tab-btn') === false) { return; }\n this.activeResponseTab = e.target.dataset.tab;\n }}\">\n \n \n \n
\n ${this.responseIsBlob\n ? html`\n
\n \n ${this.responseBlobType === 'view'\n ? html``\n : ''\n }\n
`\n : html`\n
\n \n
${responseContent}
\n
`\n }\n
\n \n
${unsafeHTML(Prism.highlight(this.responseHeaders, Prism.languages.css, 'css'))}
\n
\n
\n \n
${unsafeHTML(Prism.highlight(this.curlSyntax.trim().replace(/\\\\$/, ''), Prism.languages.shell, 'shell'))}
\n
\n
`;\n }\n\n apiCallTemplate() {\n let selectServerDropdownHtml = '';\n\n if (this.servers && this.servers.length > 0) {\n selectServerDropdownHtml = html`\n \n `;\n }\n const selectedServerHtml = html`\n
\n ${selectServerDropdownHtml}\n ${this.serverUrl\n ? html`\n
\n
API Server
\n ${this.serverUrl} \n
\n `\n : ''\n }\n
\n `;\n\n return html`\n
\n
\n
\n ${selectedServerHtml}\n
\n
\n
Authentication
\n ${this.security?.length > 0\n ? html`\n ${this.api_keys.length > 0\n ? html`
\n ${this.api_keys.length === 1\n ? `${this.api_keys[0]?.typeDisplay} in ${this.api_keys[0].in}`\n : `${this.api_keys.length} API keys applied`\n } \n
`\n : html`
Required (None Applied)`\n }`\n : html` Not Required `\n }\n
\n
\n ${\n this.parameters.length > 0 || this.request_body\n ? html`\n \n `\n : ''\n }\n \n
\n ${this.responseMessage === '' ? '' : this.apiResponseTabTemplate()}\n `;\n }\n /* eslint-enable indent */\n\n async onFillRequestData(e) {\n const requestPanelEl = e.target.closest('.request-panel');\n const requestPanelInputEls = [...requestPanelEl.querySelectorAll('input, tag-input, textarea:not(.is-hidden)')];\n requestPanelInputEls.forEach((el) => {\n if (el.dataset.example) {\n if (el.tagName.toUpperCase() === 'TAG-INPUT') {\n el.value = el.dataset.example.split('~|~');\n } else {\n el.value = el.dataset.example;\n }\n }\n });\n }\n\n async onClearRequestData(e) {\n const requestPanelEl = e.target.closest('.request-panel');\n const requestPanelInputEls = [...requestPanelEl.querySelectorAll('input, tag-input, textarea:not(.is-hidden)')];\n requestPanelInputEls.forEach((el) => { el.value = ''; });\n }\n\n async onTryClick(e) {\n // const me = this;\n const tryBtnEl = e.target;\n let fetchUrl;\n let curlUrl;\n let curl = '';\n let curlHeaders = '';\n let curlData = '';\n let curlForm = '';\n const respEl = this.closest('.expanded-req-resp-container, .req-resp-container')?.getElementsByTagName('api-response')[0];\n const acceptHeader = respEl?.selectedMimeType;\n const requestPanelEl = e.target.closest('.request-panel');\n const pathParamEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='path']\")];\n const queryParamEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='query']\")];\n const queryParamObjTypeEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='query-object']\")];\n const headerParamEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='header']\")];\n const requestBodyContainerEl = requestPanelEl.querySelector('.request-body-container');\n fetchUrl = this.path;\n const fetchOptions = {\n method: this.method.toUpperCase(),\n };\n // Generate URL using Path Params\n pathParamEls.map((el) => {\n fetchUrl = fetchUrl.replace(`{${el.dataset.pname}}`, encodeURIComponent(el.value));\n });\n\n // Query Params\n const urlQueryParamsMap = new Map();\n const queryParamsWithReservedCharsAllowed = [];\n if (queryParamEls.length > 0) {\n queryParamEls.forEach((el) => {\n const queryParam = new URLSearchParams();\n if (el.dataset.paramAllowReserved === 'true') {\n queryParamsWithReservedCharsAllowed.push(el.dataset.pname);\n }\n if (el.dataset.array === 'false') {\n if (el.value !== '') {\n queryParam.append(el.dataset.pname, el.value);\n }\n } else {\n const { paramSerializeStyle, paramSerializeExplode } = el.dataset;\n let vals = ((el.value && Array.isArray(el.value)) ? el.value : []);\n vals = Array.isArray(vals) ? vals.filter((v) => v !== '') : [];\n if (vals.length > 0) {\n if (paramSerializeStyle === 'spaceDelimited') {\n queryParam.append(el.dataset.pname, vals.join(' ').replace(/^\\s|\\s$/g, ''));\n } else if (paramSerializeStyle === 'pipeDelimited') {\n queryParam.append(el.dataset.pname, vals.join('|').replace(/^\\||\\|$/g, ''));\n } else {\n if (paramSerializeExplode === 'true') { // eslint-disable-line no-lonely-if\n vals.forEach((v) => { queryParam.append(el.dataset.pname, v); });\n } else {\n queryParam.append(el.dataset.pname, vals.join(',').replace(/^,|,$/g, ''));\n }\n }\n }\n }\n if (queryParam.toString()) {\n urlQueryParamsMap.set(el.dataset.pname, queryParam);\n }\n });\n }\n\n // Query Params (Dynamic - create from JSON)\n if (queryParamObjTypeEls.length > 0) {\n queryParamObjTypeEls.map((el) => {\n const queryParam = new URLSearchParams();\n try {\n let queryParamObj = {};\n const { paramSerializeStyle, paramSerializeExplode } = el.dataset;\n queryParamObj = Object.assign(queryParamObj, JSON.parse(el.value.replace(/\\s+/g, ' ')));\n if (el.dataset.paramAllowReserved === 'true') {\n queryParamsWithReservedCharsAllowed.push(el.dataset.pname);\n }\n if ('json xml'.includes(paramSerializeStyle)) {\n if (paramSerializeStyle === 'json') {\n queryParam.append(el.dataset.pname, JSON.stringify(queryParamObj));\n } else if (paramSerializeStyle === 'xml') {\n queryParam.append(el.dataset.pname, json2xml(queryParamObj));\n }\n } else {\n for (const key in queryParamObj) {\n if (typeof queryParamObj[key] === 'object') {\n if (Array.isArray(queryParamObj[key])) {\n if (paramSerializeStyle === 'spaceDelimited') {\n queryParam.append(key, queryParamObj[key].join(' '));\n } else if (paramSerializeStyle === 'pipeDelimited') {\n queryParam.append(key, queryParamObj[key].join('|'));\n } else {\n if (paramSerializeExplode === 'true') { // eslint-disable-line no-lonely-if\n queryParamObj[key].forEach((v) => {\n queryParam.append(key, v);\n });\n } else {\n queryParam.append(key, queryParamObj[key]);\n }\n }\n }\n } else {\n queryParam.append(key, queryParamObj[key]);\n }\n }\n }\n } catch (err) {\n console.log('RapiDoc: unable to parse %s into object', el.value); // eslint-disable-line no-console\n }\n if (queryParam.toString()) {\n urlQueryParamsMap.set(el.dataset.pname, queryParam);\n }\n });\n }\n let urlQueryParamString = '';\n if (urlQueryParamsMap.size) {\n urlQueryParamString = '?';\n urlQueryParamsMap.forEach((val, pname) => {\n if (queryParamsWithReservedCharsAllowed.includes(pname)) {\n urlQueryParamString += `${pname}=`;\n urlQueryParamString += val.getAll(pname).join(`&${pname}=`);\n urlQueryParamString += '&';\n } else {\n urlQueryParamString += `${val.toString()}&`;\n }\n });\n urlQueryParamString = urlQueryParamString.slice(0, -1);\n }\n fetchUrl = `${fetchUrl}${urlQueryParamString}`;\n\n // Add authentication Query-Param if provided\n this.api_keys\n .filter((v) => (v.in === 'query'))\n .forEach((v) => {\n fetchUrl = `${fetchUrl}${fetchUrl.includes('?') ? '&' : '?'}${v.name}=${encodeURIComponent(v.finalKeyValue)}`;\n });\n\n // Final URL for API call\n fetchUrl = `${this.serverUrl.replace(/\\/$/, '')}${fetchUrl}`;\n if (fetchUrl.startsWith('http') === false) {\n const url = new URL(fetchUrl, window.location.href);\n curlUrl = url.href;\n } else {\n curlUrl = fetchUrl;\n }\n curl = `curl -X ${this.method.toUpperCase()} \"${curlUrl}\" \\\\\\n`;\n const reqHeaders = new Headers();\n if (acceptHeader) {\n // Uses the acceptHeader from Response panel\n reqHeaders.append('Accept', acceptHeader);\n curlHeaders += ` -H \"Accept: ${acceptHeader}\" \\\\\\n`;\n } else if (this.accept) {\n reqHeaders.append('Accept', this.accept);\n curlHeaders += ` -H \"Accept: ${this.accept}\" \\\\\\n`;\n }\n\n // Add Authentication Header if provided\n this.api_keys\n .filter((v) => (v.in === 'header'))\n .forEach((v) => {\n reqHeaders.append(v.name, v.finalKeyValue);\n curlHeaders += ` -H \"${v.name}: ${v.finalKeyValue}\" \\\\\\n`;\n });\n\n // Add Header Params\n headerParamEls.map((el) => {\n if (el.value) {\n reqHeaders.append(el.dataset.pname, el.value);\n curlHeaders += ` -H \"${el.dataset.pname}: ${el.value}\" \\\\\\n`;\n }\n });\n\n // Request Body Params\n if (requestBodyContainerEl) {\n const requestBodyType = requestBodyContainerEl.dataset.selectedRequestBodyType;\n if (requestBodyType.includes('form-urlencoded')) {\n // url-encoded Form Params (dynamic) - Parse JSON and generate Params\n const formUrlDynamicTextAreaEl = requestPanelEl.querySelector(\"[data-ptype='dynamic-form']\");\n if (formUrlDynamicTextAreaEl) {\n const val = formUrlDynamicTextAreaEl.value;\n const formUrlDynParams = new URLSearchParams();\n let proceed = true;\n let tmpObj;\n if (val) {\n try {\n tmpObj = JSON.parse(val);\n } catch (err) {\n proceed = false;\n console.warn('RapiDoc: Invalid JSON provided', err); // eslint-disable-line no-console\n }\n } else {\n proceed = false;\n }\n if (proceed) {\n for (const prop in tmpObj) {\n formUrlDynParams.append(prop, JSON.stringify(tmpObj[prop]));\n }\n fetchOptions.body = formUrlDynParams;\n curlData = ` -d ${formUrlDynParams.toString()} \\\\\\n`;\n }\n } else {\n // url-encoded Form Params (regular)\n const formUrlEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='form-urlencode']\")];\n const formUrlParams = new URLSearchParams();\n formUrlEls\n .filter((v) => (v.type !== 'file'))\n .forEach((el) => {\n if (el.dataset.array === 'false') {\n if (el.value) {\n formUrlParams.append(el.dataset.pname, el.value);\n }\n } else {\n const vals = (el.value && Array.isArray(el.value)) ? el.value.join(',') : '';\n formUrlParams.append(el.dataset.pname, vals);\n }\n });\n fetchOptions.body = formUrlParams;\n curlData = ` -d ${formUrlParams.toString()} \\\\\\n`;\n }\n } else if (requestBodyType.includes('form-data')) {\n const formDataParams = new FormData();\n const formDataEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='form-data']\")];\n formDataEls.forEach((el) => {\n if (el.dataset.array === 'false') {\n if (el.type === 'file' && el.files[0]) {\n formDataParams.append(el.dataset.pname, el.files[0], el.files[0].name);\n curlForm += ` -F \"${el.dataset.pname}=@${el.files[0].name}\" \\\\\\n`;\n } else if (el.value) {\n formDataParams.append(el.dataset.pname, el.value);\n curlForm += ` -F \"${el.dataset.pname}=${el.value}\" \\\\\\n`;\n }\n } else if (el.value && Array.isArray(el.value)) {\n el.value.forEach((v) => {\n curlForm = `${curlForm} -F \"${el.dataset.pname}[]=${v}\" \\\\\\n`;\n });\n formDataParams.append(el.dataset.pname, el.value.join(','));\n }\n });\n fetchOptions.body = formDataParams;\n } else if (/^audio\\/|^image\\/|^video\\/|^font\\/|tar$|zip$|7z$|rtf$|msword$|excel$|\\/pdf$|\\/octet-stream$/.test(requestBodyType)) {\n const bodyParamFileEl = requestPanelEl.querySelector('.request-body-param-file');\n if (bodyParamFileEl?.files[0]) {\n fetchOptions.body = bodyParamFileEl.files[0]; // eslint-disable-line prefer-destructuring\n curlData = ` --data-binary @${bodyParamFileEl.files[0].name} \\\\\\n`;\n }\n } else if (requestBodyType.includes('json') || requestBodyType.includes('xml') || requestBodyType.includes('text')) {\n const exampleTextAreaEl = requestPanelEl.querySelector('.request-body-param-user-input');\n if (exampleTextAreaEl?.value) {\n fetchOptions.body = exampleTextAreaEl.value;\n if (requestBodyType.includes('json')) {\n try {\n curlData = ` -d '${JSON.stringify(JSON.parse(exampleTextAreaEl.value))}' \\\\\\n`;\n } catch (err) {\n // Ignore.\n }\n }\n if (!curlData) {\n curlData = ` -d '${exampleTextAreaEl.value.replace(/'/g, '\\'\"\\'\"\\'')}' \\\\\\n`;\n }\n }\n }\n // Common for all request-body\n if (!requestBodyType.includes('form-data')) {\n // For multipart/form-data dont set the content-type to allow creation of browser generated part boundaries\n reqHeaders.append('Content-Type', requestBodyType);\n }\n curlHeaders += ` -H \"Content-Type: ${requestBodyType}\" \\\\\\n`;\n }\n this.responseUrl = '';\n this.responseHeaders = [];\n this.curlSyntax = '';\n this.responseStatus = 'success';\n this.responseIsBlob = false;\n\n this.respContentDisposition = '';\n if (this.responseBlobUrl) {\n URL.revokeObjectURL(this.responseBlobUrl);\n this.responseBlobUrl = '';\n }\n this.curlSyntax = `${curl}${curlHeaders}${curlData}${curlForm}`;\n if (this.fetchCredentials) {\n fetchOptions.credentials = this.fetchCredentials;\n }\n const controller = new AbortController();\n const { signal } = controller;\n fetchOptions.headers = reqHeaders;\n const tempRequest = { url: fetchUrl, ...fetchOptions };\n this.dispatchEvent(new CustomEvent('before-try', {\n bubbles: true,\n composed: true,\n detail: {\n request: tempRequest,\n controller,\n },\n }));\n const updatedFetchOptions = {\n method: tempRequest.method,\n headers: tempRequest.headers,\n credentials: tempRequest.credentials,\n body: tempRequest.body,\n };\n const fetchRequest = new Request(tempRequest.url, updatedFetchOptions);\n\n let fetchResponse;\n let responseClone;\n try {\n let respBlob;\n let respJson;\n let respText;\n tryBtnEl.disabled = true;\n this.responseText = '⌛';\n this.responseMessage = '';\n this.requestUpdate();\n const startTime = performance.now();\n fetchResponse = await fetch(fetchRequest, { signal });\n const endTime = performance.now();\n responseClone = fetchResponse.clone(); // create a response clone to allow reading response body again (response.json, response.text etc)\n tryBtnEl.disabled = false;\n this.responseMessage = html`${fetchResponse.statusText ? `${fetchResponse.statusText}:${fetchResponse.status}` : fetchResponse.status}
Took ${Math.round(endTime - startTime)} milliseconds
`;\n this.responseUrl = fetchResponse.url;\n const respHeadersObj = {};\n fetchResponse.headers.forEach((hdrVal, hdr) => {\n respHeadersObj[hdr] = hdrVal;\n this.responseHeaders = `${this.responseHeaders}${hdr}: ${hdrVal}\\n`;\n });\n const contentType = fetchResponse.headers.get('content-type');\n const respEmpty = (await fetchResponse.clone().text()).length === 0;\n if (respEmpty) {\n this.responseText = '';\n } else if (contentType) {\n if (contentType === 'application/x-ndjson') {\n this.responseText = await fetchResponse.text();\n } else if (contentType.includes('json')) {\n if ((/charset=[^\"']+/).test(contentType)) {\n const encoding = contentType.split('charset=')[1];\n const buffer = await fetchResponse.arrayBuffer();\n try {\n respText = new TextDecoder(encoding).decode(buffer);\n } catch {\n respText = new TextDecoder('utf-8').decode(buffer);\n }\n try {\n respJson = JSON.parse(respText);\n this.responseText = JSON.stringify(respJson, null, 2);\n } catch {\n this.responseText = respText;\n }\n } else {\n respJson = await fetchResponse.json();\n this.responseText = JSON.stringify(respJson, null, 2);\n }\n // eslint-disable-next-line no-useless-escape\n } else if (/^font\\/|tar$|zip$|7z$|rtf$|msword$|excel$|\\/pdf$|\\/octet-stream$|^application\\/vnd\\./.test(contentType)) {\n this.responseIsBlob = true;\n this.responseBlobType = 'download';\n } else if (/^audio|^image|^video/.test(contentType)) {\n this.responseIsBlob = true;\n this.responseBlobType = 'view';\n } else {\n respText = await fetchResponse.text();\n if (contentType.includes('xml')) {\n this.responseText = formatXml(respText, { textNodesOnSameLine: true, indentor: ' ' });\n } else {\n this.responseText = respText;\n }\n }\n if (this.responseIsBlob) {\n const contentDisposition = fetchResponse.headers.get('content-disposition');\n this.respContentDisposition = contentDisposition ? contentDisposition.split('filename=')[1].replace(/\"|'/g, '') : 'filename';\n respBlob = await fetchResponse.blob();\n this.responseBlobUrl = URL.createObjectURL(respBlob);\n }\n } else {\n respText = await fetchResponse.text();\n this.responseText = respText;\n }\n this.dispatchEvent(new CustomEvent('after-try', {\n bubbles: true,\n composed: true,\n detail: {\n request: fetchRequest,\n response: responseClone,\n responseHeaders: respHeadersObj,\n responseBody: respJson || respText || respBlob,\n responseStatus: responseClone.ok,\n },\n }));\n } catch (err) {\n tryBtnEl.disabled = false;\n if (err.name === 'AbortError') {\n this.dispatchEvent(new CustomEvent('request-aborted', {\n bubbles: true,\n composed: true,\n detail: {\n err,\n request: fetchRequest,\n },\n }));\n this.responseMessage = 'Request Aborted';\n this.responseText = 'Request Aborted';\n } else {\n this.dispatchEvent(new CustomEvent('after-try', {\n bubbles: true,\n composed: true,\n detail: {\n err,\n request: fetchRequest,\n },\n }));\n this.responseMessage = `${err.message} (CORS or Network Issue)`;\n }\n }\n this.requestUpdate();\n }\n\n onAddRemoveFileInput(e, pname, ptype) {\n if (e.target.tagName.toLowerCase() !== 'button') {\n return;\n }\n\n if (e.target.classList.contains('file-input-remove-btn')) {\n // Remove File Input Set\n const el = e.target.closest('.input-set');\n el.remove();\n return;\n }\n const el = e.target.closest('.file-input-container');\n\n // Add File Input Set\n\n // Container\n const newInputContainerEl = document.createElement('div');\n newInputContainerEl.setAttribute('class', 'input-set row');\n\n // File Input\n const newInputEl = document.createElement('input');\n newInputEl.type = 'file';\n newInputEl.style = 'width:200px; margin-top:2px;';\n newInputEl.setAttribute('data-pname', pname);\n newInputEl.setAttribute('data-ptype', ptype.includes('form-urlencode') ? 'form-urlencode' : 'form-data');\n newInputEl.setAttribute('data-array', 'false');\n newInputEl.setAttribute('data-file-array', 'true');\n\n // Remover Button\n const newRemoveBtnEl = document.createElement('button');\n newRemoveBtnEl.setAttribute('class', 'file-input-remove-btn');\n newRemoveBtnEl.innerHTML = '✕';\n\n newInputContainerEl.appendChild(newInputEl);\n newInputContainerEl.appendChild(newRemoveBtnEl);\n el.insertBefore(newInputContainerEl, e.target);\n // el.appendChild(newInputContainerEl);\n }\n\n clearResponseData() {\n this.responseUrl = '';\n this.responseHeaders = '';\n this.responseText = '';\n this.responseStatus = 'success';\n this.responseMessage = '';\n this.responseIsBlob = false;\n this.responseBlobType = '';\n this.respContentDisposition = '';\n if (this.responseBlobUrl) {\n URL.revokeObjectURL(this.responseBlobUrl);\n this.responseBlobUrl = '';\n }\n }\n\n disconnectedCallback() {\n // Cleanup ObjectURL forthe blob data if this component created one\n if (this.responseBlobUrl) {\n URL.revokeObjectURL(this.responseBlobUrl);\n this.responseBlobUrl = '';\n }\n super.disconnectedCallback();\n }\n}\n\n// Register the element with the browser\ncustomElements.define('api-request', ApiRequest);\n","import { LitElement, html, css } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport FontStyles from '~/styles/font-styles';\nimport SchemaStyles from '~/styles/schema-styles';\nimport CustomStyles from '~/styles/custom-styles';\n\nexport default class SchemaTable extends LitElement {\n static get properties() {\n return {\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n data: { type: Object },\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true false'.includes(this.schemaDescriptionExpanded)) { this.schemaDescriptionExpanded = 'false'; }\n if (!this.schemaHideReadOnly || !'true false'.includes(this.schemaHideReadOnly)) { this.schemaHideReadOnly = 'true'; }\n if (!this.schemaHideWriteOnly || !'true false'.includes(this.schemaHideWriteOnly)) { this.schemaHideWriteOnly = 'true'; }\n }\n\n static get styles() {\n return [\n FontStyles,\n SchemaStyles,\n css`\n .table {\n font-size: var(--font-size-small);\n text-align: left;\n line-height: calc(var(--font-size-small) + 6px);\n }\n .table .tr {\n width: calc(100% - 5px);\n padding: 0 0 0 5px;\n border-bottom: 1px dotted var(--light-border-color);\n }\n .table .td {\n padding: 4px 0;\n }\n .table .key {\n width: 240px;\n }\n .key.deprecated .key-label {\n color: var(--red);\n }\n\n .table .key-type {\n white-space: normal;\n width: 150px;\n }\n .collapsed-descr .tr {\n max-height: calc(var(--font-size-small) + var(--font-size-small) + 4px);\n }\n\n .obj-toggle {\n padding: 0 2px;\n border-radius:2px;\n border: 1px solid transparent;\n display: inline-block;\n margin-left: -16px;\n color:var(--primary-color);\n cursor:pointer;\n font-size: calc(var(--font-size-small) + 4px);\n font-family: var(--font-mono);\n background-clip: border-box;\n }\n .obj-toggle:hover {\n border-color: var(--primary-color);\n }\n .tr.expanded + .object-body {\n display:block;\n }\n .tr.collapsed + .object-body {\n display:none;\n }`,\n CustomStyles,\n ];\n }\n\n /* eslint-disable indent */\n render() {\n return html`\n
\n
\n
${this.data?.['::type'] || ''}
\n ${this.allowSchemaDescriptionExpandToggle === 'true'\n ? html`\n
\n
\n ${this.schemaDescriptionExpanded === 'true' ? 'Single line description' : 'Multiline description'}\n
\n `\n : ''\n }\n
\n ${unsafeHTML(marked(this.data?.['::description'] || ''))}\n
\n
\n
Field
\n
Type
\n
Description
\n
\n ${this.data\n ? html`\n ${this.generateTree(\n this.data['::type'] === 'array' ? this.data['::props'] : this.data,\n this.data['::type'],\n this.data['::array-type'],\n )}`\n : ''\n } \n
\n
\n `;\n }\n\n generateTree(data, dataType = 'object', arrayType = '', key = '', description = '', schemaLevel = 0, indentLevel = 0, readOrWrite = '') {\n if (this.schemaHideReadOnly === 'true') {\n if (dataType === 'array') {\n if (readOrWrite === 'readonly') {\n return;\n }\n }\n if (data && data['::readwrite'] === 'readonly') {\n return;\n }\n }\n if (this.schemaHideWriteOnly === 'true') {\n if (dataType === 'array') {\n if (readOrWrite === 'writeonly') {\n return;\n }\n }\n if (data && data['::readwrite'] === 'writeonly') {\n return;\n }\n }\n if (!data) {\n return html`
\n   \n ${key.replace('::OPTION~', '')}\n ${\n dataType === 'array'\n ? html` [ ] `\n : dataType === 'object'\n ? html` { } `\n : html` schema undefined `\n }\n
`;\n }\n\n const newSchemaLevel = data['::type']?.startsWith('xxx-of') ? schemaLevel : (schemaLevel + 1);\n const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : (indentLevel + 1);\n const leftPadding = 16 * newIndentLevel; // 2 space indentation at each level\n if (Object.keys(data).length === 0) {\n return html`${key}`;\n }\n let keyLabel = '';\n let keyDescr = '';\n let isOneOfLabel = false;\n if (key.startsWith('::ONE~OF') || key.startsWith('::ANY~OF')) {\n keyLabel = key.replace('::', '').replace('~', ' ');\n isOneOfLabel = true;\n } else if (key.startsWith('::OPTION')) {\n const parts = key.split('~');\n keyLabel = parts[1]; // eslint-disable-line prefer-destructuring\n keyDescr = parts[2]; // eslint-disable-line prefer-destructuring\n } else {\n keyLabel = key;\n }\n\n let detailObjType = '';\n if (data['::type'] === 'object') {\n if (dataType === 'array') {\n detailObjType = 'array of object'; // Array of Object\n } else {\n detailObjType = data['::dataTypeLabel'] || data['::type'];\n }\n } else if (data['::type'] === 'array') {\n if (dataType === 'array') {\n // detailObjType = 'array of array'; // Array of array\n detailObjType = `array of array ${arrayType !== 'object' ? `of ${arrayType}` : ''}`; // Array of array\n } else {\n detailObjType = data['::dataTypeLabel'] || data['::type'];\n }\n }\n\n if (typeof data === 'object') {\n return html`\n ${newSchemaLevel >= 0 && key\n ? html`\n
\n
\n ${(keyLabel || keyDescr)\n ? html`\n this.toggleObjectExpand(e, keyLabel)} \n >\n ${schemaLevel < this.schemaExpandLevel ? '-' : '+'}\n `\n : ''\n }\n ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION')\n ? html`${keyLabel}${keyDescr}`\n : keyLabel.endsWith('*')\n ? html`${data['::deprecated'] ? '✗' : ''} ${keyLabel.substring(0, keyLabel.length - 1)}*`\n : html`${data['::deprecated'] ? '✗' : ''} ${keyLabel === '::props' ? '' : keyLabel}`\n }\n ${data['::type'] === 'xxx-of' && dataType === 'array' ? html`ARRAY` : ''} \n
\n
\n ${(data['::type'] || '').includes('xxx-of') ? '' : detailObjType}\n ${data['::readwrite'] === 'readonly' ? ' 🆁' : data['::readwrite'] === 'writeonly' ? ' 🆆' : ''}\n
\n
${unsafeHTML(marked(description || ''))}
\n
`\n : html`\n ${data['::type'] === 'array' && dataType === 'array'\n ? html`\n
\n
\n
\n ${arrayType && arrayType !== 'object' ? `${dataType} of ${arrayType}` : dataType}\n
\n
\n
`\n : ''\n }\n `\n }\n
\n ${Array.isArray(data) && data[0]\n ? html`${this.generateTree(data[0], 'xxx-of-option', '', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel, '')}`\n : html`\n ${Object.keys(data).map((dataKey) => html`\n ${['::title', '::description', '::type', '::props', '::deprecated', '::array-type', '::readwrite', '::dataTypeLabel'].includes(dataKey)\n ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object'\n ? html`${this.generateTree(\n data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey],\n data[dataKey]['::type'],\n data[dataKey]['::array-type'] || '',\n dataKey,\n data[dataKey]['::description'],\n newSchemaLevel,\n newIndentLevel,\n data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '',\n )}`\n : ''\n : html`${this.generateTree(\n data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey],\n data[dataKey]['::type'],\n data[dataKey]['::array-type'] || '',\n dataKey,\n data[dataKey]?.['::description'] || '',\n newSchemaLevel,\n newIndentLevel,\n data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '',\n )}`\n }\n `)}\n `\n }\n
\n `;\n }\n\n // For Primitive Data types\n // eslint-disable-next-line no-unused-vars\n const [type, readOrWriteOnly, constraint, defaultValue, allowedValues, pattern, schemaDescription, schemaTitle, deprecated] = data.split('~|~');\n if (readOrWriteOnly === '🆁' && this.schemaHideReadOnly === 'true') {\n return;\n }\n if (readOrWriteOnly === '🆆' && this.schemaHideWriteOnly === 'true') {\n return;\n }\n const dataTypeCss = type.replace(/┃.*/g, '').replace(/[^a-zA-Z0-9+]/g, '').substring(0, 4).toLowerCase();\n let dataTypeHtml = '';\n if (dataType === 'array') {\n dataTypeHtml = html` \n
\n [${type}] ${readOrWrite === 'readonly' ? '🆁' : readOrWrite === 'writeonly' ? '🆆' : ''}\n
`;\n } else {\n dataTypeHtml = html` \n
\n ${type} ${readOrWriteOnly}\n
`;\n }\n return html`\n
\n
\n ${deprecated ? html`` : ''}\n ${keyLabel?.endsWith('*')\n ? html`\n ${keyLabel.substring(0, keyLabel.length - 1)}\n *`\n : key.startsWith('::OPTION')\n ? html`${keyLabel}${keyDescr}`\n : html`${keyLabel ? html` ${keyLabel}` : html`${schemaTitle}`}`\n }\n
\n ${dataTypeHtml}\n
{ this.schemaDescriptionExpanded = 'true'; }}\">\n ${html`${unsafeHTML(marked(dataType === 'array' ? description : schemaDescription))}`}\n ${constraint ? html`
Constraints: ${constraint}
` : ''}\n ${defaultValue ? html`
Default: ${defaultValue}
` : ''}\n ${allowedValues ? html`
${type === 'const' ? 'Value' : 'Allowed'}: ${allowedValues}
` : ''}\n ${pattern ? html`
Pattern: ${pattern}
` : ''}\n
\n
\n `;\n }\n /* eslint-enable indent */\n\n toggleObjectExpand(e) {\n const rowEl = e.target.closest('.tr');\n if (rowEl.classList.contains('expanded')) {\n rowEl.classList.add('collapsed');\n rowEl.classList.remove('expanded');\n e.target.innerText = '+';\n } else {\n rowEl.classList.remove('collapsed');\n rowEl.classList.add('expanded');\n e.target.innerText = '-';\n }\n }\n}\ncustomElements.define('schema-table', SchemaTable);\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { rapidocApiKey } from '~/utils/common-utils';\nimport { pathSecurityTemplate } from '~/templates/security-scheme-template';\nimport codeSamplesTemplate from '~/templates/code-samples-template';\nimport callbackTemplate from '~/templates/callback-template';\nimport '~/components/api-request';\nimport '~/components/api-response';\n\n/* eslint-disable indent */\nfunction headingRenderer(tagElementId) {\n const renderer = new marked.Renderer();\n renderer.heading = ((text, level, raw, slugger) => `${text}`);\n return renderer;\n}\n\nfunction expandCollapseTagDescription(e) {\n const tagDescriptionEl = e.target.closest('.tag-container').querySelector('.tag-description');\n const tagIconEl = e.target.closest('.tag-container').querySelector('.tag-icon');\n if (tagDescriptionEl && tagIconEl) {\n const isExpanded = tagDescriptionEl.classList.contains('expanded');\n if (isExpanded) {\n tagDescriptionEl.style.maxHeight = 0;\n tagDescriptionEl.classList.replace('expanded', 'collapsed');\n tagIconEl.classList.replace('expanded', 'collapsed');\n } else {\n tagDescriptionEl.style.maxHeight = `${tagDescriptionEl.scrollHeight}px`;\n tagDescriptionEl.classList.replace('collapsed', 'expanded');\n tagIconEl.classList.replace('collapsed', 'expanded');\n }\n }\n}\n\nexport function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') {\n const acceptContentTypes = new Set();\n for (const respStatus in path.responses) {\n for (const acceptContentType in (path.responses[respStatus]?.content)) {\n acceptContentTypes.add(acceptContentType.trim());\n }\n }\n const accept = [...acceptContentTypes].join(', ');\n\n // Filter API Keys that are non-empty and are applicable to the the path\n const nonEmptyApiKeys = this.resolvedSpec.securitySchemes.filter((v) => (v.finalKeyValue && path.security?.some((ps) => (v.securitySchemeId in ps)))) || [];\n\n // If a RapiDoc API Key is specified on the element and its value is not hyphen(-) then include it for all paths\n const rapiDocApiKey = this.resolvedSpec.securitySchemes.find((v) => (v.securitySchemeId === rapidocApiKey && v.value !== '-'));\n if (rapiDocApiKey) {\n nonEmptyApiKeys.push(rapiDocApiKey);\n }\n\n const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate.call(this, path.xCodeSamples) : '';\n return html`\n ${this.renderStyle === 'read' ? html`
` : ''}\n
\n ${(this.renderStyle === 'focused' && tagName !== 'General ⦂')\n ? html`\n
\n ${tagName} \n ${tagDescription\n ? html`\n { expandCollapseTagDescription.call(this, e); }}\"\n >\n \n \n
\n
${unsafeHTML(marked(tagDescription))}
\n
`\n : ''\n } \n
\n `\n : ''\n }\n ${path.deprecated ? html`
DEPRECATED
` : ''}\n ${html`\n ${path.xBadges && path.xBadges?.length > 0\n ? html`\n
\n ${path.xBadges.map((v) => (\n html`${v.label}`\n ))\n }\n
\n `\n : ''\n }\n

${path.shortSummary || `${path.method.toUpperCase()} ${path.path}`}

\n ${path.isWebhook\n ? html` WEBHOOK `\n : html`\n
\n ${path.method} \n ${path.path}\n
\n `\n }\n `\n }\n ${path.description ? html`
${unsafeHTML(marked(path.description))}
` : ''}\n ${path.externalDocs?.url || path.externalDocs?.description\n ? html`
\n
${unsafeHTML(marked(path.externalDocs?.description || ''))}
\n ${path.externalDocs?.url\n ? html``\n : ''\n }\n
`\n : ''\n }\n ${pathSecurityTemplate.call(this, path.security)}\n ${codeSampleTabPanel}\n
\n \n\n ${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}\n\n \n
\n
\n `;\n}\n\nexport default function expandedEndpointTemplate() {\n if (!this.resolvedSpec) { return ''; }\n return html`\n ${this.resolvedSpec.tags.map((tag) => html`\n
\n
${tag.name}
\n \n
\n ${\n unsafeHTML(`\n
\n ${marked(tag.description || '', this.infoDescriptionHeadingsInNavBar === 'true' ? { renderer: headingRenderer(tag.elementId) } : undefined)}\n
`)\n }\n
\n
\n
\n ${tag.paths.map((path) => expandedEndpointBodyTemplate.call(this, path))}\n
\n `)\n }\n`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { schemaInObjectNotation } from '~/utils/schema-utils';\nimport '~/components/json-tree';\nimport '~/components/schema-tree';\nimport '~/components/schema-table';\n\nfunction schemaBodyTemplate(sComponent) {\n return html`\n
\n
\n
${sComponent.name} Schema
\n ${this.schemaStyle === 'table'\n ? html`\n `\n : html`\n `\n}\n
`;\n}\n\nfunction componentBodyTemplate(sComponent, componentType) {\n if (sComponent.id.indexOf('schemas-') !== -1) {\n return schemaBodyTemplate.call(this, sComponent);\n }\n return html`\n
\n
\n ${html`\n
${sComponent.name} ${componentType}
\n ${sComponent.component\n ? html`\n
\n \n
`\n : ''}\n `}\n
\n `;\n}\n\nexport default function componentsTemplate() {\n if (!this.resolvedSpec) { return ''; }\n return html`\n ${this.resolvedSpec.components.map((component) => html`\n
\n
${component.name}
\n
\n ${unsafeHTML(`
${marked(component.description ? component.description : '')}
`)}\n
\n
\n
\n ${component.subComponents.filter((c) => c.expanded !== false).map((sComponent) => componentBodyTemplate.call(this, sComponent, component.name))}\n
\n `)\n}\n`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { downloadResource, viewResource } from '~/utils/common-utils';\n\n/* eslint-disable indent */\nfunction headingRenderer() {\n const renderer = new marked.Renderer();\n renderer.heading = ((text, level, raw, slugger) => `${text}`);\n return renderer;\n}\n\nexport default function overviewTemplate() {\n return html`\n
\n ${this.resolvedSpec?.info\n ? html`\n
\n ${this.resolvedSpec.info.title}\n ${!this.resolvedSpec.info.version ? '' : html`\n \n ${this.resolvedSpec.info.version}\n `\n }\n
\n
\n ${this.resolvedSpec.info.contact?.email\n ? html`${this.resolvedSpec.info.contact.name || 'Email'}: \n ${this.resolvedSpec.info.contact.email}\n `\n : ''\n }\n ${this.resolvedSpec.info.contact?.url\n ? html`URL: ${this.resolvedSpec.info.contact.url}`\n : ''\n }\n ${this.resolvedSpec.info.license\n ? html`License: \n ${this.resolvedSpec.info.license.url\n ? html`${this.resolvedSpec.info.license.name}`\n : this.resolvedSpec.info.license.name\n } `\n : ''\n }\n ${this.resolvedSpec.info.termsOfService\n ? html`Terms of Service`\n : ''\n }\n ${this.specUrl && this.allowSpecFileDownload === 'true'\n ? html`\n
\n \n ${this.specUrl?.trim().toLowerCase().endsWith('json')\n ? html``\n : ''\n }\n
`\n : ''\n }\n
\n \n
\n ${this.resolvedSpec.info.description\n ? html`${\n unsafeHTML(`\n
\n ${marked(this.resolvedSpec.info.description, this.infoDescriptionHeadingsInNavBar === 'true' ? { renderer: headingRenderer() } : undefined)}\n
`)}`\n : ''\n }\n
\n `\n : ''\n }\n
\n `;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\n\nexport function setApiServer(serverUrl) {\n const serverObj = this.resolvedSpec?.servers.find((s) => s.url === serverUrl);\n if (!serverObj) {\n return false;\n }\n this.selectedServer = serverObj;\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent('api-server-change', {\n bubbles: true,\n composed: true,\n detail: {\n selectedServer: serverObj,\n },\n }));\n return true;\n}\n\nfunction onApiServerVarChange(e, serverObj) {\n const inputEls = [...e.currentTarget.closest('table').querySelectorAll('input, select')];\n let tempUrl = serverObj.url;\n inputEls.forEach((v) => {\n const regex = new RegExp(`{${v.dataset.var}}`, 'g');\n tempUrl = tempUrl.replace(regex, v.value);\n });\n serverObj.computedUrl = tempUrl;\n this.requestUpdate();\n}\n\n/* eslint-disable indent */\nfunction serverVarsTemplate() {\n // const selectedServerObj = this.resolvedSpec.servers.find((v) => (v.url === this.selectedServer));\n return this.selectedServer && this.selectedServer.variables\n ? html`\n
SERVER VARIABLES
\n \n ${Object.entries(this.selectedServer.variables).map((kv) => html`\n \n \n \n \n ${kv[1].description\n ? html``\n : ''\n }\n `)}\n \n `\n : '';\n}\n\nexport default function serverTemplate() {\n if (!this.resolvedSpec || this.resolvedSpec.specLoadError) { return ''; }\n return html`\n
\n
API SERVER
\n
\n ${!this.resolvedSpec.servers || this.resolvedSpec.servers?.length === 0\n ? ''\n : html`\n ${this.resolvedSpec?.servers.map((server, i) => html`\n { setApiServer.call(this, server.url); }}\n .checked = '${this.selectedServer.url === server.url}'\n style = 'margin:4px 0; cursor:pointer'\n />\n \n
\n `)}\n `}\n
SELECTED: ${this.selectedServer?.computedUrl || 'none'}
\n
\n \n ${serverVarsTemplate.call(this)}\n
`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { marked } from 'marked';\nimport { pathIsInSearch } from '~/utils/common-utils';\n\nexport function expandCollapseNavBarTag(navLinkEl, action = 'toggle') {\n const tagAndPathEl = navLinkEl?.closest('.nav-bar-tag-and-paths');\n const pathsUnderTagEl = tagAndPathEl.querySelector('.nav-bar-paths-under-tag');\n if (tagAndPathEl) {\n const isExpanded = tagAndPathEl.classList.contains('expanded');\n if (isExpanded && (action === 'toggle' || action === 'collapse')) {\n pathsUnderTagEl.style.maxHeight = 0;\n tagAndPathEl.classList.replace('expanded', 'collapsed');\n } else if (!isExpanded && (action === 'toggle' || action === 'expand')) {\n tagAndPathEl.classList.replace('collapsed', 'expanded');\n pathsUnderTagEl.style.maxHeight = `${pathsUnderTagEl.scrollHeight}px`;\n }\n }\n}\n\nexport function expandCollapseAll(navEl, action = 'expand-all') {\n const elList = [...navEl.querySelectorAll('.nav-bar-tag-and-paths')];\n if (action === 'expand-all') {\n elList.forEach((el) => {\n const navBarPathsUnderTagEl = el.querySelector('.nav-bar-paths-under-tag');\n el.classList.replace('collapsed', 'expanded');\n navBarPathsUnderTagEl.style.maxHeight = `${navBarPathsUnderTagEl?.scrollHeight}px`;\n });\n } else {\n elList.forEach((el) => {\n el.classList.replace('expanded', 'collapsed');\n el.querySelector('.nav-bar-paths-under-tag').style.maxHeight = 0;\n });\n }\n}\n\nfunction onExpandCollapse(e) {\n expandCollapseNavBarTag(e.target, 'toggle');\n}\n\nfunction onExpandCollapseAll(e, action = 'expand-all') {\n expandCollapseAll(e.target.closest('.nav-scroll'), action);\n}\n\n/* eslint-disable indent */\nexport default function navbarTemplate() {\n if (!this.resolvedSpec || this.resolvedSpec.specLoadError) {\n return html`\n \n `;\n }\n return html`\n \n`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { expandedEndpointBodyTemplate } from '~/templates/expanded-endpoint-template';\nimport '~/components/api-request';\nimport '~/components/api-response';\nimport componentsTemplate from '~/templates/components-template';\nimport overviewTemplate from '~/templates/overview-template';\nimport serverTemplate from '~/templates/server-template';\nimport securitySchemeTemplate from '~/templates/security-scheme-template';\nimport { expandCollapseNavBarTag } from '~/templates/navbar-template';\n\nfunction headingRenderer(tagElementId) {\n const renderer = new marked.Renderer();\n renderer.heading = ((text, level, raw, slugger) => `${text}`);\n return renderer;\n}\n\nfunction wrapFocusedTemplate(templateToWrap) {\n return html`\n
\n ${templateToWrap}\n
`;\n}\n\nfunction defaultContentTemplate() {\n // In focused mode default content is overview or first path\n if (this.showInfo === 'true') {\n return wrapFocusedTemplate(overviewTemplate.call(this));\n }\n const selectedTagObj = this.resolvedSpec.tags[0];\n const selectedPathObj = this.resolvedSpec.tags[0]?.paths[0];\n return (selectedTagObj && selectedPathObj)\n ? wrapFocusedTemplate(expandedEndpointBodyTemplate.call(this, selectedPathObj, selectedTagObj.name))\n : wrapFocusedTemplate('');\n}\n\n/* eslint-disable indent */\nfunction focusedTagBodyTemplate(tag) {\n return html`\n

${tag.name}

\n ${this.onNavTagClick === 'show-description' && tag.description\n ? html`\n
\n ${\n unsafeHTML(`\n
\n ${marked(tag.description || '', this.infoDescriptionHeadingsInNavBar === 'true' ? { renderer: headingRenderer(tag.elementId) } : undefined)}\n
`)\n }\n
`\n : ''\n }\n `;\n}\n\nexport default function focusedEndpointTemplate() {\n if (!this.focusedElementId || !this.resolvedSpec) {\n return;\n }\n const focusElId = this.focusedElementId;\n let selectedPathObj = null;\n let selectedTagObj = null;\n let focusedTemplate;\n let i = 0;\n if (focusElId.startsWith('overview') && this.showInfo === 'true') {\n focusedTemplate = overviewTemplate.call(this);\n } else if (focusElId === 'auth' && this.allowAuthentication === 'true') {\n focusedTemplate = securitySchemeTemplate.call(this);\n } else if (focusElId === 'servers' && this.allowServerSelection === 'true') {\n focusedTemplate = serverTemplate.call(this);\n } else if (focusElId === 'operations-top') {\n focusedTemplate = html`\n
\n \n
`;\n } else if (focusElId.startsWith('cmp--') && this.showComponents === 'true') {\n focusedTemplate = componentsTemplate.call(this);\n } else if (focusElId.startsWith('tag--')) {\n const idToFocus = focusElId.indexOf('--', 4) > 0 ? focusElId.substring(0, focusElId.indexOf('--', 5)) : focusElId;\n selectedTagObj = this.resolvedSpec.tags.find((v) => v.elementId === idToFocus);\n if (selectedTagObj) {\n focusedTemplate = wrapFocusedTemplate.call(this, focusedTagBodyTemplate.call(this, selectedTagObj));\n } else {\n focusedTemplate = defaultContentTemplate.call(this);\n }\n } else {\n for (i = 0; i < this.resolvedSpec.tags.length; i += 1) {\n selectedTagObj = this.resolvedSpec.tags[i];\n selectedPathObj = this.resolvedSpec.tags[i].paths.find((v) => `${v.elementId}` === focusElId);\n if (selectedPathObj) {\n break;\n }\n }\n if (selectedPathObj) {\n // In focused mode we must expand the nav-bar tag element if it is collapsed\n const newNavEl = this.shadowRoot.getElementById(`link-${focusElId}`);\n expandCollapseNavBarTag(newNavEl, 'expand');\n focusedTemplate = wrapFocusedTemplate.call(\n this,\n expandedEndpointBodyTemplate.call(this, selectedPathObj, (selectedTagObj.name || ''), (selectedTagObj.description || '')),\n );\n } else {\n // if focusedElementId is not found then show the default content (overview or first-path)\n focusedTemplate = defaultContentTemplate.call(this);\n }\n }\n return focusedTemplate;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport '~/components/api-request';\nimport '~/components/api-response';\nimport codeSamplesTemplate from '~/templates/code-samples-template';\nimport callbackTemplate from '~/templates/callback-template';\nimport { pathSecurityTemplate } from '~/templates/security-scheme-template';\nimport { pathIsInSearch, rapidocApiKey } from '~/utils/common-utils';\n\nfunction toggleExpand(path) {\n if (path.expanded) {\n path.expanded = false; // collapse\n if (this.updateRoute === 'true') {\n window.history.replaceState(null, null, `${window.location.href.split('#')[0]}${this.routePrefix === '#' ? '' : `${this.routePrefix}`}`);\n }\n } else {\n path.expanded = true; // Expand\n if (this.updateRoute === 'true') {\n const newHash = `${this.routePrefix || '#'}${path.elementId}`;\n if (window.location.hash !== newHash) {\n window.history.replaceState(null, null, `${window.location.href.split('#')[0]}${newHash}`);\n }\n }\n }\n this.requestUpdate();\n}\n\nexport function expandCollapseAll(operationsRootEl, action = 'expand-all') {\n const elList = [...operationsRootEl.querySelectorAll('.section-tag')];\n if (action === 'expand-all') {\n elList.map((el) => {\n el.classList.replace('collapsed', 'expanded');\n });\n } else {\n elList.map((el) => {\n el.classList.replace('expanded', 'collapsed');\n });\n }\n}\n\nfunction onExpandCollapseAll(e, action = 'expand-all') {\n expandCollapseAll.call(this, e.target.closest('.operations-root'), action);\n}\n\n/* eslint-disable indent */\nfunction endpointHeadTemplate(path, pathsExpanded = false) {\n return html`\n { toggleExpand.call(this, path, e); }}\" part=\"section-endpoint-head-${path.expanded ? 'expanded' : 'collapsed'}\" class='endpoint-head ${path.method} ${path.deprecated ? 'deprecated' : ''} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>\n
${path.method}
\n
\n ${path.path} \n ${path.isWebhook ? html` Webhook` : ''}\n
\n ${path.deprecated\n ? html`\n \n deprecated \n `\n : ''\n }\n ${this.showSummaryWhenCollapsed\n ? html`\n
\n
${path.summary || path.shortSummary}
`\n : ''\n }\n
\n `;\n}\n\nfunction endpointBodyTemplate(path) {\n const acceptContentTypes = new Set();\n for (const respStatus in path.responses) {\n for (const acceptContentType in (path.responses[respStatus]?.content)) {\n acceptContentTypes.add(acceptContentType.trim());\n }\n }\n const accept = [...acceptContentTypes].join(', ');\n // Filter API Keys that are non-empty and are applicable to the the path\n const nonEmptyApiKeys = this.resolvedSpec.securitySchemes.filter((v) => (v.finalKeyValue && path.security?.some((ps) => (v.securitySchemeId in ps)))) || [];\n\n // If a RapiDoc API Key is specified on the element and its value is not hyphen(-) then include it for all paths\n const rapiDocApiKey = this.resolvedSpec.securitySchemes.find((v) => (v.securitySchemeId === rapidocApiKey && v.value !== '-'));\n if (rapiDocApiKey) {\n nonEmptyApiKeys.push(rapiDocApiKey);\n }\n\n const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate(path.xCodeSamples) : '';\n return html`\n
\n
\n ${path.summary\n ? html`
${path.summary}
`\n : path.shortSummary !== path.description\n ? html`
${path.shortSummary}
`\n : ''\n }\n ${path.xBadges && path.xBadges?.length > 0\n ? html`\n
\n ${path.xBadges.map((v) => (\n html`${v.label}`\n ))\n }\n
\n `\n : ''\n }\n\n ${path.description ? html`
${unsafeHTML(marked(path.description))}
` : ''}\n ${path.externalDocs?.url || path.externalDocs?.description\n ? html`
\n
${unsafeHTML(marked(path.externalDocs?.description || ''))}
\n ${path.externalDocs?.url\n ? html``\n : ''\n }\n
`\n : ''\n }\n \n ${pathSecurityTemplate.call(this, path.security)}\n ${codeSampleTabPanel}\n
\n
\n
\n 0 ? path.servers[0].url : this.selectedServer.computedUrl}\" \n active-schema-tab = \"${this.defaultSchemaTab}\"\n fill-request-fields-with-example = \"${this.fillRequestFieldsWithExample}\"\n allow-try = \"${this.allowTry}\"\n accept = \"${accept}\"\n render-style=\"${this.renderStyle}\" \n schema-style = \"${this.schemaStyle}\" \n schema-expand-level = \"${this.schemaExpandLevel}\"\n schema-description-expanded = \"${this.schemaDescriptionExpanded}\"\n allow-schema-description-expand-toggle = \"${this.allowSchemaDescriptionExpandToggle}\"\n schema-hide-read-only = \"${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}\"\n schema-hide-write-only = \"${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}\"\n fetch-credentials = \"${this.fetchCredentials}\"\n exportparts = \"wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,\n file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, \n anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle\"\n > \n\n ${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}\n
\n\n \n
\n
`;\n}\n\nexport default function endpointTemplate(showExpandCollapse = true, showTags = true, pathsExpanded = false) {\n if (!this.resolvedSpec) { return ''; }\n return html`\n ${showExpandCollapse\n ? html`\n
\n onExpandCollapseAll(e, 'expand-all')}\" style=\"color:var(--primary-color); cursor:pointer;\">\n Expand all\n \n  |  \n onExpandCollapseAll(e, 'collapse-all')}\" style=\"color:var(--primary-color); cursor:pointer;\" >\n Collapse all\n \n   sections\n
`\n : ''\n }\n ${this.resolvedSpec.tags.map((tag) => html`\n ${showTags\n ? html` \n `\n : html`\n \n `\n }\n `)\n }`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\n\n/* eslint-disable indent */\nexport default function logoTemplate(style) {\nreturn html`\n
\n \n \n \n \n \n \n \n \n
\n`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport logoTemplate from '~/templates/logo-template';\n\n/* eslint-disable indent */\nexport default function headerTemplate() {\n return html`\n
\n
\n \n ${logoTemplate('height:36px;width:36px;margin-left:5px')}\n \n \n
${this.headingText}
\n
\n
\n ${(this.allowSpecUrlLoad === 'false')\n ? ''\n : html`\n \n
\n `\n } \n ${(this.allowSpecFileLoad === 'false')\n ? ''\n : html`\n \n \n `\n }\n \n ${(this.allowSearch === 'false' || 'read focused'.includes(this.renderStyle))\n ? ''\n : html` \n \n
\n `\n }\n \n ${(this.allowAdvancedSearch === 'false' || 'read focused'.includes(this.renderStyle))\n ? ''\n : html`\n \n `\n }\n
\n
`;\n }\n/* eslint-enable indent */\n","import { LitElement, html, css } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { schemaInObjectNotation, generateExample } from '~/utils/schema-utils';\nimport FontStyles from '~/styles/font-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport TableStyles from '~/styles/table-styles';\nimport InputStyles from '~/styles/input-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport BorderStyles from '~/styles/border-styles';\nimport CustomStyles from '~/styles/custom-styles';\nimport '~/components/json-tree';\nimport '~/components/schema-tree';\nimport '~/components/schema-table';\n\nexport default class ApiResponse extends LitElement {\n constructor() {\n super();\n this.selectedStatus = '';\n this.headersForEachRespStatus = {};\n this.mimeResponsesForEachStatus = {};\n this.activeSchemaTab = 'schema';\n }\n\n static get properties() {\n return {\n callback: { type: String },\n webhook: { type: String },\n responses: { type: Object },\n parser: { type: Object },\n schemaStyle: { type: String, attribute: 'schema-style' },\n renderStyle: { type: String, attribute: 'render-style' },\n selectedStatus: { type: String, attribute: 'selected-status' },\n selectedMimeType: { type: String, attribute: 'selected-mime-type' },\n activeSchemaTab: { type: String, attribute: 'active-schema-tab' },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n FlexStyles,\n TabStyles,\n TableStyles,\n InputStyles,\n BorderStyles,\n css`\n .resp-head{\n vertical-align: middle;\n padding:16px 0 8px;\n }\n .resp-head.divider{\n border-top: 1px solid var(--border-color);\n margin-top:10px;\n }\n .resp-status{ \n font-weight:bold;\n font-size:calc(var(--font-size-small) + 1px);\n }\n .resp-descr{\n font-size:calc(var(--font-size-small) + 1px);\n color:var(--light-fg);\n text-align:left;\n }\n .top-gap{margin-top:16px;}\n .example-panel{\n font-size:var(--font-size-small);\n margin:0;\n }\n .focused-mode,\n .read-mode {\n padding-top:24px;\n margin-top:12px;\n border-top: 1px dashed var(--border-color);\n }`,\n CustomStyles,\n ];\n }\n\n render() {\n return html`\n
\n
\n ${this.callback === 'true' ? 'CALLBACK RESPONSE' : 'RESPONSE'}\n
\n
\n ${this.responseTemplate()}\n
\n
\n `;\n }\n\n resetSelection() {\n this.selectedStatus = '';\n this.selectedMimeType = '';\n }\n\n /* eslint-disable indent */\n responseTemplate() {\n if (!this.responses) { return ''; }\n for (const statusCode in this.responses) {\n if (!this.selectedStatus) {\n this.selectedStatus = statusCode;\n }\n const allMimeResp = {};\n for (const mimeResp in this.responses[statusCode]?.content) {\n const mimeRespObj = this.responses[statusCode].content[mimeResp];\n if (!this.selectedMimeType) {\n this.selectedMimeType = mimeResp;\n }\n // Generate Schema\n const schemaTree = schemaInObjectNotation(mimeRespObj.schema, {});\n // Generate Example\n const respExamples = generateExample(\n mimeRespObj.schema,\n mimeResp,\n mimeRespObj.examples,\n mimeRespObj.example,\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n mimeResp.includes('json') ? 'json' : 'text',\n );\n allMimeResp[mimeResp] = {\n description: this.responses[statusCode].description,\n examples: respExamples,\n selectedExample: respExamples[0]?.exampleId || '',\n schemaTree,\n };\n }\n // Headers for each response status\n const tempHeaders = [];\n for (const key in this.responses[statusCode]?.headers) {\n tempHeaders.push({ name: key, ...this.responses[statusCode].headers[key] });\n }\n this.headersForEachRespStatus[statusCode] = tempHeaders;\n this.mimeResponsesForEachStatus[statusCode] = allMimeResp;\n }\n return html`\n ${Object.keys(this.responses).length > 1\n ? html`
\n ${Object.keys(this.responses).map((respStatus) => html`\n ${respStatus === '$$ref' // Swagger-Client parser creates '$$ref' object if JSON references are used to create responses - this should be ignored\n ? ''\n : html`\n `\n }`)\n }`\n : html`${Object.keys(this.responses)[0]}`\n }\n
\n\n ${Object.keys(this.responses).map((status) => html`\n
\n
\n ${unsafeHTML(marked(this.responses[status]?.description || ''))}\n ${(this.headersForEachRespStatus[status] && this.headersForEachRespStatus[status]?.length > 0)\n ? html`${this.responseHeaderListTemplate(this.headersForEachRespStatus[status])}`\n : ''\n }\n
\n ${Object.keys(this.mimeResponsesForEachStatus[status]).length === 0\n ? ''\n : html` \n
\n
{ if (e.target.tagName.toLowerCase() === 'button') { this.activeSchemaTab = e.target.dataset.tab; } }}\" >\n \n \n
\n ${Object.keys(this.mimeResponsesForEachStatus[status]).length === 1\n ? html` ${Object.keys(this.mimeResponsesForEachStatus[status])[0]} `\n : html`${this.mimeTypeDropdownTemplate(Object.keys(this.mimeResponsesForEachStatus[status]))}`\n }\n
\n ${this.activeSchemaTab === 'example'\n ? html`
\n ${this.mimeExampleTemplate(this.mimeResponsesForEachStatus[status][this.selectedMimeType])}\n
`\n : html`
\n ${this.mimeSchemaTemplate(this.mimeResponsesForEachStatus[status][this.selectedMimeType])}\n
`\n }\n
\n `\n }`)\n }\n `;\n }\n\n responseHeaderListTemplate(respHeaders) {\n return html`\n
RESPONSE HEADERS
\n \n ${respHeaders.map((v) => html`\n \n \n \n \n \n \n `)}\n
\n ${v.name || ''}\n \n ${v.schema?.type || ''}\n \n
${unsafeHTML(marked(v.description || ''))}
\n
\n ${v.schema?.example || ''}\n
`;\n }\n\n mimeTypeDropdownTemplate(mimeTypes) {\n return html`\n `;\n }\n\n onSelectExample(e) {\n const exampleContainerEl = e.target.closest('.example-panel');\n const exampleEls = [...exampleContainerEl.querySelectorAll('.example')];\n\n exampleEls.forEach((v) => {\n v.style.display = v.dataset.example === e.target.value ? 'block' : 'none';\n });\n }\n\n mimeExampleTemplate(mimeRespDetails) {\n if (!mimeRespDetails) {\n return html`\n
 No example provided 
\n `;\n }\n return html`\n ${mimeRespDetails.examples.length === 1\n ? html`\n ${mimeRespDetails.examples[0].exampleFormat === 'json'\n ? html`\n ${mimeRespDetails.examples[0].exampleSummary && mimeRespDetails.examples[0].exampleSummary.length > 80 ? html`
${mimeRespDetails.examples[0].exampleSummary}
` : ''}\n ${mimeRespDetails.examples[0].exampleDescription ? html`
${unsafeHTML(marked(mimeRespDetails.examples[0].exampleDescription || ''))}
` : ''}\n `\n : html`\n ${mimeRespDetails.examples[0].exampleSummary && mimeRespDetails.examples[0].exampleSummary.length > 80 ? html`
${mimeRespDetails.examples[0].exampleSummary}
` : ''}\n ${mimeRespDetails.examples[0].exampleDescription ? html`
${unsafeHTML(marked(mimeRespDetails.examples[0].exampleDescription || ''))}
` : ''}\n
${mimeRespDetails.examples[0].exampleValue}
\n `\n }`\n : html`\n \n \n ${mimeRespDetails.examples.map((v) => html`\n
\n ${v.exampleSummary && v.exampleSummary.length > 80 ? html`
${v.exampleSummary}
` : ''}\n ${v.exampleDescription ? html`
${unsafeHTML(marked(v.exampleDescription || ''))}
` : ''}\n ${v.exampleFormat === 'json'\n ? html`\n `\n : html`
${v.exampleValue}
`\n }\n
\n `)}\n
\n `\n }\n `;\n }\n\n mimeSchemaTemplate(mimeRespDetails) {\n if (!mimeRespDetails) {\n return html`\n
 Schema not found
\n `;\n }\n return html`\n ${this.schemaStyle === 'table'\n ? html`\n `\n : html`\n `\n }`;\n }\n /* eslint-enable indent */\n}\n\n// Register the element with the browser\ncustomElements.define('api-response', ApiResponse);\n","import { html } from 'lit';\nimport '~/components/dialog-box';\n\n/* eslint-disable indent */\nexport default function searchByPropertiesModalTemplate() {\n document.addEventListener('close', () => { this.showAdvancedSearchDialog = false; });\n document.addEventListener('open', this.onOpenSearchDialog);\n\n return html`\n \n \n this.onAdvancedSearch(e, 400)}\"\n >\n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n
\n \n ${this.advancedSearchMatches?.map((path) => html`\n {\n this.matchPaths = ''; // clear quick filter if applied\n this.showAdvancedSearchDialog = false; // Hide Search Dialog\n this.requestUpdate();\n this.scrollToEventTarget(e, true);\n }\n }\"\n > \n ${path.method} \n ${path.path}\n ${path.summary}\n
\n `)\n }\n \n `;\n}\n/* eslint-enable indent */\n","import { LitElement, html } from 'lit';\nimport DialogBoxStyles from '~/styles/dialog-box-styles';\n\nexport default class DialogBox extends LitElement {\n static get properties() {\n return {\n heading: { type: String, attribute: 'heading' },\n show: { type: String, attribute: 'show' },\n };\n }\n\n static get styles() {\n return [DialogBoxStyles];\n }\n\n connectedCallback() {\n super.connectedCallback();\n document.addEventListener('keydown', (e) => {\n if (e.code === 'Escape') {\n this.onClose();\n }\n });\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (oldVal !== newVal) {\n if (name === 'heading') {\n this.heading = newVal;\n }\n if (name === 'show') {\n this.show = newVal;\n if (newVal === 'true') {\n document.dispatchEvent(new CustomEvent('open', {\n bubbles: true,\n composed: true,\n detail: this,\n }));\n }\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n /* eslint-disable indent */\n render() {\n return html`\n ${this.show === 'true'\n ? html`\n
\n
\n
\n ${this.heading}\n \n
\n
\n \n
\n
\n
`\n : ''\n }`;\n }\n /* eslint-enable indent */\n\n onClose() {\n document.dispatchEvent(new CustomEvent('close', {\n bubbles: true,\n composed: true,\n }));\n }\n}\n\ncustomElements.define('dialog-box', DialogBox);\n","import { html } from 'lit';\nimport ColorUtils from '~/utils/color-utils';\n/* Generates an schema object containing type and constraint info */\nexport default function setTheme(baseTheme, theme = {}) {\n let newTheme = {};\n\n // Common Theme colors\n const primaryColor = theme.primaryColor ? theme.primaryColor : baseTheme === 'dark' ? '#f76b39' : '#ff591e';\n const primaryColorInvert = ColorUtils.color.invert(primaryColor);\n const primaryColorTrans = ColorUtils.color.opacity(primaryColor, '0.8');\n\n // Dark and Light Theme colors\n if (baseTheme === 'dark') {\n const bg1 = theme.bg1 ? theme.bg1 : '#2a2b2c';\n const fg1 = theme.fg1 ? theme.fg1 : '#bbb';\n\n const bg2 = theme.bg2 ? theme.bg2 : ColorUtils.color.brightness(bg1, 5); // or #383838;\n const bg3 = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, 17); // or #444;\n const lightBg = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, 35);\n const fg2 = theme.fg2 ? theme.fg2 : ColorUtils.color.brightness(fg1, -15); // or #ababab\n const fg3 = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, -20); // or #aaa\n const lightFg = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, -65); // or #777\n const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : '#aaa';\n const selectionBg = '#bbb';\n const selectionFg = '#eee';\n\n const headerColor = theme.headerColor ? theme.headerColor : ColorUtils.color.brightness(bg1, 10);\n\n const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, 10);\n const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.opacity(ColorUtils.color.invert(navBgColor), '0.50');\n const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : ColorUtils.color.brightness(navBgColor, -15);\n const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : ColorUtils.color.invert(navBgColor);\n const navAccentColor = theme.navAccentColor ? theme.navAccentColor : ColorUtils.color.brightness(primaryColor, 25);\n const overlayBg = 'rgba(80, 80, 80, 0.4)';\n\n newTheme = {\n bg1,\n bg2,\n bg3,\n lightBg,\n fg1,\n fg2,\n fg3,\n lightFg,\n inlineCodeFg,\n primaryColor,\n primaryColorTrans,\n primaryColorInvert,\n selectionBg,\n selectionFg,\n overlayBg,\n navBgColor,\n navTextColor,\n navHoverBgColor,\n navHoverTextColor,\n navAccentColor,\n\n headerColor,\n headerColorInvert: ColorUtils.color.invert(headerColor),\n headerColorDarker: ColorUtils.color.brightness(headerColor, -20),\n headerColorBorder: ColorUtils.color.brightness(headerColor, 10),\n\n borderColor: theme.borderColor || ColorUtils.color.brightness(bg1, 20), // #555\n lightBorderColor: theme.lightBorderColor || ColorUtils.color.brightness(bg1, 15), // #444\n codeBorderColor: theme.codeBorderColor || ColorUtils.color.brightness(bg1, 30),\n\n inputBg: theme.inputBg || ColorUtils.color.brightness(bg1, -5), // #2f2f2f\n placeHolder: theme.placeHolder || ColorUtils.color.opacity(fg1, '0.3'),\n hoverColor: theme.hoverColor || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n red: theme.red ? theme.red : '#F06560',\n lightRed: theme.lightRed ? theme.lightRed : ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n pink: theme.pink ? theme.pink : '#ffb2b2',\n lightPink: theme.lightPink || ColorUtils.color.brightness(bg1, -10),\n\n green: theme.green || '#7ec699',\n lightGreen: theme.lightGreen || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n blue: theme.blue || '#71b7ff',\n lightBlue: theme.lightBlue || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n orange: theme.orange ? theme.orange : '#f08d49',\n lightOrange: theme.lightOrange || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n yellow: theme.yellow || '#827717',\n lightYellow: theme.lightYellow || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n purple: theme.purple || '#786FF1',\n brown: theme.brown || '#D4AC0D',\n\n codeBg: theme.codeBg || ColorUtils.color.opacity(ColorUtils.color.brightness(bg1, -15), 0.7),\n codeFg: theme.codeFg || '#aaa',\n codePropertyColor: theme.codePropertyColor || '#f8c555',\n codeKeywordColor: theme.codeKeywordColor || '#cc99cd',\n codeOperatorColor: theme.codeOperatorColor || '#67cdcc',\n };\n } else {\n const bg1 = (theme.bg1 ? theme.bg1 : '#fafbfc');\n const fg1 = (theme.fg1 ? theme.fg1 : '#444444');\n const bg2 = theme.bg2 ? theme.bg2 : ColorUtils.color.brightness(bg1, -5); // or '#fafafa'\n const bg3 = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, -15); // or '#f6f6f6'\n const lightBg = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, -45);\n const fg2 = theme.fg2 ? theme.fg2 : ColorUtils.color.brightness(fg1, 17); // or '#555'\n const fg3 = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, 30); // or #666\n const lightFg = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, 70); // or #999\n const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : 'brown';\n\n const selectionBg = '#444';\n const selectionFg = '#eee';\n\n const headerColor = theme.headerColor ? theme.headerColor : ColorUtils.color.brightness(bg1, -180);\n\n /*\n const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, -10);\n const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.brightness(fg1, 5);\n const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : bg1;\n const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : primaryColor;\n const navAccentColor = theme.navAccentColor ? theme.navAccentColor : primaryColor;\n */\n const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, -200);\n const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.opacity(ColorUtils.color.invert(navBgColor), '0.65');\n const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : ColorUtils.color.brightness(navBgColor, -15);\n const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : ColorUtils.color.invert(navBgColor);\n const navAccentColor = theme.navAccentColor ? theme.navAccentColor : ColorUtils.color.brightness(primaryColor, 25);\n const overlayBg = 'rgba(0, 0, 0, 0.4)';\n\n newTheme = {\n bg1,\n bg2,\n bg3,\n lightBg,\n fg1,\n fg2,\n fg3,\n lightFg,\n inlineCodeFg,\n primaryColor,\n primaryColorTrans,\n primaryColorInvert,\n selectionBg,\n selectionFg,\n overlayBg,\n navBgColor,\n navTextColor,\n navHoverBgColor,\n navHoverTextColor,\n navAccentColor,\n\n headerColor,\n headerColorInvert: ColorUtils.color.invert(headerColor),\n headerColorDarker: ColorUtils.color.brightness(headerColor, -20),\n headerColorBorder: ColorUtils.color.brightness(headerColor, 10),\n\n borderColor: theme.borderColor || ColorUtils.color.brightness(bg1, -38),\n lightBorderColor: theme.lightBorderColor || ColorUtils.color.brightness(bg1, -23),\n codeBorderColor: theme.codeBorderColor || 'transparent',\n\n inputBg: theme.inputBg || ColorUtils.color.brightness(bg1, 10), // #fff\n placeHolder: theme.placeHolder || ColorUtils.color.brightness(lightFg, 20), // #dedede\n hoverColor: theme.hoverColor || ColorUtils.color.brightness(bg1, -5), // # f1f1f1\n\n red: theme.red || '#F06560',\n lightRed: theme.lightRed || '#fff0f0',\n\n pink: theme.pink ? theme.pink : '#990055',\n lightPink: theme.lightPink ? theme.lightPink : '#ffb2b2',\n\n green: theme.green || '#690',\n lightGreen: theme.lightGreen || '#fbfff0',\n\n blue: theme.blue || '#47AFE8',\n lightBlue: theme.lightBlue || '#eff8fd',\n\n orange: theme.orange || '#FF9900',\n lightOrange: theme.lightOrange || '#fff5e6',\n\n yellow: theme.yellow || '#827717',\n lightYellow: theme.lightYellow || '#fff5cc',\n\n purple: theme.purple || '#786FF1',\n brown: theme.brown || '#D4AC0D',\n\n codeBg: theme.codeBg || ColorUtils.color.opacity(ColorUtils.color.brightness(bg1, -15), 0.7),\n codeFg: theme.codeFg || '#666',\n codePropertyColor: theme.codePropertyColor || '#905',\n codeKeywordColor: theme.codeKeywordColor || '#07a',\n codeOperatorColor: theme.codeOperatorColor || '#9a6e3a',\n };\n }\n return html`\n `;\n}\n","import { html } from 'lit';\n\n// Templates\nimport expandedEndpointTemplate from '~/templates/expanded-endpoint-template';\nimport focusedEndpointTemplate from '~/templates/focused-endpoint-template';\nimport overviewTemplate from '~/templates/overview-template';\nimport endpointTemplate from '~/templates/endpoint-template';\nimport serverTemplate from '~/templates/server-template';\nimport securitySchemeTemplate, { recoverPersistedApiKeys } from '~/templates/security-scheme-template';\nimport headerTemplate from '~/templates/header-template';\nimport navbarTemplate from '~/templates/navbar-template';\nimport advancedSearchTemplate from '~/templates/advance-search-template';\nimport SetTheme from '~/utils/theme';\nimport { isValidHexColor } from '~/utils/color-utils';\n\nexport default function mainBodyTemplate(isMini = false, showExpandCollapse = true, showTags = true, pathsExpanded = false) {\n if (!this.resolvedSpec) {\n return '';\n }\n if (this.persistAuth === 'true') {\n recoverPersistedApiKeys.call(this);\n }\n const newTheme = {\n bg1: isValidHexColor(this.bgColor) ? this.bgColor : '',\n fg1: isValidHexColor(this.textColor) ? this.textColor : '',\n headerColor: isValidHexColor(this.headerColor) ? this.headerColor : '',\n primaryColor: isValidHexColor(this.primaryColor) ? this.primaryColor : '',\n navBgColor: isValidHexColor(this.navBgColor) ? this.navBgColor : '',\n navTextColor: isValidHexColor(this.navTextColor) ? this.navTextColor : '',\n navHoverBgColor: isValidHexColor(this.navHoverBgColor) ? this.navHoverBgColor : '',\n navHoverTextColor: isValidHexColor(this.navHoverTextColor) ? this.navHoverTextColor : '',\n navAccentColor: isValidHexColor(this.navAccentColor) ? this.navAccentColor : '',\n };\n /* eslint-disable indent */\n if (this.resolvedSpec.specLoadError) {\n if (isMini) {\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n
${this.resolvedSpec.info.description}
\n `;\n }\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n \n ${headerTemplate.call(this)}\n
\n \n
\n

${this.resolvedSpec.info.title}

\n
${this.resolvedSpec.info.description}
\n
\n
\n `;\n }\n if (this.resolvedSpec.isSpecLoading) {\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n
\n \n
\n
\n
\n
\n `;\n }\n\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n\n \n ${this.showHeader === 'false' ? '' : headerTemplate.call(this)}\n \n \n ${this.allowAdvancedSearch === 'false' ? '' : advancedSearchTemplate.call(this)}\n\n
\n \n ${((this.renderStyle === 'read' || this.renderStyle === 'focused')\n && this.showSideNav === 'true'\n && this.resolvedSpec\n ) ? navbarTemplate.call(this) : ''\n }\n\n \n
\n \n
\n ${this.loading === true\n ? html`
`\n : html`\n ${this.loadFailed === true\n ? html`
Unable to load the Spec
`\n : html`\n
{ this.handleHref(e); }}\">\n ${this.renderStyle === 'focused'\n ? html`${focusedEndpointTemplate.call(this)}`\n : html`\n ${this.showInfo === 'true' ? overviewTemplate.call(this) : ''}\n ${this.allowServerSelection === 'true' ? serverTemplate.call(this) : ''}\n ${this.allowAuthentication === 'true' ? securitySchemeTemplate.call(this) : ''}\n
\n \n
\n ${this.renderStyle === 'read'\n ? expandedEndpointTemplate.call(this)\n : endpointTemplate.call(this, showExpandCollapse, showTags, pathsExpanded)\n }\n `\n }\n
\n `\n }`\n }\n
\n \n
\n
\n `;\n}\n/* eslint-enable indent */\n","import { css, LitElement, unsafeCSS } from 'lit';\nimport { marked } from 'marked';\nimport Prism from 'prismjs';\nimport 'prismjs/components/prism-css';\nimport 'prismjs/components/prism-yaml';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-http';\nimport 'prismjs/components/prism-csharp';\n\n// Styles\nimport FontStyles from '~/styles/font-styles';\nimport InputStyles from '~/styles/input-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport TableStyles from '~/styles/table-styles';\nimport EndpointStyles from '~/styles/endpoint-styles';\nimport PrismStyles from '~/styles/prism-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport NavStyles from '~/styles/nav-styles';\nimport InfoStyles from '~/styles/info-styles';\nimport CustomStyles from '~/styles/custom-styles';\n// import { expandCollapseNavBarTag } from '@/templates/navbar-template';\nimport { advancedSearch, pathIsInSearch, componentIsInSearch, rapidocApiKey, sleep } from '~/utils/common-utils';\nimport ProcessSpec from '~/utils/spec-parser';\nimport mainBodyTemplate from '~/templates/main-body-template';\nimport { applyApiKey, onClearAllApiKeys } from '~/templates/security-scheme-template';\nimport { setApiServer } from '~/templates/server-template';\n\nexport default class RapiDoc extends LitElement {\n constructor() {\n super();\n const intersectionObserverOptions = {\n root: this.getRootNode().host,\n rootMargin: '-50px 0px -50px 0px', // when the element is visible 100px from bottom\n threshold: 0,\n };\n this.showSummaryWhenCollapsed = true;\n this.isIntersectionObserverActive = true;\n this.intersectionObserver = new IntersectionObserver((entries) => { this.onIntersect(entries); }, intersectionObserverOptions);\n }\n\n static get properties() {\n return {\n // Heading\n headingText: { type: String, attribute: 'heading-text' },\n gotoPath: { type: String, attribute: 'goto-path' },\n\n // Spec\n updateRoute: { type: String, attribute: 'update-route' },\n routePrefix: { type: String, attribute: 'route-prefix' },\n specUrl: { type: String, attribute: 'spec-url' },\n sortTags: { type: String, attribute: 'sort-tags' },\n generateMissingTags: { type: String, attribute: 'generate-missing-tags' },\n sortEndpointsBy: { type: String, attribute: 'sort-endpoints-by' },\n specFile: { type: String, attribute: false },\n\n // UI Layouts\n layout: { type: String },\n renderStyle: { type: String, attribute: 'render-style' },\n defaultSchemaTab: { type: String, attribute: 'default-schema-tab' },\n responseAreaHeight: { type: String, attribute: 'response-area-height' },\n fillRequestFieldsWithExample: { type: String, attribute: 'fill-request-fields-with-example' },\n persistAuth: { type: String, attribute: 'persist-auth' },\n onNavTagClick: { type: String, attribute: 'on-nav-tag-click' },\n\n // Schema Styles\n schemaStyle: { type: String, attribute: 'schema-style' },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n\n // API Server\n apiKeyName: { type: String, attribute: 'api-key-name' },\n apiKeyLocation: { type: String, attribute: 'api-key-location' },\n apiKeyValue: { type: String, attribute: 'api-key-value' },\n defaultApiServerUrl: { type: String, attribute: 'default-api-server' },\n serverUrl: { type: String, attribute: 'server-url' },\n oauthReceiver: { type: String, attribute: 'oauth-receiver' },\n\n // Hide/Show Sections & Enable Disable actions\n showHeader: { type: String, attribute: 'show-header' },\n showSideNav: { type: String, attribute: 'show-side-nav' },\n showInfo: { type: String, attribute: 'show-info' },\n allowAuthentication: { type: String, attribute: 'allow-authentication' },\n allowTry: { type: String, attribute: 'allow-try' },\n allowSpecUrlLoad: { type: String, attribute: 'allow-spec-url-load' },\n allowSpecFileLoad: { type: String, attribute: 'allow-spec-file-load' },\n allowSpecFileDownload: { type: String, attribute: 'allow-spec-file-download' },\n allowSearch: { type: String, attribute: 'allow-search' },\n allowAdvancedSearch: { type: String, attribute: 'allow-advanced-search' },\n allowServerSelection: { type: String, attribute: 'allow-server-selection' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n showComponents: { type: String, attribute: 'show-components' },\n pageDirection: { type: String, attribute: 'page-direction' },\n\n // Main Colors and Font\n theme: { type: String },\n bgColor: { type: String, attribute: 'bg-color' },\n textColor: { type: String, attribute: 'text-color' },\n headerColor: { type: String, attribute: 'header-color' },\n primaryColor: { type: String, attribute: 'primary-color' },\n fontSize: { type: String, attribute: 'font-size' },\n regularFont: { type: String, attribute: 'regular-font' },\n monoFont: { type: String, attribute: 'mono-font' },\n loadFonts: { type: String, attribute: 'load-fonts' },\n cssFile: { type: String, attribute: 'css-file' },\n cssClasses: { type: String, attribute: 'css-classes' },\n\n // Nav Bar Colors\n navBgColor: { type: String, attribute: 'nav-bg-color' },\n navTextColor: { type: String, attribute: 'nav-text-color' },\n navHoverBgColor: { type: String, attribute: 'nav-hover-bg-color' },\n navHoverTextColor: { type: String, attribute: 'nav-hover-text-color' },\n navAccentColor: { type: String, attribute: 'nav-accent-color' },\n navItemSpacing: { type: String, attribute: 'nav-item-spacing' },\n showMethodInNavBar: { type: String, attribute: 'show-method-in-nav-bar' },\n usePathInNavBar: { type: String, attribute: 'use-path-in-nav-bar' },\n infoDescriptionHeadingsInNavBar: { type: String, attribute: 'info-description-headings-in-navbar' },\n\n // Fetch Options\n fetchCredentials: { type: String, attribute: 'fetch-credentials' },\n\n // Filters\n matchPaths: { type: String, attribute: 'match-paths' },\n matchType: { type: String, attribute: 'match-type' },\n\n // Internal Properties\n loading: { type: Boolean }, // indicates spec is being loaded\n focusedElementId: { type: String }, // updating the focusedElementId will automatically render appropriate section in focused mode\n showAdvancedSearchDialog: { type: Boolean },\n advancedSearchMatches: { type: Object },\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n InputStyles,\n FlexStyles,\n TableStyles,\n EndpointStyles,\n PrismStyles,\n TabStyles,\n NavStyles,\n InfoStyles,\n css`\n :host {\n display:flex;\n flex-direction: column;\n min-width:360px;\n width:100%;\n height:100%;\n margin:0;\n padding:0;\n overflow: hidden;\n letter-spacing:normal;\n color:var(--fg);\n background-color:var(--bg);\n font-family:var(--font-regular);\n }\n .body {\n display:flex;\n height:100%;\n width:100%;\n overflow:hidden;\n }\n\n .main-content { \n margin:0;\n padding: 0; \n display:block;\n flex:1;\n height:100%;\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: thin;\n scrollbar-color: var(--border-color) transparent;\n }\n\n .main-content-inner--view-mode {\n padding: 0 8px;\n }\n .main-content::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n .main-content::-webkit-scrollbar-track {\n background:transparent;\n }\n .main-content::-webkit-scrollbar-thumb {\n background-color: var(--border-color);\n }\n\n .section-gap.section-tag {\n border-bottom:1px solid var(--border-color);\n }\n .section-gap,\n .section-gap--focused-mode,\n .section-gap--read-mode { \n padding: 0px 4px; \n }\n .section-tag-header {\n position:relative;\n cursor: n-resize;\n padding: 12px 0;\n }\n .collapsed .section-tag-header:hover{\n cursor: s-resize;\n }\n\n .section-tag-header:hover{\n background-image: linear-gradient(to right, rgba(0,0,0,0), var(--border-color), rgba(0,0,0,0));\n }\n\n .section-tag-header:hover::after {\n position:absolute;\n margin-left:-24px;\n font-size:20px;\n top: calc(50% - 14px);\n color:var(--primary-color);\n content: '⬆'; \n }\n\n .collapsed .section-tag-header::after {\n position:absolute;\n margin-left:-24px;\n font-size:20px;\n top: calc(50% - 14px);\n color: var(--border-color);\n content: '⬇'; \n }\n .collapsed .section-tag-header:hover::after {\n color:var(--primary-color);\n }\n\n .collapsed .section-tag-body {\n display:none;\n }\n\n .logo {\n height:36px;\n width:36px;\n margin-left:5px; \n }\n .only-large-screen-flex,\n .only-large-screen{\n display:none;\n }\n .tag.title {\n text-transform: uppercase;\n }\n .main-header {\n background-color:var(--header-bg);\n color:var(--header-fg);\n width:100%;\n }\n .header-title {\n font-size:calc(var(--font-size-regular) + 8px); \n padding:0 8px;\n }\n input.header-input{\n background:var(--header-color-darker);\n color:var(--header-fg);\n border:1px solid var(--header-color-border);\n flex:1; \n padding-right:24px;\n border-radius:3px;\n }\n input.header-input::placeholder {\n opacity:0.4;\n }\n .loader {\n margin: 16px auto 16px auto; \n border: 4px solid var(--bg3);\n border-radius: 50%;\n border-top: 4px solid var(--primary-color);\n width: 36px;\n height: 36px;\n animation: spin 2s linear infinite;\n }\n .expanded-endpoint-body { \n position: relative;\n padding: 6px 0px; \n }\n .expanded-endpoint-body .tag-description {\n background: var(--code-bg);\n border-radius: var(--border-radius);\n transition: max-height .2s ease-out;\n }\n .expanded-endpoint-body .tag-icon {\n transition: transform .2s ease-out;\n }\n .expanded-endpoint-body .tag-icon.expanded {\n transform: rotate(180deg);\n }\n .divider { \n border-top: 2px solid var(--border-color);\n margin: 24px 0;\n width:100%;\n }\n\n .tooltip {\n cursor:pointer;\n border: 1px solid var(--border-color);\n border-left-width: 4px;\n margin-left:2px;\n }\n .tooltip a {\n color: var(--fg2);\n text-decoration: none;\n }\n .tooltip-text {\n color: var(--fg2);\n max-width: 400px;\n position: absolute;\n z-index:1;\n background-color: var(--bg2);\n visibility: hidden;\n\n overflow-wrap: break-word;\n }\n .tooltip:hover {\n color: var(--primary-color);\n border-color: var(--primary-color);\n }\n .tooltip:hover a:hover {\n color: var(--primary-color);\n }\n\n .tooltip:hover .tooltip-text {\n visibility: visible;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n .nav-method { font-weight: bold; margin-right: 4px; font-size: calc(var(--font-size-small) - 2px); white-space: nowrap; }\n .nav-method.false { display: none; }\n\n .nav-method.as-colored-text.get { color:var(--nav-get-color); }\n .nav-method.as-colored-text.put { color:var(--nav-put-color); }\n .nav-method.as-colored-text.post { color:var(--nav-post-color); }\n .nav-method.as-colored-text.delete { color:var(--nav-delete-color); }\n .nav-method.as-colored-text.head, .nav-method.as-colored-text.patch, .nav-method.as-colored-text.options { color:var(--nav-head-color); }\n \n .nav-method.as-colored-block {\n padding: 1px 4px;\n min-width: 30px;\n border-radius: 4px 0 0 4px;\n color: #000;\n }\n\n .nav-method.as-colored-block.get { background-color: var(--blue); }\n .nav-method.as-colored-block.put { background-color: var(--orange); }\n .nav-method.as-colored-block.post { background-color: var(--green); }\n .nav-method.as-colored-block.delete { background-color: var(--red); }\n .nav-method.as-colored-block.head, .nav-method.as-colored-block.patch , .nav-method.as-colored-block.options { \n background-color: var(--yellow); \n }\n\n @media only screen and (min-width: 768px) {\n .nav-bar {\n width: 260px;\n display:flex;\n }\n .only-large-screen{\n display:block;\n }\n .only-large-screen-flex{\n display:flex;\n }\n .section-gap { \n padding: 0 0 0 24px; \n }\n .section-gap--focused-mode {\n padding: 24px 8px; \n }\n .section-gap--read-mode { \n padding: 24px 8px; \n }\n .endpoint-body {\n position: relative;\n padding:36px 0 48px 0;\n }\n }\n\n @media only screen and (min-width: 1024px) {\n .nav-bar {\n width: ${unsafeCSS(this.fontSize === 'default' ? '300px' : this.fontSize === 'large' ? '315px' : '330px')};\n display:flex;\n }\n .section-gap--focused-mode { \n padding: 12px 80px 12px 80px; \n }\n .section-gap--read-mode { \n padding: 24px 80px 12px 80px; \n }\n }`,\n CustomStyles,\n ];\n }\n\n // Startup\n connectedCallback() {\n super.connectedCallback();\n const parent = this.parentElement;\n if (parent) {\n if (parent.offsetWidth === 0 && parent.style.width === '') {\n parent.style.width = '100vw';\n }\n if (parent.offsetHeight === 0 && parent.style.height === '') {\n parent.style.height = '100vh';\n }\n if (parent.tagName === 'BODY') {\n if (!parent.style.marginTop) { parent.style.marginTop = '0'; }\n if (!parent.style.marginRight) { parent.style.marginRight = '0'; }\n if (!parent.style.marginBottom) { parent.style.marginBottom = '0'; }\n if (!parent.style.marginLeft) { parent.style.marginLeft = '0'; }\n }\n }\n\n if (this.loadFonts !== 'false') {\n const fontDescriptor = {\n family: 'Open Sans',\n style: 'normal',\n weight: '300',\n unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD',\n };\n const fontWeight300 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontDescriptor.weight = '600';\n const fontWeight600 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontWeight300.load().then((font) => { document.fonts.add(font); });\n fontWeight600.load().then((font) => { document.fonts.add(font); });\n }\n\n if (!this.layout || !'row, column,'.includes(`${this.layout},`)) { this.layout = 'row'; }\n if (!this.renderStyle || !'read, view, focused,'.includes(`${this.renderStyle},`)) { this.renderStyle = 'focused'; }\n if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) { this.schemaStyle = 'tree'; }\n if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {\n this.theme = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';\n }\n if (!this.defaultSchemaTab || !'example, schema, model,'.includes(`${this.defaultSchemaTab},`)) {\n this.defaultSchemaTab = 'example';\n } else if (this.defaultSchemaTab === 'model') {\n this.defaultSchemaTab = 'schema';\n }\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) { this.schemaDescriptionExpanded = 'false'; }\n\n if (!this.schemaHideReadOnly || !'default, never,'.includes(`${this.schemaHideReadOnly},`)) { this.schemaHideReadOnly = 'default'; }\n if (!this.schemaHideWriteOnly || !'default, never,'.includes(`${this.schemaHideWriteOnly},`)) { this.schemaHideWriteOnly = 'default'; }\n\n if (!this.fillRequestFieldsWithExample || !'true, false,'.includes(`${this.fillRequestFieldsWithExample},`)) { this.fillRequestFieldsWithExample = 'true'; }\n if (!this.persistAuth || !'true, false,'.includes(`${this.persistAuth},`)) { this.persistAuth = 'false'; }\n if (!this.onNavTagClick || !'expand-collapse, show-description,'.includes(`${this.onNavTagClick},`)) { this.onNavTagClick = 'expand-collapse'; }\n if (!this.responseAreaHeight) {\n this.responseAreaHeight = '400px';\n }\n\n if (!this.allowSearch || !'true, false,'.includes(`${this.allowSearch},`)) { this.allowSearch = 'true'; }\n if (!this.allowAdvancedSearch || !'true, false,'.includes(`${this.allowAdvancedSearch},`)) { this.allowAdvancedSearch = 'true'; }\n\n if (!this.allowTry || !'true, false,'.includes(`${this.allowTry},`)) { this.allowTry = 'true'; }\n if (!this.apiKeyValue) { this.apiKeyValue = '-'; }\n if (!this.apiKeyLocation) { this.apiKeyLocation = 'header'; }\n if (!this.apiKeyName) { this.apiKeyName = ''; }\n\n if (!this.oauthReceiver) { this.oauthReceiver = 'oauth-receiver.html'; }\n if (!this.updateRoute || !'true, false,'.includes(`${this.updateRoute},`)) { this.updateRoute = 'true'; }\n if (!this.routePrefix) { this.routePrefix = '#'; }\n if (!this.sortTags || !'true, false,'.includes(`${this.sortTags},`)) { this.sortTags = 'false'; }\n if (!this.generateMissingTags || !'true, false,'.includes(`${this.generateMissingTags},`)) { this.generateMissingTags = 'false'; }\n if (!this.sortEndpointsBy || !'method, path, summary, none,'.includes(`${this.sortEndpointsBy},`)) { this.sortEndpointsBy = 'path'; }\n if (!this.navItemSpacing || !'compact, relaxed, default,'.includes(`${this.navItemSpacing},`)) { this.navItemSpacing = 'default'; }\n if (!this.showMethodInNavBar || !'false, as-plain-text, as-colored-text, as-colored-block,'.includes(`${this.showMethodInNavBar},`)) { this.showMethodInNavBar = 'false'; }\n if (!this.usePathInNavBar || !'true, false,'.includes(`${this.usePathInNavBar},`)) { this.usePathInNavBar = 'false'; }\n if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) { this.fontSize = 'default'; }\n\n if (!this.showInfo || !'true, false,'.includes(`${this.showInfo},`)) { this.showInfo = 'true'; }\n if (!this.allowServerSelection || !'true, false,'.includes(`${this.allowServerSelection},`)) { this.allowServerSelection = 'true'; }\n if (!this.allowAuthentication || !'true, false,'.includes(`${this.allowAuthentication},`)) { this.allowAuthentication = 'true'; }\n if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) { this.allowSchemaDescriptionExpandToggle = 'true'; }\n\n if (!this.showSideNav || !'true false'.includes(this.showSideNav)) { this.showSideNav = 'true'; }\n if (!this.showComponents || !'true false'.includes(this.showComponents)) { this.showComponents = 'false'; }\n if (!this.infoDescriptionHeadingsInNavBar || !'true, false,'.includes(`${this.infoDescriptionHeadingsInNavBar},`)) { this.infoDescriptionHeadingsInNavBar = 'false'; }\n if (!this.fetchCredentials || !'omit, same-origin, include,'.includes(`${this.fetchCredentials},`)) { this.fetchCredentials = ''; }\n if (!this.matchType || !'includes regex'.includes(this.matchType)) { this.matchType = 'includes'; }\n\n if (!this.showAdvancedSearchDialog) { this.showAdvancedSearchDialog = false; }\n\n if (!this.cssFile) { this.cssFile = null; }\n if (!this.cssClasses) { this.cssClasses = ''; }\n\n marked.setOptions({\n highlight: (code, lang) => {\n if (Prism.languages[lang]) {\n return Prism.highlight(code, Prism.languages[lang], lang);\n }\n return code;\n },\n });\n\n window.addEventListener('hashchange', () => {\n const regEx = new RegExp(`^${this.routePrefix}`, 'i');\n const elementId = window.location.hash.replace(regEx, '');\n this.scrollTo(elementId);\n }, true);\n }\n\n // Cleanup\n disconnectedCallback() {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n }\n super.disconnectedCallback();\n }\n\n infoDescriptionHeadingRenderer() {\n const renderer = new marked.Renderer();\n renderer.heading = ((text, level, raw, slugger) => `${text}`);\n return renderer;\n }\n\n render() {\n // return render(mainBodyTemplate(this), this.shadowRoot, { eventContext: this });\n const cssLinkEl = document.querySelector(`link[href*=\"${this.cssFile}\"]`);\n // adding custom style for RapiDoc\n if (cssLinkEl) {\n this.shadowRoot.appendChild(cssLinkEl.cloneNode());\n }\n return mainBodyTemplate.call(this);\n }\n\n observeExpandedContent() {\n // Main Container\n const observeOverviewEls = this.shadowRoot.querySelectorAll('.observe-me');\n observeOverviewEls.forEach((targetEl) => {\n this.intersectionObserver.observe(targetEl);\n });\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'spec-url') {\n if (oldVal !== newVal) {\n // put it at the end of event-loop to load all the attributes\n window.setTimeout(async () => {\n await this.loadSpec(newVal);\n // If goto-path is provided and no location-hash is present then try to scroll there\n if (this.gotoPath && !window.location.hash) {\n this.scrollTo(this.gotoPath);\n }\n }, 0);\n }\n }\n if (name === 'render-style') {\n if (newVal === 'read') {\n window.setTimeout(() => {\n this.observeExpandedContent();\n }, 100);\n } else {\n this.intersectionObserver.disconnect();\n }\n }\n if (name === 'api-key-name' || name === 'api-key-location' || name === 'api-key-value') {\n let updateSelectedApiKey = false;\n let apiKeyName = '';\n let apiKeyLocation = '';\n let apiKeyValue = '';\n\n if (name === 'api-key-name') {\n if (this.getAttribute('api-key-location') && this.getAttribute('api-key-value')) {\n apiKeyName = newVal;\n apiKeyLocation = this.getAttribute('api-key-location');\n apiKeyValue = this.getAttribute('api-key-value');\n updateSelectedApiKey = true;\n }\n } else if (name === 'api-key-location') {\n if (this.getAttribute('api-key-name') && this.getAttribute('api-key-value')) {\n apiKeyLocation = newVal;\n apiKeyName = this.getAttribute('api-key-name');\n apiKeyValue = this.getAttribute('api-key-value');\n updateSelectedApiKey = true;\n }\n } else if (name === 'api-key-value') {\n if (this.getAttribute('api-key-name') && this.getAttribute('api-key-location')) {\n apiKeyValue = newVal;\n apiKeyLocation = this.getAttribute('api-key-location');\n apiKeyName = this.getAttribute('api-key-name');\n updateSelectedApiKey = true;\n }\n }\n\n if (updateSelectedApiKey) {\n if (this.resolvedSpec) {\n const rapiDocApiKey = this.resolvedSpec.securitySchemes.find((v) => v.securitySchemeId === rapidocApiKey);\n if (!rapiDocApiKey) {\n this.resolvedSpec.securitySchemes.push({\n securitySchemeId: rapidocApiKey,\n description: 'api-key provided in rapidoc element attributes',\n type: 'apiKey',\n name: apiKeyName,\n in: apiKeyLocation,\n value: apiKeyValue,\n finalKeyValue: apiKeyValue,\n });\n } else {\n rapiDocApiKey.name = apiKeyName;\n rapiDocApiKey.in = apiKeyLocation;\n rapiDocApiKey.value = apiKeyValue;\n rapiDocApiKey.finalKeyValue = apiKeyValue;\n }\n this.requestUpdate();\n }\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n onSepcUrlChange() {\n this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);\n }\n\n onSepcFileChange(e) {\n this.setAttribute('spec-file', this.shadowRoot.getElementById('spec-file').value);\n const specFile = e.target.files[0];\n const reader = new FileReader();\n reader.onload = () => {\n try {\n const specObj = JSON.parse(reader.result);\n this.loadSpec(specObj);\n this.shadowRoot.getElementById('spec-url').value = '';\n } catch (err) {\n console.error('RapiDoc: Unable to read or parse json'); // eslint-disable-line no-console\n }\n };\n // Read the Text file\n reader.readAsText(specFile);\n }\n\n onFileLoadClick() {\n this.shadowRoot.getElementById('spec-file').click();\n }\n\n onSearchChange(e) {\n this.matchPaths = e.target.value;\n this.resolvedSpec.tags.forEach((tag) => tag.paths.filter((v) => {\n if (this.matchPaths) {\n // v.expanded = false;\n if (pathIsInSearch(this.matchPaths, v, this.matchType)) {\n tag.expanded = true;\n }\n }\n }));\n this.resolvedSpec.components.forEach((component) => component.subComponents.filter((v) => {\n v.expanded = false;\n if (!this.matchPaths || componentIsInSearch(this.matchPaths, v)) {\n v.expanded = true;\n }\n }));\n this.requestUpdate();\n }\n\n onClearSearch() {\n const searchEl = this.shadowRoot.getElementById('nav-bar-search');\n searchEl.value = '';\n this.matchPaths = '';\n this.resolvedSpec.components.forEach((component) => component.subComponents.filter((v) => {\n v.expanded = true;\n }));\n }\n\n onShowSearchModalClicked() {\n this.showAdvancedSearchDialog = true;\n }\n\n // Event Handler on Dialog-Box is opened\n async onOpenSearchDialog(e) {\n // Set focus to text input\n const inputEl = e.detail.querySelector('input');\n await sleep(0);\n if (inputEl) {\n inputEl.focus();\n }\n }\n\n // Public Method\n async loadSpec(specUrl) {\n if (!specUrl) {\n return;\n }\n this.matchPaths = '';\n try {\n this.resolvedSpec = {\n specLoadError: false,\n isSpecLoading: true,\n tags: [],\n };\n this.loading = true;\n this.loadFailed = false;\n const spec = await ProcessSpec.call(\n this,\n specUrl,\n this.generateMissingTags === 'true',\n this.sortTags === 'true',\n this.getAttribute('sort-endpoints-by'),\n this.getAttribute('api-key-name'),\n this.getAttribute('api-key-location'),\n this.getAttribute('api-key-value'),\n this.getAttribute('server-url'),\n );\n this.loading = false;\n this.afterSpecParsedAndValidated(spec);\n } catch (err) {\n this.loading = false;\n this.loadFailed = true;\n this.resolvedSpec = null;\n console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console\n }\n }\n\n async afterSpecParsedAndValidated(spec) {\n this.resolvedSpec = spec;\n this.selectedServer = undefined;\n if (this.defaultApiServerUrl) {\n if (this.defaultApiServerUrl === this.serverUrl) {\n this.selectedServer = {\n url: this.serverUrl,\n computedUrl: this.serverUrl,\n };\n } else if (this.resolvedSpec.servers) {\n this.selectedServer = this.resolvedSpec.servers.find((v) => (v.url === this.defaultApiServerUrl));\n }\n }\n if (!this.selectedServer) {\n if (this.resolvedSpec.servers) {\n this.selectedServer = this.resolvedSpec.servers[0]; // eslint-disable-line prefer-destructuring\n }\n }\n this.requestUpdate();\n // eslint-disable-next-line no-await-in-loop\n while (!await this.updateComplete);\n const specLoadedEvent = new CustomEvent('spec-loaded', { detail: spec });\n this.dispatchEvent(specLoadedEvent);\n\n // Initiate IntersectionObserver and put it at the end of event loop, to allow loading all the child elements (must for larger specs)\n this.intersectionObserver.disconnect();\n if (this.renderStyle === 'read') {\n await sleep(100);\n this.observeExpandedContent(); // This will auto-highlight the selected nav-item in read-mode\n }\n\n // On first time Spec load, try to navigate to location hash if provided\n const locationHash = window.location.hash?.substring(1);\n if (locationHash) {\n const regEx = new RegExp(`^${this.routePrefix}`, 'i');\n const elementId = window.location.hash.replace(regEx, '');\n if (this.renderStyle === 'view') {\n this.expandAndGotoOperation(elementId, true, true);\n } else {\n this.scrollTo(elementId);\n }\n } else if (this.renderStyle === 'focused') {\n // If goto-path is provided and no location-hash is present then try to scroll to default element\n if (!this.gotoPath) {\n const defaultElementId = this.showInfo ? 'overview' : this.resolvedSpec.tags[0]?.paths[0];\n this.scrollTo(defaultElementId);\n }\n }\n }\n\n expandAndGotoOperation(elementId, scrollToElement = true) {\n if (!this.resolvedSpec) {\n return;\n }\n // Expand full operation and tag\n let isExpandingNeeded = true;\n const tmpElementId = elementId.indexOf('#') === -1 ? elementId : elementId.substring(1);\n if (tmpElementId.startsWith('overview') || tmpElementId === 'servers' || tmpElementId === 'auth') {\n isExpandingNeeded = false;\n } else {\n for (let i = 0; i < this.resolvedSpec.tags?.length; i++) {\n const tag = this.resolvedSpec.tags[i];\n const path = tag.paths?.find((p) => p.elementId === elementId);\n if (path) {\n if (path.expanded && tag.expanded) {\n isExpandingNeeded = false;\n } else {\n path.expanded = true;\n tag.expanded = true;\n }\n }\n }\n }\n if (scrollToElement) {\n // requestUpdate() and delay required, else we cant find element\n if (isExpandingNeeded) {\n this.requestUpdate();\n }\n window.setTimeout(() => {\n const gotoEl = this.shadowRoot.getElementById(tmpElementId);\n if (gotoEl) {\n gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n if (this.updateRoute === 'true') {\n window.history.replaceState(null, null, `${this.routePrefix || '#'}${tmpElementId}`);\n }\n }\n }, isExpandingNeeded ? 150 : 0);\n }\n }\n\n isValidTopId(id) {\n return (id.startsWith('overview') || id === 'servers' || id === 'auth');\n }\n\n isValidPathId(id) {\n if (id === 'overview' && this.showInfo) {\n return true;\n }\n if (id === 'servers' && this.allowServerSelection) {\n return true;\n }\n if (id === 'auth' && this.allowAuthentication) {\n return true;\n }\n if (id.startsWith('tag--')) {\n return this.resolvedSpec?.tags?.find((tag) => tag.elementId === id);\n }\n return this.resolvedSpec?.tags?.find((tag) => tag.paths.find((path) => path.elementId === id));\n }\n\n onIntersect(entries) {\n if (this.isIntersectionObserverActive === false) {\n return;\n }\n entries.forEach((entry) => {\n if (entry.isIntersecting && entry.intersectionRatio > 0) {\n const oldNavEl = this.shadowRoot.querySelector('.nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active');\n const newNavEl = this.shadowRoot.getElementById(`link-${entry.target.id}`);\n\n // Add active class in the new element\n if (newNavEl) {\n if (this.updateRoute === 'true') {\n window.history.replaceState(null, null, `${window.location.href.split('#')[0]}${this.routePrefix || '#'}${entry.target.id}`);\n }\n newNavEl.scrollIntoView({ behavior: 'auto', block: 'center' });\n newNavEl.classList.add('active');\n }\n // Remove active class from previous element\n if (oldNavEl) {\n oldNavEl.classList.remove('active');\n }\n }\n });\n }\n\n // Called by anchor tags created using markdown\n handleHref(e) {\n if (e.target.tagName.toLowerCase() === 'a') {\n if (e.target.getAttribute('href').startsWith('#')) {\n const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));\n if (gotoEl) {\n gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n }\n }\n }\n }\n\n /**\n * Called by\n * - onClick of Navigation Bar\n * - onClick of Advanced Search items\n *\n * Functionality:\n * 1. First deactivate IntersectionObserver\n * 2. Scroll to the element\n * 3. Activate IntersectionObserver (after little delay)\n *\n */\n async scrollToEventTarget(event, scrollNavItemToView = true) {\n const navEl = event.currentTarget;\n if (!navEl.dataset.contentId) {\n return;\n }\n this.isIntersectionObserverActive = false;\n if (this.renderStyle === 'focused') {\n const requestEl = this.shadowRoot.querySelector('api-request');\n if (requestEl) {\n requestEl.beforerNavigationFocusedMode();\n }\n }\n this.scrollTo(navEl.dataset.contentId, true, scrollNavItemToView);\n setTimeout(() => {\n this.isIntersectionObserverActive = true;\n }, 300);\n }\n\n // Public Method (scrolls to a given path and highlights the left-nav selection)\n async scrollTo(elementId, expandPath = true, scrollNavItemToView = true) {\n if (this.renderStyle === 'focused') {\n // for focused mode update this.focusedElementId to update the rendering, else it wont find the needed html elements\n // focusedElementId will get validated in the template\n this.focusedElementId = elementId;\n await sleep(0);\n }\n if (this.renderStyle === 'view') {\n this.expandAndGotoOperation(elementId, expandPath, true);\n } else {\n let isValidElementId = false;\n const contentEl = this.shadowRoot.getElementById(elementId);\n if (contentEl) {\n isValidElementId = true;\n contentEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n } else {\n isValidElementId = false;\n }\n if (isValidElementId) {\n // for focused style it is important to reset request-body-selection and response selection which maintains the state for in case of multiple req-body or multiple response mime-type\n if (this.renderStyle === 'focused') {\n const requestEl = this.shadowRoot.querySelector('api-request');\n if (requestEl) {\n requestEl.afterNavigationFocusedMode();\n }\n const responseEl = this.shadowRoot.querySelector('api-response');\n if (responseEl) {\n responseEl.resetSelection();\n }\n }\n\n // Update Location Hash\n if (this.updateRoute === 'true') {\n window.history.replaceState(null, null, `${this.routePrefix || '#'}${elementId}`);\n }\n\n // Update NavBar View and Styles\n const newNavEl = this.shadowRoot.getElementById(`link-${elementId}`);\n\n if (newNavEl) {\n if (scrollNavItemToView) {\n newNavEl.scrollIntoView({ behavior: 'auto', block: 'center' });\n }\n await sleep(0);\n const oldNavEl = this.shadowRoot.querySelector('.nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active');\n if (oldNavEl) {\n oldNavEl.classList.remove('active');\n }\n newNavEl.classList.add('active'); // must add the class after scrolling\n // this.requestUpdate();\n }\n }\n }\n }\n\n // Public Method - to update security-scheme of type http\n setHttpUserNameAndPassword(securitySchemeId, username, password) {\n return applyApiKey.call(this, securitySchemeId, username, password);\n }\n\n // Public Method - to update security-scheme of type apiKey or OAuth\n setApiKey(securitySchemeId, apiKeyValue) {\n return applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);\n }\n\n // Public Method\n removeAllSecurityKeys() {\n return onClearAllApiKeys.call(this);\n }\n\n // Public Method\n setApiServer(apiServerUrl) {\n // return apiServerUrl;\n return setApiServer.call(this, apiServerUrl);\n }\n\n // Event handler for Advanced Search text-inputs and checkboxes\n onAdvancedSearch(ev, delay) {\n const eventTargetEl = ev.target;\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(() => {\n let searchInputEl;\n if (eventTargetEl.type === 'text') {\n searchInputEl = eventTargetEl;\n } else {\n searchInputEl = eventTargetEl.closest('.advanced-search-options').querySelector('input[type=text]');\n }\n const searcOptions = [...eventTargetEl.closest('.advanced-search-options').querySelectorAll('input:checked')].map((v) => v.id);\n this.advancedSearchMatches = advancedSearch(searchInputEl.value, this.resolvedSpec.tags, searcOptions);\n }, delay);\n }\n}\ncustomElements.define('rapi-doc', RapiDoc);\n","import { css, LitElement } from 'lit';\nimport { marked } from 'marked';\nimport Prism from 'prismjs';\nimport 'prismjs/components/prism-css';\nimport 'prismjs/components/prism-yaml';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-http';\nimport 'prismjs/components/prism-csharp';\n\n// Styles\nimport FontStyles from '~/styles/font-styles';\nimport InputStyles from '~/styles/input-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport TableStyles from '~/styles/table-styles';\nimport PrismStyles from '~/styles/prism-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport NavStyles from '~/styles/nav-styles';\nimport InfoStyles from '~/styles/info-styles';\n\nimport EndpointStyles from '~/styles/endpoint-styles';\nimport { rapidocApiKey } from '~/utils/common-utils';\nimport ProcessSpec from '~/utils/spec-parser';\nimport mainBodyTemplate from '~/templates/main-body-template';\nimport { applyApiKey, onClearAllApiKeys } from '~/templates/security-scheme-template';\nimport { setApiServer } from '~/templates/server-template';\n\nexport default class RapiDocMini extends LitElement {\n constructor() {\n super();\n this.isMini = true;\n this.updateRoute = 'false';\n this.renderStyle = 'view';\n this.showHeader = 'false';\n this.allowAdvancedSearch = 'false';\n }\n\n static get properties() {\n return {\n // Spec\n specUrl: { type: String, attribute: 'spec-url' },\n sortEndpointsBy: { type: String, attribute: 'sort-endpoints-by' },\n\n // UI Layouts\n layout: { type: String },\n pathsExpanded: { type: String, attribute: 'paths-expanded' },\n defaultSchemaTab: { type: String, attribute: 'default-schema-tab' },\n responseAreaHeight: { type: String, attribute: 'response-area-height' },\n showSummaryWhenCollapsed: { type: String, attribute: 'show-summary-when-collapsed' },\n fillRequestFieldsWithExample: { type: String, attribute: 'fill-request-fields-with-example' },\n persistAuth: { type: String, attribute: 'persist-auth' },\n\n // Schema Styles\n schemaStyle: { type: String, attribute: 'schema-style' },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n\n // API Server\n apiKeyName: { type: String, attribute: 'api-key-name' },\n apiKeyLocation: { type: String, attribute: 'api-key-location' },\n apiKeyValue: { type: String, attribute: 'api-key-value' },\n defaultApiServerUrl: { type: String, attribute: 'default-api-server' },\n serverUrl: { type: String, attribute: 'server-url' },\n oauthReceiver: { type: String, attribute: 'oauth-receiver' },\n\n allowTry: { type: String, attribute: 'allow-try' },\n\n // Main Colors and Font\n theme: { type: String },\n bgColor: { type: String, attribute: 'bg-color' },\n textColor: { type: String, attribute: 'text-color' },\n primaryColor: { type: String, attribute: 'primary-color' },\n fontSize: { type: String, attribute: 'font-size' },\n regularFont: { type: String, attribute: 'regular-font' },\n monoFont: { type: String, attribute: 'mono-font' },\n loadFonts: { type: String, attribute: 'load-fonts' },\n\n // Fetch Options\n fetchCredentials: { type: String, attribute: 'fetch-credentials' },\n\n // Filters\n matchPaths: { type: String, attribute: 'match-paths' },\n matchType: { type: String, attribute: 'match-type' },\n\n // Internal Properties\n loading: { type: Boolean }, // indicates spec is being loaded\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n InputStyles,\n FlexStyles,\n TableStyles,\n EndpointStyles,\n PrismStyles,\n TabStyles,\n NavStyles,\n InfoStyles,\n css`\n :host {\n display:flex;\n flex-direction: column;\n min-width:360px;\n width:100%;\n height:100%;\n margin:0;\n padding:0;\n overflow: hidden;\n letter-spacing:normal;\n color:var(--fg);\n background-color:var(--bg);\n font-family:var(--font-regular);\n }\n\n @media only screen and (min-width: 768px) {\n .only-large-screen{\n display:block;\n }\n .only-large-screen-flex{\n display:flex;\n }\n }`,\n ];\n }\n\n // Startup\n connectedCallback() {\n super.connectedCallback();\n\n if (this.loadFonts !== 'false') {\n const fontDescriptor = {\n family: 'Open Sans',\n style: 'normal',\n weight: '300',\n unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD',\n };\n const fontWeight300 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontDescriptor.weight = '600';\n const fontWeight600 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontWeight300.load().then((font) => { document.fonts.add(font); });\n fontWeight600.load().then((font) => { document.fonts.add(font); });\n }\n\n if (!this.showSummaryWhenCollapsed || !'true, false,'.includes(`${this.showSummaryWhenCollapsed},`)) { this.showSummaryWhenCollapsed = 'true'; }\n if (!this.layout || !'row, column,'.includes(`${this.layout},`)) { this.layout = 'row'; }\n if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) { this.schemaStyle = 'tree'; }\n if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {\n this.theme = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';\n }\n if (!this.defaultSchemaTab || !'example, schema, model,'.includes(`${this.defaultSchemaTab},`)) {\n this.defaultSchemaTab = 'example';\n } else if (this.defaultSchemaTab === 'model') {\n this.defaultSchemaTab = 'schema';\n }\n this.pathsExpanded = this.pathsExpanded === 'true';\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) { this.schemaDescriptionExpanded = 'false'; }\n if (!this.fillRequestFieldsWithExample || !'true, false,'.includes(`${this.fillRequestFieldsWithExample},`)) { this.fillRequestFieldsWithExample = 'true'; }\n if (!this.persistAuth || !'true, false,'.includes(`${this.persistAuth},`)) { this.persistAuth = 'false'; }\n if (!this.responseAreaHeight) { this.responseAreaHeight = '300px'; }\n\n if (!this.allowTry || !'true, false,'.includes(`${this.allowTry},`)) { this.allowTry = 'true'; }\n if (!this.apiKeyValue) { this.apiKeyValue = '-'; }\n if (!this.apiKeyLocation) { this.apiKeyLocation = 'header'; }\n if (!this.apiKeyName) { this.apiKeyName = ''; }\n\n if (!this.oauthReceiver) { this.oauthReceiver = 'oauth-receiver.html'; }\n if (!this.sortTags || !'true, false,'.includes(`${this.sortTags},`)) { this.sortTags = 'false'; }\n if (!this.sortEndpointsBy || !'method, path, summary,'.includes(`${this.sortEndpointsBy},`)) { this.sortEndpointsBy = 'path'; }\n if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) { this.fontSize = 'default'; }\n if (!this.matchType || !'includes regex'.includes(this.matchType)) { this.matchType = 'includes'; }\n\n if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) { this.allowSchemaDescriptionExpandToggle = 'true'; }\n if (!this.fetchCredentials || !'omit, same-origin, include,'.includes(`${this.fetchCredentials},`)) { this.fetchCredentials = ''; }\n\n marked.setOptions({\n highlight: (code, lang) => {\n if (Prism.languages[lang]) {\n return Prism.highlight(code, Prism.languages[lang], lang);\n }\n return code;\n },\n });\n }\n\n render() {\n return mainBodyTemplate.call(this, true, false, false, this.pathsExpanded);\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'spec-url') {\n if (oldVal !== newVal) {\n // put it at the end of event-loop to load all the attributes\n window.setTimeout(async () => {\n await this.loadSpec(newVal);\n }, 0);\n }\n }\n if (name === 'api-key-name' || name === 'api-key-location' || name === 'api-key-value') {\n let updateSelectedApiKey = false;\n let apiKeyName = '';\n let apiKeyLocation = '';\n let apiKeyValue = '';\n\n if (name === 'api-key-name') {\n if (this.getAttribute('api-key-location') && this.getAttribute('api-key-value')) {\n apiKeyName = newVal;\n apiKeyLocation = this.getAttribute('api-key-location');\n apiKeyValue = this.getAttribute('api-key-value');\n updateSelectedApiKey = true;\n }\n } else if (name === 'api-key-location') {\n if (this.getAttribute('api-key-name') && this.getAttribute('api-key-value')) {\n apiKeyLocation = newVal;\n apiKeyName = this.getAttribute('api-key-name');\n apiKeyValue = this.getAttribute('api-key-value');\n updateSelectedApiKey = true;\n }\n } else if (name === 'api-key-value') {\n if (this.getAttribute('api-key-name') && this.getAttribute('api-key-location')) {\n apiKeyValue = newVal;\n apiKeyLocation = this.getAttribute('api-key-location');\n apiKeyName = this.getAttribute('api-key-name');\n updateSelectedApiKey = true;\n }\n }\n\n if (updateSelectedApiKey) {\n if (this.resolvedSpec) {\n const rapiDocApiKey = this.resolvedSpec.securitySchemes.find((v) => v.securitySchemeId === rapidocApiKey);\n if (!rapiDocApiKey) {\n this.resolvedSpec.securitySchemes.push({\n apiKeyId: rapidocApiKey,\n description: 'api-key provided in rapidoc element attributes',\n type: 'apiKey',\n name: apiKeyName,\n in: apiKeyLocation,\n value: apiKeyValue,\n finalKeyValue: apiKeyValue,\n });\n } else {\n rapiDocApiKey.name = apiKeyName;\n rapiDocApiKey.in = apiKeyLocation;\n rapiDocApiKey.value = apiKeyValue;\n rapiDocApiKey.finalKeyValue = apiKeyValue;\n }\n this.requestUpdate();\n }\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n onSepcUrlChange() {\n this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);\n }\n\n // Public Method\n async loadSpec(specUrl) {\n if (!specUrl) {\n return;\n }\n try {\n this.resolvedSpec = {\n specLoadError: false,\n isSpecLoading: true,\n tags: [],\n };\n this.loading = true;\n this.loadFailed = false;\n this.requestUpdate();\n const spec = await ProcessSpec.call(\n this,\n specUrl,\n this.generateMissingTags === 'true',\n this.sortTags === 'true',\n this.getAttribute('sort-endpoints-by'),\n this.getAttribute('api-key-name'),\n this.getAttribute('api-key-location'),\n this.getAttribute('api-key-value'),\n this.getAttribute('server-url'),\n );\n this.loading = false;\n this.afterSpecParsedAndValidated(spec);\n } catch (err) {\n this.loading = false;\n this.loadFailed = true;\n this.resolvedSpec = null;\n console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console\n }\n }\n\n // Public Method - to update security-scheme of type http\n setHttpUserNameAndPassword(securitySchemeId, username, password) {\n return applyApiKey.call(this, securitySchemeId, username, password);\n }\n\n // Public Method - to update security-scheme of type apiKey or OAuth\n setApiKey(securitySchemeId, apiKeyValue) {\n return applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);\n }\n\n // Public Method\n removeAllSecurityKeys() {\n return onClearAllApiKeys.call(this);\n }\n\n // Public Method\n setApiServer(apiServerUrl) {\n // return apiServerUrl;\n return setApiServer.call(this, apiServerUrl);\n }\n\n async afterSpecParsedAndValidated(spec) {\n this.resolvedSpec = spec;\n this.selectedServer = undefined;\n if (this.defaultApiServerUrl) {\n if (this.defaultApiServerUrl === this.serverUrl) {\n this.selectedServer = {\n url: this.serverUrl,\n computedUrl: this.serverUrl,\n };\n } else if (this.resolvedSpec.servers) {\n this.selectedServer = this.resolvedSpec.servers.find((v) => (v.url === this.defaultApiServerUrl));\n }\n }\n if (!this.selectedServer) {\n if (this.resolvedSpec.servers) {\n this.selectedServer = this.resolvedSpec.servers[0]; // eslint-disable-line prefer-destructuring\n }\n }\n this.requestUpdate();\n // eslint-disable-next-line no-await-in-loop\n while (!await this.updateComplete);\n const specLoadedEvent = new CustomEvent('spec-loaded', { detail: spec });\n this.dispatchEvent(specLoadedEvent);\n }\n\n // Called by anchor tags created using markdown\n handleHref(e) {\n if (e.target.tagName.toLowerCase() === 'a') {\n if (e.target.getAttribute('href').startsWith('#')) {\n const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));\n if (gotoEl) {\n gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n }\n }\n }\n }\n}\ncustomElements.define('rapi-doc-mini', RapiDocMini);\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\n\n// Templates\nimport overviewTemplate from '~/templates/overview-template';\nimport headerTemplate from '~/templates/header-template';\nimport { schemaInObjectNotation, generateExample } from '~/utils/schema-utils';\nimport '~/components/json-tree';\nimport '~/components/schema-tree';\nimport SetTheme from '~/utils/theme';\nimport { isValidHexColor } from '~/utils/color-utils';\n\n/* eslint-disable indent */\n// Json Schema Nav Template\nfunction jsonSchemaNavTemplate() {\n return html`\n \n `;\n}\n\n// Json Schema Body Template\nfunction jsonSchemaBodyTemplate() {\n return html`\n ${this.showInfo === 'true' ? overviewTemplate.call(this) : ''}\n
\n ${this.resolvedSpec.schemaAndExamples.map((jSchemaBody) => {\n const examplesObj = generateExample(jSchemaBody.schema, 'json', jSchemaBody.examples, jSchemaBody.example, true, false, 'json', true);\n jSchemaBody.selectedExample = examplesObj[0]?.exampleId;\n return html`\n
\n
\n
${jSchemaBody.name}
\n ${unsafeHTML(marked(jSchemaBody.description || ''))}\n
\n
\n
\n \n
\n
\n ${examplesObj.length > 1\n ? html``\n : html`
${examplesObj[0].exampleSummary}
`\n }\n ${examplesObj.map((v) => html`\n `)\n }\n
\n
\n
`;\n })\n }\n
\n `;\n}\n/* eslint-enable indent */\n\n// Json Schema Root Template\nexport default function jsonSchemaViewerTemplate(isMini = false) {\n// export default function jsonSchemaViewerTemplate(isMini = false, showExpandCollapse = true, showTags = true, pathsExpanded = false) {\n if (!this.resolvedSpec) {\n return '';\n }\n const newTheme = {\n bg1: isValidHexColor(this.bgColor) ? this.bgColor : '',\n fg1: isValidHexColor(this.textColor) ? this.textColor : '',\n headerColor: isValidHexColor(this.headerColor) ? this.headerColor : '',\n primaryColor: isValidHexColor(this.primaryColor) ? this.primaryColor : '',\n navBgColor: isValidHexColor(this.navBgColor) ? this.navBgColor : '',\n navTextColor: isValidHexColor(this.navTextColor) ? this.navTextColor : '',\n navHoverBgColor: isValidHexColor(this.navHoverBgColor) ? this.navHoverBgColor : '',\n navHoverTextColor: isValidHexColor(this.navHoverTextColor) ? this.navHoverTextColor : '',\n navAccentColor: isValidHexColor(this.navAccentColor) ? this.navAccentColor : '',\n };\n /* eslint-disable indent */\n if (this.resolvedSpec.specLoadError) {\n if (isMini) {\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n
${this.resolvedSpec.info.description}
\n `;\n }\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n \n ${headerTemplate.call(this)}\n

Header

\n
\n \n
\n

${this.resolvedSpec.info.title}

\n
${this.resolvedSpec.info.description}
\n
\n
\n `;\n }\n if (this.resolvedSpec.isSpecLoading) {\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n
\n \n
\n
\n
\n
\n `;\n }\n\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n\n \n ${this.showHeader === 'false' ? '' : headerTemplate.call(this)}\n \n
\n\n \n ${jsonSchemaNavTemplate.call(this)}\n\n \n
\n \n
\n ${this.loading === true\n ? html`
`\n : html`\n ${this.loadFailed === true\n ? html`
Unable to load the Spec
`\n : html`\n
{ this.handleHref(e); }}\">\n ${jsonSchemaBodyTemplate.call(this)}\n
\n `\n }`\n }\n
\n \n
\n
\n `;\n}\n/* eslint-enable indent */\n","import { css, LitElement } from 'lit';\nimport { marked } from 'marked';\nimport Prism from 'prismjs';\nimport 'prismjs/components/prism-css';\nimport 'prismjs/components/prism-yaml';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-http';\nimport 'prismjs/components/prism-csharp';\n\n// Styles\nimport FontStyles from '~/styles/font-styles';\nimport InputStyles from '~/styles/input-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport TableStyles from '~/styles/table-styles';\nimport PrismStyles from '~/styles/prism-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport NavStyles from '~/styles/nav-styles';\nimport InfoStyles from '~/styles/info-styles';\n\nimport EndpointStyles from '~/styles/endpoint-styles';\nimport ProcessSpec from '~/utils/spec-parser';\nimport jsonSchemaViewerTemplate from '~/templates/json-schema-viewer-template';\n\nexport default class JsonSchemaViewer extends LitElement {\n constructor() {\n super();\n this.isMini = false;\n this.updateRoute = 'false';\n this.renderStyle = 'focused';\n this.showHeader = 'true';\n this.allowAdvancedSearch = 'false';\n this.selectedExampleForEachSchema = {};\n }\n\n static get properties() {\n return {\n // Spec\n specUrl: { type: String, attribute: 'spec-url' },\n\n // Schema Styles\n schemaStyle: { type: String, attribute: 'schema-style' },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n\n // Hide/show Sections\n showHeader: { type: String, attribute: 'show-header' },\n showSideNav: { type: String, attribute: 'show-side-nav' },\n showInfo: { type: String, attribute: 'show-info' },\n\n // Allow or restrict features\n allowSpecUrlLoad: { type: String, attribute: 'allow-spec-url-load' },\n allowSpecFileLoad: { type: String, attribute: 'allow-spec-file-load' },\n allowSpecFileDownload: { type: String, attribute: 'allow-spec-file-download' },\n allowSearch: { type: String, attribute: 'allow-search' },\n\n // Main Colors and Font\n theme: { type: String },\n bgColor: { type: String, attribute: 'bg-color' },\n textColor: { type: String, attribute: 'text-color' },\n primaryColor: { type: String, attribute: 'primary-color' },\n fontSize: { type: String, attribute: 'font-size' },\n regularFont: { type: String, attribute: 'regular-font' },\n monoFont: { type: String, attribute: 'mono-font' },\n loadFonts: { type: String, attribute: 'load-fonts' },\n\n // Internal Properties\n loading: { type: Boolean }, // indicates spec is being loaded\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n InputStyles,\n FlexStyles,\n TableStyles,\n EndpointStyles,\n PrismStyles,\n TabStyles,\n NavStyles,\n InfoStyles,\n css`\n :host {\n display:flex;\n flex-direction: column;\n min-width:360px;\n width:100%;\n height:100%;\n margin:0;\n padding:0;\n overflow: hidden;\n letter-spacing:normal;\n color:var(--fg);\n background-color:var(--bg);\n font-family:var(--font-regular);\n }\n .body {\n display:flex;\n height:100%;\n width:100%;\n overflow:hidden;\n }\n .nav-bar {\n width: 230px;\n display:flex;\n }\n\n .main-content { \n margin:0;\n padding: 16px; \n display:block;\n flex:1;\n height:100%;\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: thin;\n scrollbar-color: var(--border-color) transparent;\n }\n .main-content-inner--view-mode {\n padding: 0 8px;\n }\n .main-content::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n .main-content::-webkit-scrollbar-track {\n background:transparent;\n }\n .main-content::-webkit-scrollbar-thumb {\n background-color: var(--border-color);\n }\n .main-header {\n background-color:var(--header-bg);\n color:var(--header-fg);\n width:100%;\n }\n .header-title {\n font-size:calc(var(--font-size-regular) + 8px); \n padding:0 8px;\n }\n input.header-input{\n background:var(--header-color-darker);\n color:var(--header-fg);\n border:1px solid var(--header-color-border);\n flex:1; \n padding-right:24px;\n border-radius:3px;\n }\n input.header-input::placeholder {\n opacity:0.4;\n }\n .loader {\n margin: 16px auto 16px auto; \n border: 4px solid var(--bg3);\n border-radius: 50%;\n border-top: 4px solid var(--primary-color);\n width: 36px;\n height: 36px;\n animation: spin 2s linear infinite;\n }\n @media only screen and (min-width: 768px) {\n .only-large-screen{\n display:block;\n }\n .only-large-screen-flex{\n display:flex;\n }\n }`,\n ];\n }\n\n // Startup\n connectedCallback() {\n super.connectedCallback();\n const parent = this.parentElement;\n if (parent) {\n if (parent.offsetWidth === 0 && parent.style.width === '') {\n parent.style.width = '100vw';\n }\n if (parent.offsetHeight === 0 && parent.style.height === '') {\n parent.style.height = '100vh';\n }\n if (parent.tagName === 'BODY') {\n if (!parent.style.marginTop) { parent.style.marginTop = '0'; }\n if (!parent.style.marginRight) { parent.style.marginRight = '0'; }\n if (!parent.style.marginBottom) { parent.style.marginBottom = '0'; }\n if (!parent.style.marginLeft) { parent.style.marginLeft = '0'; }\n }\n }\n\n if (this.loadFonts !== 'false') {\n const fontDescriptor = {\n family: 'Open Sans',\n style: 'normal',\n weight: '300',\n unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD',\n };\n const fontWeight300 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontDescriptor.weight = '600';\n const fontWeight600 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontWeight300.load().then((font) => { document.fonts.add(font); });\n fontWeight600.load().then((font) => { document.fonts.add(font); });\n }\n\n this.renderStyle = 'focused';\n this.pathsExpanded = this.pathsExpanded === 'true';\n\n if (!this.showInfo || !'true, false,'.includes(`${this.showInfo},`)) { this.showInfo = 'true'; }\n if (!this.showSideNav || !'true false'.includes(this.showSideNav)) { this.showSideNav = 'true'; }\n if (!this.showHeader || !'true, false,'.includes(`${this.showHeader},`)) { this.showHeader = 'true'; }\n\n if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) { this.schemaStyle = 'tree'; }\n if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {\n this.theme = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';\n }\n if (!this.allowSearch || !'true, false,'.includes(`${this.allowSearch},`)) { this.allowSearch = 'true'; }\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) { this.schemaDescriptionExpanded = 'false'; }\n if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) { this.fontSize = 'default'; }\n if (!this.matchType || !'includes regex'.includes(this.matchType)) { this.matchType = 'includes'; }\n if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) { this.allowSchemaDescriptionExpandToggle = 'true'; }\n\n marked.setOptions({\n highlight: (code, lang) => {\n if (Prism.languages[lang]) {\n return Prism.highlight(code, Prism.languages[lang], lang);\n }\n return code;\n },\n });\n }\n\n render() {\n return jsonSchemaViewerTemplate.call(this, true, false, false, this.pathsExpanded);\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'spec-url') {\n if (oldVal !== newVal) {\n // put it at the end of event-loop to load all the attributes\n window.setTimeout(async () => {\n await this.loadSpec(newVal);\n }, 0);\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n onSepcUrlChange() {\n this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);\n }\n\n onSearchChange(e) {\n // Todo: Filter Search\n this.matchPaths = e.target.value;\n }\n\n // Public Method\n async loadSpec(specUrl) {\n if (!specUrl) {\n return;\n }\n try {\n this.resolvedSpec = {\n specLoadError: false,\n isSpecLoading: true,\n tags: [],\n };\n this.loading = true;\n this.loadFailed = false;\n this.requestUpdate();\n const spec = await ProcessSpec.call(\n this,\n specUrl,\n this.generateMissingTags === 'true',\n this.sortTags === 'true',\n this.getAttribute('sort-endpoints-by'),\n );\n this.loading = false;\n this.afterSpecParsedAndValidated(spec);\n } catch (err) {\n this.loading = false;\n this.loadFailed = true;\n this.resolvedSpec = null;\n console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console\n }\n }\n\n async afterSpecParsedAndValidated(spec) {\n this.resolvedSpec = spec;\n const specLoadedEvent = new CustomEvent('spec-loaded', { detail: spec });\n this.dispatchEvent(specLoadedEvent);\n }\n\n // Called by anchor tags created using markdown\n handleHref(e) {\n if (e.target.tagName.toLowerCase() === 'a') {\n if (e.target.getAttribute('href').startsWith('#')) {\n const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));\n if (gotoEl) {\n gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n }\n }\n }\n }\n\n // Example Dropdown @change Handler\n onSelectExample(e) {\n const exampleContainerEl = e.target.closest('.json-schema-example-panel');\n const exampleEls = [...exampleContainerEl.querySelectorAll('.example')];\n exampleEls.forEach((v) => {\n v.style.display = v.dataset.example === e.target.value ? 'flex' : 'none';\n });\n }\n\n async scrollToEventTarget(event) {\n const navEl = event.currentTarget;\n if (!navEl.dataset.contentId) {\n return;\n }\n const contentEl = this.shadowRoot.getElementById(navEl.dataset.contentId);\n if (contentEl) {\n contentEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n }\n }\n}\ncustomElements.define('json-schema-viewer', JsonSchemaViewer);\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"rapidoc-min.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACDA;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;ACKA;;ACKA;ACgRA;AACA;AACA;AAIA;AAIA;AAIA;AAEA;;;AAIA;;AAEA;AACA;AACA;AACA;;;;;AAKA;AAGA;;AAGA;AACA;AACA;;AAIA;;AAGA;AACA;;;;AAIA;AAGA;AACA;;;AAIA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AAGA;;AAGA;AACA;;;AAKA;;AAKA;AAuBA;;;;AAIA;AAEA;;AAEA;;AAIA;;AAGA;AACA;;;AAGA;AACA;AAEA;AACA;AACA;;AAIA;;AAGA;AACA;;AAIA;;AAGA;;;AAMA;AAEA;;;AAGA;AACA;AACA;AAGA;AAGA;;;;;AAMA;AACA;;AAEA;;;AAGA;;AAEA;;;AAKA;;;AAIA;;;AAaA;;AAIA;;;AAtGA;;;AAqJA;AACA;AAEA;;;AAGA;;;AAMA;;AAEA;;;;;AAOA;;AAEA;AAKA;;AAGA;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;;;AAMA;;;AAvFA;;;AC9eA;;AAYA;;AAEA;AACA;AACA;AACA;AACA;;AAIA;;AC1BA;;AAEA;AACA;;;AAGA;;;AAGA;;AAEA;;AAEA;;;;AAIA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AAQA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOA;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;ACtEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACoFA;;;AAUA;;AAEA;;AAGA;AAYA;;AAEA;;AAEA;AACA;;;AAIA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACwOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAvQA;AAQA;;AAEA;AACA;;AAGA;AACA;;AAEA;;AAIA;AACA;AAEA;;AASA;AA0BA;AACA;AASA;AA0DA;AACA;AACA;AAMA;AACA;AACA;AAGA;;AAEA;;AAEA;AACA;AAGA;AACA;AAwBA;;;AAIA;AASA;AA4BA;AACA;AACA;AACA;AAMA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;;AAIA;;AC3TA;AACA;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC+DA;AAOA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAIA;AAmDA;;;;AAIA;AACA;AACA;AACA;AAMA;AACA;AAEA;AAIA;AACA;AAKA;;AAEA;AACA;AACA;;AAEA;AAEA;AJ9GA;AIkMA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAMA;AAEA;AACA;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAKA;;AAIA;AAOA;AACA;;AAEA;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;;;;;;AAOA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAGA;AAGA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;;AAGA;;;AAKA;;AAEA;AACA;;;AAIA;AAGA;;;AAGA;;AAGA;AAuEA;AACA;AACA;AACA;;;AAOA;AAqBA;;AAEA;AAGA;AACA;AACA;;;;AAKA;AAGA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;;;;;;AAOA;AACA;AACA;;AAEA;;;;;;AAQA;;AAoBA;;AAOA;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAIA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAKA;AAIA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;;AAIA;;;AAmBA;AAiBA;AACA;;;AAGA;AACA;;;;;;AAMA;AACA;AACA;AACA;;;;AAKA;AACA;;AAEA;AACA;AACA;AACA;;;;AAMA;AAgBA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AAGA;;;;;;AAMA;AACA;;;;;;;;AAQA;;;AAIA;AACA;AACA;;;AAGA;;;AAGA;AAEA;AAGA;AAEA;;AAEA;;;AAGA;AACA;AACA;;AAEA;;;AAOA;;AAIA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;;AAIA;;;AAMA;;;;AAMA;AACA;;;AAKA;;AAGA;;AAGA;;AAIA;;;;AAIA;AACA;;;AAGA;AAEA;;AAuBA;;AAEA;;;AAGA;AAIA;AACA;AACA;;AAEA;AAEA;AACA;;;AAGA;AAIA;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AAOA;AACA;;AAIA;;AAEA;AACA;;;AAIA;;AAEA;;AAMA;;;;AAIA;;;;AAIA;AAEA;AAEA;AAIA;;;AAOA;AAGA;;;AAGA;;AAEA;AAGA;;AAEA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACngCA;AAQA;;AAEA;AACA;;AAGA;AACA;;AAEA;;AAIA;;;;;;;AAOA;AAEA;;;AAUA;AAyBA;AACA;AACA;AAUA;AAsCA;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AAGA;AAMA;;AAEA;AACA;AACA;;AAEA;AACA;AAEA;;;;AAKA;;;AAGA;;;AAMA;AAGA;AACA;AAwBA;;;AASA;AAWA;AACA;AAGA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAIA;ACzQA;AACA;AACA;;AAGA;AACA;;AAGA;;;;;AAKA;AACA;;AAIA;AAGA;AACA;AACA;;AAGA;;AAKA;AAGA;AACA;;AAIA;AACA;;;AAIA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAGA;AAGA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAOA;AAKA;AACA;AACA;AACA;;AAEA;;;;AASA;;;AAhBA;;AChKA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;;AAGA;AACA;AACA;AACA;;AAEA;;;AAKA;;AAQA;AACA;AACA;AACA;;AAGA;AACA;;;AAKA;AAKA;AACA;AACA;;AAEA;;;;AAIA;;;AAVA;;AC5CA;AACA;;AAGA;AACA;;AAEA;AAFA;;;AAOA;AAEA;AACA;AAGA;AAIA;AAEA;AAMA;AAIA;;AAGA;AACA;AAIA;;;;AAMA;;AASA;;AAKA;;;ACtCA;;AAEA;;AAEA;;AAGA;AACA;;AAEA;;;AAIA;AACA;AACA;;AAGA;AACA;;AAGA;;;;;AAMA;AACA;AACA;;;;AAIA;;;AAMA;AAOA;;;AAGA;AAGA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;;;;AAbA;AAkBA;;;AAGA;AAEA;;;;AClDA;AACA;;AAEA;AAGA;AACA;;;;;;;AASA;;;;;AAKA;AAEA;;AAEA;;AAKA;AAGA;;;;;;AAQA;AACA;AAGA;AAEA;AAEA;AACA;;AAIA;;AAEA;AACA;;AAEA;;AAEA;;;AAIA;AACA;AAEA;;AA1BA;;AAgCA;AAIA;;AAKA;;AAEA;;;;;;;;;;AAWA;;;;;;AAQA;AAGA;AACA;;;AAKA;AACA;AACA;AACA;;;AAGA;;;;AAKA;AAEA;;AAIA;;AAEA;AACA;;AAEA;;AAEA;AACA;AAIA;;AAEA;;;AAQA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAGA;AACA;;;;;AAQA;;;AAIA;;;;;AAMA;;;AAIA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAUA;;ACtPA;AAEA;AAiBA;AACA;;AAGA;AAMA;AAIA;;;AAsBA;AC5BA;AACA;AACA;AACA;AACA;;AAEA;;;AAIA;AAGA;;AAGA;;AAKA;AAqBA;;AAEA;AAMA;;AAGA;;AAKA;;AAIA;AACA;AAEA;AACA;AAEA;AACA;AAGA;AAGA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;;;;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAOA;AAKA;;AAGA;;;;AAIA;;;;AAIA;AAGA;AACA;AAEA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AAMA;AACA;AACA;;;AAIA;;AAGA;AAMA;AACA;AACA;;;;AAnDA;;;;ACrLA;AAEA;;;;;;;;;;;;;ACOA;;;AAGA;;;;;;;AASA;AACA;;;;;AAMA;;;;;AAOA;AACA;;;AAGA;;;AAIA;AAGA;;;;AAKA;AAGA;;;;;ADtDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AE8EA;AAOA;AACA;AACA;;;AAGA;;;AAIA;AAgDA;AAEA;AACA;;AAIA;AAQA;AACA;;;AAGA;AACA;;;AAOA;AACA;;AAEA;AACA;;AAKA;;AAIA;AACA;AACA;;AAEA;;AAKA;AAEA;AACA;AAEA;;;AAIA;AAIA;;;AAMA;;;AAGA;;;AAGA;;;AAGA;;;AAGA;;;AAGA;AAEA;AAIA;AACA;AAEA;AAkBA;AAEA;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;;AAEA;;;;;AAxCA;AACA;AAgDA;AASA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAvBA;AACA;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtUA;;;AAOA;;;;;;;;;AASA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;;;AAMA;;;AAGA;AACA;;AAEA;;AASA;AACA;AACA;;;;AAMA;ACvBA;;;;AAKA;AACA;;;;;;AAMA;;;;;;;AC2IA;AACA;AACA;;AAEA;;AAMA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAGA;ACxPA;AACA;AAGA;AACA;;AAEA;;;;AAIA;AACA;;;AAKA;AAEA;;;AAGA;;;;AAOA;AACA;;;AAGA;;;AAGA;;AAEA;;AAEA;;;;;AASA;AACA;AAGA;AAGA;AACA;AAGA;AACA;AACA;;;;AAIA;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqRA;;;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;ACpRA;;;;;;;;;ACvGA;;;;;;AAMA;AACA;AACA;;AAIA;;;;AAMA;AAKA;;AAEA;AAIA;;AAEA;AACA;;;;;AAKA;AACA;AACA;AACA;;;;;;AAMA;AAEA;AACA;AACA;;AAGA;AAGA;;AAEA;AACA;;AAEA;;;;AAKA;;AAKA;AAwBA;AACA;AAGA;AACA;;AAEA;;;;;AAKA;AACA;;;AAKA;AAEA;;;AAGA;;;;AAOA;AACA;;;AAGA;;AAEA;;;AAGA;;;;;AAKA;AACA;AAGA;AAGA;AACA;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACRA","sources":["webpack://rapidoc/./src/styles/input-styles.js","webpack://rapidoc/./src/styles/flex-styles.js","webpack://rapidoc/./src/styles/table-styles.js","webpack://rapidoc/./src/styles/endpoint-styles.js","webpack://rapidoc/./src/styles/prism-styles.js","webpack://rapidoc/./src/styles/tab-styles.js","webpack://rapidoc/./src/styles/nav-styles.js","webpack://rapidoc/./src/styles/info-styles.js","webpack://rapidoc/./src/styles/custom-styles.js","webpack://rapidoc/./src/utils/common-utils.js","webpack://rapidoc/./src/templates/security-scheme-template.js","webpack://rapidoc/./src/templates/code-samples-template.js","webpack://rapidoc/./src/templates/callback-template.js","webpack://rapidoc/./src/utils/schema-utils.js","webpack://rapidoc/./src/components/json-tree.js","webpack://rapidoc/./src/components/schema-tree.js","webpack://rapidoc/./src/components/tag-input.js","webpack://rapidoc/./src/components/api-request.js","webpack://rapidoc/./src/components/schema-table.js","webpack://rapidoc/./src/templates/expanded-endpoint-template.js","webpack://rapidoc/./src/templates/components-template.js","webpack://rapidoc/./src/templates/overview-template.js","webpack://rapidoc/./src/templates/server-template.js","webpack://rapidoc/./src/templates/navbar-template.js","webpack://rapidoc/./src/templates/focused-endpoint-template.js","webpack://rapidoc/./src/templates/endpoint-template.js","webpack://rapidoc/./src/templates/logo-template.js","webpack://rapidoc/./src/templates/header-template.js","webpack://rapidoc/./src/components/api-response.js","webpack://rapidoc/./src/templates/advance-search-template.js","webpack://rapidoc/./src/components/dialog-box.js","webpack://rapidoc/./src/utils/theme.js","webpack://rapidoc/./src/templates/main-body-template.js","webpack://rapidoc/./src/rapidoc.js","webpack://rapidoc/./src/rapidoc-mini.js","webpack://rapidoc/./src/templates/json-schema-viewer-template.js","webpack://rapidoc/./src/json-schema-viewer.js"],"sourcesContent":["import { css } from 'lit';\n\n/* eslint-disable max-len */\nexport default css`\n/* Button */\n.m-btn {\n border-radius: var(--border-radius);\n font-weight: 600;\n display: inline-block;\n padding: 6px 16px;\n font-size: var(--font-size-small);\n outline: 0;\n line-height: 1;\n text-align: center;\n white-space: nowrap;\n border: 2px solid var(--primary-color);\n background-color:transparent;\n transition: background-color 0.2s;\n user-select: none;\n cursor: pointer;\n box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);\n}\n.m-btn.primary {\n background-color: var(--primary-color);\n color: var(--primary-color-invert);\n}\n.m-btn.thin-border { border-width: 1px; }\n.m-btn.large { padding:8px 14px; }\n.m-btn.small { padding:5px 12px; }\n.m-btn.tiny { padding:5px 6px; }\n.m-btn.circle { border-radius: 50%; }\n.m-btn:hover { \n background-color: var(--primary-color);\n color: var(--primary-color-invert);\n}\n.m-btn.nav { border: 2px solid var(--nav-accent-color); }\n.m-btn.nav:hover { \n background-color: var(--nav-accent-color);\n}\n.m-btn:disabled{ \n background-color: var(--bg3);\n color: var(--fg3);\n border-color: var(--fg3);\n cursor: not-allowed;\n opacity: 0.4;\n}\n.toolbar-btn{\n cursor: pointer;\n padding: 4px;\n margin:0 2px;\n font-size: var(--font-size-small);\n min-width: 50px;\n color: var(--primary-color-invert);\n border-radius: 2px;\n border: none;\n background-color: var(--primary-color);\n}\n\ninput, textarea, select, button, pre {\n color:var(--fg);\n outline: none;\n background-color: var(--input-bg);\n border: 1px solid var(--border-color);\n border-radius: var(--border-radius);\n}\nbutton {\n font-family: var(--font-regular);\n}\n\n/* Form Inputs */\npre,\nselect,\ntextarea,\ninput[type=\"file\"],\ninput[type=\"text\"],\ninput[type=\"password\"] {\n font-family: var(--font-mono);\n font-weight: 400;\n font-size: var(--font-size-small);\n transition: border .2s;\n padding: 6px 5px;\n}\n\nselect {\n font-family: var(--font-regular);\n padding: 5px 30px 5px 5px;\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20d%3D%22M10.3%203.3L6%207.6%201.7%203.3A1%201%200%2000.3%204.7l5%205a1%201%200%20001.4%200l5-5a1%201%200%2010-1.4-1.4z%22%20fill%3D%22%23777777%22%2F%3E%3C%2Fsvg%3E\"); \n background-position: calc(100% - 5px) center;\n background-repeat: no-repeat; \n background-size: 10px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n}\n\nselect:hover {\n border-color: var(--primary-color);\n}\n\ntextarea::placeholder,\ninput[type=\"text\"]::placeholder,\ninput[type=\"password\"]::placeholder {\n color: var(--placeholder-color);\n opacity:1;\n}\n\n\ninput[type=\"file\"]{\n font-family: var(--font-regular);\n padding:2px;\n cursor:pointer;\n border: 1px solid var(--primary-color);\n min-height: calc(var(--font-size-small) + 18px);\n}\n\ninput[type=\"file\"]::-webkit-file-upload-button {\n font-family: var(--font-regular);\n font-size: var(--font-size-small);\n outline: none;\n cursor:pointer;\n padding: 3px 8px;\n border: 1px solid var(--primary-color);\n background-color: var(--primary-color);\n color: var(--primary-color-invert);\n border-radius: var(--border-radius);;\n -webkit-appearance: none;\n}\n\npre,\ntextarea {\n scrollbar-width: thin;\n scrollbar-color: var(--border-color) var(--input-bg);\n}\n\npre::-webkit-scrollbar,\ntextarea::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\n\npre::-webkit-scrollbar-track,\ntextarea::-webkit-scrollbar-track {\n background:var(--input-bg);\n}\n \npre::-webkit-scrollbar-thumb,\ntextarea::-webkit-scrollbar-thumb {\n border-radius: 2px;\n background-color: var(--border-color);\n}\n\n.link {\n font-size:var(--font-size-small);\n text-decoration: underline;\n color:var(--blue);\n font-family:var(--font-mono);\n margin-bottom:2px;\n}\n\n/* Toggle Body */\ninput[type=\"checkbox\"] {\n appearance: none;\n display: inline-block;\n background-color: var(--light-bg);\n border: 1px solid var(--light-bg);\n border-radius: 9px;\n cursor: pointer;\n height: 18px;\n position: relative;\n transition: border .25s .15s, box-shadow .25s .3s, padding .25s;\n min-width: 36px;\n width: 36px;\n vertical-align: top;\n}\n/* Toggle Thumb */\ninput[type=\"checkbox\"]:after {\n position: absolute;\n background-color: var(--bg);\n border: 1px solid var(--light-bg);\n border-radius: 8px;\n content: '';\n top: 0px;\n left: 0px;\n right: 16px;\n display: block;\n height: 16px;\n transition: border .25s .15s, left .25s .1s, right .15s .175s;\n}\n\n/* Toggle Body - Checked */\ninput[type=\"checkbox\"]:checked {\n background-color: var(--green);\n border-color: var(--green);\n}\n/* Toggle Thumb - Checked*/\ninput[type=\"checkbox\"]:checked:after {\n border: 1px solid var(--green);\n left: 16px;\n right: 1px;\n transition: border .25s, left .15s .25s, right .25s .175s;\n}`;\n","import { css } from 'lit';\n\nexport default css`\n.row, .col{\n display:flex;\n} \n.row {\n align-items:center;\n flex-direction: row;\n}\n.col {\n align-items:stretch;\n flex-direction: column;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.m-table {\n border-spacing: 0; \n border-collapse: separate;\n border: 1px solid var(--light-border-color);\n border-radius: var(--border-radius);\n margin: 0;\n max-width: 100%;\n direction: ltr;\n}\n.m-table tr:first-child td,\n.m-table tr:first-child th {\n border-top: 0 none;\n}\n.m-table td, \n.m-table th {\n font-size: var(--font-size-small);\n line-height: calc(var(--font-size-small) + 4px);\n padding: 4px 5px 4px;\n vertical-align: top;\n}\n\n.m-table.padded-12 td, \n.m-table.padded-12 th {\n padding: 12px;\n}\n\n.m-table td:not([align]), \n.m-table th:not([align]) {\n text-align: left;\n}\n\n.m-table th {\n color: var(--fg2);\n font-size: var(--font-size-small);\n line-height: calc(var(--font-size-small) + 18px);\n font-weight: 600;\n letter-spacing: normal;\n background-color: var(--bg2);\n vertical-align: bottom;\n border-bottom: 1px solid var(--light-border-color);\n}\n\n.m-table > tbody > tr > td,\n.m-table > tr > td {\n border-top: 1px solid var(--light-border-color);\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.table-title {\n font-size:var(--font-size-small);\n font-weight:bold;\n vertical-align: middle;\n margin: 12px 0 4px 0;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.only-large-screen { display:none; }\n.endpoint-head .path{\n display: flex;\n font-family:var(--font-mono);\n font-size: var(--font-size-small);\n align-items: center;\n overflow-wrap: break-word;\n word-break: break-all;\n}\n\n.endpoint-head .descr {\n font-size: var(--font-size-small);\n color:var(--light-fg);\n font-weight:400;\n align-items: center;\n overflow-wrap: break-word;\n word-break: break-all;\n display:none;\n}\n\n.m-endpoint.expanded{margin-bottom:16px; }\n.m-endpoint > .endpoint-head{\n border-width:1px 1px 1px 5px;\n border-style:solid;\n border-color:transparent;\n border-top-color:var(--light-border-color);\n display:flex;\n padding:6px 16px;\n align-items: center;\n cursor: pointer;\n}\n.m-endpoint > .endpoint-head.put:hover,\n.m-endpoint > .endpoint-head.put.expanded{\n border-color:var(--orange); \n background-color:var(--light-orange); \n}\n.m-endpoint > .endpoint-head.post:hover,\n.m-endpoint > .endpoint-head.post.expanded {\n border-color:var(--green); \n background-color:var(--light-green); \n}\n.m-endpoint > .endpoint-head.get:hover,\n.m-endpoint > .endpoint-head.get.expanded {\n border-color:var(--blue); \n background-color:var(--light-blue); \n}\n.m-endpoint > .endpoint-head.delete:hover,\n.m-endpoint > .endpoint-head.delete.expanded {\n border-color:var(--red); \n background-color:var(--light-red); \n}\n\n.m-endpoint > .endpoint-head.head:hover,\n.m-endpoint > .endpoint-head.head.expanded,\n.m-endpoint > .endpoint-head.patch:hover,\n.m-endpoint > .endpoint-head.patch.expanded,\n.m-endpoint > .endpoint-head.options:hover,\n.m-endpoint > .endpoint-head.options.expanded {\n border-color:var(--yellow); \n background-color:var(--light-yellow); \n}\n\n.m-endpoint > .endpoint-head.deprecated:hover,\n.m-endpoint > .endpoint-head.deprecated.expanded {\n border-color:var(--border-color); \n filter:opacity(0.6);\n}\n\n.m-endpoint .endpoint-body {\n flex-wrap:wrap;\n padding:16px 0px 0 0px;\n border-width:0px 1px 1px 5px;\n border-style:solid;\n box-shadow: 0px 4px 3px -3px rgba(0, 0, 0, 0.15);\n}\n.m-endpoint .endpoint-body.delete{ border-color:var(--red); }\n.m-endpoint .endpoint-body.put{ border-color:var(--orange); }\n.m-endpoint .endpoint-body.post{border-color:var(--green);}\n.m-endpoint .endpoint-body.get{ border-color:var(--blue); }\n.m-endpoint .endpoint-body.head,\n.m-endpoint .endpoint-body.patch,\n.m-endpoint .endpoint-body.options { \n border-color:var(--yellow); \n}\n\n.m-endpoint .endpoint-body.deprecated{ \n border-color:var(--border-color);\n filter:opacity(0.6);\n}\n\n.endpoint-head .deprecated{\n color: var(--light-fg);\n filter:opacity(0.6);\n}\n\n.summary{\n padding:8px 8px;\n}\n.summary .title{\n font-size:calc(var(--font-size-regular) + 2px);\n margin-bottom: 6px;\n word-break: break-all;\n}\n\n.endpoint-head .method{\n padding:2px 5px;\n vertical-align: middle;\n font-size:var(--font-size-small);\n height: calc(var(--font-size-small) + 16px);\n line-height: calc(var(--font-size-small) + 8px);\n width: 60px;\n border-radius: 2px;\n display:inline-block;\n text-align: center;\n font-weight: bold;\n text-transform:uppercase;\n margin-right:5px;\n}\n.endpoint-head .method.delete{ border: 2px solid var(--red);}\n.endpoint-head .method.put{ border: 2px solid var(--orange); }\n.endpoint-head .method.post{ border: 2px solid var(--green); }\n.endpoint-head .method.get{ border: 2px solid var(--blue); }\n.endpoint-head .method.get.deprecated{ border: 2px solid var(--border-color); }\n.endpoint-head .method.head,\n.endpoint-head .method.patch,\n.endpoint-head .method.options { \n border: 2px solid var(--yellow); \n}\n\n.req-resp-container {\n display: flex;\n margin-top:16px;\n align-items: stretch;\n flex-wrap: wrap;\n flex-direction: column;\n border-top:1px solid var(--light-border-color);\n}\n\n.view-mode-request,\napi-response.view-mode {\n flex:1; \n min-height:100px;\n padding:16px 8px;\n overflow:hidden;\n}\n.view-mode-request {\n border-width:0 0 1px 0;\n border-style:dashed;\n}\n\n.head .view-mode-request,\n.patch .view-mode-request,\n.options .view-mode-request { \n border-color:var(--yellow); \n}\n.put .view-mode-request { \n border-color:var(--orange); \n}\n.post .view-mode-request { \n border-color:var(--green); \n}\n.get .view-mode-request { \n border-color:var(--blue); \n}\n.delete .view-mode-request { \n border-color:var(--red); \n}\n\n@media only screen and (min-width: 1024px) {\n .only-large-screen { display:block; }\n .endpoint-head .path{\n font-size: var(--font-size-regular);\n }\n .endpoint-head .descr{\n display: flex;\n }\n .endpoint-head .m-markdown-small,\n .descr .m-markdown-small{\n display:block;\n }\n .req-resp-container{\n flex-direction: var(--layout, row);\n flex-wrap: nowrap;\n }\n api-response.view-mode {\n padding:16px;\n }\n .view-mode-request.row-layout {\n border-width:0 1px 0 0;\n padding:16px;\n }\n .summary{\n padding:8px 16px;\n }\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\ncode[class*=\"language-\"],\npre[class*=\"language-\"] {\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n line-height: 1.5;\n tab-size: 2;\n\n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\n\n/* Code blocks */\npre[class*=\"language-\"] {\n padding: 1em;\n margin: .5em 0;\n overflow: auto;\n}\n\n/* Inline code */\n:not(pre) > code[class*=\"language-\"] {\n white-space: normal;\n}\n\n.token.comment,\n.token.block-comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n color: var(--light-fg)\n}\n\n.token.punctuation {\n color: var(--fg);\n}\n\n.token.tag,\n.token.attr-name,\n.token.namespace,\n.token.deleted {\n color:var(--pink);\n}\n\n.token.function-name {\n color: var(--blue);\n}\n\n.token.boolean,\n.token.number,\n.token.function {\n color: var(--red);\n}\n\n.token.property,\n.token.class-name,\n.token.constant,\n.token.symbol {\n color: var(--code-property-color);\n}\n\n.token.selector,\n.token.important,\n.token.atrule,\n.token.keyword,\n.token.builtin {\n color: var(--code-keyword-color);\n}\n\n.token.string,\n.token.char,\n.token.attr-value,\n.token.regex,\n.token.variable { \n color: var(--green);\n}\n\n.token.operator,\n.token.entity,\n.token.url {\n color: var(--code-operator-color);\n}\n\n.token.important,\n.token.bold {\n font-weight: bold;\n}\n.token.italic {\n font-style: italic;\n}\n\n.token.entity {\n cursor: help;\n}\n\n.token.inserted {\n color: green;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.tab-panel {\n border: none;\n}\n.tab-buttons {\n height:30px;\n padding: 4px 4px 0 4px;\n border-bottom: 1px solid var(--light-border-color) ;\n align-items: stretch;\n overflow-y: hidden;\n overflow-x: auto;\n scrollbar-width: thin;\n}\n.tab-buttons::-webkit-scrollbar {\n height: 1px;\n background-color: var(--border-color);\n}\n.tab-btn {\n border: none;\n border-bottom: 3px solid transparent; \n color: var(--light-fg);\n background-color: transparent;\n white-space: nowrap;\n cursor:pointer;\n outline:none;\n font-family:var(--font-regular); \n font-size:var(--font-size-small);\n margin-right:16px;\n padding:1px;\n}\n.tab-btn.active {\n border-bottom: 3px solid var(--primary-color); \n font-weight:bold;\n color:var(--primary-color);\n}\n\n.tab-btn:hover {\n color:var(--primary-color);\n}\n.tab-content {\n margin:-1px 0 0 0;\n position:relative;\n min-height: 50px;\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n.nav-bar-info:focus-visible,\n.nav-bar-tag:focus-visible,\n.nav-bar-path:focus-visible {\n outline: 1px solid;\n box-shadow: none;\n outline-offset: -4px;\n}\n.nav-bar-expand-all:focus-visible,\n.nav-bar-collapse-all:focus-visible,\n.nav-bar-tag-icon:focus-visible {\n outline: 1px solid;\n box-shadow: none;\n outline-offset: 2px;\n}\n.nav-bar {\n width:0;\n height:100%;\n overflow: hidden;\n color:var(--nav-text-color);\n background-color: var(--nav-bg-color);\n background-blend-mode: multiply;\n line-height: calc(var(--font-size-small) + 4px);\n display:none;\n position:relative;\n flex-direction:column;\n flex-wrap:nowrap;\n word-break:break-word;\n}\n::slotted([slot=nav-logo]){\n padding:16px 16px 0 16px;\n}\n.nav-scroll {\n overflow-x: hidden;\n overflow-y: auto;\n overflow-y: overlay;\n scrollbar-width: thin;\n scrollbar-color: var(--nav-hover-bg-color) transparent;\n}\n\n.nav-bar-tag {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: row;\n}\n.nav-bar.read .nav-bar-tag-icon {\n display:none;\n}\n.nav-bar-paths-under-tag {\n overflow:hidden;\n transition: max-height .2s ease-out, visibility .3s;\n}\n.collapsed .nav-bar-paths-under-tag {\n visibility: hidden;\n}\n\n.nav-bar-expand-all {\n transform: rotate(90deg); \n cursor:pointer; \n margin-right:10px;\n}\n.nav-bar-collapse-all {\n transform: rotate(270deg); \n cursor:pointer;\n}\n.nav-bar-expand-all:hover, .nav-bar-collapse-all:hover {\n color: var(--primary-color);\n}\n\n.nav-bar-tag-icon {\n color: var(--nav-text-color);\n font-size: 20px; \n}\n.nav-bar-tag-icon:hover {\n color:var(--nav-hover-text-color);\n}\n.nav-bar.focused .nav-bar-tag-and-paths.collapsed .nav-bar-tag-icon::after {\n content: '⌵';\n width:16px;\n height:16px;\n text-align: center;\n display: inline-block;\n transform: rotate(-90deg);\n transition: transform 0.2s ease-out 0s;\n}\n.nav-bar.focused .nav-bar-tag-and-paths.expanded .nav-bar-tag-icon::after {\n content: '⌵';\n width:16px;\n height:16px;\n text-align: center;\n display: inline-block;\n transition: transform 0.2s ease-out 0s;\n}\n.nav-scroll::-webkit-scrollbar {\n width: var(--scroll-bar-width, 8px);\n}\n.nav-scroll::-webkit-scrollbar-track {\n background:transparent;\n}\n.nav-scroll::-webkit-scrollbar-thumb {\n background-color: var(--nav-hover-bg-color);\n}\n\n.nav-bar-tag {\n font-size: var(--font-size-regular);\n color: var(--nav-accent-color);\n border-left:4px solid transparent;\n font-weight:bold;\n padding: 15px 15px 15px 10px;\n text-transform: capitalize;\n}\n\n.nav-bar-components,\n.nav-bar-h1,\n.nav-bar-h2,\n.nav-bar-info,\n.nav-bar-tag,\n.nav-bar-path {\n display:flex;\n cursor:pointer;\n border-left:4px solid transparent;\n}\n\n.nav-bar-h1,\n.nav-bar-h2,\n.nav-bar-path {\n font-size: calc(var(--font-size-small) + 1px);\n padding: var(--nav-item-padding);\n}\n.nav-bar-path.small-font {\n font-size: var(--font-size-small);\n}\n\n.nav-bar-info {\n font-size: var(--font-size-regular);\n padding: 16px 10px;\n font-weight:bold;\n}\n.nav-bar-section {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n font-size: var(--font-size-small);\n color: var(--nav-text-color);\n padding: var(--nav-item-padding);\n font-weight:bold;\n}\n.nav-bar-section.operations {\n cursor:pointer;\n}\n.nav-bar-section.operations:hover {\n color:var(--nav-hover-text-color);\n background-color:var(--nav-hover-bg-color);\n}\n\n.nav-bar-section:first-child {\n display: none;\n}\n.nav-bar-h2 {margin-left:12px;}\n\n.nav-bar-h1.active,\n.nav-bar-h2.active,\n.nav-bar-info.active,\n.nav-bar-tag.active,\n.nav-bar-path.active,\n.nav-bar-section.operations.active {\n border-left:4px solid var(--nav-accent-color);\n color:var(--nav-hover-text-color);\n}\n\n.nav-bar-h1:hover,\n.nav-bar-h2:hover,\n.nav-bar-info:hover,\n.nav-bar-tag:hover,\n.nav-bar-path:hover {\n color:var(--nav-hover-text-color);\n background-color:var(--nav-hover-bg-color);\n}\n`;\n","import { css } from 'lit';\n\nexport default css`\n#api-info {\n font-size: calc(var(--font-size-regular) - 1px);\n margin-top: 8px;\n margin-left: -15px;\n}\n\n#api-info span:before {\n content: \"|\";\n display: inline-block;\n opacity: 0.5;\n width: 15px;\n text-align: center;\n}\n#api-info span:first-child:before {\n content: \"\";\n width: 0px;\n}\n`;\n","import { css } from 'lit';\n\n/*\nThis file is reserved for any custom css that developers want to add to\ncustomize their theme. Simply add your css to this file and yarn build.\n*/\n\nexport default css`\n\n`;\n","/* For Delayed Event Handler Execution */\nexport function debounce(fn, delay) {\n let timeoutID = null;\n return (...args) => {\n clearTimeout(timeoutID);\n const that = this;\n timeoutID = setTimeout(() => {\n fn.apply(that, args);\n }, delay);\n };\n}\n\nexport const invalidCharsRegEx = /[\\s#:?&={}]/g; // used for generating valid html element ids by replacing the invalid chars with hyphen (-)\nexport const rapidocApiKey = '_rapidoc_api_key';\n\nexport function sleep(ms) {\n // eslint-disable-next-line no-promise-executor-return\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport function copyToClipboard(data, e) {\n const btnEl = e.currentTarget;\n const textArea = document.createElement('textarea');\n textArea.value = data;\n textArea.style.position = 'fixed'; // avoid scrolling to bottom\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n try {\n document.execCommand('copy');\n btnEl.innerText = 'Copied';\n setTimeout(() => {\n btnEl.innerText = 'Copy';\n }, 5000);\n } catch (err) {\n console.error('Unable to copy', err); // eslint-disable-line no-console\n }\n document.body.removeChild(textArea);\n}\n\nexport function getBaseUrlFromUrl(url) {\n const pathArray = url.split('/');\n return `${pathArray[0]}//${pathArray[2]}`;\n}\n\nexport async function wait(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nexport function componentIsInSearch(searchVal, component) {\n return component.name.toLowerCase().includes(searchVal.toLowerCase());\n}\n\nexport function pathIsInSearch(searchVal, path, matchType = 'includes') {\n if (matchType === 'includes') {\n const stringToSearch = `${path.method} ${path.path} ${path.summary || path.description || ''} ${path.operationId || ''}`.toLowerCase();\n return stringToSearch.includes(searchVal.toLowerCase());\n }\n const regex = new RegExp(searchVal, 'i');\n return regex.test(`${path.method} ${path.path}`);\n}\n\nexport function schemaKeys(schemaProps, result = new Set()) {\n if (!schemaProps) {\n return result;\n }\n Object.keys(schemaProps).forEach((key) => {\n result.add(key);\n if (schemaProps[key].properties) {\n schemaKeys(schemaProps[key].properties, result);\n } else if (schemaProps[key].items?.properties) {\n schemaKeys(schemaProps[key].items?.properties, result);\n }\n });\n return result;\n}\n\nexport function advancedSearch(searchVal, allSpecTags, searchOptions = []) {\n if (!searchVal.trim() || searchOptions.length === 0) {\n return;\n }\n\n const pathsMatched = [];\n allSpecTags.forEach((tag) => {\n tag.paths.forEach((path) => {\n let stringToSearch = '';\n if (searchOptions.includes('search-api-path')) {\n stringToSearch = path.path;\n }\n if (searchOptions.includes('search-api-descr')) {\n stringToSearch = `${stringToSearch} ${path.summary || path.description || ''}`;\n }\n if (searchOptions.includes('search-api-params')) {\n stringToSearch = `${stringToSearch} ${path.parameters?.map((v) => v.name).join(' ') || ''}`;\n }\n\n if (searchOptions.includes('search-api-request-body') && path.requestBody) {\n let schemaKeySet = new Set();\n for (const contentType in path.requestBody?.content) {\n if (path.requestBody.content[contentType].schema?.properties) {\n schemaKeySet = schemaKeys(path.requestBody.content[contentType].schema?.properties);\n }\n stringToSearch = `${stringToSearch} ${[...schemaKeySet].join(' ')}`;\n }\n }\n\n if (searchOptions.includes('search-api-resp-descr')) {\n stringToSearch = `${stringToSearch} ${Object.values(path.responses).map((v) => v.description || '').join(' ')}`;\n }\n\n if (stringToSearch.toLowerCase().includes(searchVal.trim().toLowerCase())) {\n pathsMatched.push({\n elementId: path.elementId,\n method: path.method,\n path: path.path,\n summary: path.summary || path.description || '',\n deprecated: path.deprecated,\n });\n }\n });\n });\n return pathsMatched;\n}\n\n/*\nexport function prettyXml(sourceXmlString) {\n const xmlDoc = new DOMParser().parseFromString(sourceXmlString, 'text/xml');\n const xsltDoc = new DOMParser().parseFromString([\n // describes how we want to modify the XML - indent everything\n `\n \n \n \n \n \n \n \n \n `,\n ].join('\\n'), 'application/xml');\n const xsltProcessor = new XSLTProcessor();\n xsltProcessor.importStylesheet(xsltDoc);\n const resultDoc = xsltProcessor.transformToDocument(xmlDoc);\n return new XMLSerializer().serializeToString(resultDoc);\n}\n*/\n\nexport function downloadResource(url, fileName) {\n if (url) {\n const a = document.createElement('a');\n document.body.appendChild(a);\n a.style = 'display: none';\n a.href = url;\n a.download = fileName;\n a.click();\n a.remove();\n }\n}\n\nexport function viewResource(url) {\n if (url) {\n const a = document.createElement('a');\n document.body.appendChild(a);\n a.style = 'display: none';\n a.href = url;\n a.target = '_blank';\n a.click();\n a.remove();\n }\n}\n","/* eslint-disable arrow-body-style */\nimport { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\n\nconst codeVerifier = '731DB1C3F7EA533B85E29492D26AA-1234567890-1234567890';\nconst codeChallenge = '4FatVDBJKPAo4JgLLaaQFMUcQPn5CrPRvLlaob9PTYc'; // Base64 encoded SHA-256\n\nconst localStorageKey = 'rapidoc';\n\nexport function applyApiKey(securitySchemeId, username = '', password = '', providedApikeyVal = '') {\n const securityObj = this.resolvedSpec.securitySchemes?.find((v) => (v.securitySchemeId === securitySchemeId));\n if (!securityObj) {\n return false;\n }\n let finalApiKeyValue = '';\n if (securityObj.scheme?.toLowerCase() === 'basic') {\n if (username) {\n finalApiKeyValue = `Basic ${btoa(`${username}:${password}`)}`;\n }\n } else if (providedApikeyVal) {\n securityObj.value = providedApikeyVal;\n finalApiKeyValue = `${securityObj.scheme?.toLowerCase() === 'bearer' ? 'Bearer ' : ''}${providedApikeyVal}`;\n }\n if (finalApiKeyValue) {\n securityObj.finalKeyValue = finalApiKeyValue;\n this.requestUpdate();\n return true;\n }\n return false;\n}\n\nexport function onClearAllApiKeys() {\n this.resolvedSpec.securitySchemes?.forEach((v) => {\n v.user = '';\n v.password = '';\n v.value = '';\n v.finalKeyValue = '';\n });\n this.requestUpdate();\n}\n\nfunction getPersistedApiKeys() {\n return JSON.parse(localStorage.getItem(localStorageKey)) || {};\n}\n\nfunction setPersistedApiKeys(obj) {\n localStorage.setItem(localStorageKey, JSON.stringify(obj));\n}\n\nexport function recoverPersistedApiKeys() {\n const rapidocLs = getPersistedApiKeys.call(this);\n Object.values(rapidocLs).forEach((p) => {\n applyApiKey.call(this, p.securitySchemeId, p.username, p.password, p.value);\n });\n}\n\nfunction onApiKeyChange(securitySchemeId) {\n let apiKeyValue = '';\n const securityObj = this.resolvedSpec.securitySchemes.find((v) => (v.securitySchemeId === securitySchemeId));\n if (securityObj) {\n const trEl = this.shadowRoot.getElementById(`security-scheme-${securitySchemeId}`);\n if (trEl) {\n if (securityObj.type && securityObj.scheme && securityObj.type === 'http' && securityObj.scheme.toLowerCase() === 'basic') {\n const userVal = trEl.querySelector('.api-key-user').value.trim();\n const passwordVal = trEl.querySelector('.api-key-password').value.trim();\n applyApiKey.call(this, securitySchemeId, userVal, passwordVal);\n } else {\n apiKeyValue = trEl.querySelector('.api-key-input').value.trim();\n applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);\n }\n if (this.persistAuth === 'true') {\n const rapidocLs = getPersistedApiKeys.call(this);\n rapidocLs[securitySchemeId] = securityObj;\n setPersistedApiKeys.call(this, rapidocLs);\n }\n }\n }\n}\n\n// Updates the OAuth Access Token (API key), so it reflects in UI and gets used in TRY calls\nfunction updateOAuthKey(securitySchemeId, accessToken, tokenType = 'Bearer') {\n const securityObj = this.resolvedSpec.securitySchemes.find((v) => (v.securitySchemeId === securitySchemeId));\n securityObj.finalKeyValue = `${(tokenType.toLowerCase() === 'bearer' ? 'Bearer' : (tokenType.toLowerCase() === 'mac' ? 'MAC' : tokenType))} ${accessToken}`;\n this.requestUpdate();\n}\n\n/* eslint-disable no-console */\n// Gets Access-Token in exchange of Authorization Code\nasync function fetchAccessToken(tokenUrl, clientId, clientSecret, redirectUrl, grantType, authCode, securitySchemeId, authFlowDivEl, sendClientSecretIn = 'header', scopes = null, username = null, password = null) {\n const respDisplayEl = authFlowDivEl ? authFlowDivEl.querySelector('.oauth-resp-display') : undefined;\n const urlFormParams = new URLSearchParams();\n const headers = new Headers();\n urlFormParams.append('grant_type', grantType);\n if (grantType === 'authorization_code') {\n urlFormParams.append('client_id', clientId);\n urlFormParams.append('client_secret', clientSecret);\n }\n if (grantType !== 'client_credentials' && grantType !== 'password') {\n urlFormParams.append('redirect_uri', redirectUrl);\n }\n if (authCode) {\n urlFormParams.append('code', authCode);\n urlFormParams.append('code_verifier', codeVerifier); // for PKCE\n }\n if (sendClientSecretIn === 'header') {\n headers.set('Authorization', `Basic ${btoa(`${clientId}:${clientSecret}`)}`);\n } else {\n urlFormParams.append('client_id', clientId);\n urlFormParams.append('client_secret', clientSecret);\n }\n if (grantType === 'password') {\n urlFormParams.append('username', username);\n urlFormParams.append('password', password);\n }\n if (scopes) {\n urlFormParams.append('scope', scopes);\n }\n\n try {\n const resp = await fetch(tokenUrl, { method: 'POST', headers, body: urlFormParams });\n const tokenResp = await resp.json();\n if (resp.ok) {\n if (tokenResp.token_type && tokenResp.access_token) {\n updateOAuthKey.call(this, securitySchemeId, tokenResp.access_token, tokenResp.token_type);\n if (respDisplayEl) {\n respDisplayEl.innerHTML = 'Access Token Received';\n }\n return true;\n }\n } else {\n if (respDisplayEl) {\n respDisplayEl.innerHTML = `${tokenResp.error_description || tokenResp.error_description || 'Unable to get access token'}`;\n }\n return false;\n }\n } catch (err) {\n if (respDisplayEl) {\n respDisplayEl.innerHTML = 'Failed to get access token';\n }\n return false;\n }\n}\n\n// Gets invoked when it receives the Authorization Code from the other window via message-event\nasync function onWindowMessageEvent(msgEvent, winObj, tokenUrl, clientId, clientSecret, redirectUrl, grantType, sendClientSecretIn, securitySchemeId, authFlowDivEl) {\n sessionStorage.removeItem('winMessageEventActive');\n winObj.close();\n if (msgEvent.data.fake) {\n return;\n }\n if (!msgEvent.data) {\n console.warn('RapiDoc: Received no data with authorization message');\n }\n if (msgEvent.data.error) {\n console.warn('RapiDoc: Error while receiving data');\n }\n if (msgEvent.data) {\n if (msgEvent.data.responseType === 'code') {\n // Authorization Code flow\n fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrl, grantType, msgEvent.data.code, securitySchemeId, authFlowDivEl, sendClientSecretIn);\n } else if (msgEvent.data.responseType === 'token') {\n // Implicit flow\n updateOAuthKey.call(this, securitySchemeId, msgEvent.data.access_token, msgEvent.data.token_type);\n }\n }\n}\n\n// code_challenge generator for PKCE flow\n// TODO: Implement dynamic generation of code-challenge based on code-verifier\n/*\nasync function generateCodeChallenge() {\n const encoder = new TextEncoder();\n const data = encoder.encode(codeVerifier);\n const sha256Hash = await window.crypto.subtle.digest('SHA-256', data); // returns Unit8Array\n // const utf8Decoder = new TextDecoder();\n // const b64EncodedSha256 = btoa(utf8Decoder.decode(sha256Hash));\n const b64EncodedSha256 = base64encode(sha256Hash);\n return b64EncodedSha256;\n}\n*/\n\nasync function onInvokeOAuthFlow(securitySchemeId, flowType, authUrl, tokenUrl, e) {\n const authFlowDivEl = e.target.closest('.oauth-flow');\n const clientId = authFlowDivEl.querySelector('.oauth-client-id') ? authFlowDivEl.querySelector('.oauth-client-id').value.trim() : '';\n const clientSecret = authFlowDivEl.querySelector('.oauth-client-secret') ? authFlowDivEl.querySelector('.oauth-client-secret').value.trim() : '';\n const username = authFlowDivEl.querySelector('.api-key-user') ? authFlowDivEl.querySelector('.api-key-user').value.trim() : '';\n const password = authFlowDivEl.querySelector('.api-key-password') ? authFlowDivEl.querySelector('.api-key-password').value.trim() : '';\n const sendClientSecretIn = authFlowDivEl.querySelector('.oauth-send-client-secret-in') ? authFlowDivEl.querySelector('.oauth-send-client-secret-in').value.trim() : 'header';\n const checkedScopeEls = [...authFlowDivEl.querySelectorAll('.scope-checkbox:checked')];\n const pkceCheckboxEl = authFlowDivEl.querySelector(`#${securitySchemeId}-pkce`);\n const state = (`${Math.random().toString(36).slice(2, 9)}random${Math.random().toString(36).slice(2, 9)}`);\n const nonce = (`${Math.random().toString(36).slice(2, 9)}random${Math.random().toString(36).slice(2, 9)}`);\n // const codeChallenge = await generateCodeChallenge(codeVerifier);\n const redirectUrlObj = new URL(`${window.location.origin}${window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'))}/${this.oauthReceiver}`);\n let grantType = '';\n let responseType = '';\n let newWindow;\n\n // clear previous error messages\n const errEls = [...authFlowDivEl.parentNode.querySelectorAll('.oauth-resp-display')];\n errEls.forEach((v) => { v.innerHTML = ''; });\n\n if (flowType === 'authorizationCode' || flowType === 'implicit') {\n const authUrlObj = new URL(authUrl);\n if (flowType === 'authorizationCode') {\n grantType = 'authorization_code';\n responseType = 'code';\n } else if (flowType === 'implicit') {\n responseType = 'token';\n }\n const authCodeParams = new URLSearchParams(authUrlObj.search);\n const selectedScopes = checkedScopeEls.map((v) => v.value).join(' ');\n if (selectedScopes) {\n authCodeParams.set('scope', selectedScopes);\n }\n authCodeParams.set('client_id', clientId);\n authCodeParams.set('redirect_uri', redirectUrlObj.toString());\n authCodeParams.set('response_type', responseType);\n authCodeParams.set('state', state);\n authCodeParams.set('nonce', nonce);\n if (pkceCheckboxEl && pkceCheckboxEl.checked) {\n authCodeParams.set('code_challenge', codeChallenge);\n authCodeParams.set('code_challenge_method', 'S256');\n }\n authCodeParams.set('show_dialog', true);\n authUrlObj.search = authCodeParams.toString();\n // If any older message-event-listener is active then fire a fake message to remove it (these are single time listeners)\n if (sessionStorage.getItem('winMessageEventActive') === 'true') {\n window.postMessage({ fake: true }, this);\n }\n setTimeout(() => {\n newWindow = window.open(authUrlObj.toString());\n if (!newWindow) {\n console.error(`RapiDoc: Unable to open ${authUrlObj.toString()} in a new window`);\n } else {\n sessionStorage.setItem('winMessageEventActive', 'true');\n window.addEventListener(\n 'message',\n (msgEvent) => onWindowMessageEvent.call(this, msgEvent, newWindow, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, sendClientSecretIn, securitySchemeId, authFlowDivEl),\n { once: true },\n );\n }\n }, 10);\n } else if (flowType === 'clientCredentials') {\n grantType = 'client_credentials';\n const selectedScopes = checkedScopeEls.map((v) => v.value).join(' ');\n fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, '', securitySchemeId, authFlowDivEl, sendClientSecretIn, selectedScopes);\n } else if (flowType === 'password') {\n grantType = 'password';\n const selectedScopes = checkedScopeEls.map((v) => v.value).join(' ');\n fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, '', securitySchemeId, authFlowDivEl, sendClientSecretIn, selectedScopes, username, password);\n }\n}\n/* eslint-enable no-console */\n\n/* eslint-disable indent */\n\nfunction oAuthFlowTemplate(flowName, clientId, clientSecret, securitySchemeId, authFlow, defaultScopes = [], receiveTokenIn = 'header') {\n let { authorizationUrl, tokenUrl, refreshUrl } = authFlow;\n const pkceOnly = authFlow['x-pkce-only'] || false;\n const isUrlAbsolute = (url) => (url.indexOf('://') > 0 || url.indexOf('//') === 0);\n if (refreshUrl && !isUrlAbsolute(refreshUrl)) {\n refreshUrl = `${this.selectedServer.computedUrl}/${refreshUrl.replace(/^\\//, '')}`;\n }\n if (tokenUrl && !isUrlAbsolute(tokenUrl)) {\n tokenUrl = `${this.selectedServer.computedUrl}/${tokenUrl.replace(/^\\//, '')}`;\n }\n if (authorizationUrl && !isUrlAbsolute(authorizationUrl)) {\n authorizationUrl = `${this.selectedServer.computedUrl}/${authorizationUrl.replace(/^\\//, '')}`;\n }\n let flowNameDisplay;\n if (flowName === 'authorizationCode') {\n flowNameDisplay = 'Authorization Code Flow';\n } else if (flowName === 'clientCredentials') {\n flowNameDisplay = 'Client Credentials Flow';\n } else if (flowName === 'implicit') {\n flowNameDisplay = 'Implicit Flow';\n } else if (flowName === 'password') {\n flowNameDisplay = 'Password Flow';\n } else {\n flowNameDisplay = flowName;\n }\n return html`\n
\n
${flowNameDisplay}
\n ${authorizationUrl\n ? html`
Auth URL ${authorizationUrl}
`\n : ''\n }\n ${tokenUrl\n ? html`
Token URL ${tokenUrl}
`\n : ''\n }\n ${refreshUrl\n ? html`
Refresh URL ${refreshUrl}
`\n : ''\n }\n ${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'implicit' || flowName === 'password'\n ? html`\n ${authFlow.scopes\n ? html`\n Scopes \n
\n ${Object.entries(authFlow.scopes).map((scopeAndDescr, index) => html`\n
\n \n \n
\n `)}\n
\n `\n : ''\n }\n ${flowName === 'password'\n ? html`\n
\n \n \n
`\n : ''\n }\n
\n ${flowName === 'authorizationCode'\n ? html`\n
\n \n \n
\n `\n : ''\n }\n \n ${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'password'\n ? html`\n \n `\n : ''\n }\n ${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'implicit' || flowName === 'password'\n ? html`\n `\n : ''\n }\n
\n
\n `\n : ''\n }\n
\n `;\n}\n\nfunction removeApiKey(securitySchemeId) {\n const securityObj = this.resolvedSpec.securitySchemes?.find((v) => (v.securitySchemeId === securitySchemeId));\n securityObj.user = '';\n securityObj.password = '';\n securityObj.value = '';\n securityObj.finalKeyValue = '';\n if (this.persistAuth === 'true') {\n const rapidocLs = getPersistedApiKeys.call(this);\n delete rapidocLs[securityObj.securitySchemeId];\n setPersistedApiKeys.call(this, rapidocLs);\n }\n this.requestUpdate();\n}\n\nexport default function securitySchemeTemplate() {\n if (!this.resolvedSpec) { return ''; }\n const providedApiKeys = this.resolvedSpec.securitySchemes?.filter((v) => (v.finalKeyValue));\n if (!providedApiKeys) {\n return;\n }\n return html`\n
\n
AUTHENTICATION
\n\n
\n ${providedApiKeys.length > 0\n ? html`\n
${providedApiKeys.length} API key applied
\n
\n `\n : html`
No API key applied
`\n }\n
\n ${this.resolvedSpec.securitySchemes && this.resolvedSpec.securitySchemes.length > 0\n ? html`\n \n ${this.resolvedSpec.securitySchemes.map((v) => html`\n \n \n \n ${v.type.toLowerCase() === 'oauth2'\n ? html`\n \n \n \n `\n : ''\n }\n `)}\n
\n
\n ${v.typeDisplay}\n ${v.finalKeyValue\n ? html`\n ${v.finalKeyValue ? 'Key Applied' : ''} \n \n `\n : ''\n }\n
\n ${v.description\n ? html`\n
\n ${unsafeHTML(marked(v.description || ''))}\n
`\n : ''\n }\n\n ${(v.type.toLowerCase() === 'apikey') || (v.type.toLowerCase() === 'http' && v.scheme.toLowerCase() === 'bearer')\n ? html`\n
\n ${v.type.toLowerCase() === 'apikey'\n ? html`Send ${v.name} in ${v.in}`\n : html`Send Authorization in header containing the word Bearer followed by a space and a Token String.`\n }\n
\n
\n ${v.in !== 'cookie'\n ? html`\n \n `\n : html` cookies cannot be set from here`\n }\n
`\n : ''\n }\n ${v.type.toLowerCase() === 'http' && v.scheme.toLowerCase() === 'basic'\n ? html`\n
\n Send Authorization in header containing the word Basic followed by a space and a base64 encoded string of username:password.\n
\n
\n \n \n \n
`\n : ''\n }\n
\n ${Object.keys(v.flows).map((f) => oAuthFlowTemplate\n .call(\n this,\n f,\n (v.flows[f]['x-client-id'] || v['x-client-id'] || ''),\n (v.flows[f]['x-client-secret'] || v['x-client-secret'] || ''),\n v.securitySchemeId,\n v.flows[f],\n (v.flows[f]['x-default-scopes'] || v['x-default-scopes']),\n (v.flows[f]['x-receive-token-in'] || v['x-receive-token-in']),\n ))}\n
`\n : ''\n }\n \n
\n`;\n}\n\nexport function pathSecurityTemplate(pathSecurity) {\n if (this.resolvedSpec.securitySchemes && pathSecurity) {\n const orSecurityKeys1 = [];\n if (Array.isArray(pathSecurity)) {\n if (pathSecurity.length === 0) {\n return '';\n }\n } else {\n return '';\n }\n pathSecurity.forEach((pSecurity) => {\n const andSecurityKeys1 = [];\n const andKeyTypes = [];\n if (Object.keys(pSecurity).length === 0) {\n orSecurityKeys1.push({\n securityTypes: 'None',\n securityDefs: [],\n });\n } else {\n Object.keys(pSecurity).forEach((pathSecurityKey) => {\n let pathScopes = '';\n const s = this.resolvedSpec.securitySchemes.find((ss) => ss.securitySchemeId === pathSecurityKey);\n if (pSecurity[pathSecurityKey] && Array.isArray(pSecurity[pathSecurityKey])) {\n pathScopes = pSecurity[pathSecurityKey].join(', ');\n }\n if (s) {\n andKeyTypes.push(s.typeDisplay);\n andSecurityKeys1.push({ ...s, ...({ scopes: pathScopes }) });\n }\n });\n orSecurityKeys1.push({\n securityTypes: andKeyTypes.length > 1 ? `${andKeyTypes[0]} + ${andKeyTypes.length - 1} more` : andKeyTypes[0],\n securityDefs: andSecurityKeys1,\n });\n }\n });\n return html`
\n
\n \n ${orSecurityKeys1.map((orSecurityItem1, i) => html`\n ${orSecurityItem1.securityTypes\n ? html`\n ${i !== 0 ? html`
OR
` : ''}\n
\n
\n ${this.updateRoute === 'true' && this.allowAuthentication === 'true'\n ? html` ${orSecurityItem1.securityTypes} `\n : html`${orSecurityItem1.securityTypes}`\n }\n
\n
\n ${orSecurityItem1.securityDefs.length > 1 ? html`
Requires all of the following
` : ''}\n
\n ${orSecurityItem1.securityDefs.map((andSecurityItem, j) => {\n const scopeHtml = html`${andSecurityItem.scopes !== ''\n ? html`\n
\n Required scopes:\n
\n
\n ${andSecurityItem.scopes.split(',').map((scope, cnt) => html`${cnt === 0 ? '' : '┃'}${scope}`)}\n
\n
`\n : ''\n }`;\n\n return html`\n ${andSecurityItem.type === 'oauth2'\n ? html`\n
\n ${orSecurityItem1.securityDefs.length > 1\n ? html`${j + 1}.  `\n : 'Needs'\n }\n OAuth Token ${andSecurityItem.securitySchemeId} in Authorization header\n ${scopeHtml}\n
`\n : andSecurityItem.type === 'http'\n ? html`\n
\n ${orSecurityItem1.securityDefs.length > 1 ? html`${j + 1}.  ` : html`Requires`}\n ${andSecurityItem.scheme === 'basic' ? 'Base 64 encoded username:password' : 'Bearer Token'} in Authorization header\n ${scopeHtml}\n
`\n : html`\n
\n ${orSecurityItem1.securityDefs.length > 1 ? html`${j + 1}.  ` : html`Requires`}\n Token in ${andSecurityItem.name} ${andSecurityItem.in}\n ${scopeHtml}\n
`\n }`;\n })}\n
\n
\n
\n `\n : ''\n }\n `)\n }\n
\n `;\n }\n return '';\n}\n\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport Prism from 'prismjs';\nimport { copyToClipboard } from '~/utils/common-utils';\n\n/* eslint-disable indent */\nexport default function codeSamplesTemplate(xCodeSamples) {\n return html`\n
CODE SAMPLES
\n
{\n if (!e.target.classList.contains('tab-btn')) { return; }\n const clickedTab = e.target.dataset.tab;\n\n const tabButtons = [...e.currentTarget.querySelectorAll('.tab-btn')];\n const tabContents = [...e.currentTarget.querySelectorAll('.tab-content')];\n tabButtons.forEach((tabBtnEl) => tabBtnEl.classList[tabBtnEl.dataset.tab === clickedTab ? 'add' : 'remove']('active'));\n tabContents.forEach((tabBodyEl) => { tabBodyEl.style.display = (tabBodyEl.dataset.tab === clickedTab ? 'block' : 'none'); });\n }\n }\">\n
\n ${xCodeSamples.map((v, i) => html``)}\n
\n ${xCodeSamples.map((v, i) => html`\n
\n \n
${Prism.languages[v.lang?.toLowerCase()] ? unsafeHTML(Prism.highlight(v.source, Prism.languages[v.lang?.toLowerCase()], v.lang?.toLowerCase())) : v.source}
\n
`)\n }\n
\n `;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\n\n/* eslint-disable indent */\nexport default function callbackTemplate(callbacks) {\n return html`\n
CALLBACKS
\n ${Object.entries(callbacks).map((kv) => html`\n
\n ${kv[0]}\n ${Object.entries(kv[1]).map((pathObj) => html`\n
\n
\n ${Object.entries(pathObj[1]).map((method) => html`\n
\n
\n
\n \n ${method[0]} \n
\n ${pathObj[0]} \n
\n
\n \n\n \n
\n
\n `)}\n
\n
\n `)}\n
\n `)}\n `;\n}\n/* eslint-enable indent */\n","// Takes a value as input and provides a printable string to replresent null values, spaces, blankstring etc\nexport function getPrintableVal(val) {\n if (val === undefined) {\n return '';\n }\n if (val === null) {\n return 'null';\n }\n if (val === '') {\n return '∅';\n }\n if (typeof val === 'boolean' || typeof val === 'number') {\n return `${val}`;\n }\n if (Array.isArray(val)) {\n return val.map((v) => (v === null ? 'null' : v === '' ? '∅' : v.toString().replace(/^ +| +$/g, (m) => '●'.repeat(m.length)) || '')).join(', ');\n }\n return val.toString().replace(/^ +| +$/g, (m) => '●'.repeat(m.length)) || '';\n}\n\n/* Generates an schema object containing type and constraint info */\nexport function getTypeInfo(schema) {\n if (!schema) {\n return;\n }\n let dataType = '';\n let constrain = '';\n // let examples;\n\n if (schema.$ref) {\n const n = schema.$ref.lastIndexOf('/');\n const schemaNode = schema.$ref.substring(n + 1);\n dataType = `{recursive: ${schemaNode}} `;\n } else if (schema.type) {\n dataType = Array.isArray(schema.type) ? schema.type.join(schema.length === 2 ? ' or ' : '┃') : schema.type;\n if (schema.format || schema.enum || schema.const) {\n dataType = dataType.replace('string', schema.enum ? 'enum' : schema.const ? 'const' : schema.format);\n }\n if (schema.nullable) {\n dataType += '┃null';\n }\n } else if (schema.const) {\n dataType = 'const';\n } else if (Object.keys(schema).length === 0) {\n dataType = 'any';\n } else {\n dataType = '{missing-type-info}';\n }\n\n const info = {\n type: dataType,\n format: schema.format || '',\n pattern: (schema.pattern && !schema.enum) ? schema.pattern : '',\n readOrWriteOnly: (schema.readOnly ? '🆁' : schema.writeOnly ? '🆆' : ''),\n deprecated: schema.deprecated ? '❌' : '',\n examples: schema.examples || schema.example,\n default: getPrintableVal(schema.default),\n description: schema.description || '',\n constrain: '',\n allowedValues: '',\n arrayType: '',\n html: '',\n };\n\n if (info.type === '{recursive}') {\n info.description = schema.$ref.substring(schema.$ref.lastIndexOf('/') + 1);\n } else if (info.type === '{missing-type-info}' || info.type === 'any') {\n info.description = info.description || '';\n }\n // Set Allowed Values\n info.allowedValues = schema.const\n ? schema.const\n : Array.isArray(schema.enum)\n ? schema.enum.map((v) => (getPrintableVal(v))).join('┃')\n : '';\n\n if (dataType === 'array' && schema.items) {\n const arrayItemType = schema.items?.type;\n const arrayItemDefault = getPrintableVal(schema.items.default);\n\n info.arrayType = `${schema.type} of ${Array.isArray(arrayItemType) ? arrayItemType.join('') : arrayItemType}`;\n info.default = arrayItemDefault;\n info.allowedValues = schema.items.const\n ? schema.const\n : Array.isArray(schema.items?.enum)\n ? schema.items.enum.map((v) => (getPrintableVal(v))).join('┃')\n : '';\n }\n if (dataType.match(/integer|number/g)) {\n if (schema.minimum !== undefined || schema.exclusiveMinimum !== undefined) {\n constrain += schema.minimum !== undefined ? `Min ${schema.minimum}` : `More than ${schema.exclusiveMinimum}`;\n }\n if (schema.maximum !== undefined || schema.exclusiveMaximum !== undefined) {\n constrain += schema.maximum !== undefined ? `${constrain ? '┃' : ''}Max ${schema.maximum}` : `${constrain ? '┃' : ''}Less than ${schema.exclusiveMaximum}`;\n }\n if (schema.multipleOf !== undefined) {\n constrain += `${constrain ? '┃' : ''} multiple of ${schema.multipleOf}`;\n }\n }\n if (dataType.match(/string/g)) {\n if (schema.minLength !== undefined && schema.maxLength !== undefined) {\n constrain += `${constrain ? '┃' : ''}${schema.minLength} to ${schema.maxLength} chars`;\n } else if (schema.minLength !== undefined) {\n constrain += `${constrain ? '┃' : ''}Min ${schema.minLength} chars`;\n } else if (schema.maxLength !== undefined) {\n constrain += `Max ${constrain ? '┃' : ''}${schema.maxLength} chars`;\n }\n }\n info.constrain = constrain;\n info.html = `${info.type}~|~${info.readOrWriteOnly}~|~${info.constrain}~|~${info.default}~|~${info.allowedValues}~|~${info.pattern}~|~${info.description}~|~${schema.title || ''}~|~${info.deprecated ? 'deprecated' : ''}`;\n return info;\n}\n\nexport function nestExampleIfPresent(example) {\n if (typeof example === 'boolean' || typeof example === 'number') {\n return {\n Example: { value: `${example}` },\n };\n }\n if (example === '') {\n return {\n Example: { value: '' },\n };\n }\n return example ? { Example: { value: example } } : example;\n}\n\n/**\n * Normalize example object in the following format (List of object which is used to render example links and fill the input boxes)\n * [{\n * exampleVal : 'value to be rendered on the input control (text-box)',\n * exampleList : [\n * value : '',\n * printableValue: '',\n * summary : '',\n * description : ''\n * ]\n * }]\n * */\nexport function normalizeExamples(examples, dataType = 'string') {\n if (!examples) {\n return {\n exampleVal: '',\n exampleList: [],\n };\n }\n if (examples.constructor === Object) {\n const exampleList = Object.values(examples)\n .filter((v) => (v['x-example-show-value'] !== false))\n .map((v) => ({\n value: (typeof v.value === 'boolean' || typeof v.value === 'number' ? `${v.value}` : (v.value || '')),\n printableValue: getPrintableVal(v.value),\n summary: v.summary || '',\n description: v.description || '',\n }));\n const exampleVal = exampleList.length > 0\n ? exampleList[0].value.toString()\n : '';\n return { exampleVal, exampleList };\n }\n\n // This is non-standard way to provide example but will support for now\n if (!Array.isArray(examples)) {\n examples = examples ? [examples] : [];\n }\n\n if (examples.length === 0) {\n return {\n exampleVal: '',\n exampleList: [],\n };\n }\n\n if (dataType === 'array') {\n const [exampleVal] = examples;\n const exampleList = examples.map((v) => ({\n value: v,\n printableValue: getPrintableVal(v),\n }));\n return { exampleVal, exampleList };\n }\n\n const exampleVal = examples[0].toString();\n const exampleList = examples.map((v) => ({\n value: v.toString(),\n printableValue: getPrintableVal(v),\n }));\n return { exampleVal, exampleList };\n}\n\nexport function anyExampleWithSummaryOrDescription(examples) {\n return examples.some((x) => x.summary?.length > 0 || x.description?.length > 0);\n}\n\nexport function getSampleValueByType(schemaObj) {\n const example = schemaObj.examples\n ? schemaObj.examples[0]\n : schemaObj.example === null\n ? null\n : schemaObj.example || undefined;\n if (example === '') { return ''; }\n if (example === null) { return null; }\n if (example === 0) { return 0; }\n if (example === false) { return false; }\n if (example instanceof Date) {\n switch (schemaObj.format.toLowerCase()) {\n case 'date':\n return example.toISOString().split('T')[0];\n case 'time':\n return example.toISOString().split('T')[1];\n default:\n return example.toISOString();\n }\n }\n if (example) { return example; }\n\n if (Object.keys(schemaObj).length === 0) {\n return null;\n }\n if (schemaObj.$ref) {\n // Indicates a Circular ref\n return schemaObj.$ref;\n }\n if (schemaObj.const === false || schemaObj.const === 0 || schemaObj.const === null || schemaObj.const === '') {\n return schemaObj.const;\n }\n if (schemaObj.const) {\n return schemaObj.const;\n }\n const typeValue = Array.isArray(schemaObj.type) ? schemaObj.type[0] : schemaObj.type;\n if (!typeValue) {\n return '?';\n }\n if (typeValue.match(/^integer|^number/g)) {\n const multipleOf = Number.isNaN(Number(schemaObj.multipleOf)) ? undefined : Number(schemaObj.multipleOf);\n const maximum = Number.isNaN(Number(schemaObj.maximum)) ? undefined : Number(schemaObj.maximum);\n const minimumPossibleVal = Number.isNaN(Number(schemaObj.minimum))\n ? Number.isNaN(Number(schemaObj.exclusiveMinimum))\n ? maximum || 0\n : Number(schemaObj.exclusiveMinimum) + (typeValue.startsWith('integer') ? 1 : 0.001)\n : Number(schemaObj.minimum);\n const finalVal = multipleOf\n ? multipleOf >= minimumPossibleVal\n ? multipleOf\n : minimumPossibleVal % multipleOf === 0\n ? minimumPossibleVal\n : Math.ceil(minimumPossibleVal / multipleOf) * multipleOf\n : minimumPossibleVal;\n return finalVal;\n }\n if (typeValue.match(/^boolean/g)) { return false; }\n if (typeValue.match(/^null/g)) { return null; }\n if (typeValue.match(/^string/g)) {\n if (schemaObj.enum) { return schemaObj.enum[0]; }\n if (schemaObj.const) { return schemaObj.const; }\n if (schemaObj.pattern) { return schemaObj.pattern; }\n if (schemaObj.format) {\n const u = `${Date.now().toString(16)}${Math.random().toString(16)}0`.repeat(16);\n switch (schemaObj.format.toLowerCase()) {\n case 'url':\n case 'uri':\n return 'http://example.com';\n case 'date':\n return (new Date(0)).toISOString().split('T')[0];\n case 'time':\n return (new Date(0)).toISOString().split('T')[1];\n case 'date-time':\n return (new Date(0)).toISOString();\n case 'duration':\n return 'P3Y6M4DT12H30M5S'; // P=Period 3-Years 6-Months 4-Days 12-Hours 30-Minutes 5-Seconds\n case 'email':\n case 'idn-email':\n return 'user@example.com';\n case 'hostname':\n case 'idn-hostname':\n return 'www.example.com';\n case 'ipv4':\n return '198.51.100.42';\n case 'ipv6':\n return '2001:0db8:5b96:0000:0000:426f:8e17:642a';\n case 'uuid':\n return [u.substr(0, 8), u.substr(8, 4), `4000-8${u.substr(13, 3)}`, u.substr(16, 12)].join('-');\n default:\n return '';\n }\n } else {\n const minLength = Number.isNaN(schemaObj.minLength) ? undefined : Number(schemaObj.minLength);\n const maxLength = Number.isNaN(schemaObj.maxLength) ? undefined : Number(schemaObj.maxLength);\n const finalLength = minLength || (maxLength > 6 ? 6 : maxLength || undefined);\n return finalLength ? 'A'.repeat(finalLength) : 'string';\n }\n }\n // If type cannot be determined\n return '?';\n}\n\n/*\njson2xml- TestCase\n {\n 'prop1' : 'one',\n 'prop2' : 'two',\n 'prop3' : [ 'a', 'b', 'c' ],\n 'prop4' : {\n 'ob1' : 'val-1',\n 'ob2' : 'val-2'\n }\n }\n \n simple\n \n <0> a \n <1> b \n <2> c \n \n \n val-1\n val-2\n \n \n*/\nexport function json2xml(obj, level = 1) {\n const indent = ' '.repeat(level);\n let xmlText = '';\n if (level === 1 && typeof obj !== 'object') {\n return `\\n${indent}${obj.toString()}`;\n }\n for (const prop in obj) {\n const tagNameOrProp = (obj[prop]['::XML_TAG'] || prop);\n let tagName = '';\n if (Array.isArray(obj[prop])) {\n tagName = tagNameOrProp[0]['::XML_TAG'] || `${prop}`;\n } else {\n tagName = tagNameOrProp;\n }\n if (prop.startsWith('::')) {\n continue;\n }\n if (Array.isArray(obj[prop])) {\n xmlText = `${xmlText}\\n${indent}<${tagName}> ${json2xml(obj[prop], level + 1)}\\n${indent}`;\n } else if (typeof obj[prop] === 'object') {\n xmlText = `${xmlText}\\n${indent}<${tagName}> ${json2xml(obj[prop], level + 1)}\\n${indent}`;\n } else {\n xmlText = `${xmlText}\\n${indent}<${tagName}> ${obj[prop].toString()} `;\n }\n }\n return xmlText;\n}\n\nfunction addSchemaInfoToExample(schema, obj) {\n if (typeof obj !== 'object' || obj === null) {\n return;\n }\n if (schema.title) {\n obj['::TITLE'] = schema.title;\n }\n if (schema.description) {\n obj['::DESCRIPTION'] = schema.description;\n }\n if (schema.xml?.name) {\n obj['::XML_TAG'] = schema.xml?.name;\n }\n if (schema.xml?.wrapped) {\n obj['::XML_WRAP'] = schema.xml?.wrapped.toString();\n }\n}\n\nfunction removeTitlesAndDescriptions(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return;\n }\n delete obj['::TITLE'];\n delete obj['::DESCRIPTION'];\n delete obj['::XML_TAG'];\n delete obj['::XML_WRAP'];\n for (const k in obj) {\n removeTitlesAndDescriptions(obj[k]);\n }\n}\n\nfunction addPropertyExampleToObjectExamples(example, obj, propertyKey) {\n for (const key in obj) {\n obj[key][propertyKey] = example;\n }\n}\n\nfunction mergePropertyExamples(obj, propertyName, propExamples) {\n // Create an example for each variant of the propertyExample, merging them with the current (parent) example\n let i = 0;\n const maxCombinations = 10;\n const mergedObj = {};\n for (const exampleKey in obj) {\n for (const propExampleKey in propExamples) {\n mergedObj[`example-${i}`] = { ...obj[exampleKey] };\n mergedObj[`example-${i}`][propertyName] = propExamples[propExampleKey];\n i++;\n if (i >= maxCombinations) {\n break;\n }\n }\n if (i >= maxCombinations) {\n break;\n }\n }\n return mergedObj;\n}\n\n/* For changing JSON-Schema to a Sample Object, as per the schema (to generate examples based on schema) */\nexport function schemaToSampleObj(schema, config = { }) {\n let obj = {};\n if (!schema) {\n return;\n }\n\n if (schema.allOf) {\n const objWithAllProps = {};\n\n if (schema.allOf.length === 1 && !schema.allOf[0]?.properties && !schema.allOf[0]?.items) {\n // If allOf has single item and the type is not an object or array, then its a primitive\n if (schema.allOf[0].$ref) {\n return '{ }';\n }\n if (schema.allOf[0].readOnly && config.includeReadOnly) {\n const tempSchema = schema.allOf[0];\n return getSampleValueByType(tempSchema);\n }\n return;\n }\n\n schema.allOf.forEach((v) => {\n if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {\n const partialObj = schemaToSampleObj(v, config);\n Object.assign(objWithAllProps, partialObj);\n } else if (v.type === 'array' || v.items) {\n const partialObj = [schemaToSampleObj(v, config)];\n Object.assign(objWithAllProps, partialObj);\n } else if (v.type) {\n const prop = `prop${Object.keys(objWithAllProps).length}`;\n objWithAllProps[prop] = getSampleValueByType(v);\n } else {\n return '';\n }\n });\n\n obj = objWithAllProps;\n } else if (schema.oneOf) {\n // 1. First create example with scheme.properties\n const objWithSchemaProps = {};\n if (schema.properties) {\n for (const propertyName in schema.properties) {\n if (schema.properties[propertyName].properties || schema.properties[propertyName].properties?.items) {\n objWithSchemaProps[propertyName] = schemaToSampleObj(schema.properties[propertyName], config);\n } else {\n objWithSchemaProps[propertyName] = getSampleValueByType(schema.properties[propertyName]);\n }\n }\n }\n\n if (schema.oneOf.length > 0) {\n /*\n oneOf:\n - type: object\n properties:\n option1_PropA:\n type: string\n option1_PropB:\n type: string\n - type: object\n properties:\n option2_PropX:\n type: string\n properties:\n prop1:\n type: string\n prop2:\n type: string\n minLength: 10\n\n The aboove Schem should generate the following 2 examples\n\n Example-1\n {\n prop1: 'string',\n prop2: 'AAAAAAAAAA', <-- min-length 10\n option1_PropA: 'string',\n option1_PropB: 'string'\n }\n\n Example-2\n {\n prop1: 'string',\n prop2: 'AAAAAAAAAA', <-- min-length 10\n option2_PropX: 'string'\n }\n */\n let i = 0;\n // Merge all examples of each oneOf-schema\n for (const key in schema.oneOf) {\n const oneOfSamples = schemaToSampleObj(schema.oneOf[key], config);\n for (const sampleKey in oneOfSamples) {\n // 2. In the final example include a one-of item along with properties\n let finalExample;\n if (Object.keys(objWithSchemaProps).length > 0) {\n if (oneOfSamples[sampleKey] === null || typeof oneOfSamples[sampleKey] !== 'object') {\n // This doesn't really make sense since every oneOf schema _should_ be an object if there are common properties, so we'll skip this\n continue;\n } else {\n finalExample = Object.assign(oneOfSamples[sampleKey], objWithSchemaProps);\n }\n } else {\n finalExample = oneOfSamples[sampleKey];\n }\n obj[`example-${i}`] = finalExample;\n addSchemaInfoToExample(schema.oneOf[key], obj[`example-${i}`]);\n i++;\n }\n }\n }\n } else if (schema.anyOf) {\n // First generate values for regular properties\n let commonObj;\n if (schema.type === 'object' || schema.properties) {\n commonObj = { 'example-0': {} };\n for (const propertyName in schema.properties) {\n if (schema.example) {\n commonObj = schema;\n break;\n }\n if (schema.properties[propertyName].deprecated && !config.includeDeprecated) { continue; }\n if (schema.properties[propertyName].readOnly && !config.includeReadOnly) { continue; }\n if (schema.properties[propertyName].writeOnly && !config.includeWriteOnly) { continue; }\n commonObj = mergePropertyExamples(commonObj, propertyName, schemaToSampleObj(schema.properties[propertyName], config));\n }\n }\n\n // Combine every variant of the regular properties with every variant of the anyOf samples\n let i = 0;\n for (const key in schema.anyOf) {\n const anyOfSamples = schemaToSampleObj(schema.anyOf[key], config);\n for (const sampleKey in anyOfSamples) {\n if (typeof commonObj !== 'undefined') {\n for (const commonKey in commonObj) {\n obj[`example-${i}`] = { ...commonObj[commonKey], ...anyOfSamples[sampleKey] };\n }\n } else {\n obj[`example-${i}`] = anyOfSamples[sampleKey];\n }\n addSchemaInfoToExample(schema.anyOf[key], obj[`example-${i}`]);\n i++;\n }\n }\n } else if (schema.type === 'object' || schema.properties) {\n obj['example-0'] = {};\n addSchemaInfoToExample(schema, obj['example-0']);\n if (schema.example) {\n obj['example-0'] = schema.example;\n } else {\n for (const propertyName in schema.properties) {\n if (schema.properties[propertyName]?.deprecated && !config.includeDeprecated) { continue; }\n if (schema.properties[propertyName]?.readOnly && !config.includeReadOnly) { continue; }\n if (schema.properties[propertyName]?.writeOnly && !config.includeWriteOnly) { continue; }\n if (schema.properties[propertyName]?.type === 'array' || schema.properties[propertyName]?.items) {\n if (schema.properties[propertyName].example) {\n addPropertyExampleToObjectExamples(schema.properties[propertyName].example, obj, propertyName);\n } else if (schema.properties[propertyName]?.items?.example) { // schemas and properties support single example but not multiple examples.\n addPropertyExampleToObjectExamples([schema.properties[propertyName].items.example], obj, propertyName);\n } else {\n const itemSamples = schemaToSampleObj(schema.properties[propertyName].items, config);\n if (config.useXmlTagForProp) {\n const xmlTagName = schema.properties[propertyName].xml?.name || propertyName;\n if (schema.properties[propertyName].xml?.wrapped) {\n const wrappedItemSample = JSON.parse(`{ \"${xmlTagName}\" : { \"${xmlTagName}\" : ${JSON.stringify(itemSamples['example-0'])} } }`);\n obj = mergePropertyExamples(obj, xmlTagName, wrappedItemSample);\n } else {\n obj = mergePropertyExamples(obj, xmlTagName, itemSamples);\n }\n } else {\n const arraySamples = [];\n for (const key in itemSamples) {\n arraySamples[key] = [itemSamples[key]];\n }\n obj = mergePropertyExamples(obj, propertyName, arraySamples);\n }\n }\n continue;\n }\n obj = mergePropertyExamples(obj, propertyName, schemaToSampleObj(schema.properties[propertyName], config));\n }\n }\n } else if (schema.type === 'array' || schema.items) {\n if (schema.items || schema.example) {\n if (schema.example) {\n obj['example-0'] = schema.example;\n } else if (schema.items?.example) { // schemas and properties support single example but not multiple examples.\n obj['example-0'] = [schema.items.example];\n } else {\n const samples = schemaToSampleObj(schema.items, config);\n let i = 0;\n for (const key in samples) {\n obj[`example-${i}`] = [samples[key]];\n addSchemaInfoToExample(schema.items, obj[`example-${i}`]);\n i++;\n }\n }\n } else {\n obj['example-0'] = [];\n }\n } else {\n return { 'example-0': getSampleValueByType(schema) };\n }\n return obj;\n}\n\nfunction generateMarkdownForArrayAndObjectDescription(schema, level = 0) {\n let markdown = '';\n if (schema.title) {\n markdown = `**${schema.title}:** `;\n }\n if (schema.description) {\n markdown = `${markdown} ${schema.description} ${schema.minItems || schema.maxItems ? '
' : ''}`;\n }\n if (schema.minItems) {\n markdown = `${markdown} **Min Items:** ${schema.minItems}`;\n }\n if (schema.maxItems) {\n markdown = `${markdown} **Max Items:** ${schema.maxItems}`;\n }\n if (level > 0 && schema.items?.description) {\n let itemsMarkdown = '';\n if (schema.items.minProperties) {\n itemsMarkdown = `**Min Properties:** ${schema.items.minProperties}`;\n }\n if (schema.items.maxProperties) {\n itemsMarkdown = `${itemsMarkdown} **Max Properties:** ${schema.items.maxProperties}`;\n }\n markdown = `${markdown} ⮕ ${itemsMarkdown} [ ${schema.items.description} ] `;\n }\n return markdown;\n}\n/**\n * For changing OpenAPI-Schema to an Object Notation,\n * This Object would further be an input to UI Components to generate an Object-Tree\n * @param {object} schema - Schema object from OpenAPI spec\n * @param {object} obj - recursivly pass this object to generate object notation\n * @param {number} level - recursion level\n * @param {string} suffix - used for suffixing property names to avoid duplicate props during object composion\n */\nexport function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {\n if (!schema) {\n return;\n }\n if (schema.allOf) {\n const objWithAllProps = {};\n if (schema.allOf.length === 1 && !schema.allOf[0].properties && !schema.allOf[0].items) {\n // If allOf has single item and the type is not an object or array, then its a primitive\n const tempSchema = schema.allOf[0];\n return `${getTypeInfo(tempSchema).html}`;\n }\n // If allOf is an array of multiple elements, then all the keys makes a single object\n schema.allOf.map((v, i) => {\n if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {\n const propSuffix = (v.anyOf || v.oneOf) && i > 0 ? i : '';\n const partialObj = schemaInObjectNotation(v, {}, (level + 1), propSuffix);\n Object.assign(objWithAllProps, partialObj);\n } else if (v.type === 'array' || v.items) {\n const partialObj = schemaInObjectNotation(v, {}, (level + 1));\n Object.assign(objWithAllProps, partialObj);\n } else if (v.type) {\n const prop = `prop${Object.keys(objWithAllProps).length}`;\n const typeObj = getTypeInfo(v);\n objWithAllProps[prop] = `${typeObj.html}`;\n } else {\n return '';\n }\n });\n obj = objWithAllProps;\n } else if (schema.anyOf || schema.oneOf) {\n obj['::description'] = schema.description || '';\n // 1. First iterate the regular properties\n if (schema.type === 'object' || schema.properties) {\n obj['::description'] = schema.description || '';\n obj['::type'] = 'object';\n // obj['::deprecated'] = schema.deprecated || false;\n for (const key in schema.properties) {\n if (schema.required && schema.required.includes(key)) {\n obj[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n } else {\n obj[key] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n }\n }\n }\n // 2. Then show allof/anyof objects\n const objWithAnyOfProps = {};\n const xxxOf = schema.anyOf ? 'anyOf' : 'oneOf';\n schema[xxxOf].forEach((v, index) => {\n if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {\n const partialObj = schemaInObjectNotation(v, {});\n objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;\n objWithAnyOfProps['::type'] = 'xxx-of-option';\n } else if (v.type === 'array' || v.items) {\n // This else-if block never seems to get executed\n const partialObj = schemaInObjectNotation(v, {});\n objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;\n objWithAnyOfProps['::type'] = 'xxx-of-array';\n } else {\n const prop = `::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`;\n objWithAnyOfProps[prop] = `${getTypeInfo(v).html}`;\n objWithAnyOfProps['::type'] = 'xxx-of-option';\n }\n });\n obj[(schema.anyOf ? `::ANY~OF ${suffix}` : `::ONE~OF ${suffix}`)] = objWithAnyOfProps;\n // obj['::type'] = 'object';\n obj['::type'] = 'object';\n } else if (Array.isArray(schema.type)) {\n // When a property has multiple types, then check further if any of the types are array or object, if yes then modify the schema using one-of\n // Clone the schema - as it will be modified to replace multi-data-types with one-of;\n const subSchema = JSON.parse(JSON.stringify(schema));\n const primitiveType = [];\n const complexTypes = [];\n subSchema.type.forEach((v) => {\n if (v.match(/integer|number|string|null|boolean/g)) {\n primitiveType.push(v);\n } else if (v === 'array' && typeof subSchema.items?.type === 'string' && subSchema.items?.type.match(/integer|number|string|null|boolean/g)) {\n // Array with primitive types should also be treated as primitive type\n if (subSchema.items.type === 'string' && subSchema.items.format) {\n primitiveType.push(`[${subSchema.items.format}]`);\n } else {\n primitiveType.push(`[${subSchema.items.type}]`);\n }\n } else {\n complexTypes.push(v);\n }\n });\n let multiPrimitiveTypes;\n if (primitiveType.length > 0) {\n subSchema.type = primitiveType.join(primitiveType.length === 2 ? ' or ' : '┃');\n multiPrimitiveTypes = getTypeInfo(subSchema);\n if (complexTypes.length === 0) {\n return `${multiPrimitiveTypes?.html || ''}`;\n }\n }\n if (complexTypes.length > 0) {\n obj['::type'] = 'object';\n const multiTypeOptions = {\n '::type': 'xxx-of-option',\n };\n\n // Generate ONE-OF options for complexTypes\n complexTypes.forEach((v, i) => {\n if (v === 'null') {\n multiTypeOptions[`::OPTION~${i + 1}`] = 'NULL~|~~|~~|~~|~~|~~|~~|~~|~';\n } else if ('integer, number, string, boolean,'.includes(`${v},`)) {\n subSchema.type = Array.isArray(v) ? v.join('┃') : v;\n const primitiveTypeInfo = getTypeInfo(subSchema);\n multiTypeOptions[`::OPTION~${i + 1}`] = primitiveTypeInfo.html;\n } else if (v === 'object') {\n // If object type iterate all the properties and create an object-type-option\n const objTypeOption = {\n '::title': schema.title || '',\n '::description': schema.description || '',\n '::type': 'object',\n '::deprecated': schema.deprecated || false,\n };\n for (const key in schema.properties) {\n if (schema.required && schema.required.includes(key)) {\n objTypeOption[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n } else {\n objTypeOption[key] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n }\n }\n multiTypeOptions[`::OPTION~${i + 1}`] = objTypeOption;\n } else if (v === 'array') {\n multiTypeOptions[`::OPTION~${i + 1}`] = {\n '::title': schema.title || '',\n '::description': schema.description || '',\n '::type': 'array',\n '::props': schemaInObjectNotation(schema.items, {}, (level + 1)),\n };\n }\n });\n multiTypeOptions[`::OPTION~${complexTypes.length + 1}`] = multiPrimitiveTypes?.html || '';\n obj['::ONE~OF'] = multiTypeOptions;\n }\n } else if (schema.type === 'object' || schema.properties) { // If Object\n obj['::title'] = schema.title || '';\n obj['::description'] = generateMarkdownForArrayAndObjectDescription(schema, level);\n obj['::type'] = 'object';\n if ((Array.isArray(schema.type) && schema.type.includes('null')) || schema.nullable) {\n obj['::dataTypeLabel'] = 'object or null';\n }\n obj['::deprecated'] = schema.deprecated || false;\n obj['::readwrite'] = schema.readOnly ? 'readonly' : schema.writeOnly ? 'writeonly' : '';\n for (const key in schema.properties) {\n if (schema.required && schema.required.includes(key)) {\n obj[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n } else {\n obj[key] = schemaInObjectNotation(schema.properties[key], {}, (level + 1));\n }\n }\n if (schema.additionalProperties) {\n obj[''] = schemaInObjectNotation(schema.additionalProperties, {});\n }\n } else if (schema.type === 'array' || schema.items) { // If Array\n obj['::title'] = schema.title || '';\n obj['::description'] = generateMarkdownForArrayAndObjectDescription(schema, level);\n obj['::type'] = 'array';\n if ((Array.isArray(schema.type) && schema.type.includes('null')) || schema.nullable) {\n obj['::dataTypeLabel'] = 'array or null';\n }\n obj['::deprecated'] = schema.deprecated || false;\n obj['::readwrite'] = schema.readOnly ? 'readonly' : schema.writeOnly ? 'writeonly' : '';\n if (schema.items?.items) {\n obj['::array-type'] = schema.items.items.type;\n }\n obj['::props'] = schemaInObjectNotation(schema.items, {}, (level + 1));\n } else {\n const typeObj = getTypeInfo(schema);\n if (typeObj?.html) {\n return `${typeObj.html}`;\n }\n return '';\n }\n return obj;\n}\n\n/* Create Example object */\nexport function generateExample(schema, mimeType, examples = '', example = '', includeReadOnly = true, includeWriteOnly = true, outputType = 'json', includeGeneratedExample = false) {\n const finalExamples = [];\n // First check if examples is provided\n if (examples) {\n for (const eg in examples) {\n let egContent = '';\n let egFormat = 'json';\n if (mimeType?.toLowerCase().includes('json')) {\n if (outputType === 'text') {\n egContent = typeof examples[eg].value === 'string' ? examples[eg].value : JSON.stringify(examples[eg].value, undefined, 2);\n egFormat = 'text';\n } else {\n egContent = examples[eg].value;\n if (typeof examples[eg].value === 'string') {\n try {\n // const fixedJsonString = examples[eg].value.replace((/([\\w]+)(:)/g), '\"$1\"$2').replace((/'/g), '\"');\n const fixedJsonString = examples[eg].value;\n egContent = JSON.parse(fixedJsonString);\n egFormat = 'json';\n } catch (err) {\n egFormat = 'text';\n egContent = examples[eg].value;\n }\n }\n }\n } else {\n egContent = examples[eg].value;\n egFormat = 'text';\n }\n\n finalExamples.push({\n exampleId: eg,\n exampleSummary: examples[eg].summary || eg,\n exampleDescription: examples[eg].description || '',\n exampleType: mimeType,\n exampleValue: egContent,\n exampleFormat: egFormat,\n });\n }\n } else if (example) {\n let egContent = '';\n let egFormat = 'json';\n if (mimeType?.toLowerCase().includes('json')) {\n if (outputType === 'text') {\n egContent = typeof example === 'string' ? example : JSON.stringify(example, undefined, 2);\n egFormat = 'text';\n } else if (typeof example === 'object') {\n egContent = example;\n egFormat = 'json';\n } else if (typeof example === 'string') {\n try {\n egContent = JSON.parse(example);\n egFormat = 'json';\n } catch (err) {\n egFormat = 'text';\n egContent = example;\n }\n }\n } else {\n egContent = example;\n egFormat = 'text';\n }\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: '',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: egContent,\n exampleFormat: egFormat,\n });\n }\n // If schema-level examples are not provided or includeGeneratedExample === true then generate one based on the schema field types\n if (finalExamples.length === 0 || includeGeneratedExample === true) {\n if (schema) {\n if (schema.example) {\n // Note: Deprecated: The 'example' property has been deprecated in 3.1.0 in favor of the JSON Schema 'examples' keyword\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: '',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: schema.example,\n exampleFormat: ((mimeType?.toLowerCase().includes('json') && typeof schema.example === 'object') ? 'json' : 'text'),\n });\n } else if (mimeType?.toLowerCase().includes('json') || mimeType?.toLowerCase().includes('text') || mimeType?.toLowerCase().includes('*/*') || mimeType?.toLowerCase().includes('xml')) {\n let xmlRootStart = '';\n let xmlRootEnd = '';\n let exampleFormat = '';\n let exampleValue = '';\n if (mimeType?.toLowerCase().includes('xml')) {\n xmlRootStart = schema.xml?.name ? `<${schema.xml.name} ${schema.xml.namespace ? `xmlns=\"${schema.xml.namespace}\"` : ''}>` : '';\n xmlRootEnd = schema.xml?.name ? `` : '';\n exampleFormat = 'text';\n } else {\n exampleFormat = outputType;\n }\n const samples = schemaToSampleObj(schema, { includeReadOnly, includeWriteOnly, deprecated: true, useXmlTagForProp: true });\n let i = 0;\n for (const samplesKey in samples) {\n if (!samples[samplesKey]) {\n continue;\n }\n const summary = samples[samplesKey]['::TITLE'] || `Example ${++i}`;\n const description = samples[samplesKey]['::DESCRIPTION'] || '';\n if (mimeType?.toLowerCase().includes('xml')) {\n exampleValue = `\\n${xmlRootStart}${json2xml(samples[samplesKey], 1)}\\n${xmlRootEnd}`;\n } else {\n removeTitlesAndDescriptions(samples[samplesKey]);\n exampleValue = outputType === 'text' ? JSON.stringify(samples[samplesKey], null, 2) : samples[samplesKey];\n }\n\n finalExamples.push({\n exampleId: samplesKey,\n exampleSummary: summary,\n exampleDescription: description,\n exampleType: mimeType,\n exampleFormat,\n exampleValue,\n });\n }\n } else if (mimeType?.toLowerCase().includes('jose')) {\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: 'Base64 Encoded',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: schema.pattern || 'bXJpbg==',\n exampleFormat: 'text',\n });\n } else {\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: '',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: '',\n exampleFormat: 'text',\n });\n }\n } else {\n // No Example or Schema provided (should never reach here)\n finalExamples.push({\n exampleId: 'Example',\n exampleSummary: '',\n exampleDescription: '',\n exampleType: mimeType,\n exampleValue: '',\n exampleFormat: 'text',\n });\n }\n }\n return finalExamples;\n}\n\nfunction getSerializeStyleForContentType(contentType) {\n if (contentType === 'application/json') {\n return 'json';\n }\n if (contentType === 'application/xml') {\n return 'xml';\n }\n return null;\n}\n\nexport function getSchemaFromParam(param) {\n if (param.schema) {\n return [param.schema, null, null];\n }\n if (param.content) {\n // we gonna use the first content-encoding\n for (const contentType of Object.keys(param.content)) {\n if (param.content[contentType].schema) {\n return [param.content[contentType].schema, getSerializeStyleForContentType(contentType), param.content[contentType]];\n }\n }\n }\n return [null, null, null];\n}\n","import { LitElement, html, css } from 'lit';\nimport { copyToClipboard } from '~/utils/common-utils';\nimport FontStyles from '~/styles/font-styles';\nimport BorderStyles from '~/styles/border-styles';\nimport InputStyles from '~/styles/input-styles';\nimport CustomStyles from '~/styles/custom-styles';\n\nexport default class JsonTree extends LitElement {\n static get properties() {\n return {\n data: { type: Object },\n renderStyle: { type: String, attribute: 'render-style' },\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n BorderStyles,\n InputStyles,\n css`\n :host{\n display:flex;\n }\n :where(button, input[type=\"checkbox\"], [tabindex=\"0\"]):focus-visible { box-shadow: var(--focus-shadow); }\n :where(input[type=\"text\"], input[type=\"password\"], select, textarea):focus-visible { border-color: var(--primary-color); }\n .json-tree {\n position: relative;\n font-family: var(--font-mono);\n font-size: var(--font-size-small);\n display:inline-block;\n overflow:hidden;\n word-break: break-all;\n flex:1;\n line-height: calc(var(--font-size-small) + 6px);\n min-height: 40px;\n direction: ltr; \n text-align: left;\n }\n\n .open-bracket {\n display:inline-block;\n padding: 0 20px 0 0;\n cursor:pointer;\n border: 1px solid transparent;\n border-radius:3px;\n }\n .close-bracket {\n border: 1px solid transparent;\n border-radius:3px;\n display:inline-block;\n }\n .open-bracket:hover {\n color:var(--primary-color);\n background-color:var(--hover-color);\n border: 1px solid var(--border-color);\n }\n .open-bracket.expanded:hover ~ .inside-bracket {\n border-left: 1px solid var(--fg3);\n }\n .open-bracket.expanded:hover ~ .close-bracket {\n color:var(--primary-color);\n }\n .inside-bracket {\n padding-left:12px;\n overflow: hidden;\n border-left:1px dotted var(--border-color);\n }\n .open-bracket.collapsed + .inside-bracket,\n .open-bracket.collapsed + .inside-bracket + .close-bracket {\n display:none;\n }\n\n .string{color:var(--green);}\n .number{color:var(--blue);}\n .null{color:var(--red);}\n .boolean{color:var(--purple);}\n .object{color:var(--fg)}\n .toolbar {\n position: absolute;\n top:5px;\n right:6px;\n display:flex;\n padding:2px;\n align-items: center;\n }`,\n CustomStyles,\n ];\n }\n\n /* eslint-disable indent */\n render() {\n return html`\n
\n
\n \n
\n ${this.generateTree(this.data, true)}\n
\n `;\n }\n\n generateTree(data, isLast = false) {\n if (data === null) {\n return html`
null
`;\n }\n if (typeof data === 'object' && (data instanceof Date === false)) {\n const detailType = Array.isArray(data) ? 'array' : 'pure_object';\n if (Object.keys(data).length === 0) {\n return html`${(Array.isArray(data) ? '[ ],' : '{ },')}`;\n }\n return html`\n
${detailType === 'array' ? '[' : '{'}
\n
\n ${Object.keys(data).map((key, i, a) => html`\n
\n ${detailType === 'pure_object' ? html`\"${key}\":` : ''}\n ${this.generateTree(data[key], i === (a.length - 1))}\n
`)\n }\n
\n
${detailType === 'array' ? ']' : '}'}${isLast ? '' : ','}
\n `;\n }\n\n return (typeof data === 'string' || data instanceof Date)\n ? html`\"${data}\"${isLast ? '' : ','}`\n : html`${data}${isLast ? '' : ','}`;\n }\n /* eslint-enable indent */\n\n toggleExpand(e) {\n const openBracketEl = e.target;\n if (openBracketEl.classList.contains('expanded')) {\n openBracketEl.classList.replace('expanded', 'collapsed');\n e.target.innerHTML = e.target.classList.contains('array') ? '[...]' : '{...}';\n } else {\n openBracketEl.classList.replace('collapsed', 'expanded');\n e.target.innerHTML = e.target.classList.contains('array') ? '[' : '{';\n }\n }\n}\n// Register the element with the browser\ncustomElements.define('json-tree', JsonTree);\n","import { LitElement, html, css } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport FontStyles from '~/styles/font-styles';\nimport SchemaStyles from '~/styles/schema-styles';\nimport BorderStyles from '~/styles/border-styles';\nimport CustomStyles from '~/styles/custom-styles';\n\nexport default class SchemaTree extends LitElement {\n static get properties() {\n return {\n data: { type: Object },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true false'.includes(this.schemaDescriptionExpanded)) { this.schemaDescriptionExpanded = 'false'; }\n if (!this.schemaHideReadOnly || !'true false'.includes(this.schemaHideReadOnly)) { this.schemaHideReadOnly = 'true'; }\n if (!this.schemaHideWriteOnly || !'true false'.includes(this.schemaHideWriteOnly)) { this.schemaHideWriteOnly = 'true'; }\n }\n\n static get styles() {\n return [\n FontStyles,\n SchemaStyles,\n BorderStyles,\n css`\n .tree {\n font-size:var(--font-size-small);\n text-align: left;\n direction: ltr;\n line-height:calc(var(--font-size-small) + 6px);\n }\n .tree .tr:hover{\n background-color:var(--hover-color);\n }\n .collapsed-descr .tr {\n max-height:calc(var(--font-size-small) + 8px);\n }\n .collapsed-descr .m-markdown-small p {\n line-height:calc(var(--font-size-small) + 6px);\n }\n\n .tree .key {\n max-width: 300px;\n }\n .key.deprecated .key-label {\n color: var(--red);\n }\n .tr.expanded:hover > .td.key > .open-bracket {\n color: var(--primary-color);\n }\n .tr.expanded:hover + .inside-bracket {\n border-left: 1px solid var(--fg3);\n }\n .tr.expanded:hover + .inside-bracket + .close-bracket {\n color: var(--primary-color);\n }\n .inside-bracket.xxx-of-option {\n border-left: 1px solid transparent;\n }\n .open-bracket{\n display:inline-block;\n padding: 0 20px 0 0;\n cursor:pointer;\n border: 1px solid transparent;\n border-radius:3px;\n }\n .open-bracket:hover {\n color:var(--primary-color);\n background-color:var(--hover-color);\n border: 1px solid var(--border-color);\n }\n .close-bracket{\n display:inline-block;\n font-family: var(--font-mono);\n }\n .tr.collapsed + .inside-bracket,\n .tr.collapsed + .inside-bracket + .close-bracket{\n overflow: hidden;\n display:none;\n }\n .inside-bracket.object,\n .inside-bracket.array {\n border-left: 1px dotted var(--border-color);\n }`,\n CustomStyles,\n ];\n }\n\n /* eslint-disable indent */\n render() {\n return html`\n
\n
\n
${this.data?.['::type'] || ''}
\n ${this.allowSchemaDescriptionExpandToggle === 'true'\n ? html`\n
\n
\n ${this.schemaDescriptionExpanded === 'true' ? 'Single line description' : 'Multiline description'}\n
\n `\n : ''\n }\n
\n ${unsafeHTML(marked(this.data?.['::description'] || ''))}\n ${this.data\n ? html`\n ${this.generateTree(\n this.data['::type'] === 'array' ? this.data['::props'] : this.data,\n this.data['::type'],\n this.data['::array-type'] || '',\n )}`\n : html` Schema not found `\n }\n
\n `;\n }\n\n generateTree(data, dataType = 'object', arrayType = '', key = '', description = '', schemaLevel = 0, indentLevel = 0, readOrWrite = '') {\n if (this.schemaHideReadOnly === 'true') {\n if (dataType === 'array') {\n if (readOrWrite === 'readonly') {\n return;\n }\n }\n if (data && data['::readwrite'] === 'readonly') {\n return;\n }\n }\n if (this.schemaHideWriteOnly === 'true') {\n if (dataType === 'array') {\n if (readOrWrite === 'writeonly') {\n return;\n }\n }\n if (data && data['::readwrite'] === 'writeonly') {\n return;\n }\n }\n\n if (!data) {\n return html`
\n ${key.replace('::OPTION~', '')}\n ${\n dataType === 'array'\n ? html` [ ] `\n : dataType === 'object'\n ? html` { } `\n : html` schema undefined `\n }\n
`;\n }\n if (Object.keys(data).length === 0) {\n return html`${key}:{ }`;\n }\n let keyLabel = '';\n let keyDescr = '';\n if (key.startsWith('::ONE~OF') || key.startsWith('::ANY~OF')) {\n keyLabel = key.replace('::', '').replace('~', ' ');\n } else if (key.startsWith('::OPTION')) {\n const parts = key.split('~');\n keyLabel = parts[1]; // eslint-disable-line prefer-destructuring\n keyDescr = parts[2]; // eslint-disable-line prefer-destructuring\n } else {\n keyLabel = key;\n }\n\n const leftPadding = 12;\n const minFieldColWidth = 400 - (indentLevel * leftPadding);\n let openBracket = '';\n let closeBracket = '';\n const newSchemaLevel = data['::type']?.startsWith('xxx-of') ? schemaLevel : (schemaLevel + 1);\n // const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' ? indentLevel : (indentLevel + 1);\n const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : (indentLevel + 1);\n if (data['::type'] === 'object') {\n if (dataType === 'array') {\n if (schemaLevel < this.schemaExpandLevel) {\n openBracket = html`[{`;\n } else {\n openBracket = html`[{...}]`;\n }\n closeBracket = '}]';\n } else {\n if (schemaLevel < this.schemaExpandLevel) {\n openBracket = html`{`;\n } else {\n openBracket = html`{...}`;\n }\n closeBracket = '}';\n }\n } else if (data['::type'] === 'array') {\n if (dataType === 'array') {\n const arrType = arrayType !== 'object' ? arrayType : '';\n if (schemaLevel < this.schemaExpandLevel) {\n openBracket = html`[[ ${arrType} `;\n } else {\n openBracket = html`[[...]]`;\n }\n closeBracket = ']]';\n } else {\n if (schemaLevel < this.schemaExpandLevel) {\n openBracket = html`[`;\n } else {\n openBracket = html`[...]`;\n }\n closeBracket = ']';\n }\n }\n if (typeof data === 'object') {\n return html`\n
\n
\n ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION')\n ? html` ${keyLabel}${keyDescr}`\n : keyLabel === '::props' || keyLabel === '::ARRAY~OF'\n ? ''\n : schemaLevel > 0\n ? html`\n ${data['::deprecated'] ? '✗' : ''}\n ${keyLabel.replace(/\\*$/, '')}${keyLabel.endsWith('*') ? html`*` : ''}${readOrWrite === 'readonly' ? html` 🆁` : readOrWrite === 'writeonly' ? html` 🆆` : readOrWrite}:\n `\n : ''\n }\n ${openBracket}\n
\n
${unsafeHTML(marked(description || ''))}
\n
\n
\n ${Array.isArray(data) && data[0]\n ? html`${this.generateTree(data[0], 'xxx-of-option', '', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel, data[0]['::readwrite'])}`\n : html`\n ${Object.keys(data).map((dataKey) => html`\n ${['::title', '::description', '::type', '::props', '::deprecated', '::array-type', '::readwrite', '::dataTypeLabel'].includes(dataKey)\n ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object'\n ? html`${this.generateTree(\n data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey],\n data[dataKey]['::type'],\n data[dataKey]['::array-type'] || '',\n dataKey,\n data[dataKey]['::description'],\n newSchemaLevel,\n newIndentLevel,\n data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '',\n )}`\n : ''\n : html`${this.generateTree(\n data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey],\n data[dataKey]['::type'],\n data[dataKey]['::array-type'] || '',\n dataKey,\n data[dataKey]?.['::description'] || '',\n newSchemaLevel,\n newIndentLevel,\n data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '',\n )}`\n }\n `)}\n `\n }\n
\n ${data['::type'] && data['::type'].includes('xxx-of')\n ? ''\n : html`
${closeBracket}
`\n }\n `;\n }\n\n // For Primitive types and array of Primitives\n // eslint-disable-next-line no-unused-vars\n const [type, primitiveReadOrWrite, constraint, defaultValue, allowedValues, pattern, schemaDescription, schemaTitle, deprecated] = data.split('~|~');\n if (primitiveReadOrWrite === '🆁' && this.schemaHideReadOnly === 'true') {\n return;\n }\n if (primitiveReadOrWrite === '🆆' && this.schemaHideWriteOnly === 'true') {\n return;\n }\n const dataTypeCss = type.replace(/┃.*/g, '').replace(/[^a-zA-Z0-9+]/g, '').substring(0, 4).toLowerCase();\n\n let finalReadWriteText = '';\n let finalReadWriteTip = '';\n if (dataType === 'array') {\n if (readOrWrite === 'readonly') {\n finalReadWriteText = '🆁';\n finalReadWriteTip = 'Read-Only';\n } else if (readOrWrite === 'writeonly') {\n finalReadWriteText = '🆆';\n finalReadWriteTip = 'Write-Only';\n }\n } else if (primitiveReadOrWrite === '🆁') {\n finalReadWriteText = '🆁';\n finalReadWriteTip = 'Read-Only';\n } else if (primitiveReadOrWrite === '🆆') {\n finalReadWriteText = '🆆';\n finalReadWriteTip = 'Write-Only';\n }\n\n return html`\n
\n
\n ${deprecated ? html`` : ''}\n ${keyLabel.endsWith('*')\n ? html`${keyLabel.substring(0, keyLabel.length - 1)}*:`\n : key.startsWith('::OPTION')\n ? html`${keyLabel}${keyDescr}`\n : html`${keyLabel}:`\n }\n \n ${dataType === 'array' ? `[${type}]` : `${type}`}\n ${finalReadWriteText}\n \n
\n
\n ${html`${unsafeHTML(marked(dataType === 'array' ? description : schemaDescription))}`}\n ${constraint ? html`
Constraints: ${constraint}
` : ''}\n ${defaultValue ? html`
Default: ${defaultValue}
` : ''}\n ${allowedValues ? html`
${type === 'const' ? 'Value' : 'Allowed'}: ${allowedValues}
` : ''}\n ${pattern ? html`
Pattern: ${pattern}
` : ''}\n
\n
\n `;\n }\n /* eslint-enable indent */\n\n toggleObjectExpand(e) {\n const rowEl = e.target.closest('.tr');\n if (rowEl.classList.contains('expanded')) {\n rowEl.classList.replace('expanded', 'collapsed');\n e.target.innerHTML = e.target.classList.contains('array-of-object')\n ? '[{...}]'\n : e.target.classList.contains('array-of-array')\n ? '[[...]]'\n : e.target.classList.contains('array')\n ? '[...]'\n : '{...}';\n } else {\n rowEl.classList.replace('collapsed', 'expanded');\n e.target.innerHTML = e.target.classList.contains('array-of-object')\n ? '[{'\n : e.target.classList.contains('array-of-array')\n ? `[[ ${e.target.dataset.arrayType}`\n : e.target.classList.contains('object')\n ? '{'\n : '[';\n }\n }\n}\ncustomElements.define('schema-tree', SchemaTree);\n","import { LitElement, html, css } from 'lit';\n\nexport default class TagInput extends LitElement {\n /* eslint-disable indent */\n render() {\n let tagItemTmpl = '';\n if (Array.isArray(this.value)) {\n tagItemTmpl = html`${this.value\n .filter((v) => typeof v === 'string' && v.trim() !== '')\n .map((v) => html`${v}`)\n }`;\n }\n return html`\n
\n ${tagItemTmpl}\n this.afterPaste(e)}\" @keydown=\"${this.afterKeyDown}\" @blur=\"${this.onBlur}\" placeholder=\"${this.placeholder || ''}\">\n
\n `;\n }\n /* eslint-enable indent */\n\n static get properties() {\n return {\n placeholder: { type: String },\n value: { type: Array, attribute: 'value' },\n };\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'value') {\n if (newVal && oldVal !== newVal) {\n this.value = newVal.split(',').filter((v) => v.trim() !== '');\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n afterPaste(e) {\n const clipboardData = e.clipboardData || window.clipboardData;\n const pastedData = clipboardData.getData('Text');\n const pastedArray = pastedData ? pastedData.split(',').filter((v) => v.trim() !== '') : '';\n if (pastedArray) {\n if (Array.isArray(this.value)) {\n this.value = [...this.value, ...pastedArray];\n } else {\n this.value = pastedArray;\n }\n }\n e.preventDefault();\n }\n\n afterKeyDown(e) {\n if (e.keyCode === 13) {\n e.stopPropagation();\n e.preventDefault();\n if (e.target.value) {\n if (Array.isArray(this.value)) {\n this.value = [...this.value, e.target.value];\n } else {\n this.value = [e.target.value];\n }\n e.target.value = '';\n }\n } else if (e.keyCode === 8) {\n if (e.target.value.length === 0) {\n if (Array.isArray(this.value) && this.value.length > 0) {\n this.value.splice(-1);\n this.value = [...this.value];\n }\n }\n }\n }\n\n onBlur(e) {\n if (e.target.value) {\n if (Array.isArray(this.value)) {\n this.value = [...this.value, e.target.value];\n } else {\n this.value = [e.target.value];\n }\n e.target.value = '';\n }\n }\n\n static get styles() {\n return [css`\n .tags {\n display:flex;\n flex-wrap: wrap;\n outline: none;\n padding:0;\n border-radius:var(--border-radius);\n border:1px solid var(--border-color);\n cursor:text;\n overflow:hidden;\n background:var(--input-bg);\n }\n .tag, .editor {\n padding:3px;\n margin:2px;\n }\n .tag{\n border:1px solid var(--border-color);\n background-color:var(--bg3);\n color:var(--fg3);\n border-radius:var(--border-radius);\n word-break: break-all;\n font-size: var(--font-size-small);\n }\n .tag:hover ~ #cursor {\n display: block;\n }\n .editor {\n flex:1;\n border:1px solid transparent;\n color:var(--fg);\n min-width:60px;\n outline: none;\n line-height: inherit;\n font-family:inherit;\n background:transparent;\n font-size: calc(var(--font-size-small) + 1px);\n }\n .editor:focus-visible {\n outline: 1px solid;\n }\n .editor::placeholder {\n color: var(--placeholder-color);\n opacity:1;\n }\n `];\n }\n}\n// Register the element with the browser\ncustomElements.define('tag-input', TagInput);\n","import { LitElement, html, css } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { guard } from 'lit/directives/guard.js'; // eslint-disable-line import/extensions\nimport { live } from 'lit/directives/live.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport formatXml from 'xml-but-prettier';\nimport Prism from 'prismjs';\nimport TableStyles from '~/styles/table-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport InputStyles from '~/styles/input-styles';\nimport FontStyles from '~/styles/font-styles';\nimport BorderStyles from '~/styles/border-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport PrismStyles from '~/styles/prism-styles';\nimport CustomStyles from '~/styles/custom-styles';\nimport { copyToClipboard, downloadResource, viewResource } from '~/utils/common-utils';\nimport { schemaInObjectNotation,\n getTypeInfo,\n generateExample,\n normalizeExamples,\n getSchemaFromParam,\n json2xml,\n nestExampleIfPresent,\n anyExampleWithSummaryOrDescription } from '~/utils/schema-utils';\nimport '~/components/json-tree';\nimport '~/components/schema-tree';\nimport '~/components/tag-input';\n\nexport default class ApiRequest extends LitElement {\n constructor() {\n super();\n this.responseMessage = '';\n this.responseStatus = 'success';\n this.responseHeaders = '';\n this.responseText = '';\n this.responseUrl = '';\n this.curlSyntax = '';\n this.activeResponseTab = 'response'; // allowed values: response, headers, curl\n this.selectedRequestBodyType = '';\n this.selectedRequestBodyExample = '';\n this.activeParameterSchemaTabs = {};\n }\n\n static get properties() {\n return {\n serverUrl: { type: String, attribute: 'server-url' },\n servers: { type: Array },\n method: { type: String },\n path: { type: String },\n security: { type: Array },\n parameters: { type: Array },\n request_body: { type: Object },\n api_keys: { type: Array },\n parser: { type: Object },\n accept: { type: String },\n callback: { type: String },\n webhook: { type: String },\n responseMessage: { type: String, attribute: false },\n responseText: { type: String, attribute: false },\n responseHeaders: { type: String, attribute: false },\n responseStatus: { type: String, attribute: false },\n responseUrl: { type: String, attribute: false },\n fillRequestFieldsWithExample: { type: String, attribute: 'fill-request-fields-with-example' },\n allowTry: { type: String, attribute: 'allow-try' },\n renderStyle: { type: String, attribute: 'render-style' },\n schemaStyle: { type: String, attribute: 'schema-style' },\n activeSchemaTab: { type: String, attribute: 'active-schema-tab' },\n activeParameterSchemaTabs: {\n type: Object,\n converter: {\n fromAttribute: (attr) => JSON.parse(attr),\n toAttribute: (prop) => JSON.stringify(prop),\n },\n attribute: 'active-parameter-schema-tabs',\n },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n fetchCredentials: { type: String, attribute: 'fetch-credentials' },\n\n // properties for internal tracking\n activeResponseTab: { type: String }, // internal tracking of response-tab not exposed as a attribute\n selectedRequestBodyType: { type: String, attribute: 'selected-request-body-type' }, // internal tracking of selected request-body type\n selectedRequestBodyExample: { type: String, attribute: 'selected-request-body-example' }, // internal tracking of selected request-body example\n };\n }\n\n static get styles() {\n return [\n TableStyles,\n InputStyles,\n FontStyles,\n FlexStyles,\n BorderStyles,\n TabStyles,\n PrismStyles,\n css`\n *, *:before, *:after { box-sizing: border-box; }\n :where(button, input[type=\"checkbox\"], [tabindex=\"0\"]):focus-visible { box-shadow: var(--focus-shadow); }\n :where(input[type=\"text\"], input[type=\"password\"], select, textarea):focus-visible { border-color: var(--primary-color); }\n tag-input:focus-within { outline: 1px solid;}\n .read-mode {\n margin-top: 24px;\n }\n .param-name,\n .param-type {\n margin: 1px 0;\n text-align: right;\n line-height: var(--font-size-small);\n }\n .param-name {\n color: var(--fg); \n font-family: var(--font-mono);\n }\n .param-name.deprecated { \n color: var(--red);\n }\n .param-type{\n color: var(--light-fg); \n font-family: var(--font-regular);\n }\n .param-constraint{\n min-width:100px;\n }\n .param-constraint:empty{\n display:none;\n }\n .top-gap{margin-top:24px;}\n\n .textarea {\n min-height:220px; \n padding:5px;\n resize:vertical;\n direction: ltr;\n }\n .example:first-child {\n margin-top: -9px;\n }\n\n .response-message{\n font-weight:bold;\n text-overflow: ellipsis;\n }\n .response-message.error {\n color:var(--red);\n }\n .response-message.success {\n color:var(--blue);\n }\n\n .file-input-container {\n align-items:flex-end;\n }\n .file-input-container .input-set:first-child .file-input-remove-btn{\n visibility:hidden;\n }\n\n .file-input-remove-btn{\n font-size:16px;\n color:var(--red);\n outline: none;\n border: none;\n background:none;\n cursor:pointer;\n }\n\n .v-tab-btn {\n font-size: var(--smal-font-size);\n height:24px; \n border:none; \n background:none; \n opacity: 0.3;\n cursor: pointer;\n padding: 4px 8px;\n }\n .v-tab-btn.active {\n font-weight: bold;\n background: var(--bg);\n opacity: 1;\n }\n\n @media only screen and (min-width: 768px) {\n .textarea {\n padding:8px;\n }\n }\n\n @media only screen and (max-width: 470px) {\n .hide-in-small-screen {\n display:none;\n }\n }\n `,\n CustomStyles,\n ];\n }\n\n render() {\n return html`\n
\n
\n ${this.callback === 'true' ? 'CALLBACK REQUEST' : 'REQUEST'}\n
\n
\n ${guard([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('path'))}\n ${guard([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('query'))}\n ${this.requestBodyTemplate()}\n ${guard([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('header'))}\n ${guard([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('cookie'))}\n ${this.allowTry === 'false' ? '' : html`${this.apiCallTemplate()}`}\n
\n
\n `;\n }\n\n /*\n async updated(changedProperties) {\n // In focused mode after rendering the request component, update the text-areas(which contains examples) using\n // the original values from hidden textareas\n // This is done coz, user may update the dom by editing the textarea's and once the DOM is updated externally change detection wont happen, therefore update the values manually\n if (this.renderStyle === 'focused') {\n if (changedProperties.size === 1 && changedProperties.has('activeSchemaTab')) {\n // dont update example as only tabs is switched\n } else {\n this.requestUpdate();\n }\n }\n }\n */\n\n async saveExampleState() {\n if (this.renderStyle === 'focused') {\n const reqBodyTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea.request-body-param-user-input')];\n reqBodyTextAreaEls.forEach((el) => {\n el.dataset.user_example = el.value;\n });\n const exampleTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea[data-ptype=\"form-data\"]')];\n exampleTextAreaEls.forEach((el) => {\n el.dataset.user_example = el.value;\n });\n this.requestUpdate();\n }\n }\n\n async updateExamplesFromDataAttr() {\n // In focused mode after rendering the request component, update the text-areas(which contains examples) using\n // the original values from hidden textareas\n // This is done coz, user may update the dom by editing the textarea's and once the DOM is updated externally change detection wont happen, therefore update the values manually\n if (this.renderStyle === 'focused') {\n const reqBodyTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea.request-body-param-user-input')];\n reqBodyTextAreaEls.forEach((el) => {\n el.value = el.dataset.user_example || el.dataset.example;\n });\n const exampleTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea[data-ptype=\"form-data\"]')];\n exampleTextAreaEls.forEach((el) => {\n el.value = el.dataset.user_example || el.dataset.example;\n });\n this.requestUpdate();\n }\n }\n\n /* eslint-disable indent */\n renderExample(example, paramType, paramName) {\n return html`\n ${paramType === 'array' ? '[' : ''}\n {\n const inputEl = e.target.closest('table').querySelector(`[data-pname=\"${paramName}\"]`);\n if (inputEl) {\n inputEl.value = e.target.dataset.exampleType === 'array' ? e.target.dataset.example.split('~|~') : e.target.dataset.example;\n }\n }}\"\n > ${example.printableValue || example.value} \n ${paramType === 'array' ? '] ' : ''}\n `;\n }\n\n renderShortFormatExamples(examples, paramType, paramName) {\n return html`${examples.map((x, i) => html`\n ${i === 0 ? '' : '┃'}\n ${this.renderExample(x, paramType, paramName)}`)}`;\n }\n\n renderLongFormatExamples(exampleList, paramType, paramName) {\n return html`
    \n ${exampleList.map((v) => html`\n
  • \n ${this.renderExample(v, paramType, paramName)}\n ${v.summary?.length > 0 ? html`(${v.summary})` : ''}\n ${v.description?.length > 0 ? html`

    ${unsafeHTML(marked(v.description))}

    ` : ''}\n
  • \n `)}\n
`;\n }\n\n exampleListTemplate(paramName, paramType, exampleList = []) {\n return html` ${\n exampleList.length > 0\n ? html`Examples: \n ${anyExampleWithSummaryOrDescription(exampleList)\n ? this.renderLongFormatExamples(exampleList, paramType, paramName)\n : this.renderShortFormatExamples(exampleList, paramType, paramName)}`\n : ''\n }`;\n }\n\n inputParametersTemplate(paramType) {\n const filteredParams = this.parameters ? this.parameters.filter((param) => param.in === paramType) : [];\n if (filteredParams.length === 0) {\n return '';\n }\n let title = '';\n if (paramType === 'path') {\n title = 'PATH PARAMETERS';\n } else if (paramType === 'query') {\n title = 'QUERY-STRING PARAMETERS';\n } else if (paramType === 'header') {\n title = 'REQUEST HEADERS';\n } else if (paramType === 'cookie') {\n title = 'COOKIES';\n }\n\n const tableRows = [];\n for (const param of filteredParams) {\n const [declaredParamSchema, serializeStyle, mimeTypeElem] = getSchemaFromParam(param);\n if (!declaredParamSchema) {\n continue;\n }\n const paramSchema = getTypeInfo(declaredParamSchema);\n if (!paramSchema) {\n continue; // eslint-disable-line no-continue\n }\n const schemaAsObj = schemaInObjectNotation(declaredParamSchema, {});\n // let exampleVal = '';\n // let exampleList = [];\n let paramStyle = 'form';\n let paramExplode = true;\n let paramAllowReserved = false;\n if (paramType === 'query') {\n if (param.style && 'form spaceDelimited pipeDelimited'.includes(param.style)) {\n paramStyle = param.style;\n } else if (serializeStyle) {\n paramStyle = serializeStyle;\n }\n if (typeof param.explode === 'boolean') {\n paramExplode = param.explode;\n }\n if (typeof param.allowReserved === 'boolean') {\n paramAllowReserved = param.allowReserved;\n }\n }\n // openapi 3.1.0 spec based examples (which must be Object(string : { value:any, summary?: string, description?: string})\n const example = normalizeExamples(\n (param.examples\n || nestExampleIfPresent(param.example)\n || nestExampleIfPresent(mimeTypeElem?.example)\n || mimeTypeElem?.examples\n || paramSchema.examples\n || nestExampleIfPresent(paramSchema.example)\n ),\n paramSchema.type,\n );\n if (!example.exampleVal && paramSchema.type === 'object') {\n example.exampleVal = generateExample(\n declaredParamSchema,\n serializeStyle || 'json',\n '',\n '',\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n true,\n 'text',\n false,\n )[0].exampleValue;\n }\n const labelColWidth = 'read focused'.includes(this.renderStyle) ? '200px' : '160px';\n tableRows.push(html`\n \n \n
\n ${param.deprecated ? html`` : ''}\n ${param.required ? html`*` : ''}\n ${param.name}\n
\n
\n ${paramSchema.type === 'array'\n ? `${paramSchema.arrayType}`\n : `${paramSchema.format ? paramSchema.format : paramSchema.type}`\n }\n
\n \n ${this.allowTry === 'true'\n ? html`\n \n ${paramSchema.type === 'array'\n ? html`\n \n `\n : paramSchema.type === 'object'\n ? html`\n
\n
{\n if (e.target.tagName.toLowerCase() === 'button') {\n const newState = { ...this.activeParameterSchemaTabs };\n newState[param.name] = e.target.dataset.tab;\n this.activeParameterSchemaTabs = newState;\n }\n }}\">\n \n \n
\n ${this.activeParameterSchemaTabs[param.name] === 'example'\n ? html`
\n \n
`\n : html`\n
\n \n
`\n }\n
`\n : html`\n `\n }\n `\n : ''\n }\n ${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues || paramSchema.pattern\n ? html`\n \n
\n ${paramSchema.default ? html`Default: ${paramSchema.default}
` : ''}\n ${paramSchema.pattern ? html`Pattern: ${paramSchema.pattern}
` : ''}\n ${paramSchema.constrain ? html`${paramSchema.constrain}
` : ''}\n ${paramSchema.allowedValues && paramSchema.allowedValues.split('┃').map((v, i) => html`\n ${i > 0 ? '┃' : html`Allowed: `}\n ${html`\n {\n const inputEl = e.target.closest('table').querySelector(`[data-pname=\"${param.name}\"]`);\n if (inputEl) {\n if (e.target.dataset.type === 'array') {\n inputEl.value = [e.target.dataset.enum];\n } else {\n inputEl.value = e.target.dataset.enum;\n }\n }\n }}\"\n >${v}`\n }`)}\n
\n `\n : html``\n }\n \n \n ${this.allowTry === 'true' ? html` ` : ''}\n \n ${unsafeHTML(marked(param.description || ''))}\n ${this.exampleListTemplate.call(this, param.name, paramSchema.type, example.exampleList)}\n \n \n `);\n }\n\n return html`\n
${title}
\n
\n \n ${tableRows}\n
\n
`;\n }\n\n // This method is called before navigation change in focusd mode\n async beforerNavigationFocusedMode() {\n // this.saveExampleState();\n }\n\n // This method is called after navigation change in focusd mode\n async afterNavigationFocusedMode() {\n this.selectedRequestBodyType = '';\n this.selectedRequestBodyExample = '';\n this.updateExamplesFromDataAttr();\n this.clearResponseData();\n }\n\n // Request-Body Event Handlers\n onSelectExample(e) {\n this.selectedRequestBodyExample = e.target.value;\n const exampleDropdownEl = e.target;\n window.setTimeout((selectEl) => {\n const readOnlyExampleEl = selectEl.closest('.example-panel').querySelector('.request-body-param');\n const userInputExampleTextareaEl = selectEl.closest('.example-panel').querySelector('.request-body-param-user-input');\n userInputExampleTextareaEl.value = readOnlyExampleEl.innerText;\n }, 0, exampleDropdownEl);\n }\n\n onMimeTypeChange(e) {\n this.selectedRequestBodyType = e.target.value;\n const mimeDropdownEl = e.target;\n this.selectedRequestBodyExample = '';\n window.setTimeout((selectEl) => {\n const readOnlyExampleEl = selectEl.closest('.request-body-container').querySelector('.request-body-param');\n if (readOnlyExampleEl) {\n const userInputExampleTextareaEl = selectEl.closest('.request-body-container').querySelector('.request-body-param-user-input');\n userInputExampleTextareaEl.value = readOnlyExampleEl.innerText;\n }\n }, 0, mimeDropdownEl);\n }\n\n requestBodyTemplate() {\n if (!this.request_body) {\n return '';\n }\n if (Object.keys(this.request_body).length === 0) {\n return '';\n }\n\n // Variable to store partial HTMLs\n let reqBodyTypeSelectorHtml = '';\n let reqBodyFileInputHtml = '';\n let reqBodyFormHtml = '';\n let reqBodySchemaHtml = '';\n let reqBodyExampleHtml = '';\n\n const requestBodyTypes = [];\n const { content } = this.request_body;\n for (const mimeType in content) {\n requestBodyTypes.push({\n mimeType,\n schema: content[mimeType].schema,\n example: content[mimeType].example,\n examples: content[mimeType].examples,\n });\n if (!this.selectedRequestBodyType) {\n this.selectedRequestBodyType = mimeType;\n }\n }\n // MIME Type selector\n reqBodyTypeSelectorHtml = requestBodyTypes.length === 1\n ? ''\n : html`\n \n `;\n\n // For Loop - Main\n requestBodyTypes.forEach((reqBody) => {\n let schemaAsObj;\n let reqBodyExamples = [];\n\n if (this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') || this.selectedRequestBodyType.includes('jose')) {\n // Generate Example\n if (reqBody.mimeType === this.selectedRequestBodyType) {\n reqBodyExamples = generateExample(\n reqBody.schema,\n reqBody.mimeType,\n reqBody.examples,\n reqBody.example,\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n 'text',\n false,\n );\n if (!this.selectedRequestBodyExample) {\n this.selectedRequestBodyExample = (reqBodyExamples.length > 0 ? reqBodyExamples[0].exampleId : '');\n }\n reqBodyExampleHtml = html`\n ${reqBodyExampleHtml}\n
\n ${reqBodyExamples.length === 1\n ? ''\n : html`\n \n `\n }\n ${reqBodyExamples\n .filter((v) => v.exampleId === this.selectedRequestBodyExample)\n .map((v) => html`\n
\n ${v.exampleSummary && v.exampleSummary.length > 80 ? html`
${v.exampleSummary}
` : ''}\n ${v.exampleDescription ? html`
${unsafeHTML(marked(v.exampleDescription || ''))}
` : ''}\n \n
${(v.exampleFormat === 'text' ? v.exampleValue : JSON.stringify(v.exampleValue, null, 2))}
\n\n \n \n
\n `)}\n\n
\n `;\n }\n } else if (this.selectedRequestBodyType.includes('form-urlencoded') || this.selectedRequestBodyType.includes('form-data')) {\n if (reqBody.mimeType === this.selectedRequestBodyType) {\n const ex = generateExample(\n reqBody.schema,\n reqBody.mimeType,\n reqBody.examples,\n reqBody.example,\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n 'text',\n false,\n );\n if (reqBody.schema) {\n reqBodyFormHtml = this.formDataTemplate(reqBody.schema, reqBody.mimeType, (ex[0] ? ex[0].exampleValue : ''));\n }\n }\n } else if ((/^audio\\/|^image\\/|^video\\/|^font\\/|tar$|zip$|7z$|rtf$|msword$|excel$|\\/pdf$|\\/octet-stream$/.test(this.selectedRequestBodyType))) {\n if (reqBody.mimeType === this.selectedRequestBodyType) {\n reqBodyFileInputHtml = html`\n
\n \n
\n `;\n }\n }\n\n // Generate Schema\n if (reqBody.mimeType.includes('json') || reqBody.mimeType.includes('xml') || reqBody.mimeType.includes('text') || this.selectedRequestBodyType.includes('jose')) {\n schemaAsObj = schemaInObjectNotation(reqBody.schema, {});\n if (this.schemaStyle === 'table') {\n reqBodySchemaHtml = html`\n ${reqBodySchemaHtml}\n \n `;\n } else if (this.schemaStyle === 'tree') {\n reqBodySchemaHtml = html`\n ${reqBodySchemaHtml}\n \n `;\n }\n }\n });\n\n return html`\n
\n
\n REQUEST BODY ${this.request_body.required ? html`*` : ''} \n ${this.selectedRequestBodyType}\n \n ${reqBodyTypeSelectorHtml}\n
\n ${this.request_body.description ? html`
${unsafeHTML(marked(this.request_body.description))}
` : ''}\n \n ${(this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') || this.selectedRequestBodyType.includes('jose'))\n ? html`\n
\n
{ if (e.target.tagName.toLowerCase() === 'button') { this.activeSchemaTab = e.target.dataset.tab; } }}\">\n \n \n
\n ${html`
${reqBodyExampleHtml}
`}\n ${html`
${reqBodySchemaHtml}
`}\n
`\n : html` \n ${reqBodyFileInputHtml}\n ${reqBodyFormHtml}`\n }\n
\n `;\n }\n\n formDataParamAsObjectTemplate(fieldName, fieldSchema, mimeType) {\n // This template is used when form-data param should be send as a object (application/json, application/xml)\n const formdataPartSchema = schemaInObjectNotation(fieldSchema, {});\n const formdataPartExample = generateExample(\n fieldSchema,\n 'json',\n fieldSchema.examples,\n fieldSchema.example,\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n 'text',\n false,\n );\n\n return html`\n
\n
\n
{\n if (e.target.classList.contains('v-tab-btn')) {\n const { tab } = e.target.dataset;\n if (tab) {\n const tabPanelEl = e.target.closest('.tab-panel');\n const selectedTabBtnEl = tabPanelEl.querySelector(`.v-tab-btn[data-tab=\"${tab}\"]`);\n const otherTabBtnEl = [...tabPanelEl.querySelectorAll(`.v-tab-btn:not([data-tab=\"${tab}\"])`)];\n const selectedTabContentEl = tabPanelEl.querySelector(`.tab-content[data-tab=\"${tab}\"]`);\n const otherTabContentEl = [...tabPanelEl.querySelectorAll(`.tab-content:not([data-tab=\"${tab}\"])`)];\n selectedTabBtnEl.classList.add('active');\n selectedTabContentEl.style.display = 'block';\n otherTabBtnEl.forEach((el) => { el.classList.remove('active'); });\n otherTabContentEl.forEach((el) => { el.style.display = 'none'; });\n }\n }\n if (e.target.tagName.toLowerCase() === 'button') { this.activeSchemaTab = e.target.dataset.tab; }\n }}\">\n \n \n
\n
\n ${html`\n
\n \n
`\n }\n ${html`\n
\n \n
`\n }\n
\n `;\n }\n\n formDataTemplate(schema, mimeType, exampleValue = '') {\n const formDataTableRows = [];\n if (schema.properties) {\n for (const fieldName in schema.properties) {\n const fieldSchema = schema.properties[fieldName];\n if (fieldSchema.readOnly) {\n continue;\n }\n const fieldExamples = fieldSchema.examples || fieldSchema.example || '';\n const fieldType = fieldSchema.type;\n const paramSchema = getTypeInfo(fieldSchema);\n const labelColWidth = 'read focused'.includes(this.renderStyle) ? '200px' : '160px';\n const example = normalizeExamples((paramSchema.examples || paramSchema.example), paramSchema.type);\n formDataTableRows.push(html`\n \n \n
\n ${fieldName}${(schema.required?.includes(fieldName) || fieldSchema.required) ? html`*` : ''}\n
\n
${paramSchema.type}
\n \n \n ${fieldType === 'array'\n ? fieldSchema.items?.format === 'binary'\n ? html`\n
this.onAddRemoveFileInput(e, fieldName, mimeType)}\">\n
\n \n \n
\n \n
\n `\n : html`\n \n \n `\n : html`\n ${fieldType === 'object'\n ? this.formDataParamAsObjectTemplate.call(this, fieldName, fieldSchema, mimeType)\n : html`\n ${this.allowTry === 'true'\n ? html``\n : ''\n }\n `\n }`\n }\n \n ${fieldType === 'object'\n ? ''\n : html`\n \n ${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues || paramSchema.pattern\n ? html`\n
\n ${paramSchema.default ? html`Default: ${paramSchema.default}
` : ''}\n ${paramSchema.pattern ? html`Pattern: ${paramSchema.pattern}
` : ''}\n ${paramSchema.constrain ? html`${paramSchema.constrain}
` : ''}\n ${paramSchema.allowedValues && paramSchema.allowedValues.split('┃').map((v, i) => html`\n ${i > 0 ? '┃' : html`Allowed: `}\n ${html`\n {\n const inputEl = e.target.closest('table').querySelector(`[data-pname=\"${fieldName}\"]`);\n if (inputEl) {\n if (e.target.dataset.type === 'array') {\n inputEl.value = [e.target.dataset.enum];\n } else {\n inputEl.value = e.target.dataset.enum;\n }\n }\n }}\"\n > \n ${v} \n `\n }`)\n }\n
`\n : ''\n }\n `\n }\n \n ${fieldType === 'object'\n ? ''\n : html`\n \n \n \n ${unsafeHTML(marked(fieldSchema.description || ''))}\n ${this.exampleListTemplate.call(this, fieldName, paramSchema.type, example.exampleList)}\n \n \n `\n }`);\n }\n return html`\n \n ${formDataTableRows}\n
\n `;\n }\n\n return html`\n \n ${schema.description ? html`${unsafeHTML(marked(schema.description))}` : ''}\n `;\n }\n\n apiResponseTabTemplate() {\n let responseFormat = '';\n let responseContent = '';\n if (!this.responseIsBlob) {\n if (this.responseHeaders.includes('application/x-ndjson')) {\n responseFormat = 'json';\n const prismLines = this.responseText.split('\\n').map((q) => Prism.highlight(q, Prism.languages[responseFormat], responseFormat)).join('\\n');\n responseContent = html`${unsafeHTML(prismLines)}`;\n } else if (this.responseHeaders.includes('json')) {\n responseFormat = 'json';\n responseContent = html`${unsafeHTML(Prism.highlight(this.responseText, Prism.languages[responseFormat], responseFormat))}`;\n } else if (this.responseHeaders.includes('html') || this.responseHeaders.includes('xml')) {\n responseFormat = 'html';\n responseContent = html`${unsafeHTML(Prism.highlight(this.responseText, Prism.languages[responseFormat], responseFormat))}`;\n } else {\n responseFormat = 'text';\n responseContent = html`${this.responseText}`;\n }\n }\n return html`\n
\n
Response Status: ${this.responseMessage}
\n
\n \n
\n
\n
{\n if (e.target.classList.contains('tab-btn') === false) { return; }\n this.activeResponseTab = e.target.dataset.tab;\n }}\">\n \n \n \n
\n ${this.responseIsBlob\n ? html`\n
\n \n ${this.responseBlobType === 'view'\n ? html``\n : ''\n }\n
`\n : html`\n
\n \n
${responseContent}
\n
`\n }\n
\n \n
${unsafeHTML(Prism.highlight(this.responseHeaders, Prism.languages.css, 'css'))}
\n
\n
\n \n
${unsafeHTML(Prism.highlight(this.curlSyntax.trim().replace(/\\\\$/, ''), Prism.languages.shell, 'shell'))}
\n
\n
`;\n }\n\n apiCallTemplate() {\n let selectServerDropdownHtml = '';\n\n if (this.servers && this.servers.length > 0) {\n selectServerDropdownHtml = html`\n \n `;\n }\n const selectedServerHtml = html`\n
\n ${selectServerDropdownHtml}\n ${this.serverUrl\n ? html`\n
\n
API Server
\n ${this.serverUrl} \n
\n `\n : ''\n }\n
\n `;\n\n return html`\n
\n
\n
\n ${selectedServerHtml}\n
\n
\n
Authentication
\n ${this.security?.length > 0\n ? html`\n ${this.api_keys.length > 0\n ? html`
\n ${this.api_keys.length === 1\n ? `${this.api_keys[0]?.typeDisplay} in ${this.api_keys[0].in}`\n : `${this.api_keys.length} API keys applied`\n } \n
`\n : html`
Required (None Applied)`\n }`\n : html` Not Required `\n }\n
\n
\n ${\n this.parameters.length > 0 || this.request_body\n ? html`\n \n `\n : ''\n }\n \n
\n ${this.responseMessage === '' ? '' : this.apiResponseTabTemplate()}\n `;\n }\n /* eslint-enable indent */\n\n async onFillRequestData(e) {\n const requestPanelEl = e.target.closest('.request-panel');\n const requestPanelInputEls = [...requestPanelEl.querySelectorAll('input, tag-input, textarea:not(.is-hidden)')];\n requestPanelInputEls.forEach((el) => {\n if (el.dataset.example) {\n if (el.tagName.toUpperCase() === 'TAG-INPUT') {\n el.value = el.dataset.example.split('~|~');\n } else {\n el.value = el.dataset.example;\n }\n }\n });\n }\n\n async onClearRequestData(e) {\n const requestPanelEl = e.target.closest('.request-panel');\n const requestPanelInputEls = [...requestPanelEl.querySelectorAll('input, tag-input, textarea:not(.is-hidden)')];\n requestPanelInputEls.forEach((el) => { el.value = ''; });\n }\n\n async onTryClick(e) {\n // const me = this;\n const tryBtnEl = e.target;\n let fetchUrl;\n let curlUrl;\n let curl = '';\n let curlHeaders = '';\n let curlData = '';\n let curlForm = '';\n const respEl = this.closest('.expanded-req-resp-container, .req-resp-container')?.getElementsByTagName('api-response')[0];\n const acceptHeader = respEl?.selectedMimeType;\n const requestPanelEl = e.target.closest('.request-panel');\n const pathParamEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='path']\")];\n const queryParamEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='query']\")];\n const queryParamObjTypeEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='query-object']\")];\n const headerParamEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='header']\")];\n const requestBodyContainerEl = requestPanelEl.querySelector('.request-body-container');\n fetchUrl = this.path;\n const fetchOptions = {\n method: this.method.toUpperCase(),\n };\n // Generate URL using Path Params\n pathParamEls.map((el) => {\n fetchUrl = fetchUrl.replace(`{${el.dataset.pname}}`, encodeURIComponent(el.value));\n });\n\n // Query Params\n const urlQueryParamsMap = new Map();\n const queryParamsWithReservedCharsAllowed = [];\n if (queryParamEls.length > 0) {\n queryParamEls.forEach((el) => {\n const queryParam = new URLSearchParams();\n if (el.dataset.paramAllowReserved === 'true') {\n queryParamsWithReservedCharsAllowed.push(el.dataset.pname);\n }\n if (el.dataset.array === 'false') {\n if (el.value !== '') {\n queryParam.append(el.dataset.pname, el.value);\n }\n } else {\n const { paramSerializeStyle, paramSerializeExplode } = el.dataset;\n let vals = ((el.value && Array.isArray(el.value)) ? el.value : []);\n vals = Array.isArray(vals) ? vals.filter((v) => v !== '') : [];\n if (vals.length > 0) {\n if (paramSerializeStyle === 'spaceDelimited') {\n queryParam.append(el.dataset.pname, vals.join(' ').replace(/^\\s|\\s$/g, ''));\n } else if (paramSerializeStyle === 'pipeDelimited') {\n queryParam.append(el.dataset.pname, vals.join('|').replace(/^\\||\\|$/g, ''));\n } else {\n if (paramSerializeExplode === 'true') { // eslint-disable-line no-lonely-if\n vals.forEach((v) => { queryParam.append(el.dataset.pname, v); });\n } else {\n queryParam.append(el.dataset.pname, vals.join(',').replace(/^,|,$/g, ''));\n }\n }\n }\n }\n if (queryParam.toString()) {\n urlQueryParamsMap.set(el.dataset.pname, queryParam);\n }\n });\n }\n\n // Query Params (Dynamic - create from JSON)\n if (queryParamObjTypeEls.length > 0) {\n queryParamObjTypeEls.map((el) => {\n const queryParam = new URLSearchParams();\n try {\n let queryParamObj = {};\n const { paramSerializeStyle, paramSerializeExplode } = el.dataset;\n queryParamObj = Object.assign(queryParamObj, JSON.parse(el.value.replace(/\\s+/g, ' ')));\n if (el.dataset.paramAllowReserved === 'true') {\n queryParamsWithReservedCharsAllowed.push(el.dataset.pname);\n }\n if ('json xml'.includes(paramSerializeStyle)) {\n if (paramSerializeStyle === 'json') {\n queryParam.append(el.dataset.pname, JSON.stringify(queryParamObj));\n } else if (paramSerializeStyle === 'xml') {\n queryParam.append(el.dataset.pname, json2xml(queryParamObj));\n }\n } else {\n for (const key in queryParamObj) {\n if (typeof queryParamObj[key] === 'object') {\n if (Array.isArray(queryParamObj[key])) {\n if (paramSerializeStyle === 'spaceDelimited') {\n queryParam.append(key, queryParamObj[key].join(' '));\n } else if (paramSerializeStyle === 'pipeDelimited') {\n queryParam.append(key, queryParamObj[key].join('|'));\n } else {\n if (paramSerializeExplode === 'true') { // eslint-disable-line no-lonely-if\n queryParamObj[key].forEach((v) => {\n queryParam.append(key, v);\n });\n } else {\n queryParam.append(key, queryParamObj[key]);\n }\n }\n }\n } else {\n queryParam.append(key, queryParamObj[key]);\n }\n }\n }\n } catch (err) {\n console.error('RapiDoc: unable to parse %s into object', el.value); // eslint-disable-line no-console\n }\n if (queryParam.toString()) {\n urlQueryParamsMap.set(el.dataset.pname, queryParam);\n }\n });\n }\n let urlQueryParamString = '';\n if (urlQueryParamsMap.size) {\n urlQueryParamString = '?';\n urlQueryParamsMap.forEach((val, pname) => {\n if (queryParamsWithReservedCharsAllowed.includes(pname)) {\n urlQueryParamString += `${pname}=`;\n urlQueryParamString += val.getAll(pname).join(`&${pname}=`);\n urlQueryParamString += '&';\n } else {\n urlQueryParamString += `${val.toString()}&`;\n }\n });\n urlQueryParamString = urlQueryParamString.slice(0, -1);\n }\n fetchUrl = `${fetchUrl}${urlQueryParamString}`;\n\n // Add authentication Query-Param if provided\n this.api_keys\n .filter((v) => (v.in === 'query'))\n .forEach((v) => {\n fetchUrl = `${fetchUrl}${fetchUrl.includes('?') ? '&' : '?'}${v.name}=${encodeURIComponent(v.finalKeyValue)}`;\n });\n\n // Final URL for API call\n fetchUrl = `${this.serverUrl.replace(/\\/$/, '')}${fetchUrl}`;\n if (fetchUrl.startsWith('http') === false) {\n const url = new URL(fetchUrl, window.location.href);\n curlUrl = url.href;\n } else {\n curlUrl = fetchUrl;\n }\n curl = `curl -X ${this.method.toUpperCase()} \"${curlUrl}\" \\\\\\n`;\n const reqHeaders = new Headers();\n if (acceptHeader) {\n // Uses the acceptHeader from Response panel\n reqHeaders.append('Accept', acceptHeader);\n curlHeaders += ` -H \"Accept: ${acceptHeader}\" \\\\\\n`;\n } else if (this.accept) {\n reqHeaders.append('Accept', this.accept);\n curlHeaders += ` -H \"Accept: ${this.accept}\" \\\\\\n`;\n }\n\n // Add Authentication Header if provided\n this.api_keys\n .filter((v) => (v.in === 'header'))\n .forEach((v) => {\n reqHeaders.append(v.name, v.finalKeyValue);\n curlHeaders += ` -H \"${v.name}: ${v.finalKeyValue}\" \\\\\\n`;\n });\n\n // Add Header Params\n headerParamEls.map((el) => {\n if (el.value) {\n reqHeaders.append(el.dataset.pname, el.value);\n curlHeaders += ` -H \"${el.dataset.pname}: ${el.value}\" \\\\\\n`;\n }\n });\n\n // Request Body Params\n if (requestBodyContainerEl) {\n const requestBodyType = requestBodyContainerEl.dataset.selectedRequestBodyType;\n if (requestBodyType.includes('form-urlencoded')) {\n // url-encoded Form Params (dynamic) - Parse JSON and generate Params\n const formUrlDynamicTextAreaEl = requestPanelEl.querySelector(\"[data-ptype='dynamic-form']\");\n if (formUrlDynamicTextAreaEl) {\n const val = formUrlDynamicTextAreaEl.value;\n const formUrlDynParams = new URLSearchParams();\n let proceed = true;\n let tmpObj;\n if (val) {\n try {\n tmpObj = JSON.parse(val);\n } catch (err) {\n proceed = false;\n console.warn('RapiDoc: Invalid JSON provided', err); // eslint-disable-line no-console\n }\n } else {\n proceed = false;\n }\n if (proceed) {\n for (const prop in tmpObj) {\n formUrlDynParams.append(prop, JSON.stringify(tmpObj[prop]));\n }\n fetchOptions.body = formUrlDynParams;\n curlData = ` -d ${formUrlDynParams.toString()} \\\\\\n`;\n }\n } else {\n // url-encoded Form Params (regular)\n const formUrlEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='form-urlencode']\")];\n const formUrlParams = new URLSearchParams();\n formUrlEls\n .filter((v) => (v.type !== 'file'))\n .forEach((el) => {\n if (el.dataset.array === 'false') {\n if (el.value) {\n formUrlParams.append(el.dataset.pname, el.value);\n }\n } else {\n const vals = (el.value && Array.isArray(el.value)) ? el.value.join(',') : '';\n formUrlParams.append(el.dataset.pname, vals);\n }\n });\n fetchOptions.body = formUrlParams;\n curlData = ` -d ${formUrlParams.toString()} \\\\\\n`;\n }\n } else if (requestBodyType.includes('form-data')) {\n const formDataParams = new FormData();\n const formDataEls = [...requestPanelEl.querySelectorAll(\"[data-ptype='form-data']\")];\n formDataEls.forEach((el) => {\n if (el.dataset.array === 'false') {\n if (el.type === 'file' && el.files[0]) {\n formDataParams.append(el.dataset.pname, el.files[0], el.files[0].name);\n curlForm += ` -F \"${el.dataset.pname}=@${el.files[0].name}\" \\\\\\n`;\n } else if (el.value) {\n formDataParams.append(el.dataset.pname, el.value);\n curlForm += ` -F \"${el.dataset.pname}=${el.value}\" \\\\\\n`;\n }\n } else if (el.value && Array.isArray(el.value)) {\n el.value.forEach((v) => {\n curlForm = `${curlForm} -F \"${el.dataset.pname}[]=${v}\" \\\\\\n`;\n });\n formDataParams.append(el.dataset.pname, el.value.join(','));\n }\n });\n fetchOptions.body = formDataParams;\n } else if (/^audio\\/|^image\\/|^video\\/|^font\\/|tar$|zip$|7z$|rtf$|msword$|excel$|\\/pdf$|\\/octet-stream$/.test(requestBodyType)) {\n const bodyParamFileEl = requestPanelEl.querySelector('.request-body-param-file');\n if (bodyParamFileEl?.files[0]) {\n fetchOptions.body = bodyParamFileEl.files[0]; // eslint-disable-line prefer-destructuring\n curlData = ` --data-binary @${bodyParamFileEl.files[0].name} \\\\\\n`;\n }\n } else if (requestBodyType.includes('json') || requestBodyType.includes('xml') || requestBodyType.includes('text')) {\n const exampleTextAreaEl = requestPanelEl.querySelector('.request-body-param-user-input');\n if (exampleTextAreaEl?.value) {\n fetchOptions.body = exampleTextAreaEl.value;\n if (requestBodyType.includes('json')) {\n try {\n curlData = ` -d '${JSON.stringify(JSON.parse(exampleTextAreaEl.value))}' \\\\\\n`;\n } catch (err) {\n // Ignore.\n }\n }\n if (!curlData) {\n curlData = ` -d '${exampleTextAreaEl.value.replace(/'/g, '\\'\"\\'\"\\'')}' \\\\\\n`;\n }\n }\n }\n // Common for all request-body\n if (!requestBodyType.includes('form-data')) {\n // For multipart/form-data dont set the content-type to allow creation of browser generated part boundaries\n reqHeaders.append('Content-Type', requestBodyType);\n }\n curlHeaders += ` -H \"Content-Type: ${requestBodyType}\" \\\\\\n`;\n }\n this.responseUrl = '';\n this.responseHeaders = [];\n this.curlSyntax = '';\n this.responseStatus = 'success';\n this.responseIsBlob = false;\n\n this.respContentDisposition = '';\n if (this.responseBlobUrl) {\n URL.revokeObjectURL(this.responseBlobUrl);\n this.responseBlobUrl = '';\n }\n this.curlSyntax = `${curl}${curlHeaders}${curlData}${curlForm}`;\n if (this.fetchCredentials) {\n fetchOptions.credentials = this.fetchCredentials;\n }\n const controller = new AbortController();\n const { signal } = controller;\n fetchOptions.headers = reqHeaders;\n const tempRequest = { url: fetchUrl, ...fetchOptions };\n this.dispatchEvent(new CustomEvent('before-try', {\n bubbles: true,\n composed: true,\n detail: {\n request: tempRequest,\n controller,\n },\n }));\n const updatedFetchOptions = {\n method: tempRequest.method,\n headers: tempRequest.headers,\n credentials: tempRequest.credentials,\n body: tempRequest.body,\n };\n const fetchRequest = new Request(tempRequest.url, updatedFetchOptions);\n\n let fetchResponse;\n let responseClone;\n try {\n let respBlob;\n let respJson;\n let respText;\n tryBtnEl.disabled = true;\n this.responseText = '⌛';\n this.responseMessage = '';\n this.requestUpdate();\n const startTime = performance.now();\n fetchResponse = await fetch(fetchRequest, { signal });\n const endTime = performance.now();\n responseClone = fetchResponse.clone(); // create a response clone to allow reading response body again (response.json, response.text etc)\n tryBtnEl.disabled = false;\n this.responseMessage = html`${fetchResponse.statusText ? `${fetchResponse.statusText}:${fetchResponse.status}` : fetchResponse.status}
Took ${Math.round(endTime - startTime)} milliseconds
`;\n this.responseUrl = fetchResponse.url;\n const respHeadersObj = {};\n fetchResponse.headers.forEach((hdrVal, hdr) => {\n respHeadersObj[hdr] = hdrVal;\n this.responseHeaders = `${this.responseHeaders}${hdr}: ${hdrVal}\\n`;\n });\n const contentType = fetchResponse.headers.get('content-type');\n const respEmpty = (await fetchResponse.clone().text()).length === 0;\n if (respEmpty) {\n this.responseText = '';\n } else if (contentType) {\n if (contentType === 'application/x-ndjson') {\n this.responseText = await fetchResponse.text();\n } else if (contentType.includes('json')) {\n if ((/charset=[^\"']+/).test(contentType)) {\n const encoding = contentType.split('charset=')[1];\n const buffer = await fetchResponse.arrayBuffer();\n try {\n respText = new TextDecoder(encoding).decode(buffer);\n } catch {\n respText = new TextDecoder('utf-8').decode(buffer);\n }\n try {\n respJson = JSON.parse(respText);\n this.responseText = JSON.stringify(respJson, null, 2);\n } catch {\n this.responseText = respText;\n }\n } else {\n respJson = await fetchResponse.json();\n this.responseText = JSON.stringify(respJson, null, 2);\n }\n // eslint-disable-next-line no-useless-escape\n } else if (/^font\\/|tar$|zip$|7z$|rtf$|msword$|excel$|\\/pdf$|\\/octet-stream$|^application\\/vnd\\./.test(contentType)) {\n this.responseIsBlob = true;\n this.responseBlobType = 'download';\n } else if (/^audio|^image|^video/.test(contentType)) {\n this.responseIsBlob = true;\n this.responseBlobType = 'view';\n } else {\n respText = await fetchResponse.text();\n if (contentType.includes('xml')) {\n this.responseText = formatXml(respText, { textNodesOnSameLine: true, indentor: ' ' });\n } else {\n this.responseText = respText;\n }\n }\n if (this.responseIsBlob) {\n const contentDisposition = fetchResponse.headers.get('content-disposition');\n this.respContentDisposition = contentDisposition ? contentDisposition.split('filename=')[1].replace(/\"|'/g, '') : 'filename';\n respBlob = await fetchResponse.blob();\n this.responseBlobUrl = URL.createObjectURL(respBlob);\n }\n } else {\n respText = await fetchResponse.text();\n this.responseText = respText;\n }\n this.dispatchEvent(new CustomEvent('after-try', {\n bubbles: true,\n composed: true,\n detail: {\n request: fetchRequest,\n response: responseClone,\n responseHeaders: respHeadersObj,\n responseBody: respJson || respText || respBlob,\n responseStatus: responseClone.ok,\n },\n }));\n } catch (err) {\n tryBtnEl.disabled = false;\n if (err.name === 'AbortError') {\n this.dispatchEvent(new CustomEvent('request-aborted', {\n bubbles: true,\n composed: true,\n detail: {\n err,\n request: fetchRequest,\n },\n }));\n this.responseMessage = 'Request Aborted';\n this.responseText = 'Request Aborted';\n } else {\n this.dispatchEvent(new CustomEvent('after-try', {\n bubbles: true,\n composed: true,\n detail: {\n err,\n request: fetchRequest,\n },\n }));\n this.responseMessage = `${err.message} (CORS or Network Issue)`;\n }\n }\n this.requestUpdate();\n }\n\n onAddRemoveFileInput(e, pname, ptype) {\n if (e.target.tagName.toLowerCase() !== 'button') {\n return;\n }\n\n if (e.target.classList.contains('file-input-remove-btn')) {\n // Remove File Input Set\n const el = e.target.closest('.input-set');\n el.remove();\n return;\n }\n const el = e.target.closest('.file-input-container');\n\n // Add File Input Set\n\n // Container\n const newInputContainerEl = document.createElement('div');\n newInputContainerEl.setAttribute('class', 'input-set row');\n\n // File Input\n const newInputEl = document.createElement('input');\n newInputEl.type = 'file';\n newInputEl.style = 'width:200px; margin-top:2px;';\n newInputEl.setAttribute('data-pname', pname);\n newInputEl.setAttribute('data-ptype', ptype.includes('form-urlencode') ? 'form-urlencode' : 'form-data');\n newInputEl.setAttribute('data-array', 'false');\n newInputEl.setAttribute('data-file-array', 'true');\n\n // Remover Button\n const newRemoveBtnEl = document.createElement('button');\n newRemoveBtnEl.setAttribute('class', 'file-input-remove-btn');\n newRemoveBtnEl.innerHTML = '✕';\n\n newInputContainerEl.appendChild(newInputEl);\n newInputContainerEl.appendChild(newRemoveBtnEl);\n el.insertBefore(newInputContainerEl, e.target);\n // el.appendChild(newInputContainerEl);\n }\n\n clearResponseData() {\n this.responseUrl = '';\n this.responseHeaders = '';\n this.responseText = '';\n this.responseStatus = 'success';\n this.responseMessage = '';\n this.responseIsBlob = false;\n this.responseBlobType = '';\n this.respContentDisposition = '';\n if (this.responseBlobUrl) {\n URL.revokeObjectURL(this.responseBlobUrl);\n this.responseBlobUrl = '';\n }\n }\n\n disconnectedCallback() {\n // Cleanup ObjectURL forthe blob data if this component created one\n if (this.responseBlobUrl) {\n URL.revokeObjectURL(this.responseBlobUrl);\n this.responseBlobUrl = '';\n }\n super.disconnectedCallback();\n }\n}\n\n// Register the element with the browser\ncustomElements.define('api-request', ApiRequest);\n","import { LitElement, html, css } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport FontStyles from '~/styles/font-styles';\nimport SchemaStyles from '~/styles/schema-styles';\nimport CustomStyles from '~/styles/custom-styles';\n\nexport default class SchemaTable extends LitElement {\n static get properties() {\n return {\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n data: { type: Object },\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true false'.includes(this.schemaDescriptionExpanded)) { this.schemaDescriptionExpanded = 'false'; }\n if (!this.schemaHideReadOnly || !'true false'.includes(this.schemaHideReadOnly)) { this.schemaHideReadOnly = 'true'; }\n if (!this.schemaHideWriteOnly || !'true false'.includes(this.schemaHideWriteOnly)) { this.schemaHideWriteOnly = 'true'; }\n }\n\n static get styles() {\n return [\n FontStyles,\n SchemaStyles,\n css`\n .table {\n font-size: var(--font-size-small);\n text-align: left;\n line-height: calc(var(--font-size-small) + 6px);\n }\n .table .tr {\n width: calc(100% - 5px);\n padding: 0 0 0 5px;\n border-bottom: 1px dotted var(--light-border-color);\n }\n .table .td {\n padding: 4px 0;\n }\n .table .key {\n width: 240px;\n }\n .key.deprecated .key-label {\n color: var(--red);\n }\n\n .table .key-type {\n white-space: normal;\n width: 150px;\n }\n .collapsed-descr .tr {\n max-height: calc(var(--font-size-small) + var(--font-size-small) + 4px);\n }\n\n .obj-toggle {\n padding: 0 2px;\n border-radius:2px;\n border: 1px solid transparent;\n display: inline-block;\n margin-left: -16px;\n color:var(--primary-color);\n cursor:pointer;\n font-size: calc(var(--font-size-small) + 4px);\n font-family: var(--font-mono);\n background-clip: border-box;\n }\n .obj-toggle:hover {\n border-color: var(--primary-color);\n }\n .tr.expanded + .object-body {\n display:block;\n }\n .tr.collapsed + .object-body {\n display:none;\n }`,\n CustomStyles,\n ];\n }\n\n /* eslint-disable indent */\n render() {\n return html`\n
\n
\n
${this.data?.['::type'] || ''}
\n ${this.allowSchemaDescriptionExpandToggle === 'true'\n ? html`\n
\n
\n ${this.schemaDescriptionExpanded === 'true' ? 'Single line description' : 'Multiline description'}\n
\n `\n : ''\n }\n
\n ${unsafeHTML(marked(this.data?.['::description'] || ''))}\n
\n
\n
Field
\n
Type
\n
Description
\n
\n ${this.data\n ? html`\n ${this.generateTree(\n this.data['::type'] === 'array' ? this.data['::props'] : this.data,\n this.data['::type'],\n this.data['::array-type'],\n )}`\n : ''\n } \n
\n
\n `;\n }\n\n generateTree(data, dataType = 'object', arrayType = '', key = '', description = '', schemaLevel = 0, indentLevel = 0, readOrWrite = '') {\n if (this.schemaHideReadOnly === 'true') {\n if (dataType === 'array') {\n if (readOrWrite === 'readonly') {\n return;\n }\n }\n if (data && data['::readwrite'] === 'readonly') {\n return;\n }\n }\n if (this.schemaHideWriteOnly === 'true') {\n if (dataType === 'array') {\n if (readOrWrite === 'writeonly') {\n return;\n }\n }\n if (data && data['::readwrite'] === 'writeonly') {\n return;\n }\n }\n if (!data) {\n return html`
\n   \n ${key.replace('::OPTION~', '')}\n ${\n dataType === 'array'\n ? html` [ ] `\n : dataType === 'object'\n ? html` { } `\n : html` schema undefined `\n }\n
`;\n }\n\n const newSchemaLevel = data['::type']?.startsWith('xxx-of') ? schemaLevel : (schemaLevel + 1);\n const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : (indentLevel + 1);\n const leftPadding = 16 * newIndentLevel; // 2 space indentation at each level\n if (Object.keys(data).length === 0) {\n return html`${key}`;\n }\n let keyLabel = '';\n let keyDescr = '';\n let isOneOfLabel = false;\n if (key.startsWith('::ONE~OF') || key.startsWith('::ANY~OF')) {\n keyLabel = key.replace('::', '').replace('~', ' ');\n isOneOfLabel = true;\n } else if (key.startsWith('::OPTION')) {\n const parts = key.split('~');\n keyLabel = parts[1]; // eslint-disable-line prefer-destructuring\n keyDescr = parts[2]; // eslint-disable-line prefer-destructuring\n } else {\n keyLabel = key;\n }\n\n let detailObjType = '';\n if (data['::type'] === 'object') {\n if (dataType === 'array') {\n detailObjType = 'array of object'; // Array of Object\n } else {\n detailObjType = data['::dataTypeLabel'] || data['::type'];\n }\n } else if (data['::type'] === 'array') {\n if (dataType === 'array') {\n // detailObjType = 'array of array'; // Array of array\n detailObjType = `array of array ${arrayType !== 'object' ? `of ${arrayType}` : ''}`; // Array of array\n } else {\n detailObjType = data['::dataTypeLabel'] || data['::type'];\n }\n }\n\n if (typeof data === 'object') {\n return html`\n ${newSchemaLevel >= 0 && key\n ? html`\n
\n
\n ${(keyLabel || keyDescr)\n ? html`\n this.toggleObjectExpand(e, keyLabel)} \n >\n ${schemaLevel < this.schemaExpandLevel ? '-' : '+'}\n `\n : ''\n }\n ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION')\n ? html`${keyLabel}${keyDescr}`\n : keyLabel.endsWith('*')\n ? html`${data['::deprecated'] ? '✗' : ''} ${keyLabel.substring(0, keyLabel.length - 1)}*`\n : html`${data['::deprecated'] ? '✗' : ''} ${keyLabel === '::props' ? '' : keyLabel}`\n }\n ${data['::type'] === 'xxx-of' && dataType === 'array' ? html`ARRAY` : ''} \n
\n
\n ${(data['::type'] || '').includes('xxx-of') ? '' : detailObjType}\n ${data['::readwrite'] === 'readonly' ? ' 🆁' : data['::readwrite'] === 'writeonly' ? ' 🆆' : ''}\n
\n
${unsafeHTML(marked(description || ''))}
\n
`\n : html`\n ${data['::type'] === 'array' && dataType === 'array'\n ? html`\n
\n
\n
\n ${arrayType && arrayType !== 'object' ? `${dataType} of ${arrayType}` : dataType}\n
\n
\n
`\n : ''\n }\n `\n }\n
\n ${Array.isArray(data) && data[0]\n ? html`${this.generateTree(data[0], 'xxx-of-option', '', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel, '')}`\n : html`\n ${Object.keys(data).map((dataKey) => html`\n ${['::title', '::description', '::type', '::props', '::deprecated', '::array-type', '::readwrite', '::dataTypeLabel'].includes(dataKey)\n ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object'\n ? html`${this.generateTree(\n data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey],\n data[dataKey]['::type'],\n data[dataKey]['::array-type'] || '',\n dataKey,\n data[dataKey]['::description'],\n newSchemaLevel,\n newIndentLevel,\n data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '',\n )}`\n : ''\n : html`${this.generateTree(\n data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey],\n data[dataKey]['::type'],\n data[dataKey]['::array-type'] || '',\n dataKey,\n data[dataKey]?.['::description'] || '',\n newSchemaLevel,\n newIndentLevel,\n data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '',\n )}`\n }\n `)}\n `\n }\n
\n `;\n }\n\n // For Primitive Data types\n // eslint-disable-next-line no-unused-vars\n const [type, readOrWriteOnly, constraint, defaultValue, allowedValues, pattern, schemaDescription, schemaTitle, deprecated] = data.split('~|~');\n if (readOrWriteOnly === '🆁' && this.schemaHideReadOnly === 'true') {\n return;\n }\n if (readOrWriteOnly === '🆆' && this.schemaHideWriteOnly === 'true') {\n return;\n }\n const dataTypeCss = type.replace(/┃.*/g, '').replace(/[^a-zA-Z0-9+]/g, '').substring(0, 4).toLowerCase();\n let dataTypeHtml = '';\n if (dataType === 'array') {\n dataTypeHtml = html` \n
\n [${type}] ${readOrWrite === 'readonly' ? '🆁' : readOrWrite === 'writeonly' ? '🆆' : ''}\n
`;\n } else {\n dataTypeHtml = html` \n
\n ${type} ${readOrWriteOnly}\n
`;\n }\n return html`\n
\n
\n ${deprecated ? html`` : ''}\n ${keyLabel?.endsWith('*')\n ? html`\n ${keyLabel.substring(0, keyLabel.length - 1)}\n *`\n : key.startsWith('::OPTION')\n ? html`${keyLabel}${keyDescr}`\n : html`${keyLabel ? html` ${keyLabel}` : html`${schemaTitle}`}`\n }\n
\n ${dataTypeHtml}\n
{ this.schemaDescriptionExpanded = 'true'; }}\">\n ${html`${unsafeHTML(marked(dataType === 'array' ? description : schemaDescription))}`}\n ${constraint ? html`
Constraints: ${constraint}
` : ''}\n ${defaultValue ? html`
Default: ${defaultValue}
` : ''}\n ${allowedValues ? html`
${type === 'const' ? 'Value' : 'Allowed'}: ${allowedValues}
` : ''}\n ${pattern ? html`
Pattern: ${pattern}
` : ''}\n
\n
\n `;\n }\n /* eslint-enable indent */\n\n toggleObjectExpand(e) {\n const rowEl = e.target.closest('.tr');\n if (rowEl.classList.contains('expanded')) {\n rowEl.classList.add('collapsed');\n rowEl.classList.remove('expanded');\n e.target.innerText = '+';\n } else {\n rowEl.classList.remove('collapsed');\n rowEl.classList.add('expanded');\n e.target.innerText = '-';\n }\n }\n}\ncustomElements.define('schema-table', SchemaTable);\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { rapidocApiKey } from '~/utils/common-utils';\nimport { pathSecurityTemplate } from '~/templates/security-scheme-template';\nimport codeSamplesTemplate from '~/templates/code-samples-template';\nimport callbackTemplate from '~/templates/callback-template';\nimport '~/components/api-request';\nimport '~/components/api-response';\n\n/* eslint-disable indent */\nfunction headingRenderer(tagElementId) {\n const renderer = new marked.Renderer();\n renderer.heading = ((text, level, raw, slugger) => `${text}`);\n return renderer;\n}\n\nfunction expandCollapseTagDescription(e) {\n const tagDescriptionEl = e.target.closest('.tag-container').querySelector('.tag-description');\n const tagIconEl = e.target.closest('.tag-container').querySelector('.tag-icon');\n if (tagDescriptionEl && tagIconEl) {\n const isExpanded = tagDescriptionEl.classList.contains('expanded');\n if (isExpanded) {\n tagDescriptionEl.style.maxHeight = 0;\n tagDescriptionEl.classList.replace('expanded', 'collapsed');\n tagIconEl.classList.replace('expanded', 'collapsed');\n } else {\n tagDescriptionEl.style.maxHeight = `${tagDescriptionEl.scrollHeight}px`;\n tagDescriptionEl.classList.replace('collapsed', 'expanded');\n tagIconEl.classList.replace('collapsed', 'expanded');\n }\n }\n}\n\nexport function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') {\n const acceptContentTypes = new Set();\n for (const respStatus in path.responses) {\n for (const acceptContentType in (path.responses[respStatus]?.content)) {\n acceptContentTypes.add(acceptContentType.trim());\n }\n }\n const accept = [...acceptContentTypes].join(', ');\n\n // Filter API Keys that are non-empty and are applicable to the the path\n const nonEmptyApiKeys = this.resolvedSpec.securitySchemes.filter((v) => (v.finalKeyValue && path.security?.some((ps) => (v.securitySchemeId in ps)))) || [];\n\n // If a RapiDoc API Key is specified on the element and its value is not hyphen(-) then include it for all paths\n const rapiDocApiKey = this.resolvedSpec.securitySchemes.find((v) => (v.securitySchemeId === rapidocApiKey && v.value !== '-'));\n if (rapiDocApiKey) {\n nonEmptyApiKeys.push(rapiDocApiKey);\n }\n\n const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate.call(this, path.xCodeSamples) : '';\n return html`\n ${this.renderStyle === 'read' ? html`
` : ''}\n
\n ${(this.renderStyle === 'focused' && tagName !== 'General ⦂')\n ? html`\n
\n ${tagName} \n ${tagDescription\n ? html`\n { expandCollapseTagDescription.call(this, e); }}\"\n >\n \n \n
\n
${unsafeHTML(marked(tagDescription))}
\n
`\n : ''\n } \n
\n `\n : ''\n }\n ${path.deprecated ? html`
DEPRECATED
` : ''}\n ${html`\n ${path.xBadges && path.xBadges?.length > 0\n ? html`\n
\n ${path.xBadges.map((v) => (\n html`${v.label}`\n ))\n }\n
\n `\n : ''\n }\n

${path.shortSummary || `${path.method.toUpperCase()} ${path.path}`}

\n ${path.isWebhook\n ? html` WEBHOOK `\n : html`\n
\n ${path.method} \n ${path.path}\n
\n `\n }\n `\n }\n ${path.description ? html`
${unsafeHTML(marked(path.description))}
` : ''}\n ${pathSecurityTemplate.call(this, path.security)}\n ${path.externalDocs?.url || path.externalDocs?.description\n ? html`
\n
${unsafeHTML(marked(path.externalDocs?.description || ''))}
\n ${path.externalDocs?.url\n ? html``\n : ''\n }\n
`\n : ''\n }\n ${codeSampleTabPanel}\n
\n \n\n ${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}\n\n \n
\n
\n `;\n}\n\nexport default function expandedEndpointTemplate() {\n if (!this.resolvedSpec) { return ''; }\n return html`\n ${this.resolvedSpec.tags.map((tag) => html`\n
\n
${tag.name}
\n \n
\n ${\n unsafeHTML(`\n
\n ${marked(tag.description || '', this.infoDescriptionHeadingsInNavBar === 'true' ? { renderer: headingRenderer(tag.elementId) } : undefined)}\n
`)\n }\n
\n
\n
\n ${tag.paths.map((path) => expandedEndpointBodyTemplate.call(this, path))}\n
\n `)\n }\n`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { schemaInObjectNotation } from '~/utils/schema-utils';\nimport '~/components/json-tree';\nimport '~/components/schema-tree';\nimport '~/components/schema-table';\n\nfunction schemaBodyTemplate(sComponent) {\n return html`\n
\n
\n
${sComponent.name} Schema
\n ${this.schemaStyle === 'table'\n ? html`\n `\n : html`\n `\n}\n
`;\n}\n\nfunction componentBodyTemplate(sComponent, componentType) {\n if (sComponent.id.indexOf('schemas-') !== -1) {\n return schemaBodyTemplate.call(this, sComponent);\n }\n return html`\n
\n
\n ${html`\n
${sComponent.name} ${componentType}
\n ${sComponent.component\n ? html`\n
\n \n
`\n : ''}\n `}\n
\n `;\n}\n\nexport default function componentsTemplate() {\n if (!this.resolvedSpec) { return ''; }\n return html`\n ${this.resolvedSpec.components.map((component) => html`\n
\n
${component.name}
\n
\n ${unsafeHTML(`
${marked(component.description ? component.description : '')}
`)}\n
\n
\n
\n ${component.subComponents.filter((c) => c.expanded !== false).map((sComponent) => componentBodyTemplate.call(this, sComponent, component.name))}\n
\n `)\n}\n`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { downloadResource, viewResource } from '~/utils/common-utils';\n\n/* eslint-disable indent */\nfunction headingRenderer() {\n const renderer = new marked.Renderer();\n renderer.heading = ((text, level, raw, slugger) => `${text}`);\n return renderer;\n}\n\nexport default function overviewTemplate() {\n return html`\n
\n ${this.resolvedSpec?.info\n ? html`\n
\n ${this.resolvedSpec.info.title}\n ${!this.resolvedSpec.info.version ? '' : html`\n \n ${this.resolvedSpec.info.version}\n `\n }\n
\n
\n ${this.resolvedSpec.info.contact?.email\n ? html`${this.resolvedSpec.info.contact.name || 'Email'}: \n ${this.resolvedSpec.info.contact.email}\n `\n : ''\n }\n ${this.resolvedSpec.info.contact?.url\n ? html`URL: ${this.resolvedSpec.info.contact.url}`\n : ''\n }\n ${this.resolvedSpec.info.license\n ? html`License: \n ${this.resolvedSpec.info.license.url\n ? html`${this.resolvedSpec.info.license.name}`\n : this.resolvedSpec.info.license.name\n } `\n : ''\n }\n ${this.resolvedSpec.info.termsOfService\n ? html`Terms of Service`\n : ''\n }\n ${this.specUrl && this.allowSpecFileDownload === 'true'\n ? html`\n
\n \n ${this.specUrl?.trim().toLowerCase().endsWith('json')\n ? html``\n : ''\n }\n
`\n : ''\n }\n
\n \n
\n ${this.resolvedSpec.info.description\n ? html`${\n unsafeHTML(`\n
\n ${marked(this.resolvedSpec.info.description, this.infoDescriptionHeadingsInNavBar === 'true' ? { renderer: headingRenderer() } : undefined)}\n
`)}`\n : ''\n }\n
\n `\n : ''\n }\n
\n `;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\n\nexport function setApiServer(serverUrl) {\n const serverObj = this.resolvedSpec?.servers.find((s) => s.url === serverUrl);\n if (!serverObj) {\n return false;\n }\n this.selectedServer = serverObj;\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent('api-server-change', {\n bubbles: true,\n composed: true,\n detail: {\n selectedServer: serverObj,\n },\n }));\n return true;\n}\n\nfunction onApiServerVarChange(e, serverObj) {\n const inputEls = [...e.currentTarget.closest('table').querySelectorAll('input, select')];\n let tempUrl = serverObj.url;\n inputEls.forEach((v) => {\n const regex = new RegExp(`{${v.dataset.var}}`, 'g');\n tempUrl = tempUrl.replace(regex, v.value);\n });\n serverObj.computedUrl = tempUrl;\n this.requestUpdate();\n}\n\n/* eslint-disable indent */\nfunction serverVarsTemplate() {\n // const selectedServerObj = this.resolvedSpec.servers.find((v) => (v.url === this.selectedServer));\n return this.selectedServer && this.selectedServer.variables\n ? html`\n
SERVER VARIABLES
\n \n ${Object.entries(this.selectedServer.variables).map((kv) => html`\n \n \n \n \n ${kv[1].description\n ? html``\n : ''\n }\n `)}\n \n `\n : '';\n}\n\nexport default function serverTemplate() {\n if (!this.resolvedSpec || this.resolvedSpec.specLoadError) { return ''; }\n return html`\n
\n
API SERVER
\n
\n ${!this.resolvedSpec.servers || this.resolvedSpec.servers?.length === 0\n ? ''\n : html`\n ${this.resolvedSpec?.servers.map((server, i) => html`\n { setApiServer.call(this, server.url); }}\n .checked = '${this.selectedServer.url === server.url}'\n style = 'margin:4px 0; cursor:pointer'\n />\n \n
\n `)}\n `}\n
SELECTED: ${this.selectedServer?.computedUrl || 'none'}
\n
\n \n ${serverVarsTemplate.call(this)}\n
`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { marked } from 'marked';\nimport { pathIsInSearch } from '~/utils/common-utils';\n\nexport function expandCollapseNavBarTag(navLinkEl, action = 'toggle') {\n const tagAndPathEl = navLinkEl?.closest('.nav-bar-tag-and-paths');\n const pathsUnderTagEl = tagAndPathEl.querySelector('.nav-bar-paths-under-tag');\n if (tagAndPathEl) {\n const isExpanded = tagAndPathEl.classList.contains('expanded');\n if (isExpanded && (action === 'toggle' || action === 'collapse')) {\n pathsUnderTagEl.style.maxHeight = 0;\n tagAndPathEl.classList.replace('expanded', 'collapsed');\n } else if (!isExpanded && (action === 'toggle' || action === 'expand')) {\n tagAndPathEl.classList.replace('collapsed', 'expanded');\n pathsUnderTagEl.style.maxHeight = `${pathsUnderTagEl.scrollHeight}px`;\n }\n }\n}\n\nexport function expandCollapseAll(event, action = 'expand-all') {\n if (!(event.type === 'click' || (event.type === 'keyup' && event.keyCode === 13))) {\n return;\n }\n const navEl = event.target.closest('.nav-scroll');\n const elList = [...navEl.querySelectorAll('.nav-bar-tag-and-paths')];\n if (action === 'expand-all') {\n elList.forEach((el) => {\n const navBarPathsUnderTagEl = el.querySelector('.nav-bar-paths-under-tag');\n el.classList.replace('collapsed', 'expanded');\n navBarPathsUnderTagEl.style.maxHeight = `${navBarPathsUnderTagEl?.scrollHeight}px`;\n });\n } else {\n elList.forEach((el) => {\n el.classList.replace('expanded', 'collapsed');\n el.querySelector('.nav-bar-paths-under-tag').style.maxHeight = 0;\n });\n }\n}\n\nexport function navBarClickAndEnterHandler(event) {\n if (!(event.type === 'click' || (event.type === 'keyup' && event.keyCode === 13))) {\n return;\n }\n const navEl = event.target;\n event.stopPropagation();\n if (navEl.dataset?.action === 'navigate') {\n this.scrollToEventTarget(event, false);\n } else if (navEl.dataset?.action === 'expand-all' || (navEl.dataset?.action === 'collapse-all')) {\n expandCollapseAll(event, navEl.dataset.action);\n } else if (navEl.dataset?.action === 'expand-collapse-tag') {\n expandCollapseNavBarTag(navEl, 'toggle');\n }\n}\n\n/* eslint-disable indent */\nexport default function navbarTemplate() {\n if (!this.resolvedSpec || this.resolvedSpec.specLoadError) {\n return html`\n \n `;\n }\n return html`\n
\n `)\n }\n\n \n ${this.resolvedSpec.components && this.showComponents === 'true' && this.renderStyle === 'focused'\n ? html`\n \n ${this.resolvedSpec.components.map((component) => (component.subComponents.length\n ? html`\n \n ${component.subComponents.filter((p) => p.expanded !== false).map((p) => html`\n `)\n }`\n : ''))\n }`\n : ''\n }\n `\n }\n\n`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { expandedEndpointBodyTemplate } from '~/templates/expanded-endpoint-template';\nimport '~/components/api-request';\nimport '~/components/api-response';\nimport componentsTemplate from '~/templates/components-template';\nimport overviewTemplate from '~/templates/overview-template';\nimport serverTemplate from '~/templates/server-template';\nimport securitySchemeTemplate from '~/templates/security-scheme-template';\nimport { expandCollapseNavBarTag } from '~/templates/navbar-template';\n\nfunction headingRenderer(tagElementId) {\n const renderer = new marked.Renderer();\n renderer.heading = ((text, level, raw, slugger) => `${text}`);\n return renderer;\n}\n\nfunction wrapFocusedTemplate(templateToWrap) {\n return html`\n
\n ${templateToWrap}\n
`;\n}\n\nfunction defaultContentTemplate() {\n // In focused mode default content is overview or first path\n if (this.showInfo === 'true') {\n return wrapFocusedTemplate(overviewTemplate.call(this));\n }\n const selectedTagObj = this.resolvedSpec.tags[0];\n const selectedPathObj = this.resolvedSpec.tags[0]?.paths[0];\n return (selectedTagObj && selectedPathObj)\n ? wrapFocusedTemplate(expandedEndpointBodyTemplate.call(this, selectedPathObj, selectedTagObj.name))\n : wrapFocusedTemplate('');\n}\n\n/* eslint-disable indent */\nfunction focusedTagBodyTemplate(tag) {\n return html`\n

${tag.name}

\n ${this.onNavTagClick === 'show-description' && tag.description\n ? html`\n
\n ${\n unsafeHTML(`\n
\n ${marked(tag.description || '', this.infoDescriptionHeadingsInNavBar === 'true' ? { renderer: headingRenderer(tag.elementId) } : undefined)}\n
`)\n }\n
`\n : ''\n }\n `;\n}\n\nexport default function focusedEndpointTemplate() {\n if (!this.focusedElementId || !this.resolvedSpec) {\n return;\n }\n const focusElId = this.focusedElementId;\n let selectedPathObj = null;\n let selectedTagObj = null;\n let focusedTemplate;\n let i = 0;\n if (focusElId.startsWith('overview') && this.showInfo === 'true') {\n focusedTemplate = overviewTemplate.call(this);\n } else if (focusElId === 'auth' && this.allowAuthentication === 'true') {\n focusedTemplate = securitySchemeTemplate.call(this);\n } else if (focusElId === 'servers' && this.allowServerSelection === 'true') {\n focusedTemplate = serverTemplate.call(this);\n } else if (focusElId === 'operations-top') {\n focusedTemplate = html`\n
\n \n
`;\n } else if (focusElId.startsWith('cmp--') && this.showComponents === 'true') {\n focusedTemplate = componentsTemplate.call(this);\n } else if (focusElId.startsWith('tag--')) {\n const idToFocus = focusElId.indexOf('--', 4) > 0 ? focusElId.substring(0, focusElId.indexOf('--', 5)) : focusElId;\n selectedTagObj = this.resolvedSpec.tags.find((v) => v.elementId === idToFocus);\n if (selectedTagObj) {\n focusedTemplate = wrapFocusedTemplate.call(this, focusedTagBodyTemplate.call(this, selectedTagObj));\n } else {\n focusedTemplate = defaultContentTemplate.call(this);\n }\n } else {\n for (i = 0; i < this.resolvedSpec.tags.length; i += 1) {\n selectedTagObj = this.resolvedSpec.tags[i];\n selectedPathObj = this.resolvedSpec.tags[i].paths.find((v) => `${v.elementId}` === focusElId);\n if (selectedPathObj) {\n break;\n }\n }\n if (selectedPathObj) {\n // In focused mode we must expand the nav-bar tag element if it is collapsed\n const newNavEl = this.shadowRoot.getElementById(`link-${focusElId}`);\n expandCollapseNavBarTag(newNavEl, 'expand');\n focusedTemplate = wrapFocusedTemplate.call(\n this,\n expandedEndpointBodyTemplate.call(this, selectedPathObj, (selectedTagObj.name || ''), (selectedTagObj.description || '')),\n );\n } else {\n // if focusedElementId is not found then show the default content (overview or first-path)\n focusedTemplate = defaultContentTemplate.call(this);\n }\n }\n return focusedTemplate;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport '~/components/api-request';\nimport '~/components/api-response';\nimport codeSamplesTemplate from '~/templates/code-samples-template';\nimport callbackTemplate from '~/templates/callback-template';\nimport { pathSecurityTemplate } from '~/templates/security-scheme-template';\nimport { pathIsInSearch, rapidocApiKey } from '~/utils/common-utils';\n\nfunction toggleExpand(path) {\n if (path.expanded) {\n path.expanded = false; // collapse\n if (this.updateRoute === 'true') {\n window.history.replaceState(null, null, `${window.location.href.split('#')[0]}${this.routePrefix === '#' ? '' : `${this.routePrefix}`}`);\n }\n } else {\n path.expanded = true; // Expand\n if (this.updateRoute === 'true') {\n const newHash = `${this.routePrefix || '#'}${path.elementId}`;\n if (window.location.hash !== newHash) {\n window.history.replaceState(null, null, `${window.location.href.split('#')[0]}${newHash}`);\n }\n }\n }\n this.requestUpdate();\n}\n\nexport function expandCollapseAll(operationsRootEl, action = 'expand-all') {\n const elList = [...operationsRootEl.querySelectorAll('.section-tag')];\n if (action === 'expand-all') {\n elList.map((el) => {\n el.classList.replace('collapsed', 'expanded');\n });\n } else {\n elList.map((el) => {\n el.classList.replace('expanded', 'collapsed');\n });\n }\n}\n\nfunction onExpandCollapseAll(e, action = 'expand-all') {\n expandCollapseAll.call(this, e.target.closest('.operations-root'), action);\n}\n\n/* eslint-disable indent */\nfunction endpointHeadTemplate(path, pathsExpanded = false) {\n return html`\n { toggleExpand.call(this, path, e); }}\" part=\"section-endpoint-head-${path.expanded ? 'expanded' : 'collapsed'}\" class='endpoint-head ${path.method} ${path.deprecated ? 'deprecated' : ''} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>\n
${path.method}
\n
\n ${path.path} \n ${path.isWebhook ? html` Webhook` : ''}\n
\n ${path.deprecated\n ? html`\n \n deprecated \n `\n : ''\n }\n ${this.showSummaryWhenCollapsed\n ? html`\n
\n
${path.summary || path.shortSummary}
`\n : ''\n }\n
\n `;\n}\n\nfunction endpointBodyTemplate(path) {\n const acceptContentTypes = new Set();\n for (const respStatus in path.responses) {\n for (const acceptContentType in (path.responses[respStatus]?.content)) {\n acceptContentTypes.add(acceptContentType.trim());\n }\n }\n const accept = [...acceptContentTypes].join(', ');\n // Filter API Keys that are non-empty and are applicable to the the path\n const nonEmptyApiKeys = this.resolvedSpec.securitySchemes.filter((v) => (v.finalKeyValue && path.security?.some((ps) => (v.securitySchemeId in ps)))) || [];\n\n // If a RapiDoc API Key is specified on the element and its value is not hyphen(-) then include it for all paths\n const rapiDocApiKey = this.resolvedSpec.securitySchemes.find((v) => (v.securitySchemeId === rapidocApiKey && v.value !== '-'));\n if (rapiDocApiKey) {\n nonEmptyApiKeys.push(rapiDocApiKey);\n }\n\n const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate(path.xCodeSamples) : '';\n return html`\n
\n
\n ${path.summary\n ? html`
${path.summary}
`\n : path.shortSummary !== path.description\n ? html`
${path.shortSummary}
`\n : ''\n }\n ${path.xBadges && path.xBadges?.length > 0\n ? html`\n
\n ${path.xBadges.map((v) => (\n html`${v.label}`\n ))\n }\n
\n `\n : ''\n }\n\n ${path.description ? html`
${unsafeHTML(marked(path.description))}
` : ''}\n ${path.externalDocs?.url || path.externalDocs?.description\n ? html`
\n
${unsafeHTML(marked(path.externalDocs?.description || ''))}
\n ${path.externalDocs?.url\n ? html``\n : ''\n }\n
`\n : ''\n }\n \n ${pathSecurityTemplate.call(this, path.security)}\n ${codeSampleTabPanel}\n
\n
\n
\n 0 ? path.servers[0].url : this.selectedServer.computedUrl}\" \n active-schema-tab = \"${this.defaultSchemaTab}\"\n fill-request-fields-with-example = \"${this.fillRequestFieldsWithExample}\"\n allow-try = \"${this.allowTry}\"\n accept = \"${accept}\"\n render-style=\"${this.renderStyle}\" \n schema-style = \"${this.schemaStyle}\" \n schema-expand-level = \"${this.schemaExpandLevel}\"\n schema-description-expanded = \"${this.schemaDescriptionExpanded}\"\n allow-schema-description-expand-toggle = \"${this.allowSchemaDescriptionExpandToggle}\"\n schema-hide-read-only = \"${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}\"\n schema-hide-write-only = \"${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}\"\n fetch-credentials = \"${this.fetchCredentials}\"\n exportparts = \"wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,\n file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, \n anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle\"\n > \n\n ${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}\n
\n\n \n
\n
`;\n}\n\nexport default function endpointTemplate(showExpandCollapse = true, showTags = true, pathsExpanded = false) {\n if (!this.resolvedSpec) { return ''; }\n return html`\n ${showExpandCollapse\n ? html`\n
\n onExpandCollapseAll(e, 'expand-all')}\" style=\"color:var(--primary-color); cursor:pointer;\">\n Expand all\n \n  |  \n onExpandCollapseAll(e, 'collapse-all')}\" style=\"color:var(--primary-color); cursor:pointer;\" >\n Collapse all\n \n   sections\n
`\n : ''\n }\n ${this.resolvedSpec.tags.map((tag) => html`\n ${showTags\n ? html` \n `\n : html`\n \n `\n }\n `)\n }`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\n\n/* eslint-disable indent */\nexport default function logoTemplate(style) {\nreturn html`\n
\n \n \n \n \n \n \n \n \n
\n`;\n}\n/* eslint-enable indent */\n","import { html } from 'lit';\nimport logoTemplate from '~/templates/logo-template';\n\n/* eslint-disable indent */\nexport default function headerTemplate() {\n return html`\n
\n
\n \n ${logoTemplate('height:36px;width:36px;margin-left:5px')}\n \n \n
${this.headingText}
\n
\n
\n ${(this.allowSpecUrlLoad === 'false')\n ? ''\n : html`\n \n
\n `\n } \n ${(this.allowSpecFileLoad === 'false')\n ? ''\n : html`\n \n \n `\n }\n \n ${(this.allowSearch === 'false' || 'read focused'.includes(this.renderStyle))\n ? ''\n : html` \n \n
\n `\n }\n \n ${(this.allowAdvancedSearch === 'false' || 'read focused'.includes(this.renderStyle))\n ? ''\n : html`\n \n `\n }\n
\n
`;\n }\n/* eslint-enable indent */\n","import { LitElement, html, css } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\nimport { schemaInObjectNotation, generateExample } from '~/utils/schema-utils';\nimport FontStyles from '~/styles/font-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport TableStyles from '~/styles/table-styles';\nimport InputStyles from '~/styles/input-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport BorderStyles from '~/styles/border-styles';\nimport CustomStyles from '~/styles/custom-styles';\nimport '~/components/json-tree';\nimport '~/components/schema-tree';\nimport '~/components/schema-table';\n\nexport default class ApiResponse extends LitElement {\n constructor() {\n super();\n this.selectedStatus = '';\n this.headersForEachRespStatus = {};\n this.mimeResponsesForEachStatus = {};\n this.activeSchemaTab = 'schema';\n }\n\n static get properties() {\n return {\n callback: { type: String },\n webhook: { type: String },\n responses: { type: Object },\n parser: { type: Object },\n schemaStyle: { type: String, attribute: 'schema-style' },\n renderStyle: { type: String, attribute: 'render-style' },\n selectedStatus: { type: String, attribute: 'selected-status' },\n selectedMimeType: { type: String, attribute: 'selected-mime-type' },\n activeSchemaTab: { type: String, attribute: 'active-schema-tab' },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n FlexStyles,\n TabStyles,\n TableStyles,\n InputStyles,\n BorderStyles,\n css`\n :where(button, input[type=\"checkbox\"], [tabindex=\"0\"]):focus-visible { box-shadow: var(--focus-shadow); }\n :where(input[type=\"text\"], input[type=\"password\"], select, textarea):focus-visible { border-color: var(--primary-color); }\n .resp-head{\n vertical-align: middle;\n padding:16px 0 8px;\n }\n .resp-head.divider{\n border-top: 1px solid var(--border-color);\n margin-top:10px;\n }\n .resp-status{ \n font-weight:bold;\n font-size:calc(var(--font-size-small) + 1px);\n }\n .resp-descr{\n font-size:calc(var(--font-size-small) + 1px);\n color:var(--light-fg);\n text-align:left;\n }\n .top-gap{margin-top:16px;}\n .example-panel{\n font-size:var(--font-size-small);\n margin:0;\n }\n .focused-mode,\n .read-mode {\n padding-top:24px;\n margin-top:12px;\n border-top: 1px dashed var(--border-color);\n }`,\n CustomStyles,\n ];\n }\n\n render() {\n return html`\n
\n
\n ${this.callback === 'true' ? 'CALLBACK RESPONSE' : 'RESPONSE'}\n
\n
\n ${this.responseTemplate()}\n
\n
\n `;\n }\n\n resetSelection() {\n this.selectedStatus = '';\n this.selectedMimeType = '';\n }\n\n /* eslint-disable indent */\n responseTemplate() {\n if (!this.responses) { return ''; }\n for (const statusCode in this.responses) {\n if (!this.selectedStatus) {\n this.selectedStatus = statusCode;\n }\n const allMimeResp = {};\n for (const mimeResp in this.responses[statusCode]?.content) {\n const mimeRespObj = this.responses[statusCode].content[mimeResp];\n if (!this.selectedMimeType) {\n this.selectedMimeType = mimeResp;\n }\n // Generate Schema\n const schemaTree = schemaInObjectNotation(mimeRespObj.schema, {});\n // Generate Example\n const respExamples = generateExample(\n mimeRespObj.schema,\n mimeResp,\n mimeRespObj.examples,\n mimeRespObj.example,\n this.callback === 'true' || this.webhook === 'true' ? false : true, // eslint-disable-line no-unneeded-ternary\n this.callback === 'true' || this.webhook === 'true' ? true : false, // eslint-disable-line no-unneeded-ternary\n mimeResp.includes('json') ? 'json' : 'text',\n );\n allMimeResp[mimeResp] = {\n description: this.responses[statusCode].description,\n examples: respExamples,\n selectedExample: respExamples[0]?.exampleId || '',\n schemaTree,\n };\n }\n // Headers for each response status\n const tempHeaders = [];\n for (const key in this.responses[statusCode]?.headers) {\n tempHeaders.push({ name: key, ...this.responses[statusCode].headers[key] });\n }\n this.headersForEachRespStatus[statusCode] = tempHeaders;\n this.mimeResponsesForEachStatus[statusCode] = allMimeResp;\n }\n return html`\n ${Object.keys(this.responses).length > 1\n ? html`
\n ${Object.keys(this.responses).map((respStatus) => html`\n ${respStatus === '$$ref' // Swagger-Client parser creates '$$ref' object if JSON references are used to create responses - this should be ignored\n ? ''\n : html`\n `\n }`)\n }`\n : html`${Object.keys(this.responses)[0]}`\n }\n
\n\n ${Object.keys(this.responses).map((status) => html`\n
\n
\n ${unsafeHTML(marked(this.responses[status]?.description || ''))}\n ${(this.headersForEachRespStatus[status] && this.headersForEachRespStatus[status]?.length > 0)\n ? html`${this.responseHeaderListTemplate(this.headersForEachRespStatus[status])}`\n : ''\n }\n
\n ${Object.keys(this.mimeResponsesForEachStatus[status]).length === 0\n ? ''\n : html` \n
\n
{ if (e.target.tagName.toLowerCase() === 'button') { this.activeSchemaTab = e.target.dataset.tab; } }}\" >\n \n \n
\n ${Object.keys(this.mimeResponsesForEachStatus[status]).length === 1\n ? html` ${Object.keys(this.mimeResponsesForEachStatus[status])[0]} `\n : html`${this.mimeTypeDropdownTemplate(Object.keys(this.mimeResponsesForEachStatus[status]))}`\n }\n
\n ${this.activeSchemaTab === 'example'\n ? html`
\n ${this.mimeExampleTemplate(this.mimeResponsesForEachStatus[status][this.selectedMimeType])}\n
`\n : html`
\n ${this.mimeSchemaTemplate(this.mimeResponsesForEachStatus[status][this.selectedMimeType])}\n
`\n }\n
\n `\n }`)\n }\n `;\n }\n\n responseHeaderListTemplate(respHeaders) {\n return html`\n
RESPONSE HEADERS
\n \n ${respHeaders.map((v) => html`\n \n \n \n \n \n \n `)}\n
\n ${v.name || ''}\n \n ${v.schema?.type || ''}\n \n
${unsafeHTML(marked(v.description || ''))}
\n
\n ${v.schema?.example || ''}\n
`;\n }\n\n mimeTypeDropdownTemplate(mimeTypes) {\n return html`\n `;\n }\n\n onSelectExample(e) {\n const exampleContainerEl = e.target.closest('.example-panel');\n const exampleEls = [...exampleContainerEl.querySelectorAll('.example')];\n\n exampleEls.forEach((v) => {\n v.style.display = v.dataset.example === e.target.value ? 'block' : 'none';\n });\n }\n\n mimeExampleTemplate(mimeRespDetails) {\n if (!mimeRespDetails) {\n return html`\n
 No example provided 
\n `;\n }\n return html`\n ${mimeRespDetails.examples.length === 1\n ? html`\n ${mimeRespDetails.examples[0].exampleFormat === 'json'\n ? html`\n ${mimeRespDetails.examples[0].exampleSummary && mimeRespDetails.examples[0].exampleSummary.length > 80 ? html`
${mimeRespDetails.examples[0].exampleSummary}
` : ''}\n ${mimeRespDetails.examples[0].exampleDescription ? html`
${unsafeHTML(marked(mimeRespDetails.examples[0].exampleDescription || ''))}
` : ''}\n `\n : html`\n ${mimeRespDetails.examples[0].exampleSummary && mimeRespDetails.examples[0].exampleSummary.length > 80 ? html`
${mimeRespDetails.examples[0].exampleSummary}
` : ''}\n ${mimeRespDetails.examples[0].exampleDescription ? html`
${unsafeHTML(marked(mimeRespDetails.examples[0].exampleDescription || ''))}
` : ''}\n
${mimeRespDetails.examples[0].exampleValue}
\n `\n }`\n : html`\n \n \n ${mimeRespDetails.examples.map((v) => html`\n
\n ${v.exampleSummary && v.exampleSummary.length > 80 ? html`
${v.exampleSummary}
` : ''}\n ${v.exampleDescription ? html`
${unsafeHTML(marked(v.exampleDescription || ''))}
` : ''}\n ${v.exampleFormat === 'json'\n ? html`\n `\n : html`
${v.exampleValue}
`\n }\n
\n `)}\n
\n `\n }\n `;\n }\n\n mimeSchemaTemplate(mimeRespDetails) {\n if (!mimeRespDetails) {\n return html`\n
 Schema not found
\n `;\n }\n return html`\n ${this.schemaStyle === 'table'\n ? html`\n `\n : html`\n `\n }`;\n }\n /* eslint-enable indent */\n}\n\n// Register the element with the browser\ncustomElements.define('api-response', ApiResponse);\n","import { html } from 'lit';\nimport '~/components/dialog-box';\n\n/* eslint-disable indent */\nexport default function searchByPropertiesModalTemplate() {\n document.addEventListener('close', () => { this.showAdvancedSearchDialog = false; });\n document.addEventListener('open', this.onOpenSearchDialog);\n\n return html`\n \n \n this.onAdvancedSearch(e, 400)}\"\n >\n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n this.onAdvancedSearch(e, 0)}\">\n \n
\n
\n
\n \n ${this.advancedSearchMatches?.map((path) => html`\n {\n this.matchPaths = ''; // clear quick filter if applied\n this.showAdvancedSearchDialog = false; // Hide Search Dialog\n this.requestUpdate();\n this.scrollToEventTarget(e, true);\n }\n }\"\n > \n ${path.method} \n ${path.path}\n ${path.summary}\n
\n `)\n }\n \n `;\n}\n/* eslint-enable indent */\n","import { LitElement, html } from 'lit';\nimport DialogBoxStyles from '~/styles/dialog-box-styles';\n\nexport default class DialogBox extends LitElement {\n static get properties() {\n return {\n heading: { type: String, attribute: 'heading' },\n show: { type: String, attribute: 'show' },\n };\n }\n\n static get styles() {\n return [DialogBoxStyles];\n }\n\n connectedCallback() {\n super.connectedCallback();\n document.addEventListener('keydown', (e) => {\n if (e.code === 'Escape') {\n this.onClose();\n }\n });\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (oldVal !== newVal) {\n if (name === 'heading') {\n this.heading = newVal;\n }\n if (name === 'show') {\n this.show = newVal;\n if (newVal === 'true') {\n document.dispatchEvent(new CustomEvent('open', {\n bubbles: true,\n composed: true,\n detail: this,\n }));\n }\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n /* eslint-disable indent */\n render() {\n return html`\n ${this.show === 'true'\n ? html`\n
\n
\n
\n ${this.heading}\n \n
\n
\n \n
\n
\n
`\n : ''\n }`;\n }\n /* eslint-enable indent */\n\n onClose() {\n document.dispatchEvent(new CustomEvent('close', {\n bubbles: true,\n composed: true,\n }));\n }\n}\n\ncustomElements.define('dialog-box', DialogBox);\n","import { html } from 'lit';\nimport ColorUtils from '~/utils/color-utils';\n/* Generates an schema object containing type and constraint info */\nexport default function setTheme(baseTheme, theme = {}) {\n let newTheme = {};\n\n // Common Theme colors\n const primaryColor = theme.primaryColor ? theme.primaryColor : baseTheme === 'dark' ? '#f76b39' : '#ff591e';\n const primaryColorInvert = ColorUtils.color.invert(primaryColor);\n const primaryColorTrans = ColorUtils.color.opacity(primaryColor, '0.4');\n\n // Dark and Light Theme colors\n if (baseTheme === 'dark') {\n const bg1 = theme.bg1 ? theme.bg1 : '#2a2b2c';\n const fg1 = theme.fg1 ? theme.fg1 : '#bbb';\n\n const bg2 = theme.bg2 ? theme.bg2 : ColorUtils.color.brightness(bg1, 5); // or #383838;\n const bg3 = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, 17); // or #444;\n const lightBg = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, 35);\n const fg2 = theme.fg2 ? theme.fg2 : ColorUtils.color.brightness(fg1, -15); // or #ababab\n const fg3 = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, -20); // or #aaa\n const lightFg = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, -65); // or #777\n const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : '#aaa';\n const selectionBg = '#bbb';\n const selectionFg = '#eee';\n\n const headerColor = theme.headerColor ? theme.headerColor : ColorUtils.color.brightness(bg1, 10);\n\n const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, 10);\n const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.opacity(ColorUtils.color.invert(navBgColor), '0.50');\n const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : ColorUtils.color.brightness(navBgColor, -15);\n const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : ColorUtils.color.invert(navBgColor);\n const navAccentColor = theme.navAccentColor ? theme.navAccentColor : ColorUtils.color.brightness(primaryColor, 25);\n const overlayBg = 'rgba(80, 80, 80, 0.4)';\n\n newTheme = {\n bg1,\n bg2,\n bg3,\n lightBg,\n fg1,\n fg2,\n fg3,\n lightFg,\n inlineCodeFg,\n primaryColor,\n primaryColorTrans,\n primaryColorInvert,\n selectionBg,\n selectionFg,\n overlayBg,\n navBgColor,\n navTextColor,\n navHoverBgColor,\n navHoverTextColor,\n navAccentColor,\n\n headerColor,\n headerColorInvert: ColorUtils.color.invert(headerColor),\n headerColorDarker: ColorUtils.color.brightness(headerColor, -20),\n headerColorBorder: ColorUtils.color.brightness(headerColor, 10),\n\n borderColor: theme.borderColor || ColorUtils.color.brightness(bg1, 20), // #555\n lightBorderColor: theme.lightBorderColor || ColorUtils.color.brightness(bg1, 15), // #444\n codeBorderColor: theme.codeBorderColor || ColorUtils.color.brightness(bg1, 30),\n\n inputBg: theme.inputBg || ColorUtils.color.brightness(bg1, -5), // #2f2f2f\n placeHolder: theme.placeHolder || ColorUtils.color.opacity(fg1, '0.3'),\n hoverColor: theme.hoverColor || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n red: theme.red ? theme.red : '#F06560',\n lightRed: theme.lightRed ? theme.lightRed : ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n pink: theme.pink ? theme.pink : '#ffb2b2',\n lightPink: theme.lightPink || ColorUtils.color.brightness(bg1, -10),\n\n green: theme.green || '#7ec699',\n lightGreen: theme.lightGreen || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n blue: theme.blue || '#71b7ff',\n lightBlue: theme.lightBlue || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n orange: theme.orange ? theme.orange : '#f08d49',\n lightOrange: theme.lightOrange || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n yellow: theme.yellow || '#827717',\n lightYellow: theme.lightYellow || ColorUtils.color.brightness(bg1, -10), // #2a2a2a\n\n purple: theme.purple || '#786FF1',\n brown: theme.brown || '#D4AC0D',\n\n codeBg: theme.codeBg || ColorUtils.color.opacity(ColorUtils.color.brightness(bg1, -15), 0.7),\n codeFg: theme.codeFg || '#aaa',\n codePropertyColor: theme.codePropertyColor || '#f8c555',\n codeKeywordColor: theme.codeKeywordColor || '#cc99cd',\n codeOperatorColor: theme.codeOperatorColor || '#67cdcc',\n };\n } else {\n const bg1 = (theme.bg1 ? theme.bg1 : '#fafbfc');\n const fg1 = (theme.fg1 ? theme.fg1 : '#444444');\n const bg2 = theme.bg2 ? theme.bg2 : ColorUtils.color.brightness(bg1, -5); // or '#fafafa'\n const bg3 = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, -15); // or '#f6f6f6'\n const lightBg = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, -45);\n const fg2 = theme.fg2 ? theme.fg2 : ColorUtils.color.brightness(fg1, 17); // or '#555'\n const fg3 = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, 30); // or #666\n const lightFg = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, 70); // or #999\n const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : 'brown';\n\n const selectionBg = '#444';\n const selectionFg = '#eee';\n\n const headerColor = theme.headerColor ? theme.headerColor : ColorUtils.color.brightness(bg1, -180);\n\n /*\n const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, -10);\n const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.brightness(fg1, 5);\n const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : bg1;\n const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : primaryColor;\n const navAccentColor = theme.navAccentColor ? theme.navAccentColor : primaryColor;\n */\n const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, -200);\n const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.opacity(ColorUtils.color.invert(navBgColor), '0.65');\n const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : ColorUtils.color.brightness(navBgColor, -15);\n const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : ColorUtils.color.invert(navBgColor);\n const navAccentColor = theme.navAccentColor ? theme.navAccentColor : ColorUtils.color.brightness(primaryColor, 25);\n const overlayBg = 'rgba(0, 0, 0, 0.4)';\n\n newTheme = {\n bg1,\n bg2,\n bg3,\n lightBg,\n fg1,\n fg2,\n fg3,\n lightFg,\n inlineCodeFg,\n primaryColor,\n primaryColorTrans,\n primaryColorInvert,\n selectionBg,\n selectionFg,\n overlayBg,\n navBgColor,\n navTextColor,\n navHoverBgColor,\n navHoverTextColor,\n navAccentColor,\n\n headerColor,\n headerColorInvert: ColorUtils.color.invert(headerColor),\n headerColorDarker: ColorUtils.color.brightness(headerColor, -20),\n headerColorBorder: ColorUtils.color.brightness(headerColor, 10),\n\n borderColor: theme.borderColor || ColorUtils.color.brightness(bg1, -38),\n lightBorderColor: theme.lightBorderColor || ColorUtils.color.brightness(bg1, -23),\n codeBorderColor: theme.codeBorderColor || 'transparent',\n\n inputBg: theme.inputBg || ColorUtils.color.brightness(bg1, 10), // #fff\n placeHolder: theme.placeHolder || ColorUtils.color.brightness(lightFg, 20), // #dedede\n hoverColor: theme.hoverColor || ColorUtils.color.brightness(bg1, -5), // # f1f1f1\n\n red: theme.red || '#F06560',\n lightRed: theme.lightRed || '#fff0f0',\n\n pink: theme.pink ? theme.pink : '#990055',\n lightPink: theme.lightPink ? theme.lightPink : '#ffb2b2',\n\n green: theme.green || '#690',\n lightGreen: theme.lightGreen || '#fbfff0',\n\n blue: theme.blue || '#47AFE8',\n lightBlue: theme.lightBlue || '#eff8fd',\n\n orange: theme.orange || '#FF9900',\n lightOrange: theme.lightOrange || '#fff5e6',\n\n yellow: theme.yellow || '#827717',\n lightYellow: theme.lightYellow || '#fff5cc',\n\n purple: theme.purple || '#786FF1',\n brown: theme.brown || '#D4AC0D',\n\n codeBg: theme.codeBg || ColorUtils.color.opacity(ColorUtils.color.brightness(bg1, -15), 0.7),\n codeFg: theme.codeFg || '#666',\n codePropertyColor: theme.codePropertyColor || '#905',\n codeKeywordColor: theme.codeKeywordColor || '#07a',\n codeOperatorColor: theme.codeOperatorColor || '#9a6e3a',\n };\n }\n return html`\n `;\n}\n","import { html } from 'lit';\n\n// Templates\nimport expandedEndpointTemplate from '~/templates/expanded-endpoint-template';\nimport focusedEndpointTemplate from '~/templates/focused-endpoint-template';\nimport overviewTemplate from '~/templates/overview-template';\nimport endpointTemplate from '~/templates/endpoint-template';\nimport serverTemplate from '~/templates/server-template';\nimport securitySchemeTemplate, { recoverPersistedApiKeys } from '~/templates/security-scheme-template';\nimport headerTemplate from '~/templates/header-template';\nimport navbarTemplate from '~/templates/navbar-template';\nimport advancedSearchTemplate from '~/templates/advance-search-template';\nimport SetTheme from '~/utils/theme';\nimport { isValidHexColor } from '~/utils/color-utils';\n\nexport default function mainBodyTemplate(isMini = false, showExpandCollapse = true, showTags = true, pathsExpanded = false) {\n if (!this.resolvedSpec) {\n return '';\n }\n if (this.persistAuth === 'true') {\n recoverPersistedApiKeys.call(this);\n }\n const newTheme = {\n bg1: isValidHexColor(this.bgColor) ? this.bgColor : '',\n fg1: isValidHexColor(this.textColor) ? this.textColor : '',\n headerColor: isValidHexColor(this.headerColor) ? this.headerColor : '',\n primaryColor: isValidHexColor(this.primaryColor) ? this.primaryColor : '',\n navBgColor: isValidHexColor(this.navBgColor) ? this.navBgColor : '',\n navTextColor: isValidHexColor(this.navTextColor) ? this.navTextColor : '',\n navHoverBgColor: isValidHexColor(this.navHoverBgColor) ? this.navHoverBgColor : '',\n navHoverTextColor: isValidHexColor(this.navHoverTextColor) ? this.navHoverTextColor : '',\n navAccentColor: isValidHexColor(this.navAccentColor) ? this.navAccentColor : '',\n };\n /* eslint-disable indent */\n if (this.resolvedSpec.specLoadError) {\n if (isMini) {\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n
${this.resolvedSpec.info.description}
\n `;\n }\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n \n ${headerTemplate.call(this)}\n
\n \n
\n

${this.resolvedSpec.info.title}

\n
${this.resolvedSpec.info.description}
\n
\n
\n `;\n }\n if (this.resolvedSpec.isSpecLoading) {\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n
\n \n
\n
\n
\n
\n `;\n }\n\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n\n \n ${this.showHeader === 'false' ? '' : headerTemplate.call(this)}\n \n \n ${this.allowAdvancedSearch === 'false' ? '' : advancedSearchTemplate.call(this)}\n\n
\n \n ${((this.renderStyle === 'read' || this.renderStyle === 'focused')\n && this.showSideNav === 'true'\n && this.resolvedSpec\n ) ? navbarTemplate.call(this) : ''\n }\n\n \n
\n \n
\n ${this.loading === true\n ? html`
`\n : html`\n ${this.loadFailed === true\n ? html`
Unable to load the Spec
`\n : html`\n
{ this.handleHref(e); }}\">\n ${this.renderStyle === 'focused'\n ? html`${focusedEndpointTemplate.call(this)}`\n : html`\n ${this.showInfo === 'true' ? overviewTemplate.call(this) : ''}\n ${this.allowServerSelection === 'true' ? serverTemplate.call(this) : ''}\n ${this.allowAuthentication === 'true' ? securitySchemeTemplate.call(this) : ''}\n
\n \n
\n ${this.renderStyle === 'read'\n ? expandedEndpointTemplate.call(this)\n : endpointTemplate.call(this, showExpandCollapse, showTags, pathsExpanded)\n }\n `\n }\n
\n `\n }`\n }\n
\n \n
\n
\n `;\n}\n/* eslint-enable indent */\n","import { css, LitElement, unsafeCSS } from 'lit';\nimport { marked } from 'marked';\nimport Prism from 'prismjs';\nimport 'prismjs/components/prism-css';\nimport 'prismjs/components/prism-yaml';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-http';\nimport 'prismjs/components/prism-csharp';\n\n// Styles\nimport FontStyles from '~/styles/font-styles';\nimport InputStyles from '~/styles/input-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport TableStyles from '~/styles/table-styles';\nimport EndpointStyles from '~/styles/endpoint-styles';\nimport PrismStyles from '~/styles/prism-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport NavStyles from '~/styles/nav-styles';\nimport InfoStyles from '~/styles/info-styles';\nimport CustomStyles from '~/styles/custom-styles';\n// import { expandCollapseNavBarTag } from '@/templates/navbar-template';\nimport { advancedSearch, pathIsInSearch, componentIsInSearch, rapidocApiKey, sleep } from '~/utils/common-utils';\nimport ProcessSpec from '~/utils/spec-parser';\nimport mainBodyTemplate from '~/templates/main-body-template';\nimport { applyApiKey, onClearAllApiKeys } from '~/templates/security-scheme-template';\nimport { setApiServer } from '~/templates/server-template';\n\nexport default class RapiDoc extends LitElement {\n constructor() {\n super();\n const intersectionObserverOptions = {\n root: this.getRootNode().host,\n rootMargin: '-50px 0px -50px 0px', // when the element is visible 100px from bottom\n threshold: 0,\n };\n this.showSummaryWhenCollapsed = true;\n this.isIntersectionObserverActive = true;\n this.intersectionObserver = new IntersectionObserver((entries) => { this.onIntersect(entries); }, intersectionObserverOptions);\n }\n\n static get properties() {\n return {\n // Heading\n headingText: { type: String, attribute: 'heading-text' },\n gotoPath: { type: String, attribute: 'goto-path' },\n\n // Spec\n updateRoute: { type: String, attribute: 'update-route' },\n routePrefix: { type: String, attribute: 'route-prefix' },\n specUrl: { type: String, attribute: 'spec-url' },\n sortTags: { type: String, attribute: 'sort-tags' },\n generateMissingTags: { type: String, attribute: 'generate-missing-tags' },\n sortEndpointsBy: { type: String, attribute: 'sort-endpoints-by' },\n specFile: { type: String, attribute: false },\n\n // UI Layouts\n layout: { type: String },\n renderStyle: { type: String, attribute: 'render-style' },\n defaultSchemaTab: { type: String, attribute: 'default-schema-tab' },\n responseAreaHeight: { type: String, attribute: 'response-area-height' },\n fillRequestFieldsWithExample: { type: String, attribute: 'fill-request-fields-with-example' },\n persistAuth: { type: String, attribute: 'persist-auth' },\n onNavTagClick: { type: String, attribute: 'on-nav-tag-click' },\n\n // Schema Styles\n schemaStyle: { type: String, attribute: 'schema-style' },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n schemaHideReadOnly: { type: String, attribute: 'schema-hide-read-only' },\n schemaHideWriteOnly: { type: String, attribute: 'schema-hide-write-only' },\n\n // API Server\n apiKeyName: { type: String, attribute: 'api-key-name' },\n apiKeyLocation: { type: String, attribute: 'api-key-location' },\n apiKeyValue: { type: String, attribute: 'api-key-value' },\n defaultApiServerUrl: { type: String, attribute: 'default-api-server' },\n serverUrl: { type: String, attribute: 'server-url' },\n oauthReceiver: { type: String, attribute: 'oauth-receiver' },\n\n // Hide/Show Sections & Enable Disable actions\n showHeader: { type: String, attribute: 'show-header' },\n showSideNav: { type: String, attribute: 'show-side-nav' },\n showInfo: { type: String, attribute: 'show-info' },\n allowAuthentication: { type: String, attribute: 'allow-authentication' },\n allowTry: { type: String, attribute: 'allow-try' },\n allowSpecUrlLoad: { type: String, attribute: 'allow-spec-url-load' },\n allowSpecFileLoad: { type: String, attribute: 'allow-spec-file-load' },\n allowSpecFileDownload: { type: String, attribute: 'allow-spec-file-download' },\n allowSearch: { type: String, attribute: 'allow-search' },\n allowAdvancedSearch: { type: String, attribute: 'allow-advanced-search' },\n allowServerSelection: { type: String, attribute: 'allow-server-selection' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n showComponents: { type: String, attribute: 'show-components' },\n pageDirection: { type: String, attribute: 'page-direction' },\n\n // Main Colors and Font\n theme: { type: String },\n bgColor: { type: String, attribute: 'bg-color' },\n textColor: { type: String, attribute: 'text-color' },\n headerColor: { type: String, attribute: 'header-color' },\n primaryColor: { type: String, attribute: 'primary-color' },\n fontSize: { type: String, attribute: 'font-size' },\n regularFont: { type: String, attribute: 'regular-font' },\n monoFont: { type: String, attribute: 'mono-font' },\n loadFonts: { type: String, attribute: 'load-fonts' },\n cssFile: { type: String, attribute: 'css-file' },\n cssClasses: { type: String, attribute: 'css-classes' },\n\n // Nav Bar Colors\n navBgColor: { type: String, attribute: 'nav-bg-color' },\n navTextColor: { type: String, attribute: 'nav-text-color' },\n navHoverBgColor: { type: String, attribute: 'nav-hover-bg-color' },\n navHoverTextColor: { type: String, attribute: 'nav-hover-text-color' },\n navAccentColor: { type: String, attribute: 'nav-accent-color' },\n navItemSpacing: { type: String, attribute: 'nav-item-spacing' },\n showMethodInNavBar: { type: String, attribute: 'show-method-in-nav-bar' },\n usePathInNavBar: { type: String, attribute: 'use-path-in-nav-bar' },\n infoDescriptionHeadingsInNavBar: { type: String, attribute: 'info-description-headings-in-navbar' },\n\n // Fetch Options\n fetchCredentials: { type: String, attribute: 'fetch-credentials' },\n\n // Filters\n matchPaths: { type: String, attribute: 'match-paths' },\n matchType: { type: String, attribute: 'match-type' },\n\n // Internal Properties\n loading: { type: Boolean }, // indicates spec is being loaded\n focusedElementId: { type: String }, // updating the focusedElementId will automatically render appropriate section in focused mode\n showAdvancedSearchDialog: { type: Boolean },\n advancedSearchMatches: { type: Object },\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n InputStyles,\n FlexStyles,\n TableStyles,\n EndpointStyles,\n PrismStyles,\n TabStyles,\n NavStyles,\n InfoStyles,\n css`\n :host {\n display:flex;\n flex-direction: column;\n min-width:360px;\n width:100%;\n height:100%;\n margin:0;\n padding:0;\n overflow: hidden;\n letter-spacing:normal;\n color:var(--fg);\n background-color:var(--bg);\n font-family:var(--font-regular);\n }\n :where(button, input[type=\"checkbox\"], [tabindex=\"0\"]):focus-visible { box-shadow: var(--focus-shadow); }\n :where(input[type=\"text\"], input[type=\"password\"], select, textarea):focus-visible { border-color: var(--primary-color); }\n .body {\n display:flex;\n height:100%;\n width:100%;\n overflow:hidden;\n }\n .main-content { \n margin:0;\n padding: 0; \n display:block;\n flex:1;\n height:100%;\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: thin;\n scrollbar-color: var(--border-color) transparent;\n }\n\n .main-content-inner--view-mode {\n padding: 0 8px;\n }\n .main-content::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n .main-content::-webkit-scrollbar-track {\n background:transparent;\n }\n .main-content::-webkit-scrollbar-thumb {\n background-color: var(--border-color);\n }\n\n .section-gap.section-tag {\n border-bottom:1px solid var(--border-color);\n }\n .section-gap,\n .section-gap--focused-mode,\n .section-gap--read-mode { \n padding: 0px 4px; \n }\n .section-tag-header {\n position:relative;\n cursor: n-resize;\n padding: 12px 0;\n }\n .collapsed .section-tag-header:hover{\n cursor: s-resize;\n }\n\n .section-tag-header:hover{\n background-image: linear-gradient(to right, rgba(0,0,0,0), var(--border-color), rgba(0,0,0,0));\n }\n\n .section-tag-header:hover::after {\n position:absolute;\n margin-left:-24px;\n font-size:20px;\n top: calc(50% - 14px);\n color:var(--primary-color);\n content: '⬆'; \n }\n\n .collapsed .section-tag-header::after {\n position:absolute;\n margin-left:-24px;\n font-size:20px;\n top: calc(50% - 14px);\n color: var(--border-color);\n content: '⬇'; \n }\n .collapsed .section-tag-header:hover::after {\n color:var(--primary-color);\n }\n\n .collapsed .section-tag-body {\n display:none;\n }\n\n .logo {\n height:36px;\n width:36px;\n margin-left:5px; \n }\n .only-large-screen-flex,\n .only-large-screen{\n display:none;\n }\n .tag.title {\n text-transform: uppercase;\n }\n .main-header {\n background-color:var(--header-bg);\n color:var(--header-fg);\n width:100%;\n }\n .header-title {\n font-size:calc(var(--font-size-regular) + 8px); \n padding:0 8px;\n }\n input.header-input{\n background:var(--header-color-darker);\n color:var(--header-fg);\n border:1px solid var(--header-color-border);\n flex:1; \n padding-right:24px;\n border-radius:3px;\n }\n input.header-input::placeholder {\n opacity:0.4;\n }\n .loader {\n margin: 16px auto 16px auto; \n border: 4px solid var(--bg3);\n border-radius: 50%;\n border-top: 4px solid var(--primary-color);\n width: 36px;\n height: 36px;\n animation: spin 2s linear infinite;\n }\n .expanded-endpoint-body { \n position: relative;\n padding: 6px 0px; \n }\n .expanded-endpoint-body .tag-description {\n background: var(--code-bg);\n border-radius: var(--border-radius);\n transition: max-height .2s ease-out;\n }\n .expanded-endpoint-body .tag-icon {\n transition: transform .2s ease-out;\n }\n .expanded-endpoint-body .tag-icon.expanded {\n transform: rotate(180deg);\n }\n .divider { \n border-top: 2px solid var(--border-color);\n margin: 24px 0;\n width:100%;\n }\n\n .tooltip {\n cursor:pointer;\n border: 1px solid var(--border-color);\n border-left-width: 4px;\n margin-left:2px;\n }\n .tooltip a {\n color: var(--fg2);\n text-decoration: none;\n }\n .tooltip-text {\n color: var(--fg2);\n max-width: 400px;\n position: absolute;\n z-index:1;\n background-color: var(--bg2);\n visibility: hidden;\n\n overflow-wrap: break-word;\n }\n .tooltip:hover {\n color: var(--primary-color);\n border-color: var(--primary-color);\n }\n .tooltip:hover a:hover {\n color: var(--primary-color);\n }\n\n .tooltip:hover .tooltip-text {\n visibility: visible;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n .nav-method { font-weight: bold; margin-right: 4px; font-size: calc(var(--font-size-small) - 2px); white-space: nowrap; }\n .nav-method.false { display: none; }\n\n .nav-method.as-colored-text.get { color:var(--nav-get-color); }\n .nav-method.as-colored-text.put { color:var(--nav-put-color); }\n .nav-method.as-colored-text.post { color:var(--nav-post-color); }\n .nav-method.as-colored-text.delete { color:var(--nav-delete-color); }\n .nav-method.as-colored-text.head, .nav-method.as-colored-text.patch, .nav-method.as-colored-text.options { color:var(--nav-head-color); }\n \n .nav-method.as-colored-block {\n padding: 1px 4px;\n min-width: 30px;\n border-radius: 4px 0 0 4px;\n color: #000;\n }\n\n .nav-method.as-colored-block.get { background-color: var(--blue); }\n .nav-method.as-colored-block.put { background-color: var(--orange); }\n .nav-method.as-colored-block.post { background-color: var(--green); }\n .nav-method.as-colored-block.delete { background-color: var(--red); }\n .nav-method.as-colored-block.head, .nav-method.as-colored-block.patch , .nav-method.as-colored-block.options { \n background-color: var(--yellow); \n }\n\n @media only screen and (min-width: 768px) {\n .nav-bar {\n width: 260px;\n display:flex;\n }\n .only-large-screen{\n display:block;\n }\n .only-large-screen-flex{\n display:flex;\n }\n .section-gap { \n padding: 0 0 0 24px; \n }\n .section-gap--focused-mode {\n padding: 24px 8px; \n }\n .section-gap--read-mode { \n padding: 24px 8px; \n }\n .endpoint-body {\n position: relative;\n padding:36px 0 48px 0;\n }\n }\n\n @media only screen and (min-width: 1024px) {\n .nav-bar {\n width: ${unsafeCSS(this.fontSize === 'default' ? '300px' : this.fontSize === 'large' ? '315px' : '330px')};\n display:flex;\n }\n .section-gap--focused-mode { \n padding: 12px 80px 12px 80px; \n }\n .section-gap--read-mode { \n padding: 24px 80px 12px 80px; \n }\n }`,\n CustomStyles,\n ];\n }\n\n // Startup\n connectedCallback() {\n super.connectedCallback();\n const parent = this.parentElement;\n if (parent) {\n if (parent.offsetWidth === 0 && parent.style.width === '') {\n parent.style.width = '100vw';\n }\n if (parent.offsetHeight === 0 && parent.style.height === '') {\n parent.style.height = '100vh';\n }\n if (parent.tagName === 'BODY') {\n if (!parent.style.marginTop) { parent.style.marginTop = '0'; }\n if (!parent.style.marginRight) { parent.style.marginRight = '0'; }\n if (!parent.style.marginBottom) { parent.style.marginBottom = '0'; }\n if (!parent.style.marginLeft) { parent.style.marginLeft = '0'; }\n }\n }\n\n if (this.loadFonts !== 'false') {\n const fontDescriptor = {\n family: 'Open Sans',\n style: 'normal',\n weight: '300',\n unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD',\n };\n const fontWeight300 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontDescriptor.weight = '600';\n const fontWeight600 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontWeight300.load().then((font) => { document.fonts.add(font); });\n fontWeight600.load().then((font) => { document.fonts.add(font); });\n }\n\n if (!this.layout || !'row, column,'.includes(`${this.layout},`)) { this.layout = 'row'; }\n if (!this.renderStyle || !'read, view, focused,'.includes(`${this.renderStyle},`)) { this.renderStyle = 'focused'; }\n if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) { this.schemaStyle = 'tree'; }\n if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {\n this.theme = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';\n }\n if (!this.defaultSchemaTab || !'example, schema, model,'.includes(`${this.defaultSchemaTab},`)) {\n this.defaultSchemaTab = 'example';\n } else if (this.defaultSchemaTab === 'model') {\n this.defaultSchemaTab = 'schema';\n }\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) { this.schemaDescriptionExpanded = 'false'; }\n\n if (!this.schemaHideReadOnly || !'default, never,'.includes(`${this.schemaHideReadOnly},`)) { this.schemaHideReadOnly = 'default'; }\n if (!this.schemaHideWriteOnly || !'default, never,'.includes(`${this.schemaHideWriteOnly},`)) { this.schemaHideWriteOnly = 'default'; }\n\n if (!this.fillRequestFieldsWithExample || !'true, false,'.includes(`${this.fillRequestFieldsWithExample},`)) { this.fillRequestFieldsWithExample = 'true'; }\n if (!this.persistAuth || !'true, false,'.includes(`${this.persistAuth},`)) { this.persistAuth = 'false'; }\n if (!this.onNavTagClick || !'expand-collapse, show-description,'.includes(`${this.onNavTagClick},`)) { this.onNavTagClick = 'expand-collapse'; }\n if (!this.responseAreaHeight) {\n this.responseAreaHeight = '400px';\n }\n\n if (!this.allowSearch || !'true, false,'.includes(`${this.allowSearch},`)) { this.allowSearch = 'true'; }\n if (!this.allowAdvancedSearch || !'true, false,'.includes(`${this.allowAdvancedSearch},`)) { this.allowAdvancedSearch = 'true'; }\n\n if (!this.allowTry || !'true, false,'.includes(`${this.allowTry},`)) { this.allowTry = 'true'; }\n if (!this.apiKeyValue) { this.apiKeyValue = '-'; }\n if (!this.apiKeyLocation) { this.apiKeyLocation = 'header'; }\n if (!this.apiKeyName) { this.apiKeyName = ''; }\n\n if (!this.oauthReceiver) { this.oauthReceiver = 'oauth-receiver.html'; }\n if (!this.updateRoute || !'true, false,'.includes(`${this.updateRoute},`)) { this.updateRoute = 'true'; }\n if (!this.routePrefix) { this.routePrefix = '#'; }\n if (!this.sortTags || !'true, false,'.includes(`${this.sortTags},`)) { this.sortTags = 'false'; }\n if (!this.generateMissingTags || !'true, false,'.includes(`${this.generateMissingTags},`)) { this.generateMissingTags = 'false'; }\n if (!this.sortEndpointsBy || !'method, path, summary, none,'.includes(`${this.sortEndpointsBy},`)) { this.sortEndpointsBy = 'path'; }\n if (!this.navItemSpacing || !'compact, relaxed, default,'.includes(`${this.navItemSpacing},`)) { this.navItemSpacing = 'default'; }\n if (!this.showMethodInNavBar || !'false, as-plain-text, as-colored-text, as-colored-block,'.includes(`${this.showMethodInNavBar},`)) { this.showMethodInNavBar = 'false'; }\n if (!this.usePathInNavBar || !'true, false,'.includes(`${this.usePathInNavBar},`)) { this.usePathInNavBar = 'false'; }\n if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) { this.fontSize = 'default'; }\n\n if (!this.showInfo || !'true, false,'.includes(`${this.showInfo},`)) { this.showInfo = 'true'; }\n if (!this.allowServerSelection || !'true, false,'.includes(`${this.allowServerSelection},`)) { this.allowServerSelection = 'true'; }\n if (!this.allowAuthentication || !'true, false,'.includes(`${this.allowAuthentication},`)) { this.allowAuthentication = 'true'; }\n if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) { this.allowSchemaDescriptionExpandToggle = 'true'; }\n\n if (!this.showSideNav || !'true false'.includes(this.showSideNav)) { this.showSideNav = 'true'; }\n if (!this.showComponents || !'true false'.includes(this.showComponents)) { this.showComponents = 'false'; }\n if (!this.infoDescriptionHeadingsInNavBar || !'true, false,'.includes(`${this.infoDescriptionHeadingsInNavBar},`)) { this.infoDescriptionHeadingsInNavBar = 'false'; }\n if (!this.fetchCredentials || !'omit, same-origin, include,'.includes(`${this.fetchCredentials},`)) { this.fetchCredentials = ''; }\n if (!this.matchType || !'includes regex'.includes(this.matchType)) { this.matchType = 'includes'; }\n\n if (!this.showAdvancedSearchDialog) { this.showAdvancedSearchDialog = false; }\n\n if (!this.cssFile) { this.cssFile = null; }\n if (!this.cssClasses) { this.cssClasses = ''; }\n\n marked.setOptions({\n highlight: (code, lang) => {\n if (Prism.languages[lang]) {\n return Prism.highlight(code, Prism.languages[lang], lang);\n }\n return code;\n },\n });\n\n window.addEventListener('hashchange', () => {\n const regEx = new RegExp(`^${this.routePrefix}`, 'i');\n const elementId = window.location.hash.replace(regEx, '');\n this.scrollTo(elementId);\n }, true);\n }\n\n // Cleanup\n disconnectedCallback() {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n }\n super.disconnectedCallback();\n }\n\n infoDescriptionHeadingRenderer() {\n const renderer = new marked.Renderer();\n renderer.heading = ((text, level, raw, slugger) => `${text}`);\n return renderer;\n }\n\n render() {\n // return render(mainBodyTemplate(this), this.shadowRoot, { eventContext: this });\n const cssLinkEl = document.querySelector(`link[href*=\"${this.cssFile}\"]`);\n // adding custom style for RapiDoc\n if (cssLinkEl) {\n this.shadowRoot.appendChild(cssLinkEl.cloneNode());\n }\n return mainBodyTemplate.call(this);\n }\n\n observeExpandedContent() {\n // Main Container\n const observeOverviewEls = this.shadowRoot.querySelectorAll('.observe-me');\n observeOverviewEls.forEach((targetEl) => {\n this.intersectionObserver.observe(targetEl);\n });\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'spec-url') {\n if (oldVal !== newVal) {\n // put it at the end of event-loop to load all the attributes\n window.setTimeout(async () => {\n await this.loadSpec(newVal);\n // If goto-path is provided and no location-hash is present then try to scroll there\n if (this.gotoPath && !window.location.hash) {\n this.scrollTo(this.gotoPath);\n }\n }, 0);\n }\n }\n if (name === 'render-style') {\n if (newVal === 'read') {\n window.setTimeout(() => {\n this.observeExpandedContent();\n }, 100);\n } else {\n this.intersectionObserver.disconnect();\n }\n }\n if (name === 'api-key-name' || name === 'api-key-location' || name === 'api-key-value') {\n let updateSelectedApiKey = false;\n let apiKeyName = '';\n let apiKeyLocation = '';\n let apiKeyValue = '';\n\n if (name === 'api-key-name') {\n if (this.getAttribute('api-key-location') && this.getAttribute('api-key-value')) {\n apiKeyName = newVal;\n apiKeyLocation = this.getAttribute('api-key-location');\n apiKeyValue = this.getAttribute('api-key-value');\n updateSelectedApiKey = true;\n }\n } else if (name === 'api-key-location') {\n if (this.getAttribute('api-key-name') && this.getAttribute('api-key-value')) {\n apiKeyLocation = newVal;\n apiKeyName = this.getAttribute('api-key-name');\n apiKeyValue = this.getAttribute('api-key-value');\n updateSelectedApiKey = true;\n }\n } else if (name === 'api-key-value') {\n if (this.getAttribute('api-key-name') && this.getAttribute('api-key-location')) {\n apiKeyValue = newVal;\n apiKeyLocation = this.getAttribute('api-key-location');\n apiKeyName = this.getAttribute('api-key-name');\n updateSelectedApiKey = true;\n }\n }\n\n if (updateSelectedApiKey) {\n if (this.resolvedSpec) {\n const rapiDocApiKey = this.resolvedSpec.securitySchemes.find((v) => v.securitySchemeId === rapidocApiKey);\n if (!rapiDocApiKey) {\n this.resolvedSpec.securitySchemes.push({\n securitySchemeId: rapidocApiKey,\n description: 'api-key provided in rapidoc element attributes',\n type: 'apiKey',\n name: apiKeyName,\n in: apiKeyLocation,\n value: apiKeyValue,\n finalKeyValue: apiKeyValue,\n });\n } else {\n rapiDocApiKey.name = apiKeyName;\n rapiDocApiKey.in = apiKeyLocation;\n rapiDocApiKey.value = apiKeyValue;\n rapiDocApiKey.finalKeyValue = apiKeyValue;\n }\n this.requestUpdate();\n }\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n onSepcUrlChange() {\n this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);\n }\n\n onSepcFileChange(e) {\n this.setAttribute('spec-file', this.shadowRoot.getElementById('spec-file').value);\n const specFile = e.target.files[0];\n const reader = new FileReader();\n reader.onload = () => {\n try {\n const specObj = JSON.parse(reader.result);\n this.loadSpec(specObj);\n this.shadowRoot.getElementById('spec-url').value = '';\n } catch (err) {\n console.error('RapiDoc: Unable to read or parse json'); // eslint-disable-line no-console\n }\n };\n // Read the Text file\n reader.readAsText(specFile);\n }\n\n onFileLoadClick() {\n this.shadowRoot.getElementById('spec-file').click();\n }\n\n onSearchChange(e) {\n this.matchPaths = e.target.value;\n this.resolvedSpec.tags.forEach((tag) => tag.paths.filter((v) => {\n if (this.matchPaths) {\n // v.expanded = false;\n if (pathIsInSearch(this.matchPaths, v, this.matchType)) {\n tag.expanded = true;\n }\n }\n }));\n this.resolvedSpec.components.forEach((component) => component.subComponents.filter((v) => {\n v.expanded = false;\n if (!this.matchPaths || componentIsInSearch(this.matchPaths, v)) {\n v.expanded = true;\n }\n }));\n this.requestUpdate();\n }\n\n onClearSearch() {\n const searchEl = this.shadowRoot.getElementById('nav-bar-search');\n searchEl.value = '';\n this.matchPaths = '';\n this.resolvedSpec.components.forEach((component) => component.subComponents.filter((v) => {\n v.expanded = true;\n }));\n }\n\n onShowSearchModalClicked() {\n this.showAdvancedSearchDialog = true;\n }\n\n // Event Handler on Dialog-Box is opened\n async onOpenSearchDialog(e) {\n // Set focus to text input\n const inputEl = e.detail.querySelector('input');\n await sleep(0);\n if (inputEl) {\n inputEl.focus();\n }\n }\n\n // Public Method\n async loadSpec(specUrl) {\n if (!specUrl) {\n return;\n }\n this.matchPaths = '';\n try {\n this.resolvedSpec = {\n specLoadError: false,\n isSpecLoading: true,\n tags: [],\n };\n this.loading = true;\n this.loadFailed = false;\n const spec = await ProcessSpec.call(\n this,\n specUrl,\n this.generateMissingTags === 'true',\n this.sortTags === 'true',\n this.getAttribute('sort-endpoints-by'),\n this.getAttribute('api-key-name'),\n this.getAttribute('api-key-location'),\n this.getAttribute('api-key-value'),\n this.getAttribute('server-url'),\n );\n this.loading = false;\n this.afterSpecParsedAndValidated(spec);\n } catch (err) {\n this.loading = false;\n this.loadFailed = true;\n this.resolvedSpec = null;\n console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console\n }\n }\n\n async afterSpecParsedAndValidated(spec) {\n this.resolvedSpec = spec;\n this.selectedServer = undefined;\n if (this.defaultApiServerUrl) {\n if (this.defaultApiServerUrl === this.serverUrl) {\n this.selectedServer = {\n url: this.serverUrl,\n computedUrl: this.serverUrl,\n };\n } else if (this.resolvedSpec.servers) {\n this.selectedServer = this.resolvedSpec.servers.find((v) => (v.url === this.defaultApiServerUrl));\n }\n }\n if (!this.selectedServer) {\n if (this.resolvedSpec.servers) {\n this.selectedServer = this.resolvedSpec.servers[0]; // eslint-disable-line prefer-destructuring\n }\n }\n this.requestUpdate();\n // eslint-disable-next-line no-await-in-loop\n while (!await this.updateComplete);\n const specLoadedEvent = new CustomEvent('spec-loaded', { detail: spec });\n this.dispatchEvent(specLoadedEvent);\n\n // Initiate IntersectionObserver and put it at the end of event loop, to allow loading all the child elements (must for larger specs)\n this.intersectionObserver.disconnect();\n if (this.renderStyle === 'read') {\n await sleep(100);\n this.observeExpandedContent(); // This will auto-highlight the selected nav-item in read-mode\n }\n\n // On first time Spec load, try to navigate to location hash if provided\n const locationHash = window.location.hash?.substring(1);\n if (locationHash) {\n const regEx = new RegExp(`^${this.routePrefix}`, 'i');\n const elementId = window.location.hash.replace(regEx, '');\n if (this.renderStyle === 'view') {\n this.expandAndGotoOperation(elementId, true, true);\n } else {\n this.scrollTo(elementId);\n }\n } else if (this.renderStyle === 'focused') {\n // If goto-path is provided and no location-hash is present then try to scroll to default element\n if (!this.gotoPath) {\n const defaultElementId = this.showInfo ? 'overview' : this.resolvedSpec.tags[0]?.paths[0];\n this.scrollTo(defaultElementId);\n }\n }\n }\n\n expandAndGotoOperation(elementId, scrollToElement = true) {\n if (!this.resolvedSpec) {\n return;\n }\n // Expand full operation and tag\n let isExpandingNeeded = true;\n const tmpElementId = elementId.indexOf('#') === -1 ? elementId : elementId.substring(1);\n if (tmpElementId.startsWith('overview') || tmpElementId === 'servers' || tmpElementId === 'auth') {\n isExpandingNeeded = false;\n } else {\n for (let i = 0; i < this.resolvedSpec.tags?.length; i++) {\n const tag = this.resolvedSpec.tags[i];\n const path = tag.paths?.find((p) => p.elementId === elementId);\n if (path) {\n if (path.expanded && tag.expanded) {\n isExpandingNeeded = false;\n } else {\n path.expanded = true;\n tag.expanded = true;\n }\n }\n }\n }\n if (scrollToElement) {\n // requestUpdate() and delay required, else we cant find element\n if (isExpandingNeeded) {\n this.requestUpdate();\n }\n window.setTimeout(() => {\n const gotoEl = this.shadowRoot.getElementById(tmpElementId);\n if (gotoEl) {\n gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n if (this.updateRoute === 'true') {\n window.history.replaceState(null, null, `${this.routePrefix || '#'}${tmpElementId}`);\n }\n }\n }, isExpandingNeeded ? 150 : 0);\n }\n }\n\n isValidTopId(id) {\n return (id.startsWith('overview') || id === 'servers' || id === 'auth');\n }\n\n isValidPathId(id) {\n if (id === 'overview' && this.showInfo) {\n return true;\n }\n if (id === 'servers' && this.allowServerSelection) {\n return true;\n }\n if (id === 'auth' && this.allowAuthentication) {\n return true;\n }\n if (id.startsWith('tag--')) {\n return this.resolvedSpec?.tags?.find((tag) => tag.elementId === id);\n }\n return this.resolvedSpec?.tags?.find((tag) => tag.paths.find((path) => path.elementId === id));\n }\n\n onIntersect(entries) {\n if (this.isIntersectionObserverActive === false) {\n return;\n }\n entries.forEach((entry) => {\n if (entry.isIntersecting && entry.intersectionRatio > 0) {\n const oldNavEl = this.shadowRoot.querySelector('.nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active');\n const newNavEl = this.shadowRoot.getElementById(`link-${entry.target.id}`);\n\n // Add active class in the new element\n if (newNavEl) {\n if (this.updateRoute === 'true') {\n window.history.replaceState(null, null, `${window.location.href.split('#')[0]}${this.routePrefix || '#'}${entry.target.id}`);\n }\n newNavEl.scrollIntoView({ behavior: 'auto', block: 'center' });\n newNavEl.classList.add('active');\n }\n // Remove active class from previous element\n if (oldNavEl) {\n oldNavEl.classList.remove('active');\n }\n }\n });\n }\n\n // Called by anchor tags created using markdown\n handleHref(e) {\n if (e.target.tagName.toLowerCase() === 'a') {\n if (e.target.getAttribute('href').startsWith('#')) {\n const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));\n if (gotoEl) {\n gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n }\n }\n }\n }\n\n /**\n * Called by\n * - onClick of Navigation Bar\n * - onClick of Advanced Search items\n *\n * Functionality:\n * 1. First deactivate IntersectionObserver\n * 2. Scroll to the element\n * 3. Activate IntersectionObserver (after little delay)\n *\n */\n async scrollToEventTarget(event, scrollNavItemToView = true) {\n if (!(event.type === 'click' || (event.type === 'keyup' && event.keyCode === 13))) {\n return;\n }\n const navEl = event.target;\n if (!navEl.dataset.contentId) {\n return;\n }\n this.isIntersectionObserverActive = false;\n if (this.renderStyle === 'focused') {\n const requestEl = this.shadowRoot.querySelector('api-request');\n if (requestEl) {\n requestEl.beforerNavigationFocusedMode();\n }\n }\n this.scrollTo(navEl.dataset.contentId, true, scrollNavItemToView);\n setTimeout(() => {\n this.isIntersectionObserverActive = true;\n }, 300);\n }\n\n // Public Method (scrolls to a given path and highlights the left-nav selection)\n async scrollTo(elementId, expandPath = true, scrollNavItemToView = true) {\n if (this.renderStyle === 'focused') {\n // for focused mode update this.focusedElementId to update the rendering, else it wont find the needed html elements\n // focusedElementId will get validated in the template\n this.focusedElementId = elementId;\n await sleep(0);\n }\n if (this.renderStyle === 'view') {\n this.expandAndGotoOperation(elementId, expandPath, true);\n } else {\n let isValidElementId = false;\n const contentEl = this.shadowRoot.getElementById(elementId);\n if (contentEl) {\n isValidElementId = true;\n contentEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n } else {\n isValidElementId = false;\n }\n if (isValidElementId) {\n // for focused style it is important to reset request-body-selection and response selection which maintains the state for in case of multiple req-body or multiple response mime-type\n if (this.renderStyle === 'focused') {\n const requestEl = this.shadowRoot.querySelector('api-request');\n if (requestEl) {\n requestEl.afterNavigationFocusedMode();\n }\n const responseEl = this.shadowRoot.querySelector('api-response');\n if (responseEl) {\n responseEl.resetSelection();\n }\n }\n\n // Update Location Hash\n if (this.updateRoute === 'true') {\n window.history.replaceState(null, null, `${this.routePrefix || '#'}${elementId}`);\n }\n\n // Update NavBar View and Styles\n const newNavEl = this.shadowRoot.getElementById(`link-${elementId}`);\n\n if (newNavEl) {\n if (scrollNavItemToView) {\n newNavEl.scrollIntoView({ behavior: 'auto', block: 'center' });\n }\n await sleep(0);\n const oldNavEl = this.shadowRoot.querySelector('.nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active');\n if (oldNavEl) {\n oldNavEl.classList.remove('active');\n }\n newNavEl.classList.add('active'); // must add the class after scrolling\n // this.requestUpdate();\n }\n }\n }\n }\n\n // Public Method - to update security-scheme of type http\n setHttpUserNameAndPassword(securitySchemeId, username, password) {\n return applyApiKey.call(this, securitySchemeId, username, password);\n }\n\n // Public Method - to update security-scheme of type apiKey or OAuth\n setApiKey(securitySchemeId, apiKeyValue) {\n return applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);\n }\n\n // Public Method\n removeAllSecurityKeys() {\n return onClearAllApiKeys.call(this);\n }\n\n // Public Method\n setApiServer(apiServerUrl) {\n // return apiServerUrl;\n return setApiServer.call(this, apiServerUrl);\n }\n\n // Event handler for Advanced Search text-inputs and checkboxes\n onAdvancedSearch(ev, delay) {\n const eventTargetEl = ev.target;\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(() => {\n let searchInputEl;\n if (eventTargetEl.type === 'text') {\n searchInputEl = eventTargetEl;\n } else {\n searchInputEl = eventTargetEl.closest('.advanced-search-options').querySelector('input[type=text]');\n }\n const searcOptions = [...eventTargetEl.closest('.advanced-search-options').querySelectorAll('input:checked')].map((v) => v.id);\n this.advancedSearchMatches = advancedSearch(searchInputEl.value, this.resolvedSpec.tags, searcOptions);\n }, delay);\n }\n}\ncustomElements.define('rapi-doc', RapiDoc);\n","import { css, LitElement } from 'lit';\nimport { marked } from 'marked';\nimport Prism from 'prismjs';\nimport 'prismjs/components/prism-css';\nimport 'prismjs/components/prism-yaml';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-http';\nimport 'prismjs/components/prism-csharp';\n\n// Styles\nimport FontStyles from '~/styles/font-styles';\nimport InputStyles from '~/styles/input-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport TableStyles from '~/styles/table-styles';\nimport PrismStyles from '~/styles/prism-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport NavStyles from '~/styles/nav-styles';\nimport InfoStyles from '~/styles/info-styles';\n\nimport EndpointStyles from '~/styles/endpoint-styles';\nimport { rapidocApiKey } from '~/utils/common-utils';\nimport ProcessSpec from '~/utils/spec-parser';\nimport mainBodyTemplate from '~/templates/main-body-template';\nimport { applyApiKey, onClearAllApiKeys } from '~/templates/security-scheme-template';\nimport { setApiServer } from '~/templates/server-template';\n\nexport default class RapiDocMini extends LitElement {\n constructor() {\n super();\n this.isMini = true;\n this.updateRoute = 'false';\n this.renderStyle = 'view';\n this.showHeader = 'false';\n this.allowAdvancedSearch = 'false';\n }\n\n static get properties() {\n return {\n // Spec\n specUrl: { type: String, attribute: 'spec-url' },\n sortEndpointsBy: { type: String, attribute: 'sort-endpoints-by' },\n\n // UI Layouts\n layout: { type: String },\n pathsExpanded: { type: String, attribute: 'paths-expanded' },\n defaultSchemaTab: { type: String, attribute: 'default-schema-tab' },\n responseAreaHeight: { type: String, attribute: 'response-area-height' },\n showSummaryWhenCollapsed: { type: String, attribute: 'show-summary-when-collapsed' },\n fillRequestFieldsWithExample: { type: String, attribute: 'fill-request-fields-with-example' },\n persistAuth: { type: String, attribute: 'persist-auth' },\n\n // Schema Styles\n schemaStyle: { type: String, attribute: 'schema-style' },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n\n // API Server\n apiKeyName: { type: String, attribute: 'api-key-name' },\n apiKeyLocation: { type: String, attribute: 'api-key-location' },\n apiKeyValue: { type: String, attribute: 'api-key-value' },\n defaultApiServerUrl: { type: String, attribute: 'default-api-server' },\n serverUrl: { type: String, attribute: 'server-url' },\n oauthReceiver: { type: String, attribute: 'oauth-receiver' },\n\n allowTry: { type: String, attribute: 'allow-try' },\n\n // Main Colors and Font\n theme: { type: String },\n bgColor: { type: String, attribute: 'bg-color' },\n textColor: { type: String, attribute: 'text-color' },\n primaryColor: { type: String, attribute: 'primary-color' },\n fontSize: { type: String, attribute: 'font-size' },\n regularFont: { type: String, attribute: 'regular-font' },\n monoFont: { type: String, attribute: 'mono-font' },\n loadFonts: { type: String, attribute: 'load-fonts' },\n\n // Fetch Options\n fetchCredentials: { type: String, attribute: 'fetch-credentials' },\n\n // Filters\n matchPaths: { type: String, attribute: 'match-paths' },\n matchType: { type: String, attribute: 'match-type' },\n\n // Internal Properties\n loading: { type: Boolean }, // indicates spec is being loaded\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n InputStyles,\n FlexStyles,\n TableStyles,\n EndpointStyles,\n PrismStyles,\n TabStyles,\n NavStyles,\n InfoStyles,\n css`\n :host {\n display:flex;\n flex-direction: column;\n min-width:360px;\n width:100%;\n height:100%;\n margin:0;\n padding:0;\n overflow: hidden;\n letter-spacing:normal;\n color:var(--fg);\n background-color:var(--bg);\n font-family:var(--font-regular);\n }\n\n @media only screen and (min-width: 768px) {\n .only-large-screen{\n display:block;\n }\n .only-large-screen-flex{\n display:flex;\n }\n }`,\n ];\n }\n\n // Startup\n connectedCallback() {\n super.connectedCallback();\n\n if (this.loadFonts !== 'false') {\n const fontDescriptor = {\n family: 'Open Sans',\n style: 'normal',\n weight: '300',\n unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD',\n };\n const fontWeight300 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontDescriptor.weight = '600';\n const fontWeight600 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontWeight300.load().then((font) => { document.fonts.add(font); });\n fontWeight600.load().then((font) => { document.fonts.add(font); });\n }\n\n if (!this.showSummaryWhenCollapsed || !'true, false,'.includes(`${this.showSummaryWhenCollapsed},`)) { this.showSummaryWhenCollapsed = 'true'; }\n if (!this.layout || !'row, column,'.includes(`${this.layout},`)) { this.layout = 'row'; }\n if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) { this.schemaStyle = 'tree'; }\n if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {\n this.theme = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';\n }\n if (!this.defaultSchemaTab || !'example, schema, model,'.includes(`${this.defaultSchemaTab},`)) {\n this.defaultSchemaTab = 'example';\n } else if (this.defaultSchemaTab === 'model') {\n this.defaultSchemaTab = 'schema';\n }\n this.pathsExpanded = this.pathsExpanded === 'true';\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) { this.schemaDescriptionExpanded = 'false'; }\n if (!this.fillRequestFieldsWithExample || !'true, false,'.includes(`${this.fillRequestFieldsWithExample},`)) { this.fillRequestFieldsWithExample = 'true'; }\n if (!this.persistAuth || !'true, false,'.includes(`${this.persistAuth},`)) { this.persistAuth = 'false'; }\n if (!this.responseAreaHeight) { this.responseAreaHeight = '300px'; }\n\n if (!this.allowTry || !'true, false,'.includes(`${this.allowTry},`)) { this.allowTry = 'true'; }\n if (!this.apiKeyValue) { this.apiKeyValue = '-'; }\n if (!this.apiKeyLocation) { this.apiKeyLocation = 'header'; }\n if (!this.apiKeyName) { this.apiKeyName = ''; }\n\n if (!this.oauthReceiver) { this.oauthReceiver = 'oauth-receiver.html'; }\n if (!this.sortTags || !'true, false,'.includes(`${this.sortTags},`)) { this.sortTags = 'false'; }\n if (!this.sortEndpointsBy || !'method, path, summary,'.includes(`${this.sortEndpointsBy},`)) { this.sortEndpointsBy = 'path'; }\n if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) { this.fontSize = 'default'; }\n if (!this.matchType || !'includes regex'.includes(this.matchType)) { this.matchType = 'includes'; }\n\n if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) { this.allowSchemaDescriptionExpandToggle = 'true'; }\n if (!this.fetchCredentials || !'omit, same-origin, include,'.includes(`${this.fetchCredentials},`)) { this.fetchCredentials = ''; }\n\n marked.setOptions({\n highlight: (code, lang) => {\n if (Prism.languages[lang]) {\n return Prism.highlight(code, Prism.languages[lang], lang);\n }\n return code;\n },\n });\n }\n\n render() {\n return mainBodyTemplate.call(this, true, false, false, this.pathsExpanded);\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'spec-url') {\n if (oldVal !== newVal) {\n // put it at the end of event-loop to load all the attributes\n window.setTimeout(async () => {\n await this.loadSpec(newVal);\n }, 0);\n }\n }\n if (name === 'api-key-name' || name === 'api-key-location' || name === 'api-key-value') {\n let updateSelectedApiKey = false;\n let apiKeyName = '';\n let apiKeyLocation = '';\n let apiKeyValue = '';\n\n if (name === 'api-key-name') {\n if (this.getAttribute('api-key-location') && this.getAttribute('api-key-value')) {\n apiKeyName = newVal;\n apiKeyLocation = this.getAttribute('api-key-location');\n apiKeyValue = this.getAttribute('api-key-value');\n updateSelectedApiKey = true;\n }\n } else if (name === 'api-key-location') {\n if (this.getAttribute('api-key-name') && this.getAttribute('api-key-value')) {\n apiKeyLocation = newVal;\n apiKeyName = this.getAttribute('api-key-name');\n apiKeyValue = this.getAttribute('api-key-value');\n updateSelectedApiKey = true;\n }\n } else if (name === 'api-key-value') {\n if (this.getAttribute('api-key-name') && this.getAttribute('api-key-location')) {\n apiKeyValue = newVal;\n apiKeyLocation = this.getAttribute('api-key-location');\n apiKeyName = this.getAttribute('api-key-name');\n updateSelectedApiKey = true;\n }\n }\n\n if (updateSelectedApiKey) {\n if (this.resolvedSpec) {\n const rapiDocApiKey = this.resolvedSpec.securitySchemes.find((v) => v.securitySchemeId === rapidocApiKey);\n if (!rapiDocApiKey) {\n this.resolvedSpec.securitySchemes.push({\n apiKeyId: rapidocApiKey,\n description: 'api-key provided in rapidoc element attributes',\n type: 'apiKey',\n name: apiKeyName,\n in: apiKeyLocation,\n value: apiKeyValue,\n finalKeyValue: apiKeyValue,\n });\n } else {\n rapiDocApiKey.name = apiKeyName;\n rapiDocApiKey.in = apiKeyLocation;\n rapiDocApiKey.value = apiKeyValue;\n rapiDocApiKey.finalKeyValue = apiKeyValue;\n }\n this.requestUpdate();\n }\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n onSepcUrlChange() {\n this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);\n }\n\n // Public Method\n async loadSpec(specUrl) {\n if (!specUrl) {\n return;\n }\n try {\n this.resolvedSpec = {\n specLoadError: false,\n isSpecLoading: true,\n tags: [],\n };\n this.loading = true;\n this.loadFailed = false;\n this.requestUpdate();\n const spec = await ProcessSpec.call(\n this,\n specUrl,\n this.generateMissingTags === 'true',\n this.sortTags === 'true',\n this.getAttribute('sort-endpoints-by'),\n this.getAttribute('api-key-name'),\n this.getAttribute('api-key-location'),\n this.getAttribute('api-key-value'),\n this.getAttribute('server-url'),\n );\n this.loading = false;\n this.afterSpecParsedAndValidated(spec);\n } catch (err) {\n this.loading = false;\n this.loadFailed = true;\n this.resolvedSpec = null;\n console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console\n }\n }\n\n // Public Method - to update security-scheme of type http\n setHttpUserNameAndPassword(securitySchemeId, username, password) {\n return applyApiKey.call(this, securitySchemeId, username, password);\n }\n\n // Public Method - to update security-scheme of type apiKey or OAuth\n setApiKey(securitySchemeId, apiKeyValue) {\n return applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);\n }\n\n // Public Method\n removeAllSecurityKeys() {\n return onClearAllApiKeys.call(this);\n }\n\n // Public Method\n setApiServer(apiServerUrl) {\n // return apiServerUrl;\n return setApiServer.call(this, apiServerUrl);\n }\n\n async afterSpecParsedAndValidated(spec) {\n this.resolvedSpec = spec;\n this.selectedServer = undefined;\n if (this.defaultApiServerUrl) {\n if (this.defaultApiServerUrl === this.serverUrl) {\n this.selectedServer = {\n url: this.serverUrl,\n computedUrl: this.serverUrl,\n };\n } else if (this.resolvedSpec.servers) {\n this.selectedServer = this.resolvedSpec.servers.find((v) => (v.url === this.defaultApiServerUrl));\n }\n }\n if (!this.selectedServer) {\n if (this.resolvedSpec.servers) {\n this.selectedServer = this.resolvedSpec.servers[0]; // eslint-disable-line prefer-destructuring\n }\n }\n this.requestUpdate();\n // eslint-disable-next-line no-await-in-loop\n while (!await this.updateComplete);\n const specLoadedEvent = new CustomEvent('spec-loaded', { detail: spec });\n this.dispatchEvent(specLoadedEvent);\n }\n\n // Called by anchor tags created using markdown\n handleHref(e) {\n if (e.target.tagName.toLowerCase() === 'a') {\n if (e.target.getAttribute('href').startsWith('#')) {\n const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));\n if (gotoEl) {\n gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n }\n }\n }\n }\n}\ncustomElements.define('rapi-doc-mini', RapiDocMini);\n","import { html } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'; // eslint-disable-line import/extensions\nimport { marked } from 'marked';\n\n// Templates\nimport overviewTemplate from '~/templates/overview-template';\nimport headerTemplate from '~/templates/header-template';\nimport { schemaInObjectNotation, generateExample } from '~/utils/schema-utils';\nimport '~/components/json-tree';\nimport '~/components/schema-tree';\nimport SetTheme from '~/utils/theme';\nimport { isValidHexColor } from '~/utils/color-utils';\n\n/* eslint-disable indent */\n// Json Schema Nav Template\nfunction jsonSchemaNavTemplate() {\n return html`\n \n `;\n}\n\n// Json Schema Body Template\nfunction jsonSchemaBodyTemplate() {\n return html`\n ${this.showInfo === 'true' ? overviewTemplate.call(this) : ''}\n
\n ${this.resolvedSpec.schemaAndExamples.map((jSchemaBody) => {\n const examplesObj = generateExample(jSchemaBody.schema, 'json', jSchemaBody.examples, jSchemaBody.example, true, false, 'json', true);\n jSchemaBody.selectedExample = examplesObj[0]?.exampleId;\n return html`\n
\n
\n
${jSchemaBody.name}
\n ${unsafeHTML(marked(jSchemaBody.description || ''))}\n
\n
\n
\n \n
\n
\n ${examplesObj.length > 1\n ? html``\n : html`
${examplesObj[0].exampleSummary}
`\n }\n ${examplesObj.map((v) => html`\n `)\n }\n
\n
\n
`;\n })\n }\n
\n `;\n}\n/* eslint-enable indent */\n\n// Json Schema Root Template\nexport default function jsonSchemaViewerTemplate(isMini = false) {\n// export default function jsonSchemaViewerTemplate(isMini = false, showExpandCollapse = true, showTags = true, pathsExpanded = false) {\n if (!this.resolvedSpec) {\n return '';\n }\n const newTheme = {\n bg1: isValidHexColor(this.bgColor) ? this.bgColor : '',\n fg1: isValidHexColor(this.textColor) ? this.textColor : '',\n headerColor: isValidHexColor(this.headerColor) ? this.headerColor : '',\n primaryColor: isValidHexColor(this.primaryColor) ? this.primaryColor : '',\n navBgColor: isValidHexColor(this.navBgColor) ? this.navBgColor : '',\n navTextColor: isValidHexColor(this.navTextColor) ? this.navTextColor : '',\n navHoverBgColor: isValidHexColor(this.navHoverBgColor) ? this.navHoverBgColor : '',\n navHoverTextColor: isValidHexColor(this.navHoverTextColor) ? this.navHoverTextColor : '',\n navAccentColor: isValidHexColor(this.navAccentColor) ? this.navAccentColor : '',\n };\n /* eslint-disable indent */\n if (this.resolvedSpec.specLoadError) {\n if (isMini) {\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n
${this.resolvedSpec.info.description}
\n `;\n }\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n \n ${headerTemplate.call(this)}\n

Header

\n
\n \n
\n

${this.resolvedSpec.info.title}

\n
${this.resolvedSpec.info.description}
\n
\n
\n `;\n }\n if (this.resolvedSpec.isSpecLoading) {\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n
\n \n
\n
\n
\n
\n `;\n }\n\n return html`\n ${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}\n\n \n ${this.showHeader === 'false' ? '' : headerTemplate.call(this)}\n \n
\n\n \n ${jsonSchemaNavTemplate.call(this)}\n\n \n
\n \n
\n ${this.loading === true\n ? html`
`\n : html`\n ${this.loadFailed === true\n ? html`
Unable to load the Spec
`\n : html`\n
{ this.handleHref(e); }}\">\n ${jsonSchemaBodyTemplate.call(this)}\n
\n `\n }`\n }\n
\n \n
\n
\n `;\n}\n/* eslint-enable indent */\n","import { css, LitElement } from 'lit';\nimport { marked } from 'marked';\nimport Prism from 'prismjs';\nimport 'prismjs/components/prism-css';\nimport 'prismjs/components/prism-yaml';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-http';\nimport 'prismjs/components/prism-csharp';\n\n// Styles\nimport FontStyles from '~/styles/font-styles';\nimport InputStyles from '~/styles/input-styles';\nimport FlexStyles from '~/styles/flex-styles';\nimport TableStyles from '~/styles/table-styles';\nimport PrismStyles from '~/styles/prism-styles';\nimport TabStyles from '~/styles/tab-styles';\nimport NavStyles from '~/styles/nav-styles';\nimport InfoStyles from '~/styles/info-styles';\n\nimport EndpointStyles from '~/styles/endpoint-styles';\nimport ProcessSpec from '~/utils/spec-parser';\nimport jsonSchemaViewerTemplate from '~/templates/json-schema-viewer-template';\n\nexport default class JsonSchemaViewer extends LitElement {\n constructor() {\n super();\n this.isMini = false;\n this.updateRoute = 'false';\n this.renderStyle = 'focused';\n this.showHeader = 'true';\n this.allowAdvancedSearch = 'false';\n this.selectedExampleForEachSchema = {};\n }\n\n static get properties() {\n return {\n // Spec\n specUrl: { type: String, attribute: 'spec-url' },\n\n // Schema Styles\n schemaStyle: { type: String, attribute: 'schema-style' },\n schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },\n schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },\n allowSchemaDescriptionExpandToggle: { type: String, attribute: 'allow-schema-description-expand-toggle' },\n\n // Hide/show Sections\n showHeader: { type: String, attribute: 'show-header' },\n showSideNav: { type: String, attribute: 'show-side-nav' },\n showInfo: { type: String, attribute: 'show-info' },\n\n // Allow or restrict features\n allowSpecUrlLoad: { type: String, attribute: 'allow-spec-url-load' },\n allowSpecFileLoad: { type: String, attribute: 'allow-spec-file-load' },\n allowSpecFileDownload: { type: String, attribute: 'allow-spec-file-download' },\n allowSearch: { type: String, attribute: 'allow-search' },\n\n // Main Colors and Font\n theme: { type: String },\n bgColor: { type: String, attribute: 'bg-color' },\n textColor: { type: String, attribute: 'text-color' },\n primaryColor: { type: String, attribute: 'primary-color' },\n fontSize: { type: String, attribute: 'font-size' },\n regularFont: { type: String, attribute: 'regular-font' },\n monoFont: { type: String, attribute: 'mono-font' },\n loadFonts: { type: String, attribute: 'load-fonts' },\n\n // Internal Properties\n loading: { type: Boolean }, // indicates spec is being loaded\n };\n }\n\n static get styles() {\n return [\n FontStyles,\n InputStyles,\n FlexStyles,\n TableStyles,\n EndpointStyles,\n PrismStyles,\n TabStyles,\n NavStyles,\n InfoStyles,\n css`\n :host {\n display:flex;\n flex-direction: column;\n min-width:360px;\n width:100%;\n height:100%;\n margin:0;\n padding:0;\n overflow: hidden;\n letter-spacing:normal;\n color:var(--fg);\n background-color:var(--bg);\n font-family:var(--font-regular);\n }\n .body {\n display:flex;\n height:100%;\n width:100%;\n overflow:hidden;\n }\n .nav-bar {\n width: 230px;\n display:flex;\n }\n\n .main-content { \n margin:0;\n padding: 16px; \n display:block;\n flex:1;\n height:100%;\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: thin;\n scrollbar-color: var(--border-color) transparent;\n }\n .main-content-inner--view-mode {\n padding: 0 8px;\n }\n .main-content::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n .main-content::-webkit-scrollbar-track {\n background:transparent;\n }\n .main-content::-webkit-scrollbar-thumb {\n background-color: var(--border-color);\n }\n .main-header {\n background-color:var(--header-bg);\n color:var(--header-fg);\n width:100%;\n }\n .header-title {\n font-size:calc(var(--font-size-regular) + 8px); \n padding:0 8px;\n }\n input.header-input{\n background:var(--header-color-darker);\n color:var(--header-fg);\n border:1px solid var(--header-color-border);\n flex:1; \n padding-right:24px;\n border-radius:3px;\n }\n input.header-input::placeholder {\n opacity:0.4;\n }\n .loader {\n margin: 16px auto 16px auto; \n border: 4px solid var(--bg3);\n border-radius: 50%;\n border-top: 4px solid var(--primary-color);\n width: 36px;\n height: 36px;\n animation: spin 2s linear infinite;\n }\n @media only screen and (min-width: 768px) {\n .only-large-screen{\n display:block;\n }\n .only-large-screen-flex{\n display:flex;\n }\n }`,\n ];\n }\n\n // Startup\n connectedCallback() {\n super.connectedCallback();\n const parent = this.parentElement;\n if (parent) {\n if (parent.offsetWidth === 0 && parent.style.width === '') {\n parent.style.width = '100vw';\n }\n if (parent.offsetHeight === 0 && parent.style.height === '') {\n parent.style.height = '100vh';\n }\n if (parent.tagName === 'BODY') {\n if (!parent.style.marginTop) { parent.style.marginTop = '0'; }\n if (!parent.style.marginRight) { parent.style.marginRight = '0'; }\n if (!parent.style.marginBottom) { parent.style.marginBottom = '0'; }\n if (!parent.style.marginLeft) { parent.style.marginLeft = '0'; }\n }\n }\n\n if (this.loadFonts !== 'false') {\n const fontDescriptor = {\n family: 'Open Sans',\n style: 'normal',\n weight: '300',\n unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD',\n };\n const fontWeight300 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontDescriptor.weight = '600';\n const fontWeight600 = new FontFace(\n 'Open Sans',\n \"url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')\",\n fontDescriptor,\n );\n fontWeight300.load().then((font) => { document.fonts.add(font); });\n fontWeight600.load().then((font) => { document.fonts.add(font); });\n }\n\n this.renderStyle = 'focused';\n this.pathsExpanded = this.pathsExpanded === 'true';\n\n if (!this.showInfo || !'true, false,'.includes(`${this.showInfo},`)) { this.showInfo = 'true'; }\n if (!this.showSideNav || !'true false'.includes(this.showSideNav)) { this.showSideNav = 'true'; }\n if (!this.showHeader || !'true, false,'.includes(`${this.showHeader},`)) { this.showHeader = 'true'; }\n\n if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) { this.schemaStyle = 'tree'; }\n if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {\n this.theme = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';\n }\n if (!this.allowSearch || !'true, false,'.includes(`${this.allowSearch},`)) { this.allowSearch = 'true'; }\n if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }\n if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) { this.schemaDescriptionExpanded = 'false'; }\n if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) { this.fontSize = 'default'; }\n if (!this.matchType || !'includes regex'.includes(this.matchType)) { this.matchType = 'includes'; }\n if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) { this.allowSchemaDescriptionExpandToggle = 'true'; }\n\n marked.setOptions({\n highlight: (code, lang) => {\n if (Prism.languages[lang]) {\n return Prism.highlight(code, Prism.languages[lang], lang);\n }\n return code;\n },\n });\n }\n\n render() {\n return jsonSchemaViewerTemplate.call(this, true, false, false, this.pathsExpanded);\n }\n\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'spec-url') {\n if (oldVal !== newVal) {\n // put it at the end of event-loop to load all the attributes\n window.setTimeout(async () => {\n await this.loadSpec(newVal);\n }, 0);\n }\n }\n super.attributeChangedCallback(name, oldVal, newVal);\n }\n\n onSepcUrlChange() {\n this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);\n }\n\n onSearchChange(e) {\n // Todo: Filter Search\n this.matchPaths = e.target.value;\n }\n\n // Public Method\n async loadSpec(specUrl) {\n if (!specUrl) {\n return;\n }\n try {\n this.resolvedSpec = {\n specLoadError: false,\n isSpecLoading: true,\n tags: [],\n };\n this.loading = true;\n this.loadFailed = false;\n this.requestUpdate();\n const spec = await ProcessSpec.call(\n this,\n specUrl,\n this.generateMissingTags === 'true',\n this.sortTags === 'true',\n this.getAttribute('sort-endpoints-by'),\n );\n this.loading = false;\n this.afterSpecParsedAndValidated(spec);\n } catch (err) {\n this.loading = false;\n this.loadFailed = true;\n this.resolvedSpec = null;\n console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console\n }\n }\n\n async afterSpecParsedAndValidated(spec) {\n this.resolvedSpec = spec;\n const specLoadedEvent = new CustomEvent('spec-loaded', { detail: spec });\n this.dispatchEvent(specLoadedEvent);\n }\n\n // Called by anchor tags created using markdown\n handleHref(e) {\n if (e.target.tagName.toLowerCase() === 'a') {\n if (e.target.getAttribute('href').startsWith('#')) {\n const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));\n if (gotoEl) {\n gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n }\n }\n }\n }\n\n // Example Dropdown @change Handler\n onSelectExample(e) {\n const exampleContainerEl = e.target.closest('.json-schema-example-panel');\n const exampleEls = [...exampleContainerEl.querySelectorAll('.example')];\n exampleEls.forEach((v) => {\n v.style.display = v.dataset.example === e.target.value ? 'flex' : 'none';\n });\n }\n\n async scrollToEventTarget(event) {\n const navEl = event.currentTarget;\n if (!navEl.dataset.contentId) {\n return;\n }\n const contentEl = this.shadowRoot.getElementById(navEl.dataset.contentId);\n if (contentEl) {\n contentEl.scrollIntoView({ behavior: 'auto', block: 'start' });\n }\n }\n}\ncustomElements.define('json-schema-viewer', JsonSchemaViewer);\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rapidoc-min.js.map.gz b/dist/rapidoc-min.js.map.gz index 715fb787..f486de53 100644 Binary files a/dist/rapidoc-min.js.map.gz and b/dist/rapidoc-min.js.map.gz differ diff --git a/dist/rapidoc.js b/dist/rapidoc.js index 6ffcc5b0..a270da17 100644 --- a/dist/rapidoc.js +++ b/dist/rapidoc.js @@ -3257,15 +3257,6 @@ input[type="password"]::placeholder { opacity:1; } -select:focus, -textarea:focus, -input[type="text"]:focus, -input[type="password"]:focus, -textarea:active, -input[type="text"]:active, -input[type="password"]:active { - border:1px solid var(--primary-color); -} input[type="file"]{ font-family: var(--font-regular); @@ -3319,10 +3310,6 @@ textarea::-webkit-scrollbar-thumb { margin-bottom:2px; } -input[type="checkbox"]:focus{ - outline:0; -} - /* Toggle Body */ input[type="checkbox"] { appearance: none; @@ -3355,7 +3342,7 @@ input[type="checkbox"]:after { /* Toggle Body - Checked */ input[type="checkbox"]:checked { - box-shadow: inset 0 0 0 13px var(--green); + background-color: var(--green); border-color: var(--green); } /* Toggle Thumb - Checked*/ @@ -3364,8 +3351,7 @@ input[type="checkbox"]:checked:after { left: 16px; right: 1px; transition: border .25s, left .15s .25s, right .25s .175s; -} -`); +}`); ;// CONCATENATED MODULE: ./src/styles/flex-styles.js /* harmony default export */ const flex_styles = (i` @@ -3751,6 +3737,7 @@ pre[class*="language-"] { } .tab-buttons { height:30px; + padding: 4px 4px 0 4px; border-bottom: 1px solid var(--light-border-color) ; align-items: stretch; overflow-y: hidden; @@ -3792,6 +3779,20 @@ pre[class*="language-"] { ;// CONCATENATED MODULE: ./src/styles/nav-styles.js /* harmony default export */ const nav_styles = (i` +.nav-bar-info:focus-visible, +.nav-bar-tag:focus-visible, +.nav-bar-path:focus-visible { + outline: 1px solid; + box-shadow: none; + outline-offset: -4px; +} +.nav-bar-expand-all:focus-visible, +.nav-bar-collapse-all:focus-visible, +.nav-bar-tag-icon:focus-visible { + outline: 1px solid; + box-shadow: none; + outline-offset: 2px; +} .nav-bar { width:0; height:100%; @@ -3828,7 +3829,23 @@ pre[class*="language-"] { } .nav-bar-paths-under-tag { overflow:hidden; - transition: max-height .2s ease-out; + transition: max-height .2s ease-out, visibility .3s; +} +.collapsed .nav-bar-paths-under-tag { + visibility: hidden; +} + +.nav-bar-expand-all { + transform: rotate(90deg); + cursor:pointer; + margin-right:10px; +} +.nav-bar-collapse-all { + transform: rotate(270deg); + cursor:pointer; +} +.nav-bar-expand-all:hover, .nav-bar-collapse-all:hover { + color: var(--primary-color); } .nav-bar-tag-icon { @@ -14006,6 +14023,8 @@ class JsonTree extends lit_element_s { :host{ display:flex; } + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } .json-tree { position: relative; font-family: var(--font-mono); @@ -14584,7 +14603,7 @@ class TagInput extends lit_element_s { } return y` -
+
${tagItemTmpl}
@@ -14669,7 +14688,7 @@ class TagInput extends lit_element_s { static get styles() { return [i` - .tags{ + .tags { display:flex; flex-wrap: wrap; outline: none; @@ -14695,7 +14714,7 @@ class TagInput extends lit_element_s { .tag:hover ~ #cursor { display: block; } - .editor{ + .editor { flex:1; border:1px solid transparent; color:var(--fg); @@ -14706,6 +14725,9 @@ class TagInput extends lit_element_s { background:transparent; font-size: calc(var(--font-size-small) + 1px); } + .editor:focus-visible { + outline: 1px solid; + } .editor::placeholder { color: var(--placeholder-color); opacity:1; @@ -14888,7 +14910,9 @@ class ApiRequest extends lit_element_s { static get styles() { return [table_styles, input_styles, font_styles, flex_styles, border_styles, tab_styles, prism_styles, i` *, *:before, *:after { box-sizing: border-box; } - + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } + tag-input:focus-within { outline: 1px solid;} .read-mode { margin-top: 24px; } @@ -15124,7 +15148,7 @@ class ApiRequest extends lit_element_s { const [declaredParamSchema, serializeStyle, mimeTypeElem] = getSchemaFromParam(param); if (!declaredParamSchema) { - continue; // eslint-disable-line no-continue + continue; } const paramSchema = getTypeInfo(declaredParamSchema); @@ -15990,7 +16014,7 @@ class ApiRequest extends lit_element_s { } } } catch (err) { - console.log('RapiDoc: unable to parse %s into object', el.value); // eslint-disable-line no-console + console.error('RapiDoc: unable to parse %s into object', el.value); // eslint-disable-line no-console } if (queryParam.toString()) { @@ -16806,6 +16830,8 @@ class ApiResponse extends lit_element_s { static get styles() { return [font_styles, flex_styles, tab_styles, table_styles, input_styles, border_styles, i` + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } .resp-head{ vertical-align: middle; padding:16px 0 8px; @@ -17188,13 +17214,13 @@ function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') { `} `} ${path.description ? y`
${unsafe_html_o(marked(path.description))}
` : ''} + ${pathSecurityTemplate.call(this, path.security)} ${(_path$externalDocs = path.externalDocs) !== null && _path$externalDocs !== void 0 && _path$externalDocs.url || (_path$externalDocs2 = path.externalDocs) !== null && _path$externalDocs2 !== void 0 && _path$externalDocs2.description ? y`
${unsafe_html_o(marked(((_path$externalDocs3 = path.externalDocs) === null || _path$externalDocs3 === void 0 ? void 0 : _path$externalDocs3.description) || ''))}
${(_path$externalDocs4 = path.externalDocs) !== null && _path$externalDocs4 !== void 0 && _path$externalDocs4.url ? y`` : ''}
` : ''} - ${pathSecurityTemplate.call(this, path.security)} ${codeSampleTabPanel}
`} - ${y`
`;else if(e.startsWith("cmp--")&&"true"===this.showComponents)t=GI.call(this);else if(e.startsWith("tag--")){const r=e.indexOf("--",4)>0?e.substring(0,e.indexOf("--",5)):e;n=this.resolvedSpec.tags.find((e=>e.elementId===r)),t=n?aR.call(this,iR.call(this,n)):oR.call(this)}else{for(a=0;a`${t.elementId}`===e)),!r);a+=1);if(r){eR(this.shadowRoot.getElementById(`link-${e}`),"expand"),t=aR.call(this,MI.call(this,r,n.name||"",n.description||""))}else t=oR.call(this)}return t}function lR(e){if(e.expanded)e.expanded=!1,"true"===this.updateRoute&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${"#"===this.routePrefix?"":`${this.routePrefix}`}`);else if(e.expanded=!0,"true"===this.updateRoute){const t=`${this.routePrefix||"#"}${e.elementId}`;window.location.hash!==t&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${t}`)}this.requestUpdate()}function cR(e,t="expand-all"){const r=[...e.querySelectorAll(".section-tag")];"expand-all"===t?r.map((e=>{e.classList.replace("collapsed","expanded")})):r.map((e=>{e.classList.replace("expanded","collapsed")}))}function pR(e,t="expand-all"){cR.call(this,e.target.closest(".operations-root"),t)}function dR(e,t=!1){return z` +
${e.method}
${e.path} @@ -2728,7 +2763,7 @@ pre[class*="language-"] {
${e.summary||e.shortSummary}
`:""}
- `}function hR(e){var t,r,n,a,o,i,s;const l=new Set;for(const t in e.responses)for(const r in null===(c=e.responses[t])||void 0===c?void 0:c.content){var c;l.add(r.trim())}const p=[...l].join(", "),d=this.resolvedSpec.securitySchemes.filter((t=>{var r;return t.finalKeyValue&&(null===(r=e.security)||void 0===r?void 0:r.some((e=>t.securitySchemeId in e)))}))||[],u=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot&&"-"!==e.value));u&&d.push(u);const h=e.xCodeSamples?fI(e.xCodeSamples):"";return z` + `}function uR(e){var t,r,n,a,o,i,s;const l=new Set;for(const t in e.responses)for(const r in null===(c=e.responses[t])||void 0===c?void 0:c.content){var c;l.add(r.trim())}const p=[...l].join(", "),d=this.resolvedSpec.securitySchemes.filter((t=>{var r;return t.finalKeyValue&&(null===(r=e.security)||void 0===r?void 0:r.some((e=>t.securitySchemeId in e)))}))||[],u=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot&&"-"!==e.value));u&&d.push(u);const h=e.xCodeSamples?fI(e.xCodeSamples):"";return z`
${e.summary?z`
${e.summary}
`:e.shortSummary!==e.description?z`
${e.shortSummary}
`:""} @@ -2802,14 +2837,14 @@ pre[class*="language-"] { schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" >
-
`}function fR(e=!0,t=!0,r=!1){return this.resolvedSpec?z` +
`}function hR(e=!0,t=!0,r=!1){return this.resolvedSpec?z` ${e?z`
- + Expand all  |  - + Collapse all   sections @@ -2827,20 +2862,20 @@ pre[class*="language-"] {
${e.paths.filter((e=>!this.matchPaths||lt(this.matchPaths,e,this.matchType))).map((e=>z`
- ${uR.call(this,e,r)} - ${r||e.expanded?hR.call(this,e):""} + ${dR.call(this,e,r)} + ${r||e.expanded?uR.call(this,e):""}
`))}
`:z` `} - `))}`:""}function mR(){return z` + `))}`:""}function fR(){return z`
`;var e}customElements.define("api-response",class extends ie{constructor(){super(),this.selectedStatus="",this.headersForEachRespStatus={},this.mimeResponsesForEachStatus={},this.activeSchemaTab="schema"}static get properties(){return{callback:{type:String},webhook:{type:String},responses:{type:Object},parser:{type:Object},schemaStyle:{type:String,attribute:"schema-style"},renderStyle:{type:String,attribute:"render-style"},selectedStatus:{type:String,attribute:"selected-status"},selectedMimeType:{type:String,attribute:"selected-mime-type"},activeSchemaTab:{type:String,attribute:"active-schema-tab"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"}}}static get styles(){return[Ke,Ye,et,Ze,Je,kI,c` + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } .resp-head{ vertical-align: middle; padding:16px 0 8px; @@ -3049,7 +3086,7 @@ pre[class*="language-"] { exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" > `}`:z`
 Schema not found
- `}});const yR=c` + `}});const mR=c` *, *:before, *:after { box-sizing: border-box; } .dialog-box-overlay { @@ -3121,7 +3158,7 @@ pre[class*="language-"] { flex-grow: 1; font-size:24px; } -`;function gR(){var e;return document.addEventListener("close",(()=>{this.showAdvancedSearchDialog=!1})),document.addEventListener("open",this.onOpenSearchDialog),z` +`;function yR(){var e;return document.addEventListener("close",(()=>{this.showAdvancedSearchDialog=!1})),document.addEventListener("open",this.onOpenSearchDialog),z` `))} - `}customElements.define("dialog-box",class extends ie{static get properties(){return{heading:{type:String,attribute:"heading"},show:{type:String,attribute:"show"}}}static get styles(){return[yR]}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",(e=>{"Escape"===e.code&&this.onClose()}))}attributeChangedCallback(e,t,r){t!==r&&("heading"===e&&(this.heading=r),"show"===e&&(this.show=r,"true"===r&&document.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0,detail:this})))),super.attributeChangedCallback(e,t,r)}render(){return z` + `}customElements.define("dialog-box",class extends ie{static get properties(){return{heading:{type:String,attribute:"heading"},show:{type:String,attribute:"show"}}}static get styles(){return[mR]}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",(e=>{"Escape"===e.code&&this.onClose()}))}attributeChangedCallback(e,t,r){t!==r&&("heading"===e&&(this.heading=r),"show"===e&&(this.show=r,"true"===r&&document.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0,detail:this})))),super.attributeChangedCallback(e,t,r)}render(){return z` ${"true"===this.show?z`
@@ -3185,7 +3222,7 @@ pre[class*="language-"] {
-
`:""}`}onClose(){document.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}});const vR={color:{inputReverseFg:"#fff",inputReverseBg:"#333",headerBg:"#444",getRgb(e){if(0===e.indexOf("#")&&(e=e.slice(1,7)),3!==e.length&&4!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6!==e.length)throw new Error("Invalid HEX color.");return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}},luminanace(e){const t=this.getRgb(e);return.299*t.r+.587*t.g+.114*t.b},invert(e){return this.luminanace(e)>135?"#000":"#fff"},opacity(e,t){const r=this.getRgb(e);return`rgba(${r.r}, ${r.g}, ${r.b}, ${t})`},brightness(e,t){const r=this.getRgb(e);return r.r+=t,r.g+=t,r.b+=t,r.r>255?r.r=255:r.r<0&&(r.r=0),r.g>255?r.g=255:r.g<0&&(r.g=0),r.b>255?r.b=255:r.b<0&&(r.b=0),`#${r.r.toString(16).padStart(2,"0")}${r.g.toString(16).padStart(2,"0")}${r.b.toString(16).padStart(2,"0")}`},hasGoodContrast(e,t){return this.luminanace(e)-this.luminanace(t)}}};function bR(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/i.test(e)}function xR(e,t={}){let r={};const n=t.primaryColor?t.primaryColor:"dark"===e?"#f76b39":"#ff591e",a=vR.color.invert(n),o=vR.color.opacity(n,"0.8");if("dark"===e){const e=t.bg1?t.bg1:"#2a2b2c",i=t.fg1?t.fg1:"#bbb",s=t.bg2?t.bg2:vR.color.brightness(e,5),l=t.bg3?t.bg3:vR.color.brightness(e,17),c=t.bg3?t.bg3:vR.color.brightness(e,35),p=t.fg2?t.fg2:vR.color.brightness(i,-15),d=t.fg3?t.fg3:vR.color.brightness(i,-20),u=t.fg3?t.fg3:vR.color.brightness(i,-65),h=t.inlineCodeFg?t.inlineCodeFg:"#aaa",f="#bbb",m="#eee",y=t.headerColor?t.headerColor:vR.color.brightness(e,10),g=t.navBgColor?t.navBgColor:vR.color.brightness(e,10);r={bg1:e,bg2:s,bg3:l,lightBg:c,fg1:i,fg2:p,fg3:d,lightFg:u,inlineCodeFg:h,primaryColor:n,primaryColorTrans:o,primaryColorInvert:a,selectionBg:f,selectionFg:m,overlayBg:"rgba(80, 80, 80, 0.4)",navBgColor:g,navTextColor:t.navTextColor?t.navTextColor:vR.color.opacity(vR.color.invert(g),"0.50"),navHoverBgColor:t.navHoverBgColor?t.navHoverBgColor:vR.color.brightness(g,-15),navHoverTextColor:t.navHoverTextColor?t.navHoverTextColor:vR.color.invert(g),navAccentColor:t.navAccentColor?t.navAccentColor:vR.color.brightness(n,25),headerColor:y,headerColorInvert:vR.color.invert(y),headerColorDarker:vR.color.brightness(y,-20),headerColorBorder:vR.color.brightness(y,10),borderColor:t.borderColor||vR.color.brightness(e,20),lightBorderColor:t.lightBorderColor||vR.color.brightness(e,15),codeBorderColor:t.codeBorderColor||vR.color.brightness(e,30),inputBg:t.inputBg||vR.color.brightness(e,-5),placeHolder:t.placeHolder||vR.color.opacity(i,"0.3"),hoverColor:t.hoverColor||vR.color.brightness(e,-10),red:t.red?t.red:"#F06560",lightRed:t.lightRed?t.lightRed:vR.color.brightness(e,-10),pink:t.pink?t.pink:"#ffb2b2",lightPink:t.lightPink||vR.color.brightness(e,-10),green:t.green||"#7ec699",lightGreen:t.lightGreen||vR.color.brightness(e,-10),blue:t.blue||"#71b7ff",lightBlue:t.lightBlue||vR.color.brightness(e,-10),orange:t.orange?t.orange:"#f08d49",lightOrange:t.lightOrange||vR.color.brightness(e,-10),yellow:t.yellow||"#827717",lightYellow:t.lightYellow||vR.color.brightness(e,-10),purple:t.purple||"#786FF1",brown:t.brown||"#D4AC0D",codeBg:t.codeBg||vR.color.opacity(vR.color.brightness(e,-15),.7),codeFg:t.codeFg||"#aaa",codePropertyColor:t.codePropertyColor||"#f8c555",codeKeywordColor:t.codeKeywordColor||"#cc99cd",codeOperatorColor:t.codeOperatorColor||"#67cdcc"}}else{const e=t.bg1?t.bg1:"#fafbfc",i=t.fg1?t.fg1:"#444444",s=t.bg2?t.bg2:vR.color.brightness(e,-5),l=t.bg3?t.bg3:vR.color.brightness(e,-15),c=t.bg3?t.bg3:vR.color.brightness(e,-45),p=t.fg2?t.fg2:vR.color.brightness(i,17),d=t.fg3?t.fg3:vR.color.brightness(i,30),u=t.fg3?t.fg3:vR.color.brightness(i,70),h=t.inlineCodeFg?t.inlineCodeFg:"brown",f="#444",m="#eee",y=t.headerColor?t.headerColor:vR.color.brightness(e,-180),g=t.navBgColor?t.navBgColor:vR.color.brightness(e,-200);r={bg1:e,bg2:s,bg3:l,lightBg:c,fg1:i,fg2:p,fg3:d,lightFg:u,inlineCodeFg:h,primaryColor:n,primaryColorTrans:o,primaryColorInvert:a,selectionBg:f,selectionFg:m,overlayBg:"rgba(0, 0, 0, 0.4)",navBgColor:g,navTextColor:t.navTextColor?t.navTextColor:vR.color.opacity(vR.color.invert(g),"0.65"),navHoverBgColor:t.navHoverBgColor?t.navHoverBgColor:vR.color.brightness(g,-15),navHoverTextColor:t.navHoverTextColor?t.navHoverTextColor:vR.color.invert(g),navAccentColor:t.navAccentColor?t.navAccentColor:vR.color.brightness(n,25),headerColor:y,headerColorInvert:vR.color.invert(y),headerColorDarker:vR.color.brightness(y,-20),headerColorBorder:vR.color.brightness(y,10),borderColor:t.borderColor||vR.color.brightness(e,-38),lightBorderColor:t.lightBorderColor||vR.color.brightness(e,-23),codeBorderColor:t.codeBorderColor||"transparent",inputBg:t.inputBg||vR.color.brightness(e,10),placeHolder:t.placeHolder||vR.color.brightness(u,20),hoverColor:t.hoverColor||vR.color.brightness(e,-5),red:t.red||"#F06560",lightRed:t.lightRed||"#fff0f0",pink:t.pink?t.pink:"#990055",lightPink:t.lightPink?t.lightPink:"#ffb2b2",green:t.green||"#690",lightGreen:t.lightGreen||"#fbfff0",blue:t.blue||"#47AFE8",lightBlue:t.lightBlue||"#eff8fd",orange:t.orange||"#FF9900",lightOrange:t.lightOrange||"#fff5e6",yellow:t.yellow||"#827717",lightYellow:t.lightYellow||"#fff5cc",purple:t.purple||"#786FF1",brown:t.brown||"#D4AC0D",codeBg:t.codeBg||vR.color.opacity(vR.color.brightness(e,-15),.7),codeFg:t.codeFg||"#666",codePropertyColor:t.codePropertyColor||"#905",codeKeywordColor:t.codeKeywordColor||"#07a",codeOperatorColor:t.codeOperatorColor||"#9a6e3a"}}return z` +
`:""}`}onClose(){document.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}});const gR={color:{inputReverseFg:"#fff",inputReverseBg:"#333",headerBg:"#444",getRgb(e){if(0===e.indexOf("#")&&(e=e.slice(1,7)),3!==e.length&&4!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6!==e.length)throw new Error("Invalid HEX color.");return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}},luminanace(e){const t=this.getRgb(e);return.299*t.r+.587*t.g+.114*t.b},invert(e){return this.luminanace(e)>135?"#000":"#fff"},opacity(e,t){const r=this.getRgb(e);return`rgba(${r.r}, ${r.g}, ${r.b}, ${t})`},brightness(e,t){const r=this.getRgb(e);return r.r+=t,r.g+=t,r.b+=t,r.r>255?r.r=255:r.r<0&&(r.r=0),r.g>255?r.g=255:r.g<0&&(r.g=0),r.b>255?r.b=255:r.b<0&&(r.b=0),`#${r.r.toString(16).padStart(2,"0")}${r.g.toString(16).padStart(2,"0")}${r.b.toString(16).padStart(2,"0")}`},hasGoodContrast(e,t){return this.luminanace(e)-this.luminanace(t)}}};function vR(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/i.test(e)}function bR(e,t={}){let r={};const n=t.primaryColor?t.primaryColor:"dark"===e?"#f76b39":"#ff591e",a=gR.color.invert(n),o=gR.color.opacity(n,"0.4");if("dark"===e){const e=t.bg1?t.bg1:"#2a2b2c",i=t.fg1?t.fg1:"#bbb",s=t.bg2?t.bg2:gR.color.brightness(e,5),l=t.bg3?t.bg3:gR.color.brightness(e,17),c=t.bg3?t.bg3:gR.color.brightness(e,35),p=t.fg2?t.fg2:gR.color.brightness(i,-15),d=t.fg3?t.fg3:gR.color.brightness(i,-20),u=t.fg3?t.fg3:gR.color.brightness(i,-65),h=t.inlineCodeFg?t.inlineCodeFg:"#aaa",f="#bbb",m="#eee",y=t.headerColor?t.headerColor:gR.color.brightness(e,10),g=t.navBgColor?t.navBgColor:gR.color.brightness(e,10);r={bg1:e,bg2:s,bg3:l,lightBg:c,fg1:i,fg2:p,fg3:d,lightFg:u,inlineCodeFg:h,primaryColor:n,primaryColorTrans:o,primaryColorInvert:a,selectionBg:f,selectionFg:m,overlayBg:"rgba(80, 80, 80, 0.4)",navBgColor:g,navTextColor:t.navTextColor?t.navTextColor:gR.color.opacity(gR.color.invert(g),"0.50"),navHoverBgColor:t.navHoverBgColor?t.navHoverBgColor:gR.color.brightness(g,-15),navHoverTextColor:t.navHoverTextColor?t.navHoverTextColor:gR.color.invert(g),navAccentColor:t.navAccentColor?t.navAccentColor:gR.color.brightness(n,25),headerColor:y,headerColorInvert:gR.color.invert(y),headerColorDarker:gR.color.brightness(y,-20),headerColorBorder:gR.color.brightness(y,10),borderColor:t.borderColor||gR.color.brightness(e,20),lightBorderColor:t.lightBorderColor||gR.color.brightness(e,15),codeBorderColor:t.codeBorderColor||gR.color.brightness(e,30),inputBg:t.inputBg||gR.color.brightness(e,-5),placeHolder:t.placeHolder||gR.color.opacity(i,"0.3"),hoverColor:t.hoverColor||gR.color.brightness(e,-10),red:t.red?t.red:"#F06560",lightRed:t.lightRed?t.lightRed:gR.color.brightness(e,-10),pink:t.pink?t.pink:"#ffb2b2",lightPink:t.lightPink||gR.color.brightness(e,-10),green:t.green||"#7ec699",lightGreen:t.lightGreen||gR.color.brightness(e,-10),blue:t.blue||"#71b7ff",lightBlue:t.lightBlue||gR.color.brightness(e,-10),orange:t.orange?t.orange:"#f08d49",lightOrange:t.lightOrange||gR.color.brightness(e,-10),yellow:t.yellow||"#827717",lightYellow:t.lightYellow||gR.color.brightness(e,-10),purple:t.purple||"#786FF1",brown:t.brown||"#D4AC0D",codeBg:t.codeBg||gR.color.opacity(gR.color.brightness(e,-15),.7),codeFg:t.codeFg||"#aaa",codePropertyColor:t.codePropertyColor||"#f8c555",codeKeywordColor:t.codeKeywordColor||"#cc99cd",codeOperatorColor:t.codeOperatorColor||"#67cdcc"}}else{const e=t.bg1?t.bg1:"#fafbfc",i=t.fg1?t.fg1:"#444444",s=t.bg2?t.bg2:gR.color.brightness(e,-5),l=t.bg3?t.bg3:gR.color.brightness(e,-15),c=t.bg3?t.bg3:gR.color.brightness(e,-45),p=t.fg2?t.fg2:gR.color.brightness(i,17),d=t.fg3?t.fg3:gR.color.brightness(i,30),u=t.fg3?t.fg3:gR.color.brightness(i,70),h=t.inlineCodeFg?t.inlineCodeFg:"brown",f="#444",m="#eee",y=t.headerColor?t.headerColor:gR.color.brightness(e,-180),g=t.navBgColor?t.navBgColor:gR.color.brightness(e,-200);r={bg1:e,bg2:s,bg3:l,lightBg:c,fg1:i,fg2:p,fg3:d,lightFg:u,inlineCodeFg:h,primaryColor:n,primaryColorTrans:o,primaryColorInvert:a,selectionBg:f,selectionFg:m,overlayBg:"rgba(0, 0, 0, 0.4)",navBgColor:g,navTextColor:t.navTextColor?t.navTextColor:gR.color.opacity(gR.color.invert(g),"0.65"),navHoverBgColor:t.navHoverBgColor?t.navHoverBgColor:gR.color.brightness(g,-15),navHoverTextColor:t.navHoverTextColor?t.navHoverTextColor:gR.color.invert(g),navAccentColor:t.navAccentColor?t.navAccentColor:gR.color.brightness(n,25),headerColor:y,headerColorInvert:gR.color.invert(y),headerColorDarker:gR.color.brightness(y,-20),headerColorBorder:gR.color.brightness(y,10),borderColor:t.borderColor||gR.color.brightness(e,-38),lightBorderColor:t.lightBorderColor||gR.color.brightness(e,-23),codeBorderColor:t.codeBorderColor||"transparent",inputBg:t.inputBg||gR.color.brightness(e,10),placeHolder:t.placeHolder||gR.color.brightness(u,20),hoverColor:t.hoverColor||gR.color.brightness(e,-5),red:t.red||"#F06560",lightRed:t.lightRed||"#fff0f0",pink:t.pink?t.pink:"#990055",lightPink:t.lightPink?t.lightPink:"#ffb2b2",green:t.green||"#690",lightGreen:t.lightGreen||"#fbfff0",blue:t.blue||"#47AFE8",lightBlue:t.lightBlue||"#eff8fd",orange:t.orange||"#FF9900",lightOrange:t.lightOrange||"#fff5e6",yellow:t.yellow||"#827717",lightYellow:t.lightYellow||"#fff5cc",purple:t.purple||"#786FF1",brown:t.brown||"#D4AC0D",codeBg:t.codeBg||gR.color.opacity(gR.color.brightness(e,-15),.7),codeFg:t.codeFg||"#666",codePropertyColor:t.codePropertyColor||"#905",codeKeywordColor:t.codeKeywordColor||"#07a",codeOperatorColor:t.codeOperatorColor||"#9a6e3a"}}return z` `}function wR(e=!1,t=!0,r=!0,n=!1){if(!this.resolvedSpec)return"";"true"===this.persistAuth&&aI.call(this);const a={bg1:bR(this.bgColor)?this.bgColor:"",fg1:bR(this.textColor)?this.textColor:"",headerColor:bR(this.headerColor)?this.headerColor:"",primaryColor:bR(this.primaryColor)?this.primaryColor:"",navBgColor:bR(this.navBgColor)?this.navBgColor:"",navTextColor:bR(this.navTextColor)?this.navTextColor:"",navHoverBgColor:bR(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:bR(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:bR(this.navAccentColor)?this.navAccentColor:""};return this.resolvedSpec.specLoadError?e?z` - ${"dark"===this.theme?xR.call(this,"dark",a):xR.call(this,"light",a)} + `}function xR(e=!1,t=!0,r=!0,n=!1){if(!this.resolvedSpec)return"";"true"===this.persistAuth&&aI.call(this);const a={bg1:vR(this.bgColor)?this.bgColor:"",fg1:vR(this.textColor)?this.textColor:"",headerColor:vR(this.headerColor)?this.headerColor:"",primaryColor:vR(this.primaryColor)?this.primaryColor:"",navBgColor:vR(this.navBgColor)?this.navBgColor:"",navTextColor:vR(this.navTextColor)?this.navTextColor:"",navHoverBgColor:vR(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:vR(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:vR(this.navAccentColor)?this.navAccentColor:""};return this.resolvedSpec.specLoadError?e?z` + ${"dark"===this.theme?bR.call(this,"dark",a):bR.call(this,"light",a)}
${this.resolvedSpec.info.description}
`:z` - ${"dark"===this.theme?xR.call(this,"dark",a):xR.call(this,"light",a)} + ${"dark"===this.theme?bR.call(this,"dark",a):bR.call(this,"light",a)} - ${mR.call(this)} + ${fR.call(this)}
@@ -3288,7 +3327,7 @@ pre[class*="language-"] {
`:this.resolvedSpec.isSpecLoading?z` - ${"dark"===this.theme?xR.call(this,"dark",a):xR.call(this,"light",a)} + ${"dark"===this.theme?bR.call(this,"dark",a):bR.call(this,"light",a)}
@@ -3296,33 +3335,33 @@ pre[class*="language-"] {
`:z` - ${"dark"===this.theme?xR.call(this,"dark",a):xR.call(this,"light",a)} + ${"dark"===this.theme?bR.call(this,"dark",a):bR.call(this,"light",a)} - ${"false"===this.showHeader?"":mR.call(this)} + ${"false"===this.showHeader?"":fR.call(this)} - ${"false"===this.allowAdvancedSearch?"":gR.call(this)} + ${"false"===this.allowAdvancedSearch?"":yR.call(this)}
- ${"read"!==this.renderStyle&&"focused"!==this.renderStyle||"true"!==this.showSideNav||!this.resolvedSpec?"":nR.call(this)} + ${"read"!==this.renderStyle&&"focused"!==this.renderStyle||"true"!==this.showSideNav||!this.resolvedSpec?"":rR.call(this)} -
+
${!0===this.loading?z`
`:z` ${!0===this.loadFailed?z`
Unable to load the Spec
`:z`
- ${"focused"===this.renderStyle?z`${lR.call(this)}`:z` + ${"focused"===this.renderStyle?z`${sR.call(this)}`:z` ${"true"===this.showInfo?JI.call(this):""} ${"true"===this.allowServerSelection?XI.call(this):""} ${"true"===this.allowAuthentication?uI.call(this):""}
- ${"read"===this.renderStyle?HI.call(this):fR.call(this,t,r,n)} + ${"read"===this.renderStyle?HI.call(this):hR.call(this,t,r,n)} `}
`}`} @@ -3330,7 +3369,7 @@ pre[class*="language-"] {
- `}class $R extends ie{constructor(){super();const e={root:this.getRootNode().host,rootMargin:"-50px 0px -50px 0px",threshold:0};this.showSummaryWhenCollapsed=!0,this.isIntersectionObserverActive=!0,this.intersectionObserver=new IntersectionObserver((e=>{this.onIntersect(e)}),e)}static get properties(){return{headingText:{type:String,attribute:"heading-text"},gotoPath:{type:String,attribute:"goto-path"},updateRoute:{type:String,attribute:"update-route"},routePrefix:{type:String,attribute:"route-prefix"},specUrl:{type:String,attribute:"spec-url"},sortTags:{type:String,attribute:"sort-tags"},generateMissingTags:{type:String,attribute:"generate-missing-tags"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},specFile:{type:String,attribute:!1},layout:{type:String},renderStyle:{type:String,attribute:"render-style"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},onNavTagClick:{type:String,attribute:"on-nav-tag-click"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowAuthentication:{type:String,attribute:"allow-authentication"},allowTry:{type:String,attribute:"allow-try"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},allowAdvancedSearch:{type:String,attribute:"allow-advanced-search"},allowServerSelection:{type:String,attribute:"allow-server-selection"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showComponents:{type:String,attribute:"show-components"},pageDirection:{type:String,attribute:"page-direction"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},headerColor:{type:String,attribute:"header-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},cssFile:{type:String,attribute:"css-file"},cssClasses:{type:String,attribute:"css-classes"},navBgColor:{type:String,attribute:"nav-bg-color"},navTextColor:{type:String,attribute:"nav-text-color"},navHoverBgColor:{type:String,attribute:"nav-hover-bg-color"},navHoverTextColor:{type:String,attribute:"nav-hover-text-color"},navAccentColor:{type:String,attribute:"nav-accent-color"},navItemSpacing:{type:String,attribute:"nav-item-spacing"},showMethodInNavBar:{type:String,attribute:"show-method-in-nav-bar"},usePathInNavBar:{type:String,attribute:"use-path-in-nav-bar"},infoDescriptionHeadingsInNavBar:{type:String,attribute:"info-description-headings-in-navbar"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},loading:{type:Boolean},focusedElementId:{type:String},showAdvancedSearchDialog:{type:Boolean},advancedSearchMatches:{type:Object}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` + `}class wR extends ie{constructor(){super();const e={root:this.getRootNode().host,rootMargin:"-50px 0px -50px 0px",threshold:0};this.showSummaryWhenCollapsed=!0,this.isIntersectionObserverActive=!0,this.intersectionObserver=new IntersectionObserver((e=>{this.onIntersect(e)}),e)}static get properties(){return{headingText:{type:String,attribute:"heading-text"},gotoPath:{type:String,attribute:"goto-path"},updateRoute:{type:String,attribute:"update-route"},routePrefix:{type:String,attribute:"route-prefix"},specUrl:{type:String,attribute:"spec-url"},sortTags:{type:String,attribute:"sort-tags"},generateMissingTags:{type:String,attribute:"generate-missing-tags"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},specFile:{type:String,attribute:!1},layout:{type:String},renderStyle:{type:String,attribute:"render-style"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},onNavTagClick:{type:String,attribute:"on-nav-tag-click"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowAuthentication:{type:String,attribute:"allow-authentication"},allowTry:{type:String,attribute:"allow-try"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},allowAdvancedSearch:{type:String,attribute:"allow-advanced-search"},allowServerSelection:{type:String,attribute:"allow-server-selection"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showComponents:{type:String,attribute:"show-components"},pageDirection:{type:String,attribute:"page-direction"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},headerColor:{type:String,attribute:"header-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},cssFile:{type:String,attribute:"css-file"},cssClasses:{type:String,attribute:"css-classes"},navBgColor:{type:String,attribute:"nav-bg-color"},navTextColor:{type:String,attribute:"nav-text-color"},navHoverBgColor:{type:String,attribute:"nav-hover-bg-color"},navHoverTextColor:{type:String,attribute:"nav-hover-text-color"},navAccentColor:{type:String,attribute:"nav-accent-color"},navItemSpacing:{type:String,attribute:"nav-item-spacing"},showMethodInNavBar:{type:String,attribute:"show-method-in-nav-bar"},usePathInNavBar:{type:String,attribute:"use-path-in-nav-bar"},infoDescriptionHeadingsInNavBar:{type:String,attribute:"info-description-headings-in-navbar"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},loading:{type:Boolean},focusedElementId:{type:String},showAdvancedSearchDialog:{type:Boolean},advancedSearchMatches:{type:Object}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` :host { display:flex; flex-direction: column; @@ -3345,13 +3384,14 @@ pre[class*="language-"] { background-color:var(--bg); font-family:var(--font-regular); } - .body { + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } + .body { display:flex; height:100%; width:100%; overflow:hidden; } - .main-content { margin:0; padding: 0; @@ -3584,7 +3624,7 @@ pre[class*="language-"] { .section-gap--read-mode { padding: 24px 80px 12px 80px; } - }`,nt]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(0===e.offsetWidth&&""===e.style.width&&(e.style.width="100vw"),0===e.offsetHeight&&""===e.style.height&&(e.style.height="100vh"),"BODY"===e.tagName&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.layout&&"row, column,".includes(`${this.layout},`)||(this.layout="row"),this.renderStyle&&"read, view, focused,".includes(`${this.renderStyle},`)||(this.renderStyle="focused"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.defaultSchemaTab&&"example, schema, model,".includes(`${this.defaultSchemaTab},`)?"model"===this.defaultSchemaTab&&(this.defaultSchemaTab="schema"):this.defaultSchemaTab="example",(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.schemaHideReadOnly&&"default, never,".includes(`${this.schemaHideReadOnly},`)||(this.schemaHideReadOnly="default"),this.schemaHideWriteOnly&&"default, never,".includes(`${this.schemaHideWriteOnly},`)||(this.schemaHideWriteOnly="default"),this.fillRequestFieldsWithExample&&"true, false,".includes(`${this.fillRequestFieldsWithExample},`)||(this.fillRequestFieldsWithExample="true"),this.persistAuth&&"true, false,".includes(`${this.persistAuth},`)||(this.persistAuth="false"),this.onNavTagClick&&"expand-collapse, show-description,".includes(`${this.onNavTagClick},`)||(this.onNavTagClick="expand-collapse"),this.responseAreaHeight||(this.responseAreaHeight="400px"),this.allowSearch&&"true, false,".includes(`${this.allowSearch},`)||(this.allowSearch="true"),this.allowAdvancedSearch&&"true, false,".includes(`${this.allowAdvancedSearch},`)||(this.allowAdvancedSearch="true"),this.allowTry&&"true, false,".includes(`${this.allowTry},`)||(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),this.updateRoute&&"true, false,".includes(`${this.updateRoute},`)||(this.updateRoute="true"),this.routePrefix||(this.routePrefix="#"),this.sortTags&&"true, false,".includes(`${this.sortTags},`)||(this.sortTags="false"),this.generateMissingTags&&"true, false,".includes(`${this.generateMissingTags},`)||(this.generateMissingTags="false"),this.sortEndpointsBy&&"method, path, summary, none,".includes(`${this.sortEndpointsBy},`)||(this.sortEndpointsBy="path"),this.navItemSpacing&&"compact, relaxed, default,".includes(`${this.navItemSpacing},`)||(this.navItemSpacing="default"),this.showMethodInNavBar&&"false, as-plain-text, as-colored-text, as-colored-block,".includes(`${this.showMethodInNavBar},`)||(this.showMethodInNavBar="false"),this.usePathInNavBar&&"true, false,".includes(`${this.usePathInNavBar},`)||(this.usePathInNavBar="false"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.showInfo&&"true, false,".includes(`${this.showInfo},`)||(this.showInfo="true"),this.allowServerSelection&&"true, false,".includes(`${this.allowServerSelection},`)||(this.allowServerSelection="true"),this.allowAuthentication&&"true, false,".includes(`${this.allowAuthentication},`)||(this.allowAuthentication="true"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),this.showSideNav&&"true false".includes(this.showSideNav)||(this.showSideNav="true"),this.showComponents&&"true false".includes(this.showComponents)||(this.showComponents="false"),this.infoDescriptionHeadingsInNavBar&&"true, false,".includes(`${this.infoDescriptionHeadingsInNavBar},`)||(this.infoDescriptionHeadingsInNavBar="false"),this.fetchCredentials&&"omit, same-origin, include,".includes(`${this.fetchCredentials},`)||(this.fetchCredentials=""),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.showAdvancedSearchDialog||(this.showAdvancedSearchDialog=!1),this.cssFile||(this.cssFile=null),this.cssClasses||(this.cssClasses=""),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e}),window.addEventListener("hashchange",(()=>{const e=new RegExp(`^${this.routePrefix}`,"i"),t=window.location.hash.replace(e,"");this.scrollTo(t)}),!0)}disconnectedCallback(){this.intersectionObserver&&this.intersectionObserver.disconnect(),super.disconnectedCallback()}infoDescriptionHeadingRenderer(){const e=new We.Renderer;return e.heading=(e,t,r,n)=>`${e}`,e}render(){const e=document.querySelector(`link[href*="${this.cssFile}"]`);return e&&this.shadowRoot.appendChild(e.cloneNode()),wR.call(this)}observeExpandedContent(){this.shadowRoot.querySelectorAll(".observe-me").forEach((e=>{this.intersectionObserver.observe(e)}))}attributeChangedCallback(e,t,r){if("spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r),this.gotoPath&&!window.location.hash&&this.scrollTo(this.gotoPath)}),0),"render-style"===e&&("read"===r?window.setTimeout((()=>{this.observeExpandedContent()}),100):this.intersectionObserver.disconnect()),"api-key-name"===e||"api-key-location"===e||"api-key-value"===e){let t=!1,n="",a="",o="";if("api-key-name"===e?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(n=r,a=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),t=!0):"api-key-location"===e?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(a=r,n=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),t=!0):"api-key-value"===e&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=r,a=this.getAttribute("api-key-location"),n=this.getAttribute("api-key-name"),t=!0),t&&this.resolvedSpec){const e=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot));e?(e.name=n,e.in=a,e.value=o,e.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({securitySchemeId:ot,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:n,in:a,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSepcFileChange(e){this.setAttribute("spec-file",this.shadowRoot.getElementById("spec-file").value);const t=e.target.files[0],r=new FileReader;r.onload=()=>{try{const e=JSON.parse(r.result);this.loadSpec(e),this.shadowRoot.getElementById("spec-url").value=""}catch(e){console.error("RapiDoc: Unable to read or parse json")}},r.readAsText(t)}onFileLoadClick(){this.shadowRoot.getElementById("spec-file").click()}onSearchChange(e){this.matchPaths=e.target.value,this.resolvedSpec.tags.forEach((e=>e.paths.filter((t=>{this.matchPaths&<(this.matchPaths,t,this.matchType)&&(e.expanded=!0)})))),this.resolvedSpec.components.forEach((e=>e.subComponents.filter((e=>{e.expanded=!1,this.matchPaths&&!function(e,t){return t.name.toLowerCase().includes(e.toLowerCase())}(this.matchPaths,e)||(e.expanded=!0)})))),this.requestUpdate()}onClearSearch(){this.shadowRoot.getElementById("nav-bar-search").value="",this.matchPaths="",this.resolvedSpec.components.forEach((e=>e.subComponents.filter((e=>{e.expanded=!0}))))}onShowSearchModalClicked(){this.showAdvancedSearchDialog=!0}async onOpenSearchDialog(e){const t=e.detail.querySelector("input");await it(0),t&&t.focus()}async loadSpec(e){if(e){this.matchPaths="";try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1;const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}}async afterSpecParsedAndValidated(e){var t;for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find((e=>e.url===this.defaultApiServerUrl)))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const r=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(r),this.intersectionObserver.disconnect(),"read"===this.renderStyle&&(await it(100),this.observeExpandedContent());if(null===(t=window.location.hash)||void 0===t?void 0:t.substring(1)){const e=new RegExp(`^${this.routePrefix}`,"i"),t=window.location.hash.replace(e,"");"view"===this.renderStyle?this.expandAndGotoOperation(t,!0,!0):this.scrollTo(t)}else if("focused"===this.renderStyle&&!this.gotoPath){var n;const e=this.showInfo?"overview":null===(n=this.resolvedSpec.tags[0])||void 0===n?void 0:n.paths[0];this.scrollTo(e)}}expandAndGotoOperation(e,t=!0){if(!this.resolvedSpec)return;let r=!0;const n=-1===e.indexOf("#")?e:e.substring(1);if(n.startsWith("overview")||"servers"===n||"auth"===n)r=!1;else for(let t=0;t<(null===(a=this.resolvedSpec.tags)||void 0===a?void 0:a.length);t++){var a,o;const n=this.resolvedSpec.tags[t],i=null===(o=n.paths)||void 0===o?void 0:o.find((t=>t.elementId===e));i&&(i.expanded&&n.expanded?r=!1:(i.expanded=!0,n.expanded=!0))}t&&(r&&this.requestUpdate(),window.setTimeout((()=>{const e=this.shadowRoot.getElementById(n);e&&(e.scrollIntoView({behavior:"auto",block:"start"}),"true"===this.updateRoute&&window.history.replaceState(null,null,`${this.routePrefix||"#"}${n}`))}),r?150:0))}isValidTopId(e){return e.startsWith("overview")||"servers"===e||"auth"===e}isValidPathId(e){var t,r,n,a;return!("overview"!==e||!this.showInfo)||(!("servers"!==e||!this.allowServerSelection)||(!("auth"!==e||!this.allowAuthentication)||(e.startsWith("tag--")?null===(n=this.resolvedSpec)||void 0===n||null===(a=n.tags)||void 0===a?void 0:a.find((t=>t.elementId===e)):null===(t=this.resolvedSpec)||void 0===t||null===(r=t.tags)||void 0===r?void 0:r.find((t=>t.paths.find((t=>t.elementId===e)))))))}onIntersect(e){!1!==this.isIntersectionObserverActive&&e.forEach((e=>{if(e.isIntersecting&&e.intersectionRatio>0){const t=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active"),r=this.shadowRoot.getElementById(`link-${e.target.id}`);r&&("true"===this.updateRoute&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${this.routePrefix||"#"}${e.target.id}`),r.scrollIntoView({behavior:"auto",block:"center"}),r.classList.add("active")),t&&t.classList.remove("active")}}))}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}async scrollToEventTarget(e,t=!0){const r=e.currentTarget;if(r.dataset.contentId){if(this.isIntersectionObserverActive=!1,"focused"===this.renderStyle){const e=this.shadowRoot.querySelector("api-request");e&&e.beforerNavigationFocusedMode()}this.scrollTo(r.dataset.contentId,!0,t),setTimeout((()=>{this.isIntersectionObserverActive=!0}),300)}}async scrollTo(e,t=!0,r=!0){if("focused"===this.renderStyle&&(this.focusedElementId=e,await it(0)),"view"===this.renderStyle)this.expandAndGotoOperation(e,t,!0);else{let t=!1;const n=this.shadowRoot.getElementById(e);if(n?(t=!0,n.scrollIntoView({behavior:"auto",block:"start"})):t=!1,t){if("focused"===this.renderStyle){const e=this.shadowRoot.querySelector("api-request");e&&e.afterNavigationFocusedMode();const t=this.shadowRoot.querySelector("api-response");t&&t.resetSelection()}"true"===this.updateRoute&&window.history.replaceState(null,null,`${this.routePrefix||"#"}${e}`);const t=this.shadowRoot.getElementById(`link-${e}`);if(t){r&&t.scrollIntoView({behavior:"auto",block:"center"}),await it(0);const e=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active");e&&e.classList.remove("active"),t.classList.add("active")}}}}setHttpUserNameAndPassword(e,t,r){return eI.call(this,e,t,r)}setApiKey(e,t){return eI.call(this,e,"","",t)}removeAllSecurityKeys(){return tI.call(this)}setApiServer(e){return YI.call(this,e)}onAdvancedSearch(e,t){const r=e.target;clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>{let e;e="text"===r.type?r:r.closest(".advanced-search-options").querySelector("input[type=text]");const t=[...r.closest(".advanced-search-options").querySelectorAll("input:checked")].map((e=>e.id));this.advancedSearchMatches=function(e,t,r=[]){if(!e.trim()||0===r.length)return;const n=[];return t.forEach((t=>{t.paths.forEach((t=>{let a="";var o;if(r.includes("search-api-path")&&(a=t.path),r.includes("search-api-descr")&&(a=`${a} ${t.summary||t.description||""}`),r.includes("search-api-params")&&(a=`${a} ${(null===(o=t.parameters)||void 0===o?void 0:o.map((e=>e.name)).join(" "))||""}`),r.includes("search-api-request-body")&&t.requestBody){let e=new Set;for(const r in null===(i=t.requestBody)||void 0===i?void 0:i.content){var i,s,l;null!==(s=t.requestBody.content[r].schema)&&void 0!==s&&s.properties&&(e=ct(null===(l=t.requestBody.content[r].schema)||void 0===l?void 0:l.properties)),a=`${a} ${[...e].join(" ")}`}}r.includes("search-api-resp-descr")&&(a=`${a} ${Object.values(t.responses).map((e=>e.description||"")).join(" ")}`),a.toLowerCase().includes(e.trim().toLowerCase())&&n.push({elementId:t.elementId,method:t.method,path:t.path,summary:t.summary||t.description||"",deprecated:t.deprecated})}))})),n}(e.value,this.resolvedSpec.tags,t)}),t)}}customElements.define("rapi-doc",$R);customElements.define("rapi-doc-mini",class extends ie{constructor(){super(),this.isMini=!0,this.updateRoute="false",this.renderStyle="view",this.showHeader="false",this.allowAdvancedSearch="false"}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},layout:{type:String},pathsExpanded:{type:String,attribute:"paths-expanded"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},showSummaryWhenCollapsed:{type:String,attribute:"show-summary-when-collapsed"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},allowTry:{type:String,attribute:"allow-try"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},loading:{type:Boolean}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` + }`,nt]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(0===e.offsetWidth&&""===e.style.width&&(e.style.width="100vw"),0===e.offsetHeight&&""===e.style.height&&(e.style.height="100vh"),"BODY"===e.tagName&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.layout&&"row, column,".includes(`${this.layout},`)||(this.layout="row"),this.renderStyle&&"read, view, focused,".includes(`${this.renderStyle},`)||(this.renderStyle="focused"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.defaultSchemaTab&&"example, schema, model,".includes(`${this.defaultSchemaTab},`)?"model"===this.defaultSchemaTab&&(this.defaultSchemaTab="schema"):this.defaultSchemaTab="example",(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.schemaHideReadOnly&&"default, never,".includes(`${this.schemaHideReadOnly},`)||(this.schemaHideReadOnly="default"),this.schemaHideWriteOnly&&"default, never,".includes(`${this.schemaHideWriteOnly},`)||(this.schemaHideWriteOnly="default"),this.fillRequestFieldsWithExample&&"true, false,".includes(`${this.fillRequestFieldsWithExample},`)||(this.fillRequestFieldsWithExample="true"),this.persistAuth&&"true, false,".includes(`${this.persistAuth},`)||(this.persistAuth="false"),this.onNavTagClick&&"expand-collapse, show-description,".includes(`${this.onNavTagClick},`)||(this.onNavTagClick="expand-collapse"),this.responseAreaHeight||(this.responseAreaHeight="400px"),this.allowSearch&&"true, false,".includes(`${this.allowSearch},`)||(this.allowSearch="true"),this.allowAdvancedSearch&&"true, false,".includes(`${this.allowAdvancedSearch},`)||(this.allowAdvancedSearch="true"),this.allowTry&&"true, false,".includes(`${this.allowTry},`)||(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),this.updateRoute&&"true, false,".includes(`${this.updateRoute},`)||(this.updateRoute="true"),this.routePrefix||(this.routePrefix="#"),this.sortTags&&"true, false,".includes(`${this.sortTags},`)||(this.sortTags="false"),this.generateMissingTags&&"true, false,".includes(`${this.generateMissingTags},`)||(this.generateMissingTags="false"),this.sortEndpointsBy&&"method, path, summary, none,".includes(`${this.sortEndpointsBy},`)||(this.sortEndpointsBy="path"),this.navItemSpacing&&"compact, relaxed, default,".includes(`${this.navItemSpacing},`)||(this.navItemSpacing="default"),this.showMethodInNavBar&&"false, as-plain-text, as-colored-text, as-colored-block,".includes(`${this.showMethodInNavBar},`)||(this.showMethodInNavBar="false"),this.usePathInNavBar&&"true, false,".includes(`${this.usePathInNavBar},`)||(this.usePathInNavBar="false"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.showInfo&&"true, false,".includes(`${this.showInfo},`)||(this.showInfo="true"),this.allowServerSelection&&"true, false,".includes(`${this.allowServerSelection},`)||(this.allowServerSelection="true"),this.allowAuthentication&&"true, false,".includes(`${this.allowAuthentication},`)||(this.allowAuthentication="true"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),this.showSideNav&&"true false".includes(this.showSideNav)||(this.showSideNav="true"),this.showComponents&&"true false".includes(this.showComponents)||(this.showComponents="false"),this.infoDescriptionHeadingsInNavBar&&"true, false,".includes(`${this.infoDescriptionHeadingsInNavBar},`)||(this.infoDescriptionHeadingsInNavBar="false"),this.fetchCredentials&&"omit, same-origin, include,".includes(`${this.fetchCredentials},`)||(this.fetchCredentials=""),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.showAdvancedSearchDialog||(this.showAdvancedSearchDialog=!1),this.cssFile||(this.cssFile=null),this.cssClasses||(this.cssClasses=""),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e}),window.addEventListener("hashchange",(()=>{const e=new RegExp(`^${this.routePrefix}`,"i"),t=window.location.hash.replace(e,"");this.scrollTo(t)}),!0)}disconnectedCallback(){this.intersectionObserver&&this.intersectionObserver.disconnect(),super.disconnectedCallback()}infoDescriptionHeadingRenderer(){const e=new We.Renderer;return e.heading=(e,t,r,n)=>`${e}`,e}render(){const e=document.querySelector(`link[href*="${this.cssFile}"]`);return e&&this.shadowRoot.appendChild(e.cloneNode()),xR.call(this)}observeExpandedContent(){this.shadowRoot.querySelectorAll(".observe-me").forEach((e=>{this.intersectionObserver.observe(e)}))}attributeChangedCallback(e,t,r){if("spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r),this.gotoPath&&!window.location.hash&&this.scrollTo(this.gotoPath)}),0),"render-style"===e&&("read"===r?window.setTimeout((()=>{this.observeExpandedContent()}),100):this.intersectionObserver.disconnect()),"api-key-name"===e||"api-key-location"===e||"api-key-value"===e){let t=!1,n="",a="",o="";if("api-key-name"===e?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(n=r,a=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),t=!0):"api-key-location"===e?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(a=r,n=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),t=!0):"api-key-value"===e&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=r,a=this.getAttribute("api-key-location"),n=this.getAttribute("api-key-name"),t=!0),t&&this.resolvedSpec){const e=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot));e?(e.name=n,e.in=a,e.value=o,e.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({securitySchemeId:ot,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:n,in:a,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSepcFileChange(e){this.setAttribute("spec-file",this.shadowRoot.getElementById("spec-file").value);const t=e.target.files[0],r=new FileReader;r.onload=()=>{try{const e=JSON.parse(r.result);this.loadSpec(e),this.shadowRoot.getElementById("spec-url").value=""}catch(e){console.error("RapiDoc: Unable to read or parse json")}},r.readAsText(t)}onFileLoadClick(){this.shadowRoot.getElementById("spec-file").click()}onSearchChange(e){this.matchPaths=e.target.value,this.resolvedSpec.tags.forEach((e=>e.paths.filter((t=>{this.matchPaths&<(this.matchPaths,t,this.matchType)&&(e.expanded=!0)})))),this.resolvedSpec.components.forEach((e=>e.subComponents.filter((e=>{e.expanded=!1,this.matchPaths&&!function(e,t){return t.name.toLowerCase().includes(e.toLowerCase())}(this.matchPaths,e)||(e.expanded=!0)})))),this.requestUpdate()}onClearSearch(){this.shadowRoot.getElementById("nav-bar-search").value="",this.matchPaths="",this.resolvedSpec.components.forEach((e=>e.subComponents.filter((e=>{e.expanded=!0}))))}onShowSearchModalClicked(){this.showAdvancedSearchDialog=!0}async onOpenSearchDialog(e){const t=e.detail.querySelector("input");await it(0),t&&t.focus()}async loadSpec(e){if(e){this.matchPaths="";try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1;const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}}async afterSpecParsedAndValidated(e){var t;for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find((e=>e.url===this.defaultApiServerUrl)))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const r=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(r),this.intersectionObserver.disconnect(),"read"===this.renderStyle&&(await it(100),this.observeExpandedContent());if(null===(t=window.location.hash)||void 0===t?void 0:t.substring(1)){const e=new RegExp(`^${this.routePrefix}`,"i"),t=window.location.hash.replace(e,"");"view"===this.renderStyle?this.expandAndGotoOperation(t,!0,!0):this.scrollTo(t)}else if("focused"===this.renderStyle&&!this.gotoPath){var n;const e=this.showInfo?"overview":null===(n=this.resolvedSpec.tags[0])||void 0===n?void 0:n.paths[0];this.scrollTo(e)}}expandAndGotoOperation(e,t=!0){if(!this.resolvedSpec)return;let r=!0;const n=-1===e.indexOf("#")?e:e.substring(1);if(n.startsWith("overview")||"servers"===n||"auth"===n)r=!1;else for(let t=0;t<(null===(a=this.resolvedSpec.tags)||void 0===a?void 0:a.length);t++){var a,o;const n=this.resolvedSpec.tags[t],i=null===(o=n.paths)||void 0===o?void 0:o.find((t=>t.elementId===e));i&&(i.expanded&&n.expanded?r=!1:(i.expanded=!0,n.expanded=!0))}t&&(r&&this.requestUpdate(),window.setTimeout((()=>{const e=this.shadowRoot.getElementById(n);e&&(e.scrollIntoView({behavior:"auto",block:"start"}),"true"===this.updateRoute&&window.history.replaceState(null,null,`${this.routePrefix||"#"}${n}`))}),r?150:0))}isValidTopId(e){return e.startsWith("overview")||"servers"===e||"auth"===e}isValidPathId(e){var t,r,n,a;return!("overview"!==e||!this.showInfo)||(!("servers"!==e||!this.allowServerSelection)||(!("auth"!==e||!this.allowAuthentication)||(e.startsWith("tag--")?null===(n=this.resolvedSpec)||void 0===n||null===(a=n.tags)||void 0===a?void 0:a.find((t=>t.elementId===e)):null===(t=this.resolvedSpec)||void 0===t||null===(r=t.tags)||void 0===r?void 0:r.find((t=>t.paths.find((t=>t.elementId===e)))))))}onIntersect(e){!1!==this.isIntersectionObserverActive&&e.forEach((e=>{if(e.isIntersecting&&e.intersectionRatio>0){const t=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active"),r=this.shadowRoot.getElementById(`link-${e.target.id}`);r&&("true"===this.updateRoute&&window.history.replaceState(null,null,`${window.location.href.split("#")[0]}${this.routePrefix||"#"}${e.target.id}`),r.scrollIntoView({behavior:"auto",block:"center"}),r.classList.add("active")),t&&t.classList.remove("active")}}))}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}async scrollToEventTarget(e,t=!0){if("click"!==e.type&&("keyup"!==e.type||13!==e.keyCode))return;const r=e.target;if(r.dataset.contentId){if(this.isIntersectionObserverActive=!1,"focused"===this.renderStyle){const e=this.shadowRoot.querySelector("api-request");e&&e.beforerNavigationFocusedMode()}this.scrollTo(r.dataset.contentId,!0,t),setTimeout((()=>{this.isIntersectionObserverActive=!0}),300)}}async scrollTo(e,t=!0,r=!0){if("focused"===this.renderStyle&&(this.focusedElementId=e,await it(0)),"view"===this.renderStyle)this.expandAndGotoOperation(e,t,!0);else{let t=!1;const n=this.shadowRoot.getElementById(e);if(n?(t=!0,n.scrollIntoView({behavior:"auto",block:"start"})):t=!1,t){if("focused"===this.renderStyle){const e=this.shadowRoot.querySelector("api-request");e&&e.afterNavigationFocusedMode();const t=this.shadowRoot.querySelector("api-response");t&&t.resetSelection()}"true"===this.updateRoute&&window.history.replaceState(null,null,`${this.routePrefix||"#"}${e}`);const t=this.shadowRoot.getElementById(`link-${e}`);if(t){r&&t.scrollIntoView({behavior:"auto",block:"center"}),await it(0);const e=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active");e&&e.classList.remove("active"),t.classList.add("active")}}}}setHttpUserNameAndPassword(e,t,r){return eI.call(this,e,t,r)}setApiKey(e,t){return eI.call(this,e,"","",t)}removeAllSecurityKeys(){return tI.call(this)}setApiServer(e){return YI.call(this,e)}onAdvancedSearch(e,t){const r=e.target;clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>{let e;e="text"===r.type?r:r.closest(".advanced-search-options").querySelector("input[type=text]");const t=[...r.closest(".advanced-search-options").querySelectorAll("input:checked")].map((e=>e.id));this.advancedSearchMatches=function(e,t,r=[]){if(!e.trim()||0===r.length)return;const n=[];return t.forEach((t=>{t.paths.forEach((t=>{let a="";var o;if(r.includes("search-api-path")&&(a=t.path),r.includes("search-api-descr")&&(a=`${a} ${t.summary||t.description||""}`),r.includes("search-api-params")&&(a=`${a} ${(null===(o=t.parameters)||void 0===o?void 0:o.map((e=>e.name)).join(" "))||""}`),r.includes("search-api-request-body")&&t.requestBody){let e=new Set;for(const r in null===(i=t.requestBody)||void 0===i?void 0:i.content){var i,s,l;null!==(s=t.requestBody.content[r].schema)&&void 0!==s&&s.properties&&(e=ct(null===(l=t.requestBody.content[r].schema)||void 0===l?void 0:l.properties)),a=`${a} ${[...e].join(" ")}`}}r.includes("search-api-resp-descr")&&(a=`${a} ${Object.values(t.responses).map((e=>e.description||"")).join(" ")}`),a.toLowerCase().includes(e.trim().toLowerCase())&&n.push({elementId:t.elementId,method:t.method,path:t.path,summary:t.summary||t.description||"",deprecated:t.deprecated})}))})),n}(e.value,this.resolvedSpec.tags,t)}),t)}}customElements.define("rapi-doc",wR);customElements.define("rapi-doc-mini",class extends ie{constructor(){super(),this.isMini=!0,this.updateRoute="false",this.renderStyle="view",this.showHeader="false",this.allowAdvancedSearch="false"}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},layout:{type:String},pathsExpanded:{type:String,attribute:"paths-expanded"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},showSummaryWhenCollapsed:{type:String,attribute:"show-summary-when-collapsed"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},allowTry:{type:String,attribute:"allow-try"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},loading:{type:Boolean}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` :host { display:flex; flex-direction: column; @@ -3607,7 +3647,7 @@ pre[class*="language-"] { .only-large-screen-flex{ display:flex; } - }`]}connectedCallback(){if(super.connectedCallback(),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.showSummaryWhenCollapsed&&"true, false,".includes(`${this.showSummaryWhenCollapsed},`)||(this.showSummaryWhenCollapsed="true"),this.layout&&"row, column,".includes(`${this.layout},`)||(this.layout="row"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.defaultSchemaTab&&"example, schema, model,".includes(`${this.defaultSchemaTab},`)?"model"===this.defaultSchemaTab&&(this.defaultSchemaTab="schema"):this.defaultSchemaTab="example",this.pathsExpanded="true"===this.pathsExpanded,(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.fillRequestFieldsWithExample&&"true, false,".includes(`${this.fillRequestFieldsWithExample},`)||(this.fillRequestFieldsWithExample="true"),this.persistAuth&&"true, false,".includes(`${this.persistAuth},`)||(this.persistAuth="false"),this.responseAreaHeight||(this.responseAreaHeight="300px"),this.allowTry&&"true, false,".includes(`${this.allowTry},`)||(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),this.sortTags&&"true, false,".includes(`${this.sortTags},`)||(this.sortTags="false"),this.sortEndpointsBy&&"method, path, summary,".includes(`${this.sortEndpointsBy},`)||(this.sortEndpointsBy="path"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),this.fetchCredentials&&"omit, same-origin, include,".includes(`${this.fetchCredentials},`)||(this.fetchCredentials=""),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e})}render(){return wR.call(this,!0,!1,!1,this.pathsExpanded)}attributeChangedCallback(e,t,r){if("spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r)}),0),"api-key-name"===e||"api-key-location"===e||"api-key-value"===e){let t=!1,n="",a="",o="";if("api-key-name"===e?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(n=r,a=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),t=!0):"api-key-location"===e?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(a=r,n=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),t=!0):"api-key-value"===e&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=r,a=this.getAttribute("api-key-location"),n=this.getAttribute("api-key-name"),t=!0),t&&this.resolvedSpec){const e=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot));e?(e.name=n,e.in=a,e.value=o,e.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({apiKeyId:ot,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:n,in:a,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}setHttpUserNameAndPassword(e,t,r){return eI.call(this,e,t,r)}setApiKey(e,t){return eI.call(this,e,"","",t)}removeAllSecurityKeys(){return tI.call(this)}setApiServer(e){return YI.call(this,e)}async afterSpecParsedAndValidated(e){for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find((e=>e.url===this.defaultApiServerUrl)))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}});class kR extends HTMLElement{connectedCallback(){this.receiveAuthParms(),window.addEventListener("storage",(e=>this.receiveStorage(e)),!0)}receiveAuthParms(){let e={};if(document.location.search){const t=new URLSearchParams(document.location.search);e={code:t.get("code"),error:t.get("error"),state:t.get("state"),responseType:"code"}}else if(window.location.hash){e={token_type:this.parseQueryString(window.location.hash.substring(1),"token_type"),access_token:this.parseQueryString(window.location.hash.substring(1),"access_token"),responseType:"token"}}window.opener?window.opener.postMessage(e,this.target):sessionStorage.setItem("rapidoc-oauth-data",JSON.stringify(e))}relayAuthParams(e){if(window.parent&&"rapidoc-oauth-data"===e.key){const t=JSON.parse(e.newValue);window.parent.postMessage(t,this.target)}}parseQueryString(e,t){const r=e.split("&");for(let e=0;e{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.showSummaryWhenCollapsed&&"true, false,".includes(`${this.showSummaryWhenCollapsed},`)||(this.showSummaryWhenCollapsed="true"),this.layout&&"row, column,".includes(`${this.layout},`)||(this.layout="row"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.defaultSchemaTab&&"example, schema, model,".includes(`${this.defaultSchemaTab},`)?"model"===this.defaultSchemaTab&&(this.defaultSchemaTab="schema"):this.defaultSchemaTab="example",this.pathsExpanded="true"===this.pathsExpanded,(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.fillRequestFieldsWithExample&&"true, false,".includes(`${this.fillRequestFieldsWithExample},`)||(this.fillRequestFieldsWithExample="true"),this.persistAuth&&"true, false,".includes(`${this.persistAuth},`)||(this.persistAuth="false"),this.responseAreaHeight||(this.responseAreaHeight="300px"),this.allowTry&&"true, false,".includes(`${this.allowTry},`)||(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),this.sortTags&&"true, false,".includes(`${this.sortTags},`)||(this.sortTags="false"),this.sortEndpointsBy&&"method, path, summary,".includes(`${this.sortEndpointsBy},`)||(this.sortEndpointsBy="path"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),this.fetchCredentials&&"omit, same-origin, include,".includes(`${this.fetchCredentials},`)||(this.fetchCredentials=""),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e})}render(){return xR.call(this,!0,!1,!1,this.pathsExpanded)}attributeChangedCallback(e,t,r){if("spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r)}),0),"api-key-name"===e||"api-key-location"===e||"api-key-value"===e){let t=!1,n="",a="",o="";if("api-key-name"===e?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(n=r,a=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),t=!0):"api-key-location"===e?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(a=r,n=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),t=!0):"api-key-value"===e&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=r,a=this.getAttribute("api-key-location"),n=this.getAttribute("api-key-name"),t=!0),t&&this.resolvedSpec){const e=this.resolvedSpec.securitySchemes.find((e=>e.securitySchemeId===ot));e?(e.name=n,e.in=a,e.value=o,e.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({apiKeyId:ot,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:n,in:a,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}setHttpUserNameAndPassword(e,t,r){return eI.call(this,e,t,r)}setApiKey(e,t){return eI.call(this,e,"","",t)}removeAllSecurityKeys(){return tI.call(this)}setApiServer(e){return YI.call(this,e)}async afterSpecParsedAndValidated(e){for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find((e=>e.url===this.defaultApiServerUrl)))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}});class $R extends HTMLElement{connectedCallback(){this.receiveAuthParms(),window.addEventListener("storage",(e=>this.receiveStorage(e)),!0)}receiveAuthParms(){let e={};if(document.location.search){const t=new URLSearchParams(document.location.search);e={code:t.get("code"),error:t.get("error"),state:t.get("state"),responseType:"code"}}else if(window.location.hash){e={token_type:this.parseQueryString(window.location.hash.substring(1),"token_type"),access_token:this.parseQueryString(window.location.hash.substring(1),"access_token"),responseType:"token"}}window.opener?window.opener.postMessage(e,this.target):sessionStorage.setItem("rapidoc-oauth-data",JSON.stringify(e))}relayAuthParams(e){if(window.parent&&"rapidoc-oauth-data"===e.key){const t=JSON.parse(e.newValue);window.parent.postMessage(t,this.target)}}parseQueryString(e,t){const r=e.split("&");for(let e=0;e
@@ -3630,7 +3670,7 @@ pre[class*="language-"] {
`))} - `}function AR(){return z` + `}function SR(){return z` ${"true"===this.showInfo?JI.call(this):""}
${this.resolvedSpec.schemaAndExamples.map((e=>{var t;const r=FI(e.schema,"json",e.examples,e.example,!0,!1,"json",!0);return e.selectedExample=null===(t=r[0])||void 0===t?void 0:t.exampleId,z` @@ -3668,13 +3708,13 @@ pre[class*="language-"] {
`}))}
- `}function OR(e=!1){if(!this.resolvedSpec)return"";const t={bg1:bR(this.bgColor)?this.bgColor:"",fg1:bR(this.textColor)?this.textColor:"",headerColor:bR(this.headerColor)?this.headerColor:"",primaryColor:bR(this.primaryColor)?this.primaryColor:"",navBgColor:bR(this.navBgColor)?this.navBgColor:"",navTextColor:bR(this.navTextColor)?this.navTextColor:"",navHoverBgColor:bR(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:bR(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:bR(this.navAccentColor)?this.navAccentColor:""};return this.resolvedSpec.specLoadError?e?z` - ${"dark"===this.theme?xR.call(this,"dark",t):xR.call(this,"light",t)} + `}function AR(e=!1){if(!this.resolvedSpec)return"";const t={bg1:vR(this.bgColor)?this.bgColor:"",fg1:vR(this.textColor)?this.textColor:"",headerColor:vR(this.headerColor)?this.headerColor:"",primaryColor:vR(this.primaryColor)?this.primaryColor:"",navBgColor:vR(this.navBgColor)?this.navBgColor:"",navTextColor:vR(this.navTextColor)?this.navTextColor:"",navHoverBgColor:vR(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:vR(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:vR(this.navAccentColor)?this.navAccentColor:""};return this.resolvedSpec.specLoadError?e?z` + ${"dark"===this.theme?bR.call(this,"dark",t):bR.call(this,"light",t)}
${this.resolvedSpec.info.description}
`:z` - ${"dark"===this.theme?xR.call(this,"dark",t):xR.call(this,"light",t)} + ${"dark"===this.theme?bR.call(this,"dark",t):bR.call(this,"light",t)} - ${mR.call(this)} + ${fR.call(this)}

Header

@@ -3684,7 +3724,7 @@ pre[class*="language-"] {
`:this.resolvedSpec.isSpecLoading?z` - ${"dark"===this.theme?xR.call(this,"dark",t):xR.call(this,"light",t)} + ${"dark"===this.theme?bR.call(this,"dark",t):bR.call(this,"light",t)}
@@ -3692,15 +3732,15 @@ pre[class*="language-"] {
`:z` - ${"dark"===this.theme?xR.call(this,"dark",t):xR.call(this,"light",t)} + ${"dark"===this.theme?bR.call(this,"dark",t):bR.call(this,"light",t)} - ${"false"===this.showHeader?"":mR.call(this)} + ${"false"===this.showHeader?"":fR.call(this)}
- ${SR.call(this)} + ${kR.call(this)}
@@ -3709,14 +3749,14 @@ pre[class*="language-"] { ${!0===this.loading?z`
`:z` ${!0===this.loadFailed?z`
Unable to load the Spec
`:z`
- ${AR.call(this)} + ${SR.call(this)}
`}`}
- `}customElements.define("oauth-receiver",kR);customElements.define("json-schema-viewer",class extends ie{constructor(){super(),this.isMini=!1,this.updateRoute="false",this.renderStyle="focused",this.showHeader="true",this.allowAdvancedSearch="false",this.selectedExampleForEachSchema={}}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},loading:{type:Boolean}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` + `}customElements.define("oauth-receiver",$R);customElements.define("json-schema-viewer",class extends ie{constructor(){super(),this.isMini=!1,this.updateRoute="false",this.renderStyle="focused",this.showHeader="true",this.allowAdvancedSearch="false",this.selectedExampleForEachSchema={}}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},loading:{type:Boolean}}}static get styles(){return[Ke,Je,Ye,Ze,Qe,Xe,et,tt,rt,c` :host { display:flex; flex-direction: column; @@ -3802,5 +3842,5 @@ pre[class*="language-"] { .only-large-screen-flex{ display:flex; } - }`]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(0===e.offsetWidth&&""===e.style.width&&(e.style.width="100vw"),0===e.offsetHeight&&""===e.style.height&&(e.style.height="100vh"),"BODY"===e.tagName&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.renderStyle="focused",this.pathsExpanded="true"===this.pathsExpanded,this.showInfo&&"true, false,".includes(`${this.showInfo},`)||(this.showInfo="true"),this.showSideNav&&"true false".includes(this.showSideNav)||(this.showSideNav="true"),this.showHeader&&"true, false,".includes(`${this.showHeader},`)||(this.showHeader="true"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.allowSearch&&"true, false,".includes(`${this.allowSearch},`)||(this.allowSearch="true"),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e})}render(){return OR.call(this,!0,!1,!1,this.pathsExpanded)}attributeChangedCallback(e,t,r){"spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r)}),0),super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSearchChange(e){this.matchPaths=e.target.value}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}async afterSpecParsedAndValidated(e){this.resolvedSpec=e;const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}onSelectExample(e){[...e.target.closest(".json-schema-example-panel").querySelectorAll(".example")].forEach((t=>{t.style.display=t.dataset.example===e.target.value?"flex":"none"}))}async scrollToEventTarget(e){const t=e.currentTarget;if(!t.dataset.contentId)return;const r=this.shadowRoot.getElementById(t.dataset.contentId);r&&r.scrollIntoView({behavior:"auto",block:"start"})}})},874:()=>{!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,i=0;i{!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,r){return"(?:"+t[+r]+")"}))}function r(e,r,n){return RegExp(t(e,r),n||"")}function n(e,t){for(var r=0;r>/g,(function(){return"(?:"+e+")"}));return e.replace(/<>/g,"[^\\s\\S]")}var a="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",o="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",s="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(o),p=RegExp(l(a+" "+o+" "+i+" "+s)),d=l(o+" "+i+" "+s),u=l(a+" "+o+" "+s),h=n(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),f=n(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,y=t(/<<0>>(?:\s*<<1>>)?/.source,[m,h]),g=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,y]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[g,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[h,f,v]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),$=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,g,v]),k={keyword:p,punctuation:/[<>()?,.:[\]]/},S=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,A=/"(?:\\.|[^\\"\r\n])*"/.source,O=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[O]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[g]),lookbehind:!0,inside:k},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,$]),lookbehind:!0,inside:k},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[c,y]),lookbehind:!0,inside:k},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[g]),lookbehind:!0,inside:k},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:k},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[$,u,m]),inside:k}],keyword:p,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:k},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[$,g]),inside:k,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[$]),lookbehind:!0,inside:k,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,h]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(h),alias:"class-name",inside:k}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,y,m,$,p.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[y,f]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:p,"class-name":{pattern:RegExp($),greedy:!0,inside:k},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var E=A+"|"+S,T=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[E]),C=n(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[T]),2),j=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,_=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[g,C]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[j,_]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[j]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[C]),inside:e.languages.csharp},"class-name":{pattern:RegExp(g),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var P=/:[^}\r\n]+/.source,I=n(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[T]),2),R=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[I,P]),L=n(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[E]),2),D=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,P]);function F(t,n){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[n,P]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[R]),lookbehind:!0,greedy:!0,inside:F(R,I)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[D]),lookbehind:!0,greedy:!0,inside:F(D,L)}],char:{pattern:RegExp(S),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},251:()=>{!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(Prism)},46:()=>{Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"]},57:()=>{!function(e){function t(e){return RegExp("(^(?:"+e+"):[ \t]*(?![ \t]))[^]+","i")}e.languages.http={"request-line":{pattern:/^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:e.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[\d.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[\d.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[\d.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},header:{pattern:/^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,inside:{"header-value":[{pattern:t(/Content-Security-Policy/.source),lookbehind:!0,alias:["csp","languages-csp"],inside:e.languages.csp},{pattern:t(/Public-Key-Pins(?:-Report-Only)?/.source),lookbehind:!0,alias:["hpkp","languages-hpkp"],inside:e.languages.hpkp},{pattern:t(/Strict-Transport-Security/.source),lookbehind:!0,alias:["hsts","languages-hsts"],inside:e.languages.hsts},{pattern:t(/[^:]+/.source),lookbehind:!0}],"header-name":{pattern:/^[^:]+/,alias:"keyword"},punctuation:/^:/}}};var r,n=e.languages,a={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css,"text/plain":n.plain},o={"application/json":!0,"application/xml":!0};function i(e){var t=e.replace(/^[a-z]+\//,"");return"(?:"+e+"|"+("\\w+/(?:[\\w.-]+\\+)+"+t+"(?![+\\w.-])")+")"}for(var s in a)if(a[s]){r=r||{};var l=o[s]?i(s):s;r[s.replace(/\//g,"-")]={pattern:RegExp("("+/content-type:\s*/.source+l+/(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source+")"+/[^ \t\w-][\s\S]*/.source,"i"),lookbehind:!0,inside:a[s]}}r&&e.languages.insertBefore("http","header",r)}(Prism)},503:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,n={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[n,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:n.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:n.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":n,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:n.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:n.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},277:()=>{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},366:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},358:()=>{!function(e){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,n="(?:"+r.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var r=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return e}));return RegExp(r,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return n}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)},660:(e,t,r)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,n={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);k+=$.value.length,$=$.next){var S=$.value;if(t.length>e.length)return;if(!(S instanceof o)){var A,O=1;if(v){if(!(A=i(w,k,e,g))||A.index>=e.length)break;var E=A.index,T=A.index+A[0].length,C=k;for(C+=$.value.length;E>=C;)C+=($=$.next).value.length;if(k=C-=$.value.length,$.value instanceof o)continue;for(var j=$;j!==t.tail&&(Cd.reach&&(d.reach=R);var L=$.prev;if(P&&(L=c(t,L,P),k+=P.length),p(t,L,O),$=c(t,L,new o(u,y?a.tokenize(_,y):_,b,_)),I&&c(t,$,I),O>1){var D={cause:u+","+f,reach:R};s(e,t,r,$.prev,k,D),d&&D.reach>d.reach&&(d.reach=D.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,r){var n=t.next,a={value:r,prev:t,next:n};return t.next=a,n.prev=a,e.length++,a}function p(e,t,r){for(var n=t.next,a=0;a"+o.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var r=JSON.parse(t.data),n=r.language,o=r.code,i=r.immediateClose;e.postMessage(a.highlight(o,a.languages[n],n)),i&&e.close()}),!1),a):a;var d=a.util.currentScript();function u(){a.manual||a.highlightAll()}if(d&&(a.filename=d.src,d.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&d&&d.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return a}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=n),void 0!==r.g&&(r.g.Prism=n),n.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:r}};a["language-"+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(void 0!==n&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",r="loading",a="loaded",o='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])';n.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),n.hooks.add("before-sanity-check",(function(i){var s=i.element;if(s.matches(o)){i.code="",s.setAttribute(t,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),p=i.language;if("none"===p){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];p=e[d]||d}n.util.setLanguage(l,p),n.util.setLanguage(s,p);var u=n.plugins.autoloader;u&&u.loadLanguages(p),function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4==n.readyState&&(n.status<400&&n.responseText?t(n.responseText):n.status>=400?r("✖ Error "+n.status+" while fetching file: "+n.statusText):r("✖ Error: File does not exist or is empty"))},n.send(null)}(c,(function(e){s.setAttribute(t,a);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var r=Number(t[1]),n=t[2],a=t[3];return n?a?[r,Number(a)]:[r,void 0]:[r,r]}}(s.getAttribute("data-range"));if(r){var o=e.split(/\r\n?|\n/g),i=r[0],c=null==r[1]?o.length:r[1];i<0&&(i+=o.length),i=Math.max(0,Math.min(i-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),e=o.slice(i,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(i+1))}l.textContent=e,n.highlightElement(l)}),(function(e){s.setAttribute(t,"failed"),l.textContent=e}))}})),n.plugins.fileHighlight={highlight:function(e){for(var t,r=(e||document).querySelectorAll(o),a=0;t=r[a++];)n.highlightElement(t)}};var i=!1;n.fileHighlight=function(){i||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),i=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},464:e=>{"use strict";var t,r="";e.exports=function(e,n){if("string"!=typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var a=e.length*n;if(t!==e||void 0===t)t=e,r="";else if(r.length>=a)return r.substr(0,a);for(;a>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,a)}},131:(e,t,r)=>{"use strict";var n=r(464),a=function(e){return/<\/+[^>]+>/.test(e)},o=function(e){return/<[^>]+\/>/.test(e)};function i(e){return e.split(/(<\/?[^>]+>)/g).filter((function(e){return""!==e.trim()})).map((function(e){return{value:e,type:s(e)}}))}function s(e){return a(e)?"ClosingTag":function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!a(e)&&!o(e)}(e)?"OpeningTag":o(e)?"SelfClosingTag":"Text"}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.indentor,a=t.textNodesOnSameLine,o=0,s=[];r=r||" ";var l=i(e).map((function(e,t,i){var l=e.value,c=e.type;"ClosingTag"===c&&o--;var p=n(r,o),d=p+l;if("OpeningTag"===c&&o++,a){var u=i[t-1],h=i[t-2];"ClosingTag"===c&&"Text"===u.type&&"OpeningTag"===h.type&&(d=""+p+h.value+u.value+l,s.push(t-2,t-1))}return d}));return s.forEach((function(e){return l[e]=null})),l.filter((function(e){return!!e})).join("\n")}}},n={};function a(e){var t=n[e];if(void 0!==t){if(void 0!==t.error)throw t.error;return t.exports}var o=n[e]={exports:{}};try{var i={id:e,module:o,factory:r[e],require:a};a.i.forEach((function(e){e(i)})),o=i.module,i.factory.call(o.exports,o,o.exports,i.require)}catch(e){throw o.error=e,e}return o.exports}a.m=r,a.c=n,a.i=[],a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.hu=e=>e+"."+a.h()+".hot-update.js",a.hmrF=()=>"main."+a.h()+".hot-update.json",a.h=()=>"a9b439cc52935489ce5a",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="rapidoc:",a.l=(r,n,o,i)=>{if(e[r])e[r].push(n);else{var s,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),p=0;p{s.onerror=s.onload=null,clearTimeout(h);var a=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((e=>e(n))),t)return t(n)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),l&&document.head.appendChild(s)}},(()=>{var e,t,r,n={},o=a.c,i=[],s=[],l="idle",c=0,p=[];function d(e){l=e;for(var t=[],r=0;r0)return d("abort").then((function(){throw a[0]}));var o=d("dispose");n.forEach((function(e){e.dispose&&e.dispose()}));var i,s=d("apply"),l=function(e){i||(i=e)},c=[];return n.forEach((function(e){if(e.apply){var t=e.apply(l);if(t)for(var r=0;r=0&&v._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,l){case"idle":t=[],Object.keys(a.hmrI).forEach((function(e){a.hmrI[e](m,t)})),d("ready");break;case"ready":Object.keys(a.hmrI).forEach((function(e){a.hmrI[e](m,t)}));break;case"prepare":case"check":case"dispose":case"apply":(r=r||[]).push(m)}},check:h,apply:f,status:function(e){if(!e)return l;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var t=s.indexOf(e);t>=0&&s.splice(t,1)},data:n[m]},e=void 0,v),b.parents=i,b.children=[],i=[],p.require=x})),a.hmrC={},a.hmrI={}})(),a.p="",(()=>{var e,t,r,n,o,i=a.hmrS_jsonp=a.hmrS_jsonp||{179:0},s={};function l(t,r){return e=r,new Promise(((e,r)=>{s[t]=e;var n=a.p+a.hu(t),o=new Error;a.l(n,(e=>{if(s[t]){s[t]=void 0;var n=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src;o.message="Loading hot update chunk "+t+" failed.\n("+n+": "+a+")",o.name="ChunkLoadError",o.type=n,o.request=a,r(o)}}))}))}function c(e){function s(e){for(var t=[e],r={},n=t.map((function(e){return{chain:[e],id:e}}));n.length>0;){var o=n.pop(),i=o.id,s=o.chain,c=a.c[i];if(c&&(!c.hot._selfAccepted||c.hot._selfInvalidated)){if(c.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:i};if(c.hot._main)return{type:"unaccepted",chain:s,moduleId:i};for(var p=0;p ")),f.type){case"self-declined":e.onDeclined&&e.onDeclined(f),e.ignoreDeclined||(y=new Error("Aborted because of self decline: "+f.moduleId+b));break;case"declined":e.onDeclined&&e.onDeclined(f),e.ignoreDeclined||(y=new Error("Aborted because of declined dependency: "+f.moduleId+" in "+f.parentId+b));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(f),e.ignoreUnaccepted||(y=new Error("Aborted because "+h+" is not accepted"+b));break;case"accepted":e.onAccepted&&e.onAccepted(f),g=!0;break;case"disposed":e.onDisposed&&e.onDisposed(f),v=!0;break;default:throw new Error("Unexception type "+f.type)}if(y)return{error:y};if(g)for(h in d[h]=m,l(p,f.outdatedModules),f.outdatedDependencies)a.o(f.outdatedDependencies,h)&&(c[h]||(c[h]=[]),l(c[h],f.outdatedDependencies[h]));v&&(l(p,[f.moduleId]),d[h]=u)}r=void 0;for(var x,w=[],$=0;$0;){var o=r.pop(),s=a.c[o];if(s){var l={},d=s.hot._disposeHandlers;for($=0;$=0&&u.parents.splice(e,1))}}}for(var h in c)if(a.o(c,h)&&(s=a.c[h]))for(x=c[h],$=0;$=0&&s.children.splice(e,1)},apply:function(t){for(var r in d)a.o(d,r)&&(a.m[r]=d[r]);for(var n=0;n{for(var l in n)a.o(n,l)&&(r[l]=n[l],e&&e.push(l));i&&o.push(i),s[t]&&(s[t](),s[t]=void 0)},a.hmrI.jsonp=function(e,t){r||(r={},o=[],n=[],t.push(c)),a.o(r,e)||(r[e]=a.m[e])},a.hmrC.jsonp=function(e,s,p,d,u,h){u.push(c),t={},n=s,r=p.reduce((function(e,t){return e[t]=!1,e}),{}),o=[],e.forEach((function(e){a.o(i,e)&&void 0!==i[e]?(d.push(l(e,h)),t[e]=!0):t[e]=!1})),a.f&&(a.f.jsonpHmr=function(e,r){t&&a.o(t,e)&&!t[e]&&(r.push(l(e)),t[e]=!0)})},a.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(a.p+a.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})();a(656)})(); + }`]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(0===e.offsetWidth&&""===e.style.width&&(e.style.width="100vw"),0===e.offsetHeight&&""===e.style.height&&(e.style.height="100vh"),"BODY"===e.tagName&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),"false"!==this.loadFonts){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then((e=>{document.fonts.add(e)})),r.load().then((e=>{document.fonts.add(e)}))}this.renderStyle="focused",this.pathsExpanded="true"===this.pathsExpanded,this.showInfo&&"true, false,".includes(`${this.showInfo},`)||(this.showInfo="true"),this.showSideNav&&"true false".includes(this.showSideNav)||(this.showSideNav="true"),this.showHeader&&"true, false,".includes(`${this.showHeader},`)||(this.showHeader="true"),this.schemaStyle&&"tree, table,".includes(`${this.schemaStyle},`)||(this.schemaStyle="tree"),this.theme&&"light, dark,".includes(`${this.theme},`)||(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),this.allowSearch&&"true, false,".includes(`${this.allowSearch},`)||(this.allowSearch="true"),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),this.schemaDescriptionExpanded&&"true, false,".includes(`${this.schemaDescriptionExpanded},`)||(this.schemaDescriptionExpanded="false"),this.fontSize&&"default, large, largest,".includes(`${this.fontSize},`)||(this.fontSize="default"),this.matchType&&"includes regex".includes(this.matchType)||(this.matchType="includes"),this.allowSchemaDescriptionExpandToggle&&"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`)||(this.allowSchemaDescriptionExpandToggle="true"),We.setOptions({highlight:(e,t)=>Ge().languages[t]?Ge().highlight(e,Ge().languages[t],t):e})}render(){return AR.call(this,!0,!1,!1,this.pathsExpanded)}attributeChangedCallback(e,t,r){"spec-url"===e&&t!==r&&window.setTimeout((async()=>{await this.loadSpec(r)}),0),super.attributeChangedCallback(e,t,r)}onSepcUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSearchChange(e){this.matchPaths=e.target.value}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await MP.call(this,e,"true"===this.generateMissingTags,"true"===this.sortTags,this.getAttribute("sort-endpoints-by"));this.loading=!1,this.afterSpecParsedAndValidated(t)}catch(e){this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null,console.error(`RapiDoc: Unable to resolve the API spec.. ${e.message}`)}}async afterSpecParsedAndValidated(e){this.resolvedSpec=e;const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if("a"===e.target.tagName.toLowerCase()&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}onSelectExample(e){[...e.target.closest(".json-schema-example-panel").querySelectorAll(".example")].forEach((t=>{t.style.display=t.dataset.example===e.target.value?"flex":"none"}))}async scrollToEventTarget(e){const t=e.currentTarget;if(!t.dataset.contentId)return;const r=this.shadowRoot.getElementById(t.dataset.contentId);r&&r.scrollIntoView({behavior:"auto",block:"start"})}})},874:()=>{!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,i=0;i{!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,r){return"(?:"+t[+r]+")"}))}function r(e,r,n){return RegExp(t(e,r),n||"")}function n(e,t){for(var r=0;r>/g,(function(){return"(?:"+e+")"}));return e.replace(/<>/g,"[^\\s\\S]")}var a="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",o="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",s="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(o),p=RegExp(l(a+" "+o+" "+i+" "+s)),d=l(o+" "+i+" "+s),u=l(a+" "+o+" "+s),h=n(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),f=n(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,y=t(/<<0>>(?:\s*<<1>>)?/.source,[m,h]),g=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,y]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[g,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[h,f,v]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),$=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,g,v]),k={keyword:p,punctuation:/[<>()?,.:[\]]/},S=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,A=/"(?:\\.|[^\\"\r\n])*"/.source,O=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[O]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[g]),lookbehind:!0,inside:k},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,$]),lookbehind:!0,inside:k},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[c,y]),lookbehind:!0,inside:k},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[g]),lookbehind:!0,inside:k},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:k},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[$,u,m]),inside:k}],keyword:p,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:k},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[$,g]),inside:k,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[$]),lookbehind:!0,inside:k,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,h]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(h),alias:"class-name",inside:k}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,y,m,$,p.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[y,f]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:p,"class-name":{pattern:RegExp($),greedy:!0,inside:k},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var E=A+"|"+S,T=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[E]),C=n(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[T]),2),j=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,_=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[g,C]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[j,_]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[j]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[C]),inside:e.languages.csharp},"class-name":{pattern:RegExp(g),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var P=/:[^}\r\n]+/.source,I=n(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[T]),2),R=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[I,P]),L=n(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[E]),2),D=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,P]);function F(t,n){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[n,P]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[R]),lookbehind:!0,greedy:!0,inside:F(R,I)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[D]),lookbehind:!0,greedy:!0,inside:F(D,L)}],char:{pattern:RegExp(S),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},251:()=>{!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(Prism)},46:()=>{Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"]},57:()=>{!function(e){function t(e){return RegExp("(^(?:"+e+"):[ \t]*(?![ \t]))[^]+","i")}e.languages.http={"request-line":{pattern:/^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:e.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[\d.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[\d.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[\d.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},header:{pattern:/^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,inside:{"header-value":[{pattern:t(/Content-Security-Policy/.source),lookbehind:!0,alias:["csp","languages-csp"],inside:e.languages.csp},{pattern:t(/Public-Key-Pins(?:-Report-Only)?/.source),lookbehind:!0,alias:["hpkp","languages-hpkp"],inside:e.languages.hpkp},{pattern:t(/Strict-Transport-Security/.source),lookbehind:!0,alias:["hsts","languages-hsts"],inside:e.languages.hsts},{pattern:t(/[^:]+/.source),lookbehind:!0}],"header-name":{pattern:/^[^:]+/,alias:"keyword"},punctuation:/^:/}}};var r,n=e.languages,a={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css,"text/plain":n.plain},o={"application/json":!0,"application/xml":!0};function i(e){var t=e.replace(/^[a-z]+\//,"");return"(?:"+e+"|"+("\\w+/(?:[\\w.-]+\\+)+"+t+"(?![+\\w.-])")+")"}for(var s in a)if(a[s]){r=r||{};var l=o[s]?i(s):s;r[s.replace(/\//g,"-")]={pattern:RegExp("("+/content-type:\s*/.source+l+/(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source+")"+/[^ \t\w-][\s\S]*/.source,"i"),lookbehind:!0,inside:a[s]}}r&&e.languages.insertBefore("http","header",r)}(Prism)},503:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,n={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[n,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:n.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:n.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":n,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:n.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:n.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},277:()=>{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},366:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},358:()=>{!function(e){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,n="(?:"+r.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+r.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var r=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return e}));return RegExp(r,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return n}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)},660:(e,t,r)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,n={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);k+=$.value.length,$=$.next){var S=$.value;if(t.length>e.length)return;if(!(S instanceof o)){var A,O=1;if(v){if(!(A=i(w,k,e,g))||A.index>=e.length)break;var E=A.index,T=A.index+A[0].length,C=k;for(C+=$.value.length;E>=C;)C+=($=$.next).value.length;if(k=C-=$.value.length,$.value instanceof o)continue;for(var j=$;j!==t.tail&&(Cd.reach&&(d.reach=R);var L=$.prev;if(P&&(L=c(t,L,P),k+=P.length),p(t,L,O),$=c(t,L,new o(u,y?a.tokenize(_,y):_,b,_)),I&&c(t,$,I),O>1){var D={cause:u+","+f,reach:R};s(e,t,r,$.prev,k,D),d&&D.reach>d.reach&&(d.reach=D.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,r){var n=t.next,a={value:r,prev:t,next:n};return t.next=a,n.prev=a,e.length++,a}function p(e,t,r){for(var n=t.next,a=0;a"+o.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var r=JSON.parse(t.data),n=r.language,o=r.code,i=r.immediateClose;e.postMessage(a.highlight(o,a.languages[n],n)),i&&e.close()}),!1),a):a;var d=a.util.currentScript();function u(){a.manual||a.highlightAll()}if(d&&(a.filename=d.src,d.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&d&&d.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return a}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=n),void 0!==r.g&&(r.g.Prism=n),n.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:r}};a["language-"+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(void 0!==n&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",r="loading",a="loaded",o='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])';n.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),n.hooks.add("before-sanity-check",(function(i){var s=i.element;if(s.matches(o)){i.code="",s.setAttribute(t,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),p=i.language;if("none"===p){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];p=e[d]||d}n.util.setLanguage(l,p),n.util.setLanguage(s,p);var u=n.plugins.autoloader;u&&u.loadLanguages(p),function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4==n.readyState&&(n.status<400&&n.responseText?t(n.responseText):n.status>=400?r("✖ Error "+n.status+" while fetching file: "+n.statusText):r("✖ Error: File does not exist or is empty"))},n.send(null)}(c,(function(e){s.setAttribute(t,a);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var r=Number(t[1]),n=t[2],a=t[3];return n?a?[r,Number(a)]:[r,void 0]:[r,r]}}(s.getAttribute("data-range"));if(r){var o=e.split(/\r\n?|\n/g),i=r[0],c=null==r[1]?o.length:r[1];i<0&&(i+=o.length),i=Math.max(0,Math.min(i-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),e=o.slice(i,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(i+1))}l.textContent=e,n.highlightElement(l)}),(function(e){s.setAttribute(t,"failed"),l.textContent=e}))}})),n.plugins.fileHighlight={highlight:function(e){for(var t,r=(e||document).querySelectorAll(o),a=0;t=r[a++];)n.highlightElement(t)}};var i=!1;n.fileHighlight=function(){i||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),i=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},464:e=>{"use strict";var t,r="";e.exports=function(e,n){if("string"!=typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var a=e.length*n;if(t!==e||void 0===t)t=e,r="";else if(r.length>=a)return r.substr(0,a);for(;a>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,a)}},131:(e,t,r)=>{"use strict";var n=r(464),a=function(e){return/<\/+[^>]+>/.test(e)},o=function(e){return/<[^>]+\/>/.test(e)};function i(e){return e.split(/(<\/?[^>]+>)/g).filter((function(e){return""!==e.trim()})).map((function(e){return{value:e,type:s(e)}}))}function s(e){return a(e)?"ClosingTag":function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!a(e)&&!o(e)}(e)?"OpeningTag":o(e)?"SelfClosingTag":"Text"}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.indentor,a=t.textNodesOnSameLine,o=0,s=[];r=r||" ";var l=i(e).map((function(e,t,i){var l=e.value,c=e.type;"ClosingTag"===c&&o--;var p=n(r,o),d=p+l;if("OpeningTag"===c&&o++,a){var u=i[t-1],h=i[t-2];"ClosingTag"===c&&"Text"===u.type&&"OpeningTag"===h.type&&(d=""+p+h.value+u.value+l,s.push(t-2,t-1))}return d}));return s.forEach((function(e){return l[e]=null})),l.filter((function(e){return!!e})).join("\n")}}},n={};function a(e){var t=n[e];if(void 0!==t){if(void 0!==t.error)throw t.error;return t.exports}var o=n[e]={exports:{}};try{var i={id:e,module:o,factory:r[e],require:a};a.i.forEach((function(e){e(i)})),o=i.module,i.factory.call(o.exports,o,o.exports,i.require)}catch(e){throw o.error=e,e}return o.exports}a.m=r,a.c=n,a.i=[],a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.hu=e=>e+"."+a.h()+".hot-update.js",a.hmrF=()=>"main."+a.h()+".hot-update.json",a.h=()=>"f1b027d929a1ed21ea97",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="rapidoc:",a.l=(r,n,o,i)=>{if(e[r])e[r].push(n);else{var s,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),p=0;p{s.onerror=s.onload=null,clearTimeout(h);var a=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((e=>e(n))),t)return t(n)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),l&&document.head.appendChild(s)}},(()=>{var e,t,r,n={},o=a.c,i=[],s=[],l="idle",c=0,p=[];function d(e){l=e;for(var t=[],r=0;r0)return d("abort").then((function(){throw a[0]}));var o=d("dispose");n.forEach((function(e){e.dispose&&e.dispose()}));var i,s=d("apply"),l=function(e){i||(i=e)},c=[];return n.forEach((function(e){if(e.apply){var t=e.apply(l);if(t)for(var r=0;r=0&&v._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,l){case"idle":t=[],Object.keys(a.hmrI).forEach((function(e){a.hmrI[e](m,t)})),d("ready");break;case"ready":Object.keys(a.hmrI).forEach((function(e){a.hmrI[e](m,t)}));break;case"prepare":case"check":case"dispose":case"apply":(r=r||[]).push(m)}},check:h,apply:f,status:function(e){if(!e)return l;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var t=s.indexOf(e);t>=0&&s.splice(t,1)},data:n[m]},e=void 0,v),b.parents=i,b.children=[],i=[],p.require=x})),a.hmrC={},a.hmrI={}})(),a.p="",(()=>{var e,t,r,n,o,i=a.hmrS_jsonp=a.hmrS_jsonp||{179:0},s={};function l(t,r){return e=r,new Promise(((e,r)=>{s[t]=e;var n=a.p+a.hu(t),o=new Error;a.l(n,(e=>{if(s[t]){s[t]=void 0;var n=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src;o.message="Loading hot update chunk "+t+" failed.\n("+n+": "+a+")",o.name="ChunkLoadError",o.type=n,o.request=a,r(o)}}))}))}function c(e){function s(e){for(var t=[e],r={},n=t.map((function(e){return{chain:[e],id:e}}));n.length>0;){var o=n.pop(),i=o.id,s=o.chain,c=a.c[i];if(c&&(!c.hot._selfAccepted||c.hot._selfInvalidated)){if(c.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:i};if(c.hot._main)return{type:"unaccepted",chain:s,moduleId:i};for(var p=0;p ")),f.type){case"self-declined":e.onDeclined&&e.onDeclined(f),e.ignoreDeclined||(y=new Error("Aborted because of self decline: "+f.moduleId+b));break;case"declined":e.onDeclined&&e.onDeclined(f),e.ignoreDeclined||(y=new Error("Aborted because of declined dependency: "+f.moduleId+" in "+f.parentId+b));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(f),e.ignoreUnaccepted||(y=new Error("Aborted because "+h+" is not accepted"+b));break;case"accepted":e.onAccepted&&e.onAccepted(f),g=!0;break;case"disposed":e.onDisposed&&e.onDisposed(f),v=!0;break;default:throw new Error("Unexception type "+f.type)}if(y)return{error:y};if(g)for(h in d[h]=m,l(p,f.outdatedModules),f.outdatedDependencies)a.o(f.outdatedDependencies,h)&&(c[h]||(c[h]=[]),l(c[h],f.outdatedDependencies[h]));v&&(l(p,[f.moduleId]),d[h]=u)}r=void 0;for(var x,w=[],$=0;$0;){var o=r.pop(),s=a.c[o];if(s){var l={},d=s.hot._disposeHandlers;for($=0;$=0&&u.parents.splice(e,1))}}}for(var h in c)if(a.o(c,h)&&(s=a.c[h]))for(x=c[h],$=0;$=0&&s.children.splice(e,1)},apply:function(t){for(var r in d)a.o(d,r)&&(a.m[r]=d[r]);for(var n=0;n{for(var l in n)a.o(n,l)&&(r[l]=n[l],e&&e.push(l));i&&o.push(i),s[t]&&(s[t](),s[t]=void 0)},a.hmrI.jsonp=function(e,t){r||(r={},o=[],n=[],t.push(c)),a.o(r,e)||(r[e]=a.m[e])},a.hmrC.jsonp=function(e,s,p,d,u,h){u.push(c),t={},n=s,r=p.reduce((function(e,t){return e[t]=!1,e}),{}),o=[],e.forEach((function(e){a.o(i,e)&&void 0!==i[e]?(d.push(l(e,h)),t[e]=!0):t[e]=!1})),a.f&&(a.f.jsonpHmr=function(e,r){t&&a.o(t,e)&&!t[e]&&(r.push(l(e)),t[e]=!0)})},a.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(a.p+a.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})();a(656)})(); //# sourceMappingURL=rapidoc-min.js.map \ No newline at end of file diff --git a/docs/rapidoc.js b/docs/rapidoc.js index 6ffcc5b0..a270da17 100644 --- a/docs/rapidoc.js +++ b/docs/rapidoc.js @@ -3257,15 +3257,6 @@ input[type="password"]::placeholder { opacity:1; } -select:focus, -textarea:focus, -input[type="text"]:focus, -input[type="password"]:focus, -textarea:active, -input[type="text"]:active, -input[type="password"]:active { - border:1px solid var(--primary-color); -} input[type="file"]{ font-family: var(--font-regular); @@ -3319,10 +3310,6 @@ textarea::-webkit-scrollbar-thumb { margin-bottom:2px; } -input[type="checkbox"]:focus{ - outline:0; -} - /* Toggle Body */ input[type="checkbox"] { appearance: none; @@ -3355,7 +3342,7 @@ input[type="checkbox"]:after { /* Toggle Body - Checked */ input[type="checkbox"]:checked { - box-shadow: inset 0 0 0 13px var(--green); + background-color: var(--green); border-color: var(--green); } /* Toggle Thumb - Checked*/ @@ -3364,8 +3351,7 @@ input[type="checkbox"]:checked:after { left: 16px; right: 1px; transition: border .25s, left .15s .25s, right .25s .175s; -} -`); +}`); ;// CONCATENATED MODULE: ./src/styles/flex-styles.js /* harmony default export */ const flex_styles = (i` @@ -3751,6 +3737,7 @@ pre[class*="language-"] { } .tab-buttons { height:30px; + padding: 4px 4px 0 4px; border-bottom: 1px solid var(--light-border-color) ; align-items: stretch; overflow-y: hidden; @@ -3792,6 +3779,20 @@ pre[class*="language-"] { ;// CONCATENATED MODULE: ./src/styles/nav-styles.js /* harmony default export */ const nav_styles = (i` +.nav-bar-info:focus-visible, +.nav-bar-tag:focus-visible, +.nav-bar-path:focus-visible { + outline: 1px solid; + box-shadow: none; + outline-offset: -4px; +} +.nav-bar-expand-all:focus-visible, +.nav-bar-collapse-all:focus-visible, +.nav-bar-tag-icon:focus-visible { + outline: 1px solid; + box-shadow: none; + outline-offset: 2px; +} .nav-bar { width:0; height:100%; @@ -3828,7 +3829,23 @@ pre[class*="language-"] { } .nav-bar-paths-under-tag { overflow:hidden; - transition: max-height .2s ease-out; + transition: max-height .2s ease-out, visibility .3s; +} +.collapsed .nav-bar-paths-under-tag { + visibility: hidden; +} + +.nav-bar-expand-all { + transform: rotate(90deg); + cursor:pointer; + margin-right:10px; +} +.nav-bar-collapse-all { + transform: rotate(270deg); + cursor:pointer; +} +.nav-bar-expand-all:hover, .nav-bar-collapse-all:hover { + color: var(--primary-color); } .nav-bar-tag-icon { @@ -14006,6 +14023,8 @@ class JsonTree extends lit_element_s { :host{ display:flex; } + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } .json-tree { position: relative; font-family: var(--font-mono); @@ -14584,7 +14603,7 @@ class TagInput extends lit_element_s { } return y` -
+
${tagItemTmpl}
@@ -14669,7 +14688,7 @@ class TagInput extends lit_element_s { static get styles() { return [i` - .tags{ + .tags { display:flex; flex-wrap: wrap; outline: none; @@ -14695,7 +14714,7 @@ class TagInput extends lit_element_s { .tag:hover ~ #cursor { display: block; } - .editor{ + .editor { flex:1; border:1px solid transparent; color:var(--fg); @@ -14706,6 +14725,9 @@ class TagInput extends lit_element_s { background:transparent; font-size: calc(var(--font-size-small) + 1px); } + .editor:focus-visible { + outline: 1px solid; + } .editor::placeholder { color: var(--placeholder-color); opacity:1; @@ -14888,7 +14910,9 @@ class ApiRequest extends lit_element_s { static get styles() { return [table_styles, input_styles, font_styles, flex_styles, border_styles, tab_styles, prism_styles, i` *, *:before, *:after { box-sizing: border-box; } - + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } + tag-input:focus-within { outline: 1px solid;} .read-mode { margin-top: 24px; } @@ -15124,7 +15148,7 @@ class ApiRequest extends lit_element_s { const [declaredParamSchema, serializeStyle, mimeTypeElem] = getSchemaFromParam(param); if (!declaredParamSchema) { - continue; // eslint-disable-line no-continue + continue; } const paramSchema = getTypeInfo(declaredParamSchema); @@ -15990,7 +16014,7 @@ class ApiRequest extends lit_element_s { } } } catch (err) { - console.log('RapiDoc: unable to parse %s into object', el.value); // eslint-disable-line no-console + console.error('RapiDoc: unable to parse %s into object', el.value); // eslint-disable-line no-console } if (queryParam.toString()) { @@ -16806,6 +16830,8 @@ class ApiResponse extends lit_element_s { static get styles() { return [font_styles, flex_styles, tab_styles, table_styles, input_styles, border_styles, i` + :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); } + :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); } .resp-head{ vertical-align: middle; padding:16px 0 8px; @@ -17188,13 +17214,13 @@ function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') { `} `} ${path.description ? y`
${unsafe_html_o(marked(path.description))}
` : ''} + ${pathSecurityTemplate.call(this, path.security)} ${(_path$externalDocs = path.externalDocs) !== null && _path$externalDocs !== void 0 && _path$externalDocs.url || (_path$externalDocs2 = path.externalDocs) !== null && _path$externalDocs2 !== void 0 && _path$externalDocs2.description ? y`
${unsafe_html_o(marked(((_path$externalDocs3 = path.externalDocs) === null || _path$externalDocs3 === void 0 ? void 0 : _path$externalDocs3.description) || ''))}
${(_path$externalDocs4 = path.externalDocs) !== null && _path$externalDocs4 !== void 0 && _path$externalDocs4.url ? y`` : ''}
` : ''} - ${pathSecurityTemplate.call(this, path.security)} ${codeSampleTabPanel}
`} - ${y`