wi-chat 0.3.0 → 0.4.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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +59 -54
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +5 -0
- package/dist/mobile-ui/chat/ChatMessagesView.vue.d.ts +5 -0
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.d.ts +2 -2
- package/dist/mobile-ui/index.js +78 -71
- package/dist/mobile-ui/style.css +1 -1
- package/dist/parser/answerCom/outputFile/parseOutputFile.d.ts +43 -0
- package/dist/parser/answerCom/outputFile/types.d.ts +17 -0
- package/dist/parser/index.cjs +2 -2
- package/dist/parser/index.d.ts +3 -0
- package/dist/parser/index.js +220 -180
- package/dist/parser/registry.d.ts +1 -1
- package/dist/renderers/index.cjs +1 -1
- package/dist/renderers/index.d.ts +3 -0
- package/dist/renderers/index.js +512 -146
- package/dist/renderers/outputFile/OutputFile.vue.d.ts +19 -0
- package/dist/renderers/outputFile/useOutputFile.d.ts +85 -0
- package/dist/renderers/style.css +1 -1
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +5 -0
- package/dist/web-ui/chat/ChatMessagesView.vue.d.ts +5 -0
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.d.ts +2 -2
- package/dist/web-ui/index.js +402 -388
- package/dist/web-ui/style.css +1 -1
- package/package.json +1 -1
package/dist/parser/index.js
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
const
|
|
1
|
+
const E = () => ({
|
|
2
2
|
answer_type: "knowledge_stream_result",
|
|
3
3
|
values: [{ answer: "" }]
|
|
4
|
-
}),
|
|
4
|
+
}), A = (e) => (e.answer_type = "knowledge_stream_result", (!Array.isArray(e.values) || !e.values.length) && (e.values = [{ answer: "" }]), e), D = (e = "", t = "") => ({
|
|
5
5
|
id: e,
|
|
6
6
|
question: t,
|
|
7
7
|
answer: { reports: [] }
|
|
8
|
-
}),
|
|
8
|
+
}), W = [
|
|
9
9
|
"knowledge_stream_begin",
|
|
10
10
|
"knowledge_stream",
|
|
11
11
|
"knowledge_stream_result",
|
|
12
12
|
"knowledge_stream_end"
|
|
13
|
-
],
|
|
13
|
+
], R = (e, t, n, o) => {
|
|
14
14
|
var u;
|
|
15
|
-
if (!e.mode || !
|
|
15
|
+
if (!e.mode || !W.includes(e.mode))
|
|
16
16
|
return !1;
|
|
17
17
|
if (e.mode === "knowledge_stream_result" || e.mode === "knowledge_stream_end")
|
|
18
18
|
return !0;
|
|
19
|
-
const
|
|
19
|
+
const i = o == null ? void 0 : o.beforeKnowledgeRender, r = (l) => i ? i(l) : l;
|
|
20
20
|
if (e.mode === "knowledge_stream_begin") {
|
|
21
21
|
const l = t.at(-1);
|
|
22
|
-
return (l == null ? void 0 : l.answer_type) === "knowledge_stream_result" ? (l.values = l.values ?? [], l.values.push({ answer: "" }), !0) : l && !l.answer_type ? (
|
|
22
|
+
return (l == null ? void 0 : l.answer_type) === "knowledge_stream_result" ? (l.values = l.values ?? [], l.values.push({ answer: "" }), !0) : l && !l.answer_type ? (A(l), !0) : (t.push(E()), !0);
|
|
23
23
|
}
|
|
24
24
|
if (e.mode !== "knowledge_stream")
|
|
25
25
|
return !1;
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
const a =
|
|
26
|
+
let s = t.at(-1);
|
|
27
|
+
s && !s.answer_type ? s = A(s) : (!s || s.answer_type !== "knowledge_stream_result") && (s = E(), t.push(s)), s.values = (u = s.values) != null && u.length ? s.values : [{ answer: "" }];
|
|
28
|
+
const a = s.values[s.values.length - 1], c = `${a.raw ?? ""}${e.value || ""}`;
|
|
29
29
|
return a.raw = c, a.answer = r(c), !0;
|
|
30
|
-
},
|
|
30
|
+
}, q = (e, t) => {
|
|
31
31
|
if (Array.isArray(e.values) && e.values.length)
|
|
32
32
|
return e;
|
|
33
33
|
const n = t == null ? void 0 : t.beforeKnowledgeRender, o = (r) => n ? n(r) : r;
|
|
34
|
-
let
|
|
35
|
-
return Array.isArray(e.knowledge) && (
|
|
36
|
-
},
|
|
34
|
+
let i = [];
|
|
35
|
+
return Array.isArray(e.knowledge) && (i = e.knowledge.map((r) => typeof r == "string" ? r : r == null ? void 0 : r.answer).filter((r) => typeof r == "string" && r !== "")), i.length === 0 && typeof e.answer == "string" && e.answer !== "" && (i = [e.answer]), i.length && (e.values = i.map((r) => ({ answer: o(r), raw: r }))), e;
|
|
36
|
+
}, K = {
|
|
37
37
|
id: "knowledge_stream",
|
|
38
38
|
answerType: "knowledge_stream_result",
|
|
39
|
-
applyChunk:
|
|
40
|
-
normalizeReport:
|
|
41
|
-
},
|
|
42
|
-
if (!
|
|
39
|
+
applyChunk: R,
|
|
40
|
+
normalizeReport: q
|
|
41
|
+
}, j = ["begin", "begin_stream", "send_stream", "end_stream"], X = (e, t) => {
|
|
42
|
+
if (!j.includes(e.mode || ""))
|
|
43
43
|
return !1;
|
|
44
44
|
let n = t.at(-1);
|
|
45
45
|
return (!n || n.answer_type) && (n = { exec_process: [] }, t.push(n)), n.exec_process = n.exec_process ?? [], n.exec_process.push({ mode: e.mode, type: e.type, value: e.value }), !0;
|
|
46
|
-
},
|
|
46
|
+
}, V = (e) => {
|
|
47
47
|
const t = [];
|
|
48
48
|
let n = "", o = !1;
|
|
49
|
-
for (const
|
|
50
|
-
(r) =>
|
|
49
|
+
for (const i of (e.exec_process ?? []).filter(
|
|
50
|
+
(r) => j.includes(r.mode || "")
|
|
51
51
|
)) {
|
|
52
|
-
const r = typeof
|
|
53
|
-
|
|
52
|
+
const r = typeof i.value == "string" ? i.value : "";
|
|
53
|
+
i.mode === "begin" ? (o && n.trim() && t.push(n.trim()), o = !1, n = "", r.trim() && t.push(r.trim())) : i.mode === "begin_stream" ? (o && n.trim() && t.push(n.trim()), o = !0, n = r) : i.mode === "send_stream" && o ? n += r : i.mode === "end_stream" && o && (n += r, n.trim() && t.push(n.trim()), o = !1, n = "");
|
|
54
54
|
}
|
|
55
55
|
return o && n.trim() && t.push(n.trim()), t;
|
|
56
|
-
},
|
|
56
|
+
}, I = (e) => {
|
|
57
57
|
var t;
|
|
58
|
-
return (((t = e.answer) == null ? void 0 : t.reports) ?? []).flatMap(
|
|
59
|
-
},
|
|
58
|
+
return (((t = e.answer) == null ? void 0 : t.reports) ?? []).flatMap(V);
|
|
59
|
+
}, G = {
|
|
60
60
|
id: "deep_thinking",
|
|
61
|
-
applyChunk:
|
|
62
|
-
}, $ = '/**\n * Skipped minification because the original files appears to be already minified.\n * Original file: /npm/@iframe-resizer/child@5.1.5/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n/*!\n * @preserve\n * \n * @module iframe-resizer/child 5.1.5 (umd) - 2024-07-09\n *\n * @license GPL-3.0 for non-commercial use only.\n * For commercial use, you must purchase a license from\n * https://iframe-resizer.com/pricing\n * \n * @desciption Keep same and cross domain iFrames sized to their content \n *\n * @author David J. Bradshaw <info@iframe-resizer.com>\n * \n * @see {@link https://iframe-resizer.com}\n * \n * @copyright (c) 2013 - 2024, David J. Bradshaw. All rights reserved.\n */\n\n\n!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.1.5",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),Ue.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,k=1,I=f,x=!0,N="",R={},B=!0,q=!1,L=0,W=!1,D="",H="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${D}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\\n").replaceAll("<rb>","\x1B[31;1m").replaceAll("</>","\x1B[m").replaceAll("<b>","\x1B[1m").replaceAll("<i>","\x1B[3m").replaceAll("<u>","\x1B[4m")):e(t.replaceAll("<br>","\\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");D=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],I=void 0===t[8]?I:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),H=void 0===t[13]?H:t[13],K=void 0===t[14]?K:t[14],W=void 0===t[15]?W:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,I=e?.heightCalculationMethod||I,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),I=t(I,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<rb>Legacy version detected on parent page</>\\n\\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\\n\\nSee <u>https://iframe-resizer.com/setup/</> for more details.\\n");Y!==e&&me(`<rb>Version mismatch</>\\n\\nThe parent and child pages are running different versions of <i>iframe resizer</>.\\n\\nParent page: ${Y} - Child page: ${e}.\\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&me("<rb>Deprecated Attributes</>\\n \\nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===I&&(I="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Xe(0,0,"autoResize",JSON.stringify(z)),z),close(){Xe(0,0,"close")},getId:()=>D,getPageInfo(e){if("function"==typeof e)return ne=e,Xe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\\n \\nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n");ne=null,Xe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Xe(0,0,"parentInfo"),()=>{oe=null,Xe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\\n \\nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Qe()},scrollBy(e,t){Xe(t,e,"scrollBy")},scrollTo(e,t){Xe(t,e,"scrollTo")},scrollToOffset(e,t){Xe(t,e,"scrollToOffset")},sendMessage(e,t){Xe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){I=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Ve("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\\n \\nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==W)return;function e(e){Xe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Xe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Xe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll(\'a[href^="#"]\').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Ve("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Xe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Ve(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Re(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<rb>Deprecated ${o}CalculationMethod (${e})</>\\n\\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ze(){I=we(I,f,He,"height")}function Se(){K=we(K,v,Ue,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Te),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ce(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Ve("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Re(document)()].filter(Pe),Me=new WeakSet;function Ae(e){e&&(Me.has(e)||(U.observe(e),Me.add(e)))}function Ce(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Ae)}function Te(e){"childList"===e.type&&Ce(e.target)}let ke=4,Ie=4;function xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\\n${t} ${T?"tagged ":""}element found at: ${a}px\\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||ke<c&&ke<Ie&&(ke=1.2*c,me(`<rb>Performance Warning</>\\n\\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\\n${u}`)),Ie=c,a}const Ne=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Re=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Be=!1;function qe({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Be)return Be=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\\n \\nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \\n\\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \\n \\nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\\n\\nMore info: https://iframe-resizer.com/performance.\\n\\n(Page size: ${i} > document size: ${e})`),o?I="autoOverflow":K="autoOverflow",n.taggedElement()}const Le={height:0,width:0},We={height:0,width:0};function De(e,t){function n(){return We[i]=r,Le[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===We[i]&&0===Le[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===We[i]&&c===Le[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==We[i]&&c<=Le[i]:return n();case!o:return t?e.taggedElement():qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<We[i]:case c===l||c===a:case r>c:return n();case!t:return qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ne(He)),min:()=>Math.min(...Ne(He)),grow:()=>He.max(),lowestElement:()=>xe("bottom"),taggedElement:()=>xe("bottom")},Ue={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(Ue,!1),autoOverflow:()=>De(Ue,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ne(Ue)),min:()=>Math.min(...Ne(Ue)),rightMostElement:()=>xe("right"),scroll:()=>Math.max(Ue.bodyScroll(),Ue.documentElementScroll()),taggedElement:()=>xe("right")};function Fe(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[I]():n,a=void 0===o?Ue[K]():o,O&&e(k,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&I in y||M&&K in y)&&Qe():(Je(),k=r,G=a,Xe(k,G,e,i))}function Ve(e,t,n,o,i){document.hidden||Fe(e,0,n,o,i)}function Je(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ze(e){k=He[I](),G=Ue[K](),Xe(k,G,e)}function Qe(e){const t=I;I=f,Je(),Ze("reset"),I=t}function Xe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${D}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Ye(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ze("resetPage")},resize(){Ve("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Xe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Xe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ge(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Ye({data:e,sameDomain:!0}),o(window,"message",Ye),o(window,"readystatechange",Ge),Ge())}));\n', X = "iframe-resizer/child 5.1.5", fe = $, w = `<script>${$}<\/script>`, V = (e) => !e || typeof e != "object" ? "" : String(e.type || e.answer_type || ""), j = (e) => {
|
|
61
|
+
applyChunk: X
|
|
62
|
+
}, $ = '/**\n * Skipped minification because the original files appears to be already minified.\n * Original file: /npm/@iframe-resizer/child@5.1.5/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n/*!\n * @preserve\n * \n * @module iframe-resizer/child 5.1.5 (umd) - 2024-07-09\n *\n * @license GPL-3.0 for non-commercial use only.\n * For commercial use, you must purchase a license from\n * https://iframe-resizer.com/pricing\n * \n * @desciption Keep same and cross domain iFrames sized to their content \n *\n * @author David J. Bradshaw <info@iframe-resizer.com>\n * \n * @see {@link https://iframe-resizer.com}\n * \n * @copyright (c) 2013 - 2024, David J. Bradshaw. All rights reserved.\n */\n\n\n!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.1.5",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),Ue.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,k=1,I=f,x=!0,N="",R={},B=!0,q=!1,L=0,W=!1,D="",H="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${D}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\\n").replaceAll("<rb>","\x1B[31;1m").replaceAll("</>","\x1B[m").replaceAll("<b>","\x1B[1m").replaceAll("<i>","\x1B[3m").replaceAll("<u>","\x1B[4m")):e(t.replaceAll("<br>","\\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");D=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],I=void 0===t[8]?I:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),H=void 0===t[13]?H:t[13],K=void 0===t[14]?K:t[14],W=void 0===t[15]?W:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,I=e?.heightCalculationMethod||I,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),I=t(I,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<rb>Legacy version detected on parent page</>\\n\\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\\n\\nSee <u>https://iframe-resizer.com/setup/</> for more details.\\n");Y!==e&&me(`<rb>Version mismatch</>\\n\\nThe parent and child pages are running different versions of <i>iframe resizer</>.\\n\\nParent page: ${Y} - Child page: ${e}.\\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&me("<rb>Deprecated Attributes</>\\n \\nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===I&&(I="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Xe(0,0,"autoResize",JSON.stringify(z)),z),close(){Xe(0,0,"close")},getId:()=>D,getPageInfo(e){if("function"==typeof e)return ne=e,Xe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\\n \\nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n");ne=null,Xe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Xe(0,0,"parentInfo"),()=>{oe=null,Xe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\\n \\nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Qe()},scrollBy(e,t){Xe(t,e,"scrollBy")},scrollTo(e,t){Xe(t,e,"scrollTo")},scrollToOffset(e,t){Xe(t,e,"scrollToOffset")},sendMessage(e,t){Xe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){I=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Ve("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\\n \\nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==W)return;function e(e){Xe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Xe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Xe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll(\'a[href^="#"]\').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Ve("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Xe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Ve(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Re(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<rb>Deprecated ${o}CalculationMethod (${e})</>\\n\\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ze(){I=we(I,f,He,"height")}function Se(){K=we(K,v,Ue,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Te),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ce(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Ve("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Re(document)()].filter(Pe),Me=new WeakSet;function Ae(e){e&&(Me.has(e)||(U.observe(e),Me.add(e)))}function Ce(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Ae)}function Te(e){"childList"===e.type&&Ce(e.target)}let ke=4,Ie=4;function xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\\n${t} ${T?"tagged ":""}element found at: ${a}px\\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||ke<c&&ke<Ie&&(ke=1.2*c,me(`<rb>Performance Warning</>\\n\\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\\n${u}`)),Ie=c,a}const Ne=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Re=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Be=!1;function qe({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Be)return Be=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\\n \\nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \\n\\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \\n \\nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\\n\\nMore info: https://iframe-resizer.com/performance.\\n\\n(Page size: ${i} > document size: ${e})`),o?I="autoOverflow":K="autoOverflow",n.taggedElement()}const Le={height:0,width:0},We={height:0,width:0};function De(e,t){function n(){return We[i]=r,Le[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===We[i]&&0===Le[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===We[i]&&c===Le[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==We[i]&&c<=Le[i]:return n();case!o:return t?e.taggedElement():qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<We[i]:case c===l||c===a:case r>c:return n();case!t:return qe({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ne(He)),min:()=>Math.min(...Ne(He)),grow:()=>He.max(),lowestElement:()=>xe("bottom"),taggedElement:()=>xe("bottom")},Ue={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(Ue,!1),autoOverflow:()=>De(Ue,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ne(Ue)),min:()=>Math.min(...Ne(Ue)),rightMostElement:()=>xe("right"),scroll:()=>Math.max(Ue.bodyScroll(),Ue.documentElementScroll()),taggedElement:()=>xe("right")};function Fe(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[I]():n,a=void 0===o?Ue[K]():o,O&&e(k,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&I in y||M&&K in y)&&Qe():(Je(),k=r,G=a,Xe(k,G,e,i))}function Ve(e,t,n,o,i){document.hidden||Fe(e,0,n,o,i)}function Je(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ze(e){k=He[I](),G=Ue[K](),Xe(k,G,e)}function Qe(e){const t=I;I=f,Je(),Ze("reset"),I=t}function Xe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${D}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Ye(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ze("resetPage")},resize(){Ve("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Xe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Xe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ge(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Ye({data:e,sameDomain:!0}),o(window,"message",Ye),o(window,"readystatechange",Ge),Ge())}));\n', J = "iframe-resizer/child 5.1.5", be = $, v = `<script>${$}<\/script>`, Y = (e) => !e || typeof e != "object" ? "" : String(e.type || e.answer_type || ""), k = (e) => {
|
|
63
63
|
if (!e || typeof e != "object")
|
|
64
64
|
return {};
|
|
65
65
|
const t = e.values, n = (r) => {
|
|
66
|
-
const
|
|
67
|
-
if (typeof
|
|
68
|
-
return
|
|
66
|
+
const s = t && typeof t == "object" ? t[r] : void 0;
|
|
67
|
+
if (typeof s == "string" && s)
|
|
68
|
+
return s;
|
|
69
69
|
const a = e[r];
|
|
70
70
|
return typeof a == "string" && a ? a : void 0;
|
|
71
|
-
}, o = n("url"),
|
|
71
|
+
}, o = n("url"), i = n("srcdoc");
|
|
72
72
|
return {
|
|
73
73
|
...o ? { url: o } : {},
|
|
74
|
-
...
|
|
74
|
+
...i ? { srcdoc: i } : {}
|
|
75
75
|
};
|
|
76
|
-
},
|
|
77
|
-
if (e.mode !== "result" ||
|
|
76
|
+
}, O = (e) => e && (e.includes("</head>") ? e.replace("</head>", `${v}</head>`) : e.includes("<body") ? e.replace("<body", `${v}<body`) : v + e), Z = (e) => !e || typeof e != "object" || Array.isArray(e) || !e.url && !e.srcdoc ? !1 : !e.srcdoc || e.srcdoc.includes(J), Q = (e, t) => {
|
|
77
|
+
if (e.mode !== "result" || Y(e.value) !== "url")
|
|
78
78
|
return !1;
|
|
79
|
-
const n =
|
|
80
|
-
return !n.url && !n.srcdoc || (n.srcdoc && (n.srcdoc =
|
|
81
|
-
},
|
|
82
|
-
if (
|
|
79
|
+
const n = k(e.value);
|
|
80
|
+
return !n.url && !n.srcdoc || (n.srcdoc && (n.srcdoc = O(n.srcdoc)), t.push({ answer_type: "url", values: n })), !0;
|
|
81
|
+
}, F = (e) => {
|
|
82
|
+
if (Z(e.values))
|
|
83
83
|
return e;
|
|
84
|
-
const t =
|
|
85
|
-
return !t.url && !t.srcdoc || (t.srcdoc && (t.srcdoc =
|
|
86
|
-
},
|
|
84
|
+
const t = k(e);
|
|
85
|
+
return !t.url && !t.srcdoc || (t.srcdoc && (t.srcdoc = O(t.srcdoc)), e.values = t), e;
|
|
86
|
+
}, ee = {
|
|
87
87
|
id: "iframe_page",
|
|
88
88
|
answerType: "url",
|
|
89
|
-
applyChunk:
|
|
90
|
-
normalizeReport:
|
|
91
|
-
},
|
|
89
|
+
applyChunk: Q,
|
|
90
|
+
normalizeReport: F
|
|
91
|
+
}, z = "recordset", te = ["cols", "values", "chart", "title", "max_cols", "parent_link_col", "agent_key"], ne = (e) => !e || typeof e != "object" ? "" : String(e.type || e.answer_type || ""), h = (e) => !!e && typeof e == "object" && !Array.isArray(e) && (Array.isArray(e.cols) || Array.isArray(e.values)), oe = (e) => {
|
|
92
92
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
93
93
|
return;
|
|
94
94
|
const t = e.values;
|
|
@@ -96,64 +96,99 @@ const _ = () => ({
|
|
|
96
96
|
return t;
|
|
97
97
|
if (h(e))
|
|
98
98
|
return e;
|
|
99
|
-
},
|
|
100
|
-
if (e.mode !== "result" ||
|
|
99
|
+
}, re = (e, t) => {
|
|
100
|
+
if (e.mode !== "result" || ne(e.value) !== z)
|
|
101
101
|
return !1;
|
|
102
|
-
const n =
|
|
103
|
-
return n && t.push({ answer_type:
|
|
104
|
-
},
|
|
102
|
+
const n = oe(e.value);
|
|
103
|
+
return n && t.push({ answer_type: z, values: n }), !0;
|
|
104
|
+
}, ie = (e) => {
|
|
105
105
|
if (h(e.values))
|
|
106
106
|
return e;
|
|
107
107
|
const t = e;
|
|
108
108
|
if (!h(t))
|
|
109
109
|
return e;
|
|
110
110
|
const n = {};
|
|
111
|
-
for (const o of
|
|
111
|
+
for (const o of te)
|
|
112
112
|
n[o] = t[o];
|
|
113
113
|
return e.values = n, e;
|
|
114
|
-
},
|
|
114
|
+
}, se = {
|
|
115
115
|
id: "recordset",
|
|
116
|
-
answerType:
|
|
117
|
-
applyChunk:
|
|
118
|
-
normalizeReport:
|
|
119
|
-
},
|
|
116
|
+
answerType: z,
|
|
117
|
+
applyChunk: re,
|
|
118
|
+
normalizeReport: ie
|
|
119
|
+
}, g = "output_file", ae = (e) => !e || typeof e != "object" ? "" : String(e.type || e.answer_type || ""), y = (e, t) => {
|
|
120
|
+
if (!e || typeof e != "object")
|
|
121
|
+
return;
|
|
122
|
+
const n = e[t];
|
|
123
|
+
return typeof n == "string" && n ? n : void 0;
|
|
124
|
+
}, M = (e) => {
|
|
125
|
+
if (!e || typeof e != "object")
|
|
126
|
+
return {};
|
|
127
|
+
const t = e.values && typeof e.values == "object" ? e.values : void 0, n = y(t, "file_id") ?? y(e, "file_id"), o = y(t, "file_name") ?? y(e, "file_name");
|
|
128
|
+
return {
|
|
129
|
+
...n ? { file_id: n } : {},
|
|
130
|
+
...o ? { file_name: o } : {}
|
|
131
|
+
};
|
|
132
|
+
}, ce = (e, t) => {
|
|
133
|
+
if (e.mode !== "result" || ae(e.value) !== g)
|
|
134
|
+
return !1;
|
|
135
|
+
const n = M(e.value);
|
|
136
|
+
return !n.file_id && !n.file_name || t.push({ answer_type: g, values: n }), !0;
|
|
137
|
+
}, le = (e) => {
|
|
138
|
+
const t = M(e);
|
|
139
|
+
if (!t.file_id && !t.file_name)
|
|
140
|
+
return e;
|
|
141
|
+
const n = e.values && typeof e.values == "object" && !Array.isArray(e.values) ? e.values : {};
|
|
142
|
+
return (!t.file_id || n.file_id) && (!t.file_name || n.file_name) || (e.values = { ...n, ...t }), e;
|
|
143
|
+
}, ue = {
|
|
144
|
+
id: g,
|
|
145
|
+
answerType: g,
|
|
146
|
+
applyChunk: ce,
|
|
147
|
+
normalizeReport: le
|
|
148
|
+
}, w = [
|
|
149
|
+
G,
|
|
150
|
+
K,
|
|
151
|
+
ee,
|
|
152
|
+
se,
|
|
153
|
+
ue
|
|
154
|
+
], de = (e) => {
|
|
120
155
|
const t = (e == null ? void 0 : e.parsers) ?? [];
|
|
121
|
-
return t.length ? [...
|
|
122
|
-
},
|
|
123
|
-
var
|
|
124
|
-
const o = (
|
|
156
|
+
return t.length ? [...w, ...t] : w;
|
|
157
|
+
}, ve = (e, t, n) => {
|
|
158
|
+
var s;
|
|
159
|
+
const o = (s = e.answer) == null ? void 0 : s.reports;
|
|
125
160
|
if (!o)
|
|
126
161
|
return [];
|
|
127
|
-
const
|
|
162
|
+
const i = new Set(
|
|
128
163
|
((n == null ? void 0 : n.parsers) ?? []).filter((a) => a.applyChunk && a.answerType).map((a) => a.answerType)
|
|
129
164
|
), r = [];
|
|
130
|
-
for (const a of
|
|
131
|
-
a.applyChunk && (
|
|
165
|
+
for (const a of de(n))
|
|
166
|
+
a.applyChunk && (w.includes(a) && a.answerType && i.has(a.answerType) || a.applyChunk(t, o, e, n) && r.push(a.id));
|
|
132
167
|
return r;
|
|
133
|
-
},
|
|
168
|
+
}, fe = (e, t) => {
|
|
134
169
|
var r;
|
|
135
170
|
const n = e.answer_type;
|
|
136
171
|
if (!n)
|
|
137
172
|
return;
|
|
138
|
-
const
|
|
139
|
-
(r =
|
|
140
|
-
},
|
|
141
|
-
var
|
|
142
|
-
const
|
|
143
|
-
if ((
|
|
144
|
-
const a =
|
|
173
|
+
const i = ((t == null ? void 0 : t.parsers) ?? []).find((s) => s.answerType === n && !!s.normalizeReport) ?? w.find((s) => s.answerType === n && !!s.normalizeReport);
|
|
174
|
+
(r = i == null ? void 0 : i.normalizeReport) == null || r.call(i, e, t);
|
|
175
|
+
}, x = (e, t = "", n = "", o) => {
|
|
176
|
+
var s;
|
|
177
|
+
const i = (e == null ? void 0 : e.values) ?? e;
|
|
178
|
+
if ((s = i == null ? void 0 : i.answer) != null && s.reports) {
|
|
179
|
+
const a = i;
|
|
145
180
|
for (const c of a.answer.reports)
|
|
146
|
-
|
|
181
|
+
fe(c, o);
|
|
147
182
|
return a;
|
|
148
183
|
}
|
|
149
|
-
const r =
|
|
150
|
-
return typeof
|
|
151
|
-
},
|
|
184
|
+
const r = D(t, n);
|
|
185
|
+
return typeof i == "string" && R({ mode: "knowledge_stream", value: i }, r.answer.reports, r, o), r;
|
|
186
|
+
}, ze = {
|
|
152
187
|
User: "user",
|
|
153
188
|
Assistant: "assistant"
|
|
154
189
|
};
|
|
155
|
-
let
|
|
156
|
-
const
|
|
190
|
+
let me = 0;
|
|
191
|
+
const P = (e = "msg") => `${e}-${++me}`, pe = (e) => {
|
|
157
192
|
const t = e.trim();
|
|
158
193
|
if (!t || t === "[DONE]")
|
|
159
194
|
return null;
|
|
@@ -167,7 +202,7 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
167
202
|
return null;
|
|
168
203
|
}
|
|
169
204
|
}
|
|
170
|
-
},
|
|
205
|
+
}, ye = () => {
|
|
171
206
|
let e = "";
|
|
172
207
|
return {
|
|
173
208
|
push(t) {
|
|
@@ -180,26 +215,26 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
180
215
|
return e = "", t ? [t] : [];
|
|
181
216
|
}
|
|
182
217
|
};
|
|
183
|
-
},
|
|
184
|
-
const n = e.getReader(), o = new TextDecoder(),
|
|
185
|
-
const a =
|
|
218
|
+
}, _e = async (e, t) => {
|
|
219
|
+
const n = e.getReader(), o = new TextDecoder(), i = ye(), r = (s) => {
|
|
220
|
+
const a = pe(s);
|
|
186
221
|
a && t(a);
|
|
187
222
|
};
|
|
188
223
|
try {
|
|
189
224
|
for (; ; ) {
|
|
190
|
-
const { done:
|
|
191
|
-
if (
|
|
225
|
+
const { done: s, value: a } = await n.read();
|
|
226
|
+
if (s)
|
|
192
227
|
break;
|
|
193
|
-
|
|
228
|
+
i.push(o.decode(a, { stream: !0 })).forEach(r);
|
|
194
229
|
}
|
|
195
|
-
|
|
196
|
-
} catch (
|
|
230
|
+
i.flush().forEach(r);
|
|
231
|
+
} catch (s) {
|
|
197
232
|
throw await n.cancel().catch(() => {
|
|
198
|
-
}),
|
|
233
|
+
}), s;
|
|
199
234
|
} finally {
|
|
200
235
|
n.releaseLock();
|
|
201
236
|
}
|
|
202
|
-
},
|
|
237
|
+
}, b = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"]), N = (e) => !e || isNaN(e) ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`, Se = (e) => {
|
|
203
238
|
var o;
|
|
204
239
|
if (e.type && e.type !== "file")
|
|
205
240
|
return !1;
|
|
@@ -207,41 +242,41 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
207
242
|
if (t.groupType === "image")
|
|
208
243
|
return !0;
|
|
209
244
|
const n = (t.suffix || ((o = e.name) != null && o.includes(".") ? e.name.split(".").pop() : "") || "").toLowerCase();
|
|
210
|
-
return !!(
|
|
211
|
-
},
|
|
245
|
+
return !!(b.has(n) || t.raw && typeof t.raw.type == "string" && t.raw.type.startsWith("image/"));
|
|
246
|
+
}, he = (e, t, n) => e.startsWith("http://") || e.startsWith("https://") || e.startsWith("/") ? e : `${(t || "").replace(/\/$/, "")}${n}?file_id=${e}`, ge = (e, t = "", n) => e ? n ? n(e) : he(e, t, "/file/download_file") : "", Ce = (e, t = "", n) => {
|
|
212
247
|
const o = e.attachContent || {};
|
|
213
|
-
return o.url ? o.url : typeof o.fileContent == "string" && o.fileContent.startsWith("data:image/") ? o.fileContent : o.fileId ?
|
|
214
|
-
},
|
|
248
|
+
return o.url ? o.url : typeof o.fileContent == "string" && o.fileContent.startsWith("data:image/") ? o.fileContent : o.fileId ? ge(o.fileId, t, n) : "";
|
|
249
|
+
}, T = (e) => {
|
|
215
250
|
var a;
|
|
216
|
-
const t = (e == null ? void 0 : e.name) || "", n = t.includes(".") && ((a = t.split(".").pop()) == null ? void 0 : a.toLowerCase()) || "", o =
|
|
217
|
-
let
|
|
251
|
+
const t = (e == null ? void 0 : e.name) || "", n = t.includes(".") && ((a = t.split(".").pop()) == null ? void 0 : a.toLowerCase()) || "", o = b.has(n) || (e == null ? void 0 : e.type) && typeof e.type == "string" && e.type.startsWith("image/");
|
|
252
|
+
let i;
|
|
218
253
|
if (o && typeof window < "u" && typeof URL < "u" && e instanceof Blob)
|
|
219
254
|
try {
|
|
220
|
-
|
|
255
|
+
i = URL.createObjectURL(e);
|
|
221
256
|
} catch {
|
|
222
|
-
|
|
257
|
+
i = void 0;
|
|
223
258
|
}
|
|
224
|
-
const r =
|
|
259
|
+
const r = N(e == null ? void 0 : e.size), s = [n.toUpperCase(), r].filter(Boolean).join(" · ");
|
|
225
260
|
return {
|
|
226
261
|
type: "file",
|
|
227
262
|
name: t,
|
|
228
|
-
description:
|
|
263
|
+
description: s,
|
|
229
264
|
attachContent: {
|
|
230
265
|
file_name: t,
|
|
231
266
|
size: e == null ? void 0 : e.size,
|
|
232
267
|
suffix: n,
|
|
233
268
|
raw: e,
|
|
234
|
-
url:
|
|
269
|
+
url: i,
|
|
235
270
|
groupType: o ? "image" : "file"
|
|
236
271
|
}
|
|
237
272
|
};
|
|
238
|
-
},
|
|
273
|
+
}, L = (e) => {
|
|
239
274
|
var r;
|
|
240
|
-
const t = (e == null ? void 0 : e.file_name) ?? (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.title) ?? "", n = t.includes(".") && ((r = t.split(".").pop()) == null ? void 0 : r.toLowerCase()) || "", o =
|
|
275
|
+
const t = (e == null ? void 0 : e.file_name) ?? (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.title) ?? "", n = t.includes(".") && ((r = t.split(".").pop()) == null ? void 0 : r.toLowerCase()) || "", o = b.has(n) || (e == null ? void 0 : e.groupType) === "image", i = n ? n.toUpperCase() : "";
|
|
241
276
|
return {
|
|
242
277
|
type: "file",
|
|
243
278
|
name: t,
|
|
244
|
-
description:
|
|
279
|
+
description: i,
|
|
245
280
|
attachContent: {
|
|
246
281
|
file_name: (e == null ? void 0 : e.file_name) ?? t,
|
|
247
282
|
fileId: (e == null ? void 0 : e.file_id) ?? (e == null ? void 0 : e.id),
|
|
@@ -250,36 +285,36 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
250
285
|
groupType: o ? "image" : "file"
|
|
251
286
|
}
|
|
252
287
|
};
|
|
253
|
-
}, de = (e) => {
|
|
254
|
-
var o, s, r, i;
|
|
255
|
-
const t = (e == null ? void 0 : e.values) ?? e, n = ((o = t == null ? void 0 : t.attach) == null ? void 0 : o.files) ?? ((r = (s = t == null ? void 0 : t.answer) == null ? void 0 : s.attach) == null ? void 0 : r.files) ?? (t == null ? void 0 : t.attach_files) ?? ((i = t == null ? void 0 : t.answer) == null ? void 0 : i.attach_files) ?? [];
|
|
256
|
-
return !Array.isArray(n) || n.length === 0 ? [] : n.map((a) => x(a));
|
|
257
288
|
}, we = (e) => {
|
|
258
|
-
var o, s;
|
|
289
|
+
var o, i, r, s;
|
|
290
|
+
const t = (e == null ? void 0 : e.values) ?? e, n = ((o = t == null ? void 0 : t.attach) == null ? void 0 : o.files) ?? ((r = (i = t == null ? void 0 : t.answer) == null ? void 0 : i.attach) == null ? void 0 : r.files) ?? (t == null ? void 0 : t.attach_files) ?? ((s = t == null ? void 0 : t.answer) == null ? void 0 : s.attach_files) ?? [];
|
|
291
|
+
return !Array.isArray(n) || n.length === 0 ? [] : n.map((a) => L(a));
|
|
292
|
+
}, Ee = (e) => {
|
|
293
|
+
var o, i;
|
|
259
294
|
if (!e)
|
|
260
295
|
return { type: "file", name: "", description: "", attachContent: {} };
|
|
261
296
|
if (typeof Blob < "u" && e instanceof Blob)
|
|
262
|
-
return
|
|
297
|
+
return T(e);
|
|
263
298
|
if (typeof e == "object" && e.attachContent) {
|
|
264
|
-
const r = e.type || "file",
|
|
299
|
+
const r = e.type || "file", s = e.name || e.attachContent.file_name || e.attachContent.name || "";
|
|
265
300
|
let a = e.description || "";
|
|
266
301
|
const c = { ...e.attachContent };
|
|
267
|
-
if (r === "file" && (!c.suffix &&
|
|
268
|
-
const l = typeof c.size == "number" ?
|
|
302
|
+
if (r === "file" && (!c.suffix && s.includes(".") && (c.suffix = ((o = s.split(".").pop()) == null ? void 0 : o.toLowerCase()) || ""), (c.groupType === "image" || c.suffix && b.has(c.suffix.toLowerCase()) || c.raw && typeof c.raw.type == "string" && c.raw.type.startsWith("image/")) && (c.groupType = "image"), !a)) {
|
|
303
|
+
const l = typeof c.size == "number" ? N(c.size) : c.size || "";
|
|
269
304
|
a = [c.suffix ? c.suffix.toUpperCase() : "", l].filter(Boolean).join(" · ");
|
|
270
305
|
}
|
|
271
306
|
return {
|
|
272
307
|
...e,
|
|
273
308
|
type: r,
|
|
274
|
-
name:
|
|
309
|
+
name: s,
|
|
275
310
|
description: a,
|
|
276
311
|
attachContent: c
|
|
277
312
|
};
|
|
278
313
|
}
|
|
279
314
|
if (e.file_id || e.fileId)
|
|
280
|
-
return
|
|
315
|
+
return L(e);
|
|
281
316
|
if (e.raw && typeof Blob < "u" && e.raw instanceof Blob) {
|
|
282
|
-
const r =
|
|
317
|
+
const r = T(e.raw);
|
|
283
318
|
return {
|
|
284
319
|
...r,
|
|
285
320
|
...e,
|
|
@@ -289,7 +324,7 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
289
324
|
}
|
|
290
325
|
};
|
|
291
326
|
}
|
|
292
|
-
const t = e.name || e.title || "", n = t.includes(".") && ((
|
|
327
|
+
const t = e.name || e.title || "", n = t.includes(".") && ((i = t.split(".").pop()) == null ? void 0 : i.toLowerCase()) || "";
|
|
293
328
|
return {
|
|
294
329
|
type: e.type || "file",
|
|
295
330
|
name: t,
|
|
@@ -300,33 +335,33 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
300
335
|
...e
|
|
301
336
|
}
|
|
302
337
|
};
|
|
303
|
-
},
|
|
338
|
+
}, H = (e) => we(e), Ae = async (e) => [...(await e.getHistoryGroups()).groups ?? []].sort((o, i) => String(i.create_time ?? "").localeCompare(String(o.create_time ?? ""))), Te = async (e, t) => {
|
|
304
339
|
const n = await e.createHistoryGroup(t), o = (n == null ? void 0 : n.group_id) ?? (n == null ? void 0 : n.history_group_id) ?? "";
|
|
305
340
|
if (!o)
|
|
306
341
|
throw new Error("创建对话分组失败");
|
|
307
342
|
return o;
|
|
308
|
-
},
|
|
343
|
+
}, Re = (e, t) => e.deleteHistoryGroup(t), je = (e, t, n) => e.setHistoryGroupTitle(t, n), B = 5, U = async (e, t, n) => {
|
|
309
344
|
const o = new Array(e.length);
|
|
310
|
-
let
|
|
345
|
+
let i = 0;
|
|
311
346
|
const r = Array.from({ length: Math.min(t, e.length) }, async () => {
|
|
312
|
-
for (;
|
|
313
|
-
const
|
|
314
|
-
o[
|
|
347
|
+
for (; i < e.length; ) {
|
|
348
|
+
const s = i++;
|
|
349
|
+
o[s] = await n(e[s], s);
|
|
315
350
|
}
|
|
316
351
|
});
|
|
317
352
|
return await Promise.all(r), o;
|
|
318
|
-
},
|
|
353
|
+
}, Ie = async (e, t, n = 10, o = 0, i) => {
|
|
319
354
|
if (!t)
|
|
320
355
|
return [];
|
|
321
|
-
const
|
|
356
|
+
const s = [...await e.getHistoryDetail(t, o, n)].sort((u, l) => String(u.create_time || "").localeCompare(String(l.create_time || ""))), a = await U(s, B, async (u) => {
|
|
322
357
|
try {
|
|
323
358
|
return await e.getHistoryAnswer(u.history_id || "");
|
|
324
359
|
} catch {
|
|
325
360
|
return null;
|
|
326
361
|
}
|
|
327
362
|
}), c = [];
|
|
328
|
-
return
|
|
329
|
-
const p = u.history_id ||
|
|
363
|
+
return s.forEach((u, l) => {
|
|
364
|
+
const p = u.history_id || P("h"), d = a[l], f = d != null ? H(d) : [];
|
|
330
365
|
if (c.push({
|
|
331
366
|
id: p,
|
|
332
367
|
historyId: u.history_id,
|
|
@@ -334,7 +369,7 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
334
369
|
content: u.question ?? "",
|
|
335
370
|
attachments: f.length > 0 ? f : void 0
|
|
336
371
|
}), d != null) {
|
|
337
|
-
const m =
|
|
372
|
+
const m = x(d, p, u.question ?? "", i);
|
|
338
373
|
c.push({
|
|
339
374
|
id: `${p}-answer`,
|
|
340
375
|
historyId: u.history_id,
|
|
@@ -342,14 +377,14 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
342
377
|
answer: m,
|
|
343
378
|
error: !1,
|
|
344
379
|
stopped: !1,
|
|
345
|
-
thinking: { steps:
|
|
380
|
+
thinking: { steps: I(m), expanded: !1 }
|
|
346
381
|
});
|
|
347
382
|
}
|
|
348
383
|
}), c;
|
|
349
|
-
},
|
|
384
|
+
}, $e = async (e, t, n = 10, o, i = 0, r) => {
|
|
350
385
|
if (!t)
|
|
351
386
|
return o == null || o({ type: "users", users: [] }), [];
|
|
352
|
-
const a = [...await e.getHistoryDetail(t,
|
|
387
|
+
const a = [...await e.getHistoryDetail(t, i, n)].sort((d, f) => String(d.create_time || "").localeCompare(String(f.create_time || ""))), c = a.map((d) => d.history_id || P("h")), u = a.map((d, f) => ({
|
|
353
388
|
id: c[f],
|
|
354
389
|
historyId: d.history_id,
|
|
355
390
|
role: "user",
|
|
@@ -357,7 +392,7 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
357
392
|
}));
|
|
358
393
|
o == null || o({ type: "users", users: u });
|
|
359
394
|
const l = new Array(a.length).fill(null);
|
|
360
|
-
await
|
|
395
|
+
await U(a, B, async (d, f) => {
|
|
361
396
|
let m = null;
|
|
362
397
|
try {
|
|
363
398
|
m = await e.getHistoryAnswer(d.history_id || "");
|
|
@@ -366,22 +401,22 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
366
401
|
}
|
|
367
402
|
if (m == null)
|
|
368
403
|
return;
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
const
|
|
404
|
+
const _ = H(m);
|
|
405
|
+
_.length > 0 && (u[f].attachments = _);
|
|
406
|
+
const S = x(m, c[f], d.question ?? "", r), C = {
|
|
372
407
|
id: `${c[f]}-answer`,
|
|
373
408
|
historyId: d.history_id,
|
|
374
409
|
role: "assistant",
|
|
375
|
-
answer:
|
|
410
|
+
answer: S,
|
|
376
411
|
error: !1,
|
|
377
412
|
stopped: !1,
|
|
378
|
-
thinking: { steps:
|
|
413
|
+
thinking: { steps: I(S), expanded: !1 }
|
|
379
414
|
};
|
|
380
|
-
l[f] =
|
|
415
|
+
l[f] = C, o == null || o({
|
|
381
416
|
type: "assistant",
|
|
382
417
|
index: f,
|
|
383
418
|
user: u[f],
|
|
384
|
-
assistant:
|
|
419
|
+
assistant: C
|
|
385
420
|
});
|
|
386
421
|
});
|
|
387
422
|
const p = [];
|
|
@@ -392,48 +427,53 @@ const O = (e = "msg") => `${e}-${++ie}`, ae = (e) => {
|
|
|
392
427
|
}), p;
|
|
393
428
|
};
|
|
394
429
|
export {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
430
|
+
be as IFRAME_RESIZER_CHILD_SCRIPT,
|
|
431
|
+
b as IMAGE_EXTENSIONS,
|
|
432
|
+
g as OUTPUT_FILE_ANSWER_TYPE,
|
|
433
|
+
z as RECORDSET_ANSWER_TYPE,
|
|
434
|
+
ze as RoleEnum,
|
|
435
|
+
ve as applyAnswerChunk,
|
|
436
|
+
X as applyDeepThinkingChunk,
|
|
437
|
+
Q as applyIframePageChunk,
|
|
438
|
+
R as applyKnowledgeStreamChunk,
|
|
439
|
+
ce as applyOutputFileChunk,
|
|
440
|
+
re as applyRecordsetChunk,
|
|
441
|
+
V as collectDeepThinkingSteps,
|
|
442
|
+
I as collectThinkingSteps,
|
|
443
|
+
_e as consumeStream,
|
|
444
|
+
D as createEmptyAnswerValues,
|
|
445
|
+
Te as createHistoryGroup,
|
|
446
|
+
ye as createLineSplitter,
|
|
447
|
+
G as deepThinkingParser,
|
|
448
|
+
Re as deleteHistoryGroup,
|
|
449
|
+
H as extractAttachmentsFromHistory,
|
|
450
|
+
we as extractHistoryAttachments,
|
|
451
|
+
N as formatFileSize,
|
|
452
|
+
Ae as getHistoryGroups,
|
|
453
|
+
ee as iframePageParser,
|
|
454
|
+
O as injectIframeResizerScript,
|
|
455
|
+
Se as isImageAttachment,
|
|
456
|
+
K as knowledgeStreamParser,
|
|
457
|
+
Ie as loadGroupMessages,
|
|
458
|
+
$e as loadGroupMessagesByStep,
|
|
459
|
+
P as nextLocalMessageId,
|
|
460
|
+
x as normalizeAnswer,
|
|
461
|
+
fe as normalizeAnswerReport,
|
|
462
|
+
Ee as normalizeAttachment,
|
|
463
|
+
F as normalizeIframePageReport,
|
|
464
|
+
q as normalizeKnowledgeStreamReport,
|
|
465
|
+
le as normalizeOutputFileReport,
|
|
466
|
+
ie as normalizeRecordsetReport,
|
|
467
|
+
ue as outputFileParser,
|
|
468
|
+
L as parseHistoryAttachment,
|
|
469
|
+
T as parseRealtimeAttachment,
|
|
470
|
+
pe as parseSseLine,
|
|
471
|
+
M as readOutputFilePayload,
|
|
472
|
+
oe as readRecordsetPayload,
|
|
473
|
+
se as recordsetParser,
|
|
474
|
+
ge as resolveAttachDownloadUrl,
|
|
475
|
+
Ce as resolveAttachPreviewUrl,
|
|
476
|
+
he as resolveRemoteFileUrl,
|
|
477
|
+
je as setHistoryGroupTitle
|
|
438
478
|
};
|
|
439
479
|
//# sourceMappingURL=index.js.map
|