"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useAsyncAPICodeSnippetLanguages=void 0;var a=require("react"),b=require("./../code-snippets/constants.js"),c=require("../contexts/ApiHandler");function d(a,b){return j(a)||h(a,b)||f(a,b)||e()}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(a,b){if(a){if("string"==typeof a)return g(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?g(a,b):void 0}}function g(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function h(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f=[],g=!0,h=!1;try{for(c=c.call(a);!(g=(d=c.next()).done)&&(f.push(d.value),!(b&&f.length===b));g=!0);}catch(a){h=!0,e=a}finally{try{g||null==c["return"]||c["return"]()}finally{if(h)throw e}}return f}}function j(a){if(Array.isArray(a))return a}var k=function(e,f){var g=(0,c.useApi)(),h=g.apiHandler,i=(0,a.useState)([]),j=d(i,2),k=j[0],l=j[1];return(0,a.useEffect)(function(){l(Object.values(b.codeLanguages).filter(function(a){return a!==b.codeLanguages.kafkacat&&a!==b.codeLanguages.consoleConsumer||!(h.isAvroSchema(e)&&"application/json"!==f)}))},[e,h,f]),k};exports.useAsyncAPICodeSnippetLanguages=k;