rhua-chatgpt-web 1.0.98 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{api_chain-wgmc7e6E.js → api_chain-6WuaFa6d.js} +2 -2
  2. package/dist/{api_chain-CB8GWGIU.cjs → api_chain-z7-hferR.cjs} +1 -1
  3. package/dist/{combine_docs_chain-DgONM3Mw.cjs → combine_docs_chain-CFAXRlyi.cjs} +1 -1
  4. package/dist/{combine_docs_chain-C4dphi5e.js → combine_docs_chain-CO7HVb4R.js} +2 -2
  5. package/dist/{few_shot-CAlLA7_Y.js → few_shot-D1fV7wmE.js} +1 -1
  6. package/dist/{few_shot-D1R-zNl7.cjs → few_shot-GynjP3JZ.cjs} +1 -1
  7. package/dist/{index-Bg5840_w.js → index-B3AeHb0J.js} +1 -1
  8. package/dist/{index-D6StpCel.cjs → index-BcePyLfy.cjs} +1 -1
  9. package/dist/{index-r3AjaSlS.cjs → index-BdHsAk36.cjs} +1 -1
  10. package/dist/index-BiyXJ5nZ.js +4 -0
  11. package/dist/{index-DWSafnCg.cjs → index-BjVIOIdk.cjs} +1 -1
  12. package/dist/index-C4FSTC-Y.js +4 -0
  13. package/dist/{index-DMb9FQJU.cjs → index-CFCSEDxn.cjs} +1 -1
  14. package/dist/{index-Dt6MdEi3.cjs → index-CMmMjajZ.cjs} +1 -1
  15. package/dist/{index-BN7_2Vpx.js → index-CYZSWzuu.js} +2 -2
  16. package/dist/{index-BbYqG4Lp.js → index-Cfz7TnCH.js} +192 -157
  17. package/dist/{index-CymPiKxB.js → index-D0o12JtU.js} +1 -1
  18. package/dist/{index-Bg42RK-4.js → index-DKYlRoiR.js} +2 -2
  19. package/dist/{index-D8gIJjM_.cjs → index-DL_ocleL.cjs} +1 -1
  20. package/dist/{index-CjSvTRsR.cjs → index-DaVkrct-.cjs} +1 -1
  21. package/dist/index-De7_kMn7.js +4 -0
  22. package/dist/{index-cTMOFBXD.cjs → index-Dift2gpr.cjs} +1 -1
  23. package/dist/{index-CI8OM2Jz.js → index-Dkq6Ss_h.js} +1 -1
  24. package/dist/{index-CjmBLRKu.cjs → index-DsPuml45.cjs} +3 -3
  25. package/dist/index-Gi2kGbCW.js +4 -0
  26. package/dist/{index-BekrpxaM.cjs → index-KDG7mz5O.cjs} +1 -1
  27. package/dist/{index-C1T2elxu.js → index-PRwtvON1.js} +1 -1
  28. package/dist/{index-DrDcayhM.js → index-gI4Ks2P3.js} +1 -1
  29. package/dist/{index-Cd_gRf5s.cjs → index-jr5i21r1.cjs} +1 -1
  30. package/dist/{index-CfwXktuP.cjs → index-oel1bTo0.cjs} +1 -1
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/{index.es-67G0dUQ8.js → index.es-Fq7tEj25.js} +11 -11
  33. package/dist/{index.es-CtypdcdJ.cjs → index.es-QDwz4eEz.cjs} +2 -2
  34. package/dist/index.esm.js +1 -1
  35. package/dist/{llm_chain-AXaQuXMt.js → llm_chain-5NVYgTDC.js} +1 -1
  36. package/dist/{llm_chain-RoYoMcLp.cjs → llm_chain-HMEylFLR.cjs} +1 -1
  37. package/dist/{sequential_chain-DVxvWiQQ.js → sequential_chain-B3aNFa_8.js} +1 -1
  38. package/dist/{sequential_chain-9yzJVjdz.cjs → sequential_chain-BIwygM6l.cjs} +1 -1
  39. package/dist/style.css +1 -1
  40. package/dist/{vector_db_qa-Ca-yXUO_.js → vector_db_qa-BlC0aeM2.js} +3 -3
  41. package/dist/{vector_db_qa-4lYMS_5X.cjs → vector_db_qa-C_vzGRYC.cjs} +1 -1
  42. package/package.json +1 -1
  43. package/dist/index-ASKx-pn3.js +0 -4
  44. package/dist/index-B-yz5nX2.js +0 -4
  45. package/dist/index-Ctbtl5KP.js +0 -4
  46. package/dist/index-Cuzto2LI.js +0 -4
@@ -1,5 +1,5 @@
1
- import { P as PromptTemplate, i as BaseChain } from "./index-BbYqG4Lp.js";
2
- import { LLMChain } from "./llm_chain-AXaQuXMt.js";
1
+ import { P as PromptTemplate, i as BaseChain } from "./index-Cfz7TnCH.js";
2
+ import { LLMChain } from "./llm_chain-5NVYgTDC.js";
3
3
  import "zod";
