{"version":3,"file":"index-DguGEE2i.js","sources":["../../../app/assets/javascripts/app/assets_info_store/index.ts"],"sourcesContent":["\nimport _memoize from \"lodash/memoize\"\nimport _once from \"lodash/once\"\nimport Promise from \"plugins/bluebird/index\"\n\nimport q_ajax_3 from \"app/utils/q_ajax/q_ajax_3\"\n\nconst getFetchAllAssetInfoPromise = _once(() => {\n return q_ajax_3(\n {\n url: \"/apps/spacious_website/assets\",\n type: \"GET\",\n },\n {\n error_tracking_options: {\n endpoint_identifier: \"app/assets/javascripts/app/assets_info_store#fetch\",\n },\n },\n )\n})\n\nconst fetch = _memoize((logical_path: string): Promise<{url: string}> => {\n return getFetchAllAssetInfoPromise()\n .then(({data}) => {\n if (logical_path in data) {\n return data[logical_path]\n }\n\n throw new Error(`asset with logical_path absent: <${logical_path}>`)\n })\n})\n\nexport default {\n fetch,\n}\n"],"names":["getFetchAllAssetInfoPromise","_once","q_ajax_3","fetch","_memoize","logical_path","data","AssetsInfoStore"],"mappings":"0HAOA,MAAMA,EAA8BC,EAAM,IACjCC,EACL,CACE,IAAS,gCACT,KAAS,KACX,EACA,CACE,uBAAwB,CACtB,oBAAqB,oDAAA,CACvB,CAEJ,CACD,EAEKC,EAAQC,EAAUC,GACfL,IACN,KAAK,CAAC,CAAC,KAAAM,KAAU,CAChB,GAAID,KAAgBC,EAClB,OAAOA,EAAKD,CAAY,EAG1B,MAAM,IAAI,MAAM,oCAAoC,OAAAA,EAAY,IAAG,CAAA,CACpE,CACF,EAEcE,EAAA,CACb,MAAAJ,CACF"}