const e=require(`./serialize.utils.cjs`),t=require(`../../constants/chains.constants.cjs`);require(`idb-keyval`);var n={encryptedOutputs:[],lastOutput:``},r=(e,t)=>({shortPublicKey:e.substring(0,25),shortHinkalAddress:t.substring(0,25)}),i=(e,t,n)=>`hinkalCache-${e}-${t}-${n}`,a=(a,o,s)=>{let{hinkalAddress:c}=t.networkRegistry[o].contractData;if(!o||!s||!c)throw Error(`GetHinkalCache: incorrect arguments`);let{shortPublicKey:l,shortHinkalAddress:u}=r(s,c);return JSON.parse(a.cacheDevice.get(i(o,l,u))??e.safeJsonStringify(n))},o=(n,a,o,s)=>{let{hinkalAddress:c}=t.networkRegistry[o].contractData;if(!o||!s||!c)throw Error(`SetHinkalCache: incorrect arguments`);let{shortPublicKey:l,shortHinkalAddress:u}=r(s,c);a.cacheDevice.set(i(o,l,u),e.safeJsonStringify(n))},s=(e,t,r)=>{o(n,e,t,r)};exports.getFilePath=i,exports.getHinkalCache=a,exports.resetCache=s,exports.setHinkalCache=o;