4
4
  const API_URL_RAW_PROMPT_TEMPLATE = `You are given the below API Documentation:
5
5
  {api_docs}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjmBLRKu.cjs"),i=require("./llm_chain-RoYoMcLp.cjs");require("zod");const t="You are given the below API Documentation:\n{api_docs}\nUsing this documentation, generate the full API url to call for answering the user question.\nYou should build the API url in order to get a response that is as short as possible, while still getting the necessary information to answer the question. Pay attention to deliberately exclude any unnecessary pieces of data in the API call.\n\nQuestion:{question}\nAPI url:",a=new e.PromptTemplate({inputVariables:["api_docs","question"],template:t}),n=`${t} {api_url}\n\nHere is the response from the API:\n\n{api_response}\n\nSummarize this response to answer the original question.\n\nSummary:`,s=new e.PromptTemplate({inputVariables:["api_docs","question","api_url","api_response"],template:n});class r extends e.BaseChain{get inputKeys(){return[this.inputKey]}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"apiAnswerChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiRequestChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"question"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output"}),this.apiRequestChain=e.apiRequestChain,this.apiAnswerChain=e.apiAnswerChain,this.apiDocs=e.apiDocs,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.headers=e.headers??this.headers}async _call(e,i){const t=e[this.inputKey],a=await this.apiRequestChain.predict({question:t,api_docs:this.apiDocs},null==i?void 0:i.getChild("request")),n=await fetch(a,{headers:this.headers}),s=await n.text(),r=await this.apiAnswerChain.predict({question:t,api_docs:this.apiDocs,api_url:a,api_response:s},null==i?void 0:i.getChild("response"));return{[this.outputKey]:r}}_chainType(){return"api_chain"}static async deserialize(e){const{api_request_chain:t,api_answer_chain:a,api_docs:n}=e;if(!t)throw new Error("LLMChain must have api_request_chain");if(!a)throw new Error("LLMChain must have api_answer_chain");if(!n)throw new Error("LLMChain must have api_docs");return new r({apiAnswerChain:await i.LLMChain.deserialize(a),apiRequestChain:await i.LLMChain.deserialize(t),apiDocs:n})}serialize(){return{_type:this._chainType(),api_answer_chain:this.apiAnswerChain.serialize(),api_request_chain:this.apiRequestChain.serialize(),api_docs:this.apiDocs}}static fromLLMAndAPIDocs(e,t,n={}){const{apiUrlPrompt:r=a,apiResponsePrompt:o=s}=n,u=new i.LLMChain({prompt:r,llm:e});return new this({apiAnswerChain:new i.LLMChain({prompt:o,llm:e}),apiRequestChain:u,apiDocs:t,...n})}}exports.APIChain=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DsPuml45.cjs"),i=require("./llm_chain-HMEylFLR.cjs");require("zod");const t="You are given the below API Documentation:\n{api_docs}\nUsing this documentation, generate the full API url to call for answering the user question.\nYou should build the API url in order to get a response that is as short as possible, while still getting the necessary information to answer the question. Pay attention to deliberately exclude any unnecessary pieces of data in the API call.\n\nQuestion:{question}\nAPI url:",a=new e.PromptTemplate({inputVariables:["api_docs","question"],template:t}),n=`${t} {api_url}\n\nHere is the response from the API:\n\n{api_response}\n\nSummarize this response to answer the original question.\n\nSummary:`,s=new e.PromptTemplate({inputVariables:["api_docs","question","api_url","api_response"],template:n});class r extends e.BaseChain{get inputKeys(){return[this.inputKey]}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"apiAnswerChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiRequestChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"question"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output"}),this.apiRequestChain=e.apiRequestChain,this.apiAnswerChain=e.apiAnswerChain,this.apiDocs=e.apiDocs,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.headers=e.headers??this.headers}async _call(e,i){const t=e[this.inputKey],a=await this.apiRequestChain.predict({question:t,api_docs:this.apiDocs},null==i?void 0:i.getChild("request")),n=await fetch(a,{headers:this.headers}),s=await n.text(),r=await this.apiAnswerChain.predict({question:t,api_docs:this.apiDocs,api_url:a,api_response:s},null==i?void 0:i.getChild("response"));return{[this.outputKey]:r}}_chainType(){return"api_chain"}static async deserialize(e){const{api_request_chain:t,api_answer_chain:a,api_docs:n}=e;if(!t)throw new Error("LLMChain must have api_request_chain");if(!a)throw new Error("LLMChain must have api_answer_chain");if(!n)throw new Error("LLMChain must have api_docs");return new r({apiAnswerChain:await i.LLMChain.deserialize(a),apiRequestChain:await i.LLMChain.deserialize(t),apiDocs:n})}serialize(){return{_type:this._chainType(),api_answer_chain:this.apiAnswerChain.serialize(),api_request_chain:this.apiRequestChain.serialize(),api_docs:this.apiDocs}}static fromLLMAndAPIDocs(e,t,n={}){const{apiUrlPrompt:r=a,apiResponsePrompt:o=s}=n,u=new i.LLMChain({prompt:r,llm:e});return new this({apiAnswerChain:new i.LLMChain({prompt:o,llm:e}),apiRequestChain:u,apiDocs:t,...n})}}exports.APIChain=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("zod");const e=require("./index-CjmBLRKu.cjs"),t=require("./llm_chain-RoYoMcLp.cjs");class i extends e.BaseChain{static lc_name(){return"StuffDocumentsChain"}get inputKeys(){return[this.inputKey,...this.llmChain.inputKeys].filter(e=>e!==this.documentVariableName)}get outputKeys(){return this.llmChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),this.llmChain=e.llmChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey}_prepInputs(e){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:t,...i}=e,n=t.map(({pageContent:e})=>e).join("\n\n");return{...i,[this.documentVariableName]:n}}async _call(e,t){return await this.llmChain.call(this._prepInputs(e),null==t?void 0:t.getChild("combine_documents"))}_chainType(){return"stuff_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");return new i({llmChain:await t.LLMChain.deserialize(e.llm_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize()}}}class n extends e.BaseChain{static lc_name(){return"MapReduceDocumentsChain"}get inputKeys(){return[this.inputKey,...this.combineDocumentChain.inputKeys]}get outputKeys(){return this.combineDocumentChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"returnIntermediateSteps",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"maxIterations",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"ensureMapStep",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"combineDocumentChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llmChain=e.llmChain,this.combineDocumentChain=e.combineDocumentChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.ensureMapStep=e.ensureMapStep??this.ensureMapStep,this.inputKey=e.inputKey??this.inputKey,this.maxTokens=e.maxTokens??this.maxTokens,this.maxIterations=e.maxIterations??this.maxIterations,this.returnIntermediateSteps=e.returnIntermediateSteps??!1}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e;let a=i,r=[];for(let o=0;o<this.maxIterations;o+=1){const e=a.map(e=>({[this.documentVariableName]:e.pageContent,...n}));if(0!==o||!this.ensureMapStep){const e=await this.combineDocumentChain.llmChain.prompt.format(this.combineDocumentChain._prepInputs({[this.combineDocumentChain.inputKey]:a,...n}));if(await this.combineDocumentChain.llmChain._getNumTokens(e)<this.maxTokens)break}const i=await this.llmChain.apply(e,t?Array.from({length:e.length},(e,i)=>t.getChild(`map_${i+1}`)):void 0),{outputKey:s}=this.llmChain;this.returnIntermediateSteps&&(r=r.concat(i.map(e=>e[s]))),a=i.map(e=>({pageContent:e[s],metadata:{}}))}const s={[this.combineDocumentChain.inputKey]:a,...n},u=await this.combineDocumentChain.call(s,null==t?void 0:t.getChild("combine_documents"));return this.returnIntermediateSteps?{...u,intermediateSteps:r}:u}_chainType(){return"map_reduce_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");if(!e.combine_document_chain)throw new Error("Missing combine_document_chain");return new n({llmChain:await t.LLMChain.deserialize(e.llm_chain),combineDocumentChain:await i.deserialize(e.combine_document_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),combine_document_chain:this.combineDocumentChain.serialize()}}}class a extends e.BaseChain{static lc_name(){return"RefineDocumentsChain"}get defaultDocumentPrompt(){return new e.PromptTemplate({inputVariables:["page_content"],template:"{page_content}"})}get inputKeys(){return[...new Set([this.inputKey,...this.llmChain.inputKeys,...this.refineLLMChain.inputKeys])].filter(e=>e!==this.documentVariableName&&e!==this.initialResponseName)}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output_text"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"initialResponseName",{enumerable:!0,configurable:!0,writable:!0,value:"existing_answer"}),Object.defineProperty(this,"refineLLMChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"documentPrompt",{enumerable:!0,configurable:!0,writable:!0,value:this.defaultDocumentPrompt}),this.llmChain=e.llmChain,this.refineLLMChain=e.refineLLMChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.documentPrompt=e.documentPrompt??this.documentPrompt,this.initialResponseName=e.initialResponseName??this.initialResponseName}async _constructInitialInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(e=>{n[e]=i[e]});return{...{[this.documentVariableName]:await this.documentPrompt.format({...n})},...t}}async _constructRefineInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(e=>{n[e]=i[e]});const a={[this.documentVariableName]:await this.documentPrompt.format({...n})};return{[this.initialResponseName]:t,...a}}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e,a=i,r=await this._constructInitialInputs(a[0],n);let s=await this.llmChain.predict({...r},null==t?void 0:t.getChild("answer"));for(let u=1;u<a.length;u+=1){const e={...await this._constructRefineInputs(a[u],s),...n};s=await this.refineLLMChain.predict({...e},null==t?void 0:t.getChild("refine"))}return{[this.outputKey]:s}}_chainType(){return"refine_documents_chain"}static async deserialize(e){const i=e.llm_chain;if(!i)throw new Error("Missing llm_chain");const n=e.refine_llm_chain;if(!n)throw new Error("Missing refine_llm_chain");return new a({llmChain:await t.LLMChain.deserialize(i),refineLLMChain:await t.LLMChain.deserialize(n)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),refine_llm_chain:this.refineLLMChain.serialize()}}}exports.MapReduceDocumentsChain=n,exports.RefineDocumentsChain=a,exports.StuffDocumentsChain=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("zod");const e=require("./index-DsPuml45.cjs"),t=require("./llm_chain-HMEylFLR.cjs");class i extends e.BaseChain{static lc_name(){return"StuffDocumentsChain"}get inputKeys(){return[this.inputKey,...this.llmChain.inputKeys].filter(e=>e!==this.documentVariableName)}get outputKeys(){return this.llmChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),this.llmChain=e.llmChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey}_prepInputs(e){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:t,...i}=e,n=t.map(({pageContent:e})=>e).join("\n\n");return{...i,[this.documentVariableName]:n}}async _call(e,t){return await this.llmChain.call(this._prepInputs(e),null==t?void 0:t.getChild("combine_documents"))}_chainType(){return"stuff_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");return new i({llmChain:await t.LLMChain.deserialize(e.llm_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize()}}}class n extends e.BaseChain{static lc_name(){return"MapReduceDocumentsChain"}get inputKeys(){return[this.inputKey,...this.combineDocumentChain.inputKeys]}get outputKeys(){return this.combineDocumentChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"returnIntermediateSteps",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"maxIterations",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"ensureMapStep",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"combineDocumentChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llmChain=e.llmChain,this.combineDocumentChain=e.combineDocumentChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.ensureMapStep=e.ensureMapStep??this.ensureMapStep,this.inputKey=e.inputKey??this.inputKey,this.maxTokens=e.maxTokens??this.maxTokens,this.maxIterations=e.maxIterations??this.maxIterations,this.returnIntermediateSteps=e.returnIntermediateSteps??!1}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e;let a=i,r=[];for(let o=0;o<this.maxIterations;o+=1){const e=a.map(e=>({[this.documentVariableName]:e.pageContent,...n}));if(0!==o||!this.ensureMapStep){const e=await this.combineDocumentChain.llmChain.prompt.format(this.combineDocumentChain._prepInputs({[this.combineDocumentChain.inputKey]:a,...n}));if(await this.combineDocumentChain.llmChain._getNumTokens(e)<this.maxTokens)break}const i=await this.llmChain.apply(e,t?Array.from({length:e.length},(e,i)=>t.getChild(`map_${i+1}`)):void 0),{outputKey:s}=this.llmChain;this.returnIntermediateSteps&&(r=r.concat(i.map(e=>e[s]))),a=i.map(e=>({pageContent:e[s],metadata:{}}))}const s={[this.combineDocumentChain.inputKey]:a,...n},u=await this.combineDocumentChain.call(s,null==t?void 0:t.getChild("combine_documents"));return this.returnIntermediateSteps?{...u,intermediateSteps:r}:u}_chainType(){return"map_reduce_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");if(!e.combine_document_chain)throw new Error("Missing combine_document_chain");return new n({llmChain:await t.LLMChain.deserialize(e.llm_chain),combineDocumentChain:await i.deserialize(e.combine_document_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),combine_document_chain:this.combineDocumentChain.serialize()}}}class a extends e.BaseChain{static lc_name(){return"RefineDocumentsChain"}get defaultDocumentPrompt(){return new e.PromptTemplate({inputVariables:["page_content"],template:"{page_content}"})}get inputKeys(){return[...new Set([this.inputKey,...this.llmChain.inputKeys,...this.refineLLMChain.inputKeys])].filter(e=>e!==this.documentVariableName&&e!==this.initialResponseName)}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output_text"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"initialResponseName",{enumerable:!0,configurable:!0,writable:!0,value:"existing_answer"}),Object.defineProperty(this,"refineLLMChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"documentPrompt",{enumerable:!0,configurable:!0,writable:!0,value:this.defaultDocumentPrompt}),this.llmChain=e.llmChain,this.refineLLMChain=e.refineLLMChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.documentPrompt=e.documentPrompt??this.documentPrompt,this.initialResponseName=e.initialResponseName??this.initialResponseName}async _constructInitialInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(e=>{n[e]=i[e]});return{...{[this.documentVariableName]:await this.documentPrompt.format({...n})},...t}}async _constructRefineInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(e=>{n[e]=i[e]});const a={[this.documentVariableName]:await this.documentPrompt.format({...n})};return{[this.initialResponseName]:t,...a}}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e,a=i,r=await this._constructInitialInputs(a[0],n);let s=await this.llmChain.predict({...r},null==t?void 0:t.getChild("answer"));for(let u=1;u<a.length;u+=1){const e={...await this._constructRefineInputs(a[u],s),...n};s=await this.refineLLMChain.predict({...e},null==t?void 0:t.getChild("refine"))}return{[this.outputKey]:s}}_chainType(){return"refine_documents_chain"}static async deserialize(e){const i=e.llm_chain;if(!i)throw new Error("Missing llm_chain");const n=e.refine_llm_chain;if(!n)throw new Error("Missing refine_llm_chain");return new a({llmChain:await t.LLMChain.deserialize(i),refineLLMChain:await t.LLMChain.deserialize(n)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),refine_llm_chain:this.refineLLMChain.serialize()}}}exports.MapReduceDocumentsChain=n,exports.RefineDocumentsChain=a,exports.StuffDocumentsChain=i;
@@ -1,6 +1,6 @@
1
1
  import "zod";
2
- import { i as BaseChain, P as PromptTemplate } from "./index-BbYqG4Lp.js";
3
- import { LLMChain } from "./llm_chain-AXaQuXMt.js";
2
+ import { i as BaseChain, P as PromptTemplate } from "./index-Cfz7TnCH.js";
3
+ import { LLMChain } from "./llm_chain-5NVYgTDC.js";
4
4
  class StuffDocumentsChain extends BaseChain {
5
5
  static lc_name() {
6
6
  return "StuffDocumentsChain";
@@ -1,4 +1,4 @@
1
- import { B as BaseStringPromptTemplate, e as checkValidTemplate, g as renderTemplate, P as PromptTemplate } from "./index-BbYqG4Lp.js";
1
+ import { B as BaseStringPromptTemplate, e as checkValidTemplate, g as renderTemplate, P as PromptTemplate } from "./index-Cfz7TnCH.js";
2
2
  import "zod";
3
3
  class FewShotPromptTemplate extends BaseStringPromptTemplate {
4
4
  constructor(input) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjmBLRKu.cjs");require("zod");class t extends e.BaseStringPromptTemplate{constructor(t){if(super(t),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:"\n\n"}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.assign(this,t),void 0!==this.examples&&void 0!==this.exampleSelector)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(void 0===this.examples&&void 0===this.exampleSelector)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let t=this.inputVariables;this.partialVariables&&(t=t.concat(Object.keys(this.partialVariables))),e.checkValidTemplate(this.prefix+this.suffix,this.templateFormat,t)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(e){if(void 0!==this.examples)return this.examples;if(void 0!==this.exampleSelector)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(e){const r=this.inputVariables.filter(t=>!(t in e)),a={...this.partialVariables??{},...e},i={...this,inputVariables:r,partialVariables:a};return new t(i)}async format(t){const r=await this.mergePartialAndUserVariables(t),a=await this.getExamples(r),i=await Promise.all(a.map(e=>this.examplePrompt.format(e))),l=[this.prefix,...i,this.suffix].join(this.exampleSeparator);return e.renderTemplate(l,this.templateFormat,r)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(void 0!==this.outputParser)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(r){const{example_prompt:a}=r;if(!a)throw new Error("Missing example prompt");const i=await e.PromptTemplate.deserialize(a);let l;if(!Array.isArray(r.examples))throw new Error("Invalid examples format. Only list or string are supported.");return l=r.examples,new t({inputVariables:r.input_variables,examplePrompt:i,examples:l,exampleSeparator:r.example_separator,prefix:r.prefix,suffix:r.suffix,templateFormat:r.template_format})}}exports.FewShotPromptTemplate=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DsPuml45.cjs");require("zod");class t extends e.BaseStringPromptTemplate{constructor(t){if(super(t),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:"\n\n"}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.assign(this,t),void 0!==this.examples&&void 0!==this.exampleSelector)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(void 0===this.examples&&void 0===this.exampleSelector)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let t=this.inputVariables;this.partialVariables&&(t=t.concat(Object.keys(this.partialVariables))),e.checkValidTemplate(this.prefix+this.suffix,this.templateFormat,t)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(e){if(void 0!==this.examples)return this.examples;if(void 0!==this.exampleSelector)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(e){const r=this.inputVariables.filter(t=>!(t in e)),a={...this.partialVariables??{},...e},i={...this,inputVariables:r,partialVariables:a};return new t(i)}async format(t){const r=await this.mergePartialAndUserVariables(t),a=await this.getExamples(r),i=await Promise.all(a.map(e=>this.examplePrompt.format(e))),l=[this.prefix,...i,this.suffix].join(this.exampleSeparator);return e.renderTemplate(l,this.templateFormat,r)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(void 0!==this.outputParser)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(r){const{example_prompt:a}=r;if(!a)throw new Error("Missing example prompt");const i=await e.PromptTemplate.deserialize(a);let l;if(!Array.isArray(r.examples))throw new Error("Invalid examples format. Only list or string are supported.");return l=r.examples,new t({inputVariables:r.input_variables,examplePrompt:i,examples:l,exampleSeparator:r.example_separator,prefix:r.prefix,suffix:r.suffix,templateFormat:r.template_format})}}exports.FewShotPromptTemplate=t;
@@ -1,4 +1,4 @@
1
- import { w as whitespace, A as svg, I as find, L as stringify, M as stringify$1, N as ccount, D as html$2 } from "./index-BbYqG4Lp.js";
1
+ import { w as whitespace, A as svg, I as find, L as stringify, M as stringify$1, N as ccount, D as html$2 } from "./index-Cfz7TnCH.js";
2
2
  import { z as zwitch } from "./index-BEZf1ZPW.js";
3
3
  const htmlVoidElements = [
4
4
  "area",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjmBLRKu.cjs"),t=require("./index-2yo2kUGy.cjs"),a=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],n=/["&'<>`]/g,r=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,s=/[|\\{}()[\]^$+*?.]/g,i=new WeakMap;function c(e,t){return e=e.replace(t.subset?function(e){let t=i.get(e);t||(t=function(e){const t=[];let a=-1;for(;++a<e.length;)t.push(e[a].replace(s,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),i.set(e,t));return t}(t.subset):n,a),t.subset||t.escapeOnly?e:e.replace(r,function(e,a,n){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,n.charCodeAt(a+2),t)}).replace(o,a);function a(e,a,n){return t.format(e.charCodeAt(0),n.charCodeAt(a+1),t)}}const u=/[\dA-Fa-f]/;const l=/\d/;const m=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],g={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},p=["cent","copy","divide","gt","lt","not","para","times"],d={}.hasOwnProperty,f={};let h;for(h in g)d.call(g,h)&&(f[g[h]]=h);const N=/[^\dA-Za-z]/;function y(e,t,a){let n,r=function(e,t,a){const n="&#x"+e.toString(16).toUpperCase();return a&&t&&!u.test(String.fromCharCode(t))?n:n+";"}(e,t,a.omitOptionalSemicolons);if((a.useNamedReferences||a.useShortestReferences)&&(n=function(e,t,a,n){const r=String.fromCharCode(e);if(d.call(f,r)){const e=f[r],o="&"+e;return a&&m.includes(e)&&!p.includes(e)&&(!n||t&&61!==t&&N.test(String.fromCharCode(t)))?o:o+";"}return""}(e,t,a.omitOptionalSemicolons,a.attribute)),(a.useShortestReferences||!n)&&a.useShortestReferences){const n=function(e,t,a){const n="&#"+String(e);return a&&t&&!l.test(String.fromCharCode(t))?n:n+";"}(e,t,a.omitOptionalSemicolons);n.length<r.length&&(r=n)}return n&&(!a.useShortestReferences||n.length<r.length)?n:r}function b(e,t){return c(e,Object.assign({format:y},t))}const v=/^>|^->|<!--|-->|--!>|<!-$/g,A=[">"],O=["<",">"];const C=q(1),E=q(-1),w=[];function q(t){return function(a,n,r){const o=a?a.children:w;let s=(n||0)+t,i=o[s];if(!r)for(;i&&e.whitespace(i);)s+=t,i=o[s];return i}}const S={}.hasOwnProperty;function x(e){return function(t,a,n){return S.call(e,t.tagName)&&e[t.tagName](t,a,n)}}const D=x({body:function(e,t,a){const n=C(a,t);return!n||"comment"!==n.type},caption:R,colgroup:R,dd:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName)},dt:function(e,t,a){const n=C(a,t);return Boolean(n&&"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName))},head:R,html:function(e,t,a){const n=C(a,t);return!n||"comment"!==n.type},li:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"li"===n.tagName},optgroup:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"optgroup"===n.tagName},option:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("option"===n.tagName||"optgroup"===n.tagName)},p:function(e,t,a){const n=C(a,t);return n?"element"===n.type&&("address"===n.tagName||"article"===n.tagName||"aside"===n.tagName||"blockquote"===n.tagName||"details"===n.tagName||"div"===n.tagName||"dl"===n.tagName||"fieldset"===n.tagName||"figcaption"===n.tagName||"figure"===n.tagName||"footer"===n.tagName||"form"===n.tagName||"h1"===n.tagName||"h2"===n.tagName||"h3"===n.tagName||"h4"===n.tagName||"h5"===n.tagName||"h6"===n.tagName||"header"===n.tagName||"hgroup"===n.tagName||"hr"===n.tagName||"main"===n.tagName||"menu"===n.tagName||"nav"===n.tagName||"ol"===n.tagName||"p"===n.tagName||"pre"===n.tagName||"section"===n.tagName||"table"===n.tagName||"ul"===n.tagName):!a||!("element"===a.type&&("a"===a.tagName||"audio"===a.tagName||"del"===a.tagName||"ins"===a.tagName||"map"===a.tagName||"noscript"===a.tagName||"video"===a.tagName))},rp:j,rt:j,tbody:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName)},td:T,tfoot:function(e,t,a){return!C(a,t)},th:T,thead:function(e,t,a){const n=C(a,t);return Boolean(n&&"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName))},tr:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"tr"===n.tagName}});function R(t,a,n){const r=C(n,a,!0);return!r||"comment"!==r.type&&!("text"===r.type&&e.whitespace(r.value.charAt(0)))}function j(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("rp"===n.tagName||"rt"===n.tagName)}function T(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("td"===n.tagName||"th"===n.tagName)}const U=x({body:function(t){const a=C(t,-1,!0);return!(a&&("comment"===a.type||"text"===a.type&&e.whitespace(a.value.charAt(0))||"element"===a.type&&("meta"===a.tagName||"link"===a.tagName||"script"===a.tagName||"style"===a.tagName||"template"===a.tagName)))},colgroup:function(e,t,a){const n=E(a,t),r=C(e,-1,!0);if(a&&n&&"element"===n.type&&"colgroup"===n.tagName&&D(n,a.children.indexOf(n),a))return!1;return Boolean(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const a=e.children[0];return!a||"element"===a.type},html:function(e){const t=C(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,a){const n=E(a,t),r=C(e,-1);if(a&&n&&"element"===n.type&&("thead"===n.tagName||"tbody"===n.tagName)&&D(n,a.children.indexOf(n),a))return!1;return Boolean(r&&"element"===r.type&&"tr"===r.tagName)}});const F={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function P(t,a,n){const r=e.find(t.schema,a),o=t.settings.allowParseErrors&&"html"===t.schema.space?0:1,s=t.settings.allowDangerousCharacters?0:1;let i,c=t.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const u=b(r.attribute,Object.assign({},t.settings.characterReferences,{subset:F.name[o][s]}));return!0===n?u:(n=Array.isArray(n)?(r.commaSeparated?e.stringify:e.stringify$1)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n?u:(t.settings.preferUnquoted&&(i=b(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:F.unquoted[o][s]}))),i!==n&&(t.settings.quoteSmart&&e.ccount(n,c)>e.ccount(n,t.alternative)&&(c=t.alternative),i=c+b(n,Object.assign({},t.settings.characterReferences,{subset:("'"===c?F.single:F.double)[o][s],attribute:!0}))+c),u+(i?"="+i:i)))}const I=["<","&"];function k(e,t,a,n){return!a||"element"!==a.type||"script"!==a.tagName&&"style"!==a.tagName?b(e.value,Object.assign({},n.settings.characterReferences,{subset:I})):e.value}const B=t.zwitch("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,a,n){return n.settings.bogusComments?"<?"+b(e.value,Object.assign({},n.settings.characterReferences,{subset:A}))+">":"\x3c!--"+e.value.replace(v,function(e){return b(e,Object.assign({},n.settings.characterReferences,{subset:O}))})+"--\x3e"},doctype:function(e,t,a,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"},element:function(t,a,n,r){const o=r.schema,s="svg"!==o.space&&r.settings.omitOptionalTags;let i="svg"===o.space?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const c=[];let u;"html"===o.space&&"svg"===t.tagName&&(r.schema=e.svg);const l=function(e,t){const a=[];let n,r=-1;if(t)for(n in t)if(null!==t[n]&&void 0!==t[n]){const r=P(e,n,t[n]);r&&a.push(r)}for(;++r<a.length;){const t=e.settings.tightAttributes?a[r].charAt(a[r].length-1):void 0;r!==a.length-1&&'"'!==t&&"'"!==t&&(a[r]+=" ")}return a.join("")}(r,t.properties),m=r.all("html"===o.space&&"template"===t.tagName?t.content:t);return r.schema=o,m&&(i=!1),!l&&s&&U(t,a,n)||(c.push("<",t.tagName,l?" "+l:""),i&&("svg"===o.space||r.settings.closeSelfClosing)&&(u=l.charAt(l.length-1),(!r.settings.tightSelfClosing||"/"===u||u&&'"'!==u&&"'"!==u)&&c.push(" "),c.push("/")),c.push(">")),c.push(m),i||s&&D(t,a,n)||c.push("</"+t.tagName+">"),c.join("")},raw:function(e,t,a,n){return n.settings.allowDangerousHtml?e.value:k(e,0,a,n)},root:function(e,t,a,n){return n.all(e)},text:k}});const z={},H={},L=[];function Y(e,t,a){return B(e,t,a,this)}function M(e){const t=[],a=e&&e.children||L;let n=-1;for(;++n<a.length;)t[n]=this.one(a[n],n,e);return t.join("")}exports.default=function(t){const n={...this.data("settings"),...t};this.compiler=function(t){return function(t,n){const r=n||z,o=r.quote||'"',s='"'===o?"'":'"';if('"'!==o&&"'"!==o)throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:Y,all:M,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||a,characterReferences:r.characterReferences||H,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:"svg"===r.space?e.svg:e.html,quote:o,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}(t,n)}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DsPuml45.cjs"),t=require("./index-2yo2kUGy.cjs"),a=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],n=/["&'<>`]/g,r=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,s=/[|\\{}()[\]^$+*?.]/g,i=new WeakMap;function c(e,t){return e=e.replace(t.subset?function(e){let t=i.get(e);t||(t=function(e){const t=[];let a=-1;for(;++a<e.length;)t.push(e[a].replace(s,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),i.set(e,t));return t}(t.subset):n,a),t.subset||t.escapeOnly?e:e.replace(r,function(e,a,n){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,n.charCodeAt(a+2),t)}).replace(o,a);function a(e,a,n){return t.format(e.charCodeAt(0),n.charCodeAt(a+1),t)}}const u=/[\dA-Fa-f]/;const l=/\d/;const m=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],g={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},p=["cent","copy","divide","gt","lt","not","para","times"],d={}.hasOwnProperty,f={};let h;for(h in g)d.call(g,h)&&(f[g[h]]=h);const N=/[^\dA-Za-z]/;function y(e,t,a){let n,r=function(e,t,a){const n="&#x"+e.toString(16).toUpperCase();return a&&t&&!u.test(String.fromCharCode(t))?n:n+";"}(e,t,a.omitOptionalSemicolons);if((a.useNamedReferences||a.useShortestReferences)&&(n=function(e,t,a,n){const r=String.fromCharCode(e);if(d.call(f,r)){const e=f[r],o="&"+e;return a&&m.includes(e)&&!p.includes(e)&&(!n||t&&61!==t&&N.test(String.fromCharCode(t)))?o:o+";"}return""}(e,t,a.omitOptionalSemicolons,a.attribute)),(a.useShortestReferences||!n)&&a.useShortestReferences){const n=function(e,t,a){const n="&#"+String(e);return a&&t&&!l.test(String.fromCharCode(t))?n:n+";"}(e,t,a.omitOptionalSemicolons);n.length<r.length&&(r=n)}return n&&(!a.useShortestReferences||n.length<r.length)?n:r}function b(e,t){return c(e,Object.assign({format:y},t))}const v=/^>|^->|<!--|-->|--!>|<!-$/g,A=[">"],O=["<",">"];const C=q(1),E=q(-1),w=[];function q(t){return function(a,n,r){const o=a?a.children:w;let s=(n||0)+t,i=o[s];if(!r)for(;i&&e.whitespace(i);)s+=t,i=o[s];return i}}const S={}.hasOwnProperty;function x(e){return function(t,a,n){return S.call(e,t.tagName)&&e[t.tagName](t,a,n)}}const D=x({body:function(e,t,a){const n=C(a,t);return!n||"comment"!==n.type},caption:R,colgroup:R,dd:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName)},dt:function(e,t,a){const n=C(a,t);return Boolean(n&&"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName))},head:R,html:function(e,t,a){const n=C(a,t);return!n||"comment"!==n.type},li:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"li"===n.tagName},optgroup:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"optgroup"===n.tagName},option:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("option"===n.tagName||"optgroup"===n.tagName)},p:function(e,t,a){const n=C(a,t);return n?"element"===n.type&&("address"===n.tagName||"article"===n.tagName||"aside"===n.tagName||"blockquote"===n.tagName||"details"===n.tagName||"div"===n.tagName||"dl"===n.tagName||"fieldset"===n.tagName||"figcaption"===n.tagName||"figure"===n.tagName||"footer"===n.tagName||"form"===n.tagName||"h1"===n.tagName||"h2"===n.tagName||"h3"===n.tagName||"h4"===n.tagName||"h5"===n.tagName||"h6"===n.tagName||"header"===n.tagName||"hgroup"===n.tagName||"hr"===n.tagName||"main"===n.tagName||"menu"===n.tagName||"nav"===n.tagName||"ol"===n.tagName||"p"===n.tagName||"pre"===n.tagName||"section"===n.tagName||"table"===n.tagName||"ul"===n.tagName):!a||!("element"===a.type&&("a"===a.tagName||"audio"===a.tagName||"del"===a.tagName||"ins"===a.tagName||"map"===a.tagName||"noscript"===a.tagName||"video"===a.tagName))},rp:j,rt:j,tbody:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName)},td:T,tfoot:function(e,t,a){return!C(a,t)},th:T,thead:function(e,t,a){const n=C(a,t);return Boolean(n&&"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName))},tr:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"tr"===n.tagName}});function R(t,a,n){const r=C(n,a,!0);return!r||"comment"!==r.type&&!("text"===r.type&&e.whitespace(r.value.charAt(0)))}function j(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("rp"===n.tagName||"rt"===n.tagName)}function T(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("td"===n.tagName||"th"===n.tagName)}const U=x({body:function(t){const a=C(t,-1,!0);return!(a&&("comment"===a.type||"text"===a.type&&e.whitespace(a.value.charAt(0))||"element"===a.type&&("meta"===a.tagName||"link"===a.tagName||"script"===a.tagName||"style"===a.tagName||"template"===a.tagName)))},colgroup:function(e,t,a){const n=E(a,t),r=C(e,-1,!0);if(a&&n&&"element"===n.type&&"colgroup"===n.tagName&&D(n,a.children.indexOf(n),a))return!1;return Boolean(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const a=e.children[0];return!a||"element"===a.type},html:function(e){const t=C(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,a){const n=E(a,t),r=C(e,-1);if(a&&n&&"element"===n.type&&("thead"===n.tagName||"tbody"===n.tagName)&&D(n,a.children.indexOf(n),a))return!1;return Boolean(r&&"element"===r.type&&"tr"===r.tagName)}});const F={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function P(t,a,n){const r=e.find(t.schema,a),o=t.settings.allowParseErrors&&"html"===t.schema.space?0:1,s=t.settings.allowDangerousCharacters?0:1;let i,c=t.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const u=b(r.attribute,Object.assign({},t.settings.characterReferences,{subset:F.name[o][s]}));return!0===n?u:(n=Array.isArray(n)?(r.commaSeparated?e.stringify:e.stringify$1)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n?u:(t.settings.preferUnquoted&&(i=b(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:F.unquoted[o][s]}))),i!==n&&(t.settings.quoteSmart&&e.ccount(n,c)>e.ccount(n,t.alternative)&&(c=t.alternative),i=c+b(n,Object.assign({},t.settings.characterReferences,{subset:("'"===c?F.single:F.double)[o][s],attribute:!0}))+c),u+(i?"="+i:i)))}const I=["<","&"];function k(e,t,a,n){return!a||"element"!==a.type||"script"!==a.tagName&&"style"!==a.tagName?b(e.value,Object.assign({},n.settings.characterReferences,{subset:I})):e.value}const B=t.zwitch("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,a,n){return n.settings.bogusComments?"<?"+b(e.value,Object.assign({},n.settings.characterReferences,{subset:A}))+">":"\x3c!--"+e.value.replace(v,function(e){return b(e,Object.assign({},n.settings.characterReferences,{subset:O}))})+"--\x3e"},doctype:function(e,t,a,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"},element:function(t,a,n,r){const o=r.schema,s="svg"!==o.space&&r.settings.omitOptionalTags;let i="svg"===o.space?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const c=[];let u;"html"===o.space&&"svg"===t.tagName&&(r.schema=e.svg);const l=function(e,t){const a=[];let n,r=-1;if(t)for(n in t)if(null!==t[n]&&void 0!==t[n]){const r=P(e,n,t[n]);r&&a.push(r)}for(;++r<a.length;){const t=e.settings.tightAttributes?a[r].charAt(a[r].length-1):void 0;r!==a.length-1&&'"'!==t&&"'"!==t&&(a[r]+=" ")}return a.join("")}(r,t.properties),m=r.all("html"===o.space&&"template"===t.tagName?t.content:t);return r.schema=o,m&&(i=!1),!l&&s&&U(t,a,n)||(c.push("<",t.tagName,l?" "+l:""),i&&("svg"===o.space||r.settings.closeSelfClosing)&&(u=l.charAt(l.length-1),(!r.settings.tightSelfClosing||"/"===u||u&&'"'!==u&&"'"!==u)&&c.push(" "),c.push("/")),c.push(">")),c.push(m),i||s&&D(t,a,n)||c.push("</"+t.tagName+">"),c.join("")},raw:function(e,t,a,n){return n.settings.allowDangerousHtml?e.value:k(e,0,a,n)},root:function(e,t,a,n){return n.all(e)},text:k}});const z={},H={},L=[];function Y(e,t,a){return B(e,t,a,this)}function M(e){const t=[],a=e&&e.children||L;let n=-1;for(;++n<a.length;)t[n]=this.one(a[n],n,e);return t.join("")}exports.default=function(t){const n={...this.data("settings"),...t};this.compiler=function(t){return function(t,n){const r=n||z,o=r.quote||'"',s='"'===o?"'":'"';if('"'!==o&&"'"!==o)throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:Y,all:M,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||a,characterReferences:r.characterReferences||H,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:"svg"===r.space?e.svg:e.html,quote:o,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}(t,n)}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CfwXktuP.cjs"),t=require("./index-CjmBLRKu.cjs"),n=["pre","script","style","textarea"],i={};function a(e,t){return Boolean(t&&"element"===t.type&&e.blanks.length>0&&e.blanks.includes(t.tagName))}function l(t,n){return"root"===n.type||"element"===n.type&&(t.head||"script"===n.tagName||e.embedded(n)||!e.phrasing(n))}exports.default=function(r){return function(c){!function(r,c){const d=c||i,s={blanks:d.blanks||[],head:!1,indentInitial:!1!==d.indentInitial,indent:"number"==typeof d.indent?" ".repeat(d.indent):"string"==typeof d.indent?d.indent:" "};function o(e,n,i){const l=e[e.length-1],r=l&&t.whitespace(l)?e[e.length-2]:l,c=(a(s,r)&&a(s,i)?"\n\n":"\n")+s.indent.repeat(Math.max(n,0));l&&"text"===l.type?l.value=t.whitespace(l)?c:l.value+c:e.push({type:"text",value:c})}e.minifyWhitespace(r,{newlines:!0}),t.visitParents(r,function(e,i){if(!("children"in e))return;if("element"===e.type&&"head"===e.tagName&&(s.head=!0),s.head&&"element"===e.type&&"body"===e.tagName&&(s.head=!1),"element"===e.type&&n.includes(e.tagName))return t.SKIP;if(0===e.children.length||!l(s,e))return;let a=i.length;s.indentInitial||a--;let r=!1;for(const t of e.children)"comment"!==t.type&&"text"!==t.type||(t.value.includes("\n")&&(r=!0),t.value=t.value.replace(/ *\n/g,"$&"+s.indent.repeat(a)));const c=[];let d;for(const t of e.children)(l(s,t)||r&&!d)&&(o(c,a,t),r=!0),d=t,c.push(t);d&&(r||l(s,d))&&(t.whitespace(d)&&(c.pop(),d=c[c.length-1]),o(c,a-1)),e.children=c})}(c,r)}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-oel1bTo0.cjs"),t=require("./index-DsPuml45.cjs"),n=["pre","script","style","textarea"],i={};function a(e,t){return Boolean(t&&"element"===t.type&&e.blanks.length>0&&e.blanks.includes(t.tagName))}function l(t,n){return"root"===n.type||"element"===n.type&&(t.head||"script"===n.tagName||e.embedded(n)||!e.phrasing(n))}exports.default=function(r){return function(c){!function(r,c){const d=c||i,s={blanks:d.blanks||[],head:!1,indentInitial:!1!==d.indentInitial,indent:"number"==typeof d.indent?" ".repeat(d.indent):"string"==typeof d.indent?d.indent:" "};function o(e,n,i){const l=e[e.length-1],r=l&&t.whitespace(l)?e[e.length-2]:l,c=(a(s,r)&&a(s,i)?"\n\n":"\n")+s.indent.repeat(Math.max(n,0));l&&"text"===l.type?l.value=t.whitespace(l)?c:l.value+c:e.push({type:"text",value:c})}e.minifyWhitespace(r,{newlines:!0}),t.visitParents(r,function(e,i){if(!("children"in e))return;if("element"===e.type&&"head"===e.tagName&&(s.head=!0),s.head&&"element"===e.type&&"body"===e.tagName&&(s.head=!1),"element"===e.type&&n.includes(e.tagName))return t.SKIP;if(0===e.children.length||!l(s,e))return;let a=i.length;s.indentInitial||a--;let r=!1;for(const t of e.children)"comment"!==t.type&&"text"!==t.type||(t.value.includes("\n")&&(r=!0),t.value=t.value.replace(/ *\n/g,"$&"+s.indent.repeat(a)));const c=[];let d;for(const t of e.children)(l(s,t)||r&&!d)&&(o(c,a,t),r=!0),d=t,c.push(t);d&&(r||l(s,d))&&(t.whitespace(d)&&(c.pop(),d=c[c.length-1]),o(c,a-1)),e.children=c})}(c,r)}};
@@ -0,0 +1,4 @@
1
+ import { u } from "./index-Cfz7TnCH.js";
2
+ export {
3
+ u as unified
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjmBLRKu.cjs");exports.fromDom=e.fromDom;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DsPuml45.cjs");exports.fromDom=e.fromDom;
@@ -0,0 +1,4 @@
1
+ import { r } from "./index-Cfz7TnCH.js";
2
+ export {
3
+ r as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjmBLRKu.cjs");exports.default=e.remarkGfm;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DsPuml45.cjs");exports.default=e.remarkGfm;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjmBLRKu.cjs");exports.default=e.remarkParse;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DsPuml45.cjs");exports.default=e.remarkParse;
@@ -1,5 +1,5 @@
1
- import { m as minifyWhitespace, e as embedded, p as phrasing } from "./index-CI8OM2Jz.js";
2
- import { v as visitParents, S as SKIP, w as whitespace } from "./index-BbYqG4Lp.js";
1
+ import { m as minifyWhitespace, e as embedded, p as phrasing } from "./index-Dkq6Ss_h.js";
2
+ import { v as visitParents, S as SKIP, w as whitespace } from "./index-Cfz7TnCH.js";
3
3
  const whitespaceSensitiveTagNames = [
4
4
  "pre",
5
5
  "script",