PageSourceSearch

https://app.budly.ai/_next/static/chunks/6921-7a03829f4701855b.js

js budly.ai collected 2026-10-05 11:53:03 UTC 34,866 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6921],{7558:(e,t,r)=>{r.d(t,{ID:()=>i,ME:()=>n,OO:()=>l,aR:()=>s,lI:()=>a,pl:()=>d});var o=r(61463);let a=(e,t)=>void 0===t&&e.trimStart().startsWith("data:"),n=e=>{if("user"!==e.role||"string"!=typeof e.content)return!0;let t=e.content.trim();return!(0===t.length||t.includes("<|FEEDBACK_REQUEST|>"))&&!t.startsWith(o.W)},i=e=>new Set(e.filter(e=>"assistant"===e.role).map(e=>e.id)),s=(e,t,r)=>{if(r)for(let r=e.length-1;r>=0;r--){let o=e[r];if("assistant"===o.role&&!t.has(o.id))return o.id}},c=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),l=e=>{let t=[],r=new Map,o=0,a=function(e){var n,i;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||s>8)return;if(Array.isArray(e))return void e.forEach(e=>a(e,s+1));if("string"==typeof e){let r=(e=>{let t=e.trim();if(""!==t)try{return JSON.parse(t)}catch(e){return}})(e);void 0!==r&&r!==e?a(r,s+1):""!==e.trim()&&t.push(e);return}if(!c(e))return void t.push(String(e));if("string"!=typeof e.type){let r=e.completion_content;"string"==typeof r&&""!==r.trim()?t.push(r):t.push(JSON.stringify(e));return}let l=c(n=e.properties)?n:{};if("general_chat"===e.type){let e=l.completion_content;"string"==typeof e&&""!==e.trim()&&t.push(e);return}let d=[e.component_id,e.componentId,e.id].find(e=>"string"==typeof e),p="string"==typeof d&&""!==d?d:"historical-".concat(e.type,"-").concat(o++),u=c(i=e.info)?Object.fromEntries(Object.entries(i).filter(e=>"string"==typeof e[1])):{};void 0===u.ctx_name&&"string"==typeof e.name&&(u.ctx_name=e.name),void 0===u.ctx_id&&"string"==typeof e.context_id&&(u.ctx_id=e.context_id),void 0===u.type&&(u.type=e.type),r.set(p,{type:e.type,properties:l,info:u,componentId:p})};return a(e),{content:t.join("\n\n"),genUi:Array.from(r.values())}},d=e=>{for(let r=e.length-1;r>=0;r--){var t;let o=e[r];if("user"!==o.role)continue;let a=new Set;return(null!=(t=o.resources)?t:[]).filter(e=>!((null==e?void 0:e.reference_type)!=="focus"||"string"!=typeof e.id||""===e.id||a.has(e.id))&&(a.add(e.id),!0))}return[]}},38810:(e,t,r)=>{r.d(t,{U:()=>o,p:()=>a});let o="ERR_FEDERATION_INVITE_ONLY";function a(e,t){return 403===e&&t.includes(o)}},50063:(e,t,r)=>{r.d(t,{Mt:()=>p,am:()=>i,ev:()=>d,iN:()=>l});var o=r(6219),a=r(48303),n=r(32730);let i=async()=>{let e=(0,n.getCookie)(o.bbO),t=await fetch(o.ow5,{method:"GET",headers:{"X-access-token-dev":e}});if(!t.ok)throw Error("Error fetching card catalog");return await t.json()},s=(e,t,r)=>{var o,a,n;let i=new URLSearchParams;return i.append(e,t.replace(/^(uobj-|coll-)/,"")),void 0!==r.style&&i.append("card_style",null!=(o=r.style)?o:""),void 0!==r.color&&i.append("card_color",null!=(a=r.color)?a:""),void 0!==r.patron&&i.append("card_patron",null!=(n=r.patron)?n:""),i},c=async(e,t)=>{let r=(0,n.getCookie)(o.bbO),a=await fetch(e,{method:"PUT",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":r},body:t});if(!a.ok)throw Error("Error updating card (".concat(a.status,")"))},l=async(e,t)=>c(o.n1r,s("resource_id",e,t)),d=async(e,t)=>c(o.TPz,s("collection_id",e,t)),p=e=>{let{looks:t,setLook:r,clearLook:o}=a.Io.getState();for(let a of e){var n,i,s,c,l;if(!(null==a?void 0:a.id)||void 0===a.card_style&&void 0===a.card_color&&void 0===a.card_patron)continue;let e=null!=(n=a.card_style)?n:"",d=null!=(i=a.card_color)?i:"",p=t[a.id],u=null!=(c=null!=(s=a.card_patron)?s:null==p?void 0:p.patron)?c:null;if(!e&&!d&&!u){a.access_type&&"OWNER"!==a.access_type&&p&&o(a.id);continue}((null==p?void 0:p.style)!==e||(null==p?void 0:p.color)!==d||(null!=(l=null==p?void 0:p.patron)?l:null)!==u)&&r(a.id,{style:e,color:d,patron:u})}}},58194:(e,t,r)=>{r.d(t,{Hg:()=>s,cb:()=>a,jO:()=>i,or:()=>n});var o=r(512);let a=o.env.NEXT_PUBLIC_PROJECT&&o.env.NEXT_PUBLIC_PROJECT.trim().length>0?o.env.NEXT_PUBLIC_PROJECT.trim():"Budly",n="budly.ai",i=!0,s=e=>{var t;return(null!=(t=e.trim().toLowerCase().split("@").pop())?t:"")===n&&i?"Stanza One":a}},61463:(e,t,r)=>{r.d(t,{W:()=>o});let o="<|USER_RESPONSE|>"},66921:(e,t,r)=>{r.d(t,{NJ:()=>er,kj:()=>eh,dk:()=>e_,O:()=>q,jq:()=>ea,_c:()=>Y,hw:()=>Z,Iq:()=>eu,No:()=>x,L_:()=>el,fx:()=>M,c7:()=>k,LK:()=>S,pQ:()=>j,tF:()=>U,An:()=>R,mZ:()=>P,v:()=>ee,I_:()=>G,uM:()=>et,$h:()=>Q,fc:()=>$,lO:()=>V,CN:()=>B,kZ:()=>T,zx:()=>N,Ir:()=>C,q_:()=>I,Jh:()=>A,AV:()=>O,vo:()=>w,Gv:()=>m,ug:()=>f,JO:()=>ec,j:()=>K,e4:()=>J,Kq:()=>X,df:()=>g,b0:()=>ed,nd:()=>_,XV:()=>z,Hl:()=>W,nH:()=>eo,x5:()=>ei,uO:()=>D,io:()=>L,Jc:()=>h,wf:()=>ep,ge:()=>H,p6:()=>en,mQ:()=>es,b6:()=>y,US:()=>v,x:()=>E}
1);var o=r(38810),a=r(6219),n=r(48303),i=r(50063),s=r(58194),c=r(32730),l=r(54814),d=r.n(l);let p=e=>{if(!e)return null;if("string"==typeof e)return/^https?:\/\//i.test(e)?e:null;if(Array.isArray(e)){for(let t of e){let e=p(t);if(e)return e}return null}if("object"==typeof e)for(let t of Object.values(e)){let e=p(t);if(e)return e}return null};var u=r(7558);let h=e=>{let t=[],r=new Set;for(let a=0;a<e.length;a+=1){var o;let n=e[a],i="string"==typeof(null==n?void 0:n[3])?n[3]:void 0,s=!!(null==n?void 0:n[4]);if(void 0!==i){if(r.has(i))continue;r.add(i)}let c={id:null!=(o=null==n?void 0:n[3])?o:"user-".concat(a),role:"user",content:"string"==typeof(null==n?void 0:n[0])?n[0]:"",resources:null==n?void 0:n[2],threadId:i},l=null==n?void 0:n[1],d=Array.isArray(l)?l[0]:l,p=(0,u.OO)(d),h={id:"assistant-".concat(null!=i?i:a),role:"assistant",content:p.content,genUi:p.genUi,resources:null,hasFeedback:s,threadId:i};t.push(c,h)}return t},_=e=>{let t=[];for(let r in e){let o=encodeURIComponent(r),a=encodeURIComponent(e[r]);t.push("".concat(o,"=").concat(a))}return t.join("&")},g=e=>{if(null!=e)try{return d().parse(e)}catch(t){console.error("Error parsing JSON",t.message);try{let t=(e=>{let t=["ROOT"],r=-1,o=null,a=(e,a,n)=>{switch(e){case'"':r=a,t.pop(),t.push(n),t.push("INSIDE_STRING");break;case"f":case"t":case"n":r=a,o=a,t.pop(),t.push(n),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(n),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=a,t.pop(),t.push(n),t.push("INSIDE_NUMBER");break;case"{":r=a,t.pop(),t.push(n),t.push("INSIDE_OBJECT_START");break;case"[":r=a,t.pop(),t.push(n),t.push("INSIDE_ARRAY_START")}},n=(e,o)=>{switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":r=o,t.pop()}},i=(e,o)=>{switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=o,t.pop()}};for(let s=0;s<e.length;s++){let c=e[s];switch(t[t.length-1]){case"ROOT":a(c,s,"FINISH");break;case"INSIDE_OBJECT_START":switch(c){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===c&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===c&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===c&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":a(c,s,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":n(c,s);break;case"INSIDE_STRING":switch(c){case'"':t.pop(),r=s;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:r=s}break;case"INSIDE_ARRAY_START":"]"===c?(r=s,t.pop()):(r=s,a(c,s,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(c){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=s,t.pop();break;default:r=s}break;case"INSIDE_ARRAY_AFTER_COMMA":a(c,s,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),r=s;break;case"INSIDE_NUMBER":switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=s;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(c,s),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&n(c,s);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&n(c,s);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(c,s);break;default:t.pop()}break;case"INSIDE_LITERAL":{let a=e.substring(o,s+1);"false".startsWith(a)||"true".startsWith(a)||"null".startsWith(a)?r=s:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?n(c,s):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(c,s))}}}let s=e.slice(0,r+1);for(let r=t.length-1;r>=0;r--)switch(t[r]){case"INSIDE_STRING":s+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":s+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":s+="]";break;case"INSIDE_LITERAL":{let t=e.substring(o,e.length);"true".startsWith(t)?s+="true".slice(t.length):"false".startsWith(t)?s+="false".slice(t.length):"null".startsWith(t)&&(s+="null".slice(t.length))}}return s})(e);return d().parse(t)}catch(e){console.error("Error parsing fixed JSON",e.message)}}},w=e=>{var t;if("string"!=typeof e||""===e.trim())return"";try{return new URL(e).origin}catch(e){}if("string"==typeof(null==(t=window.location)?void 0:t.origin))try{return new URL(e,window.location.origin).origin}catch(e){}try{let t=e.replace(/^\/+/,""),r=/^https?:\/\//i.test(t)?t:"https://".concat(t);return new URL(r).origin}catch(e){}return""},f=async()=>await fetch(a.x9D,{method:"GET",headers:{accept:"application/json","X-access-token-dev":(0,c.getCookie)(a.bbO)}}).then(async e=>{if(e.ok){let t=await e.json();return{...t,user_email:t.email,user_name:[t.name,t.last_name].filter(
1Boolean).join(" "),user_image:""}}let t=await e.text();if((0,o.p)(e.status,t))throw Error(o.U);throw Error("Error fetching user info")}),y=async(e,t)=>{let r=new URLSearchParams;if(r.append("first_name",e),r.append("last_name",t),!(await fetch(a.u5m,{method:"PATCH",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":(0,c.getCookie)(a.bbO)},body:r.toString()})).ok)throw Error("Error updating user data")},m=async()=>{let e=await fetch(a.m0Z,{method:"GET",headers:{accept:"application/json","X-access-token-dev":(0,c.getCookie)(a.bbO)}});if(404===e.status)return null;if(!e.ok)throw Error("Error fetching profile picture");try{let t=await e.json();return p(t)}catch(e){return null}},E=async e=>{let t=new FormData;t.append("file_up",e);let r=await fetch(a.m0Z,{method:"POST",headers:{accept:"application/json","X-access-token-dev":(0,c.getCookie)(a.bbO)},body:t});if(!r.ok)throw Error("Error uploading profile picture");try{let e=await r.json();return p(e)}catch(e){return null}},S=async()=>{if(!(await fetch(a.m0Z,{method:"DELETE",headers:{accept:"application/json","X-access-token-dev":(0,c.getCookie)(a.bbO)}})).ok)throw Error("Error deleting profile picture")},b=async(e,t)=>{let r=Error(await e.json().then(e=>"string"==typeof(null==e?void 0:e.detail)?e.detail:t).catch(()=>t));throw r.status=e.status,r},v=async(e,t)=>{let r=new FormData;r.append("id_group",e),r.append("file_up",t);let o=await fetch(a.U3f,{method:"POST",headers:{accept:"application/json","X-access-token-dev":(0,c.getCookie)(a.bbO)},body:r});return o.ok||await b(o,"Error uploading group profile picture"),await o.json()},k=async e=>{let t=await fetch("".concat(a.U3f,"?id_group=").concat(encodeURIComponent(e)),{method:"DELETE",headers:{accept:"application/json","X-access-token-dev":(0,c.getCookie)(a.bbO)}});return t.ok||await b(t,"Error deleting group profile picture"),await t.json()},T=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=n.PI.getState().searchTerm,r=n.PI.getState().filterType,o=n.PI.getState().ownerType,s=n.PI.getState().viewMode,l=(0,c.getCookie)(a.bbO);if("groups"===s){let r=new FormData;r.append("page_length","20"),r.append("page",e.toString());let o=await fetch(a.Uns,{method:"POST",headers:{"X-access-token-dev":l},body:r});if(!o.ok){let e=Error("Error fetching groups");throw e.status=o.status,e}let n=(await o.json()).map(e=>{var t;return{id:e.id_group,title:e.group_name,description:e.group_description||"",type:"group",creation_date:e.created_at,status:1===e.id_group_status,owner:"Pending"===e.member_status_name?"pending":e.is_owner?"owner":"member",sharing_id:e.id_group,member_count:e.member_count,member_status_name:e.member_status_name,privilege_name:e.privilege_name,profile_picture:null!=(t=e.profile_picture)?t:null}});return t?n.filter(e=>e.title.toLowerCase().includes(t.toLowerCase())||e.description.toLowerCase().includes(t.toLowerCase())):n}let d=""!==r||""!==o?a.clW:""!==t?a.Qj6:a.k2w,p=await fetch(d,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":l},body:new URLSearchParams({lazy_search:t,page:e.toString(),page_length:"50",filter_resource_type:r,filter_resource_date:"",filter_sharing_status:o})});if(!p.ok){let e=Error("Error fetching resources");throw e.status=p.status,e}let u=await p.json(),h=Array.isArray(u)?u:[];return(0,i.Mt)(h),h},O=async()=>{let e=(0,c.getCookie)(a.bbO),t=await fetch(a.k2w,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":e},body:new URLSearchParams({lazy_search:"",page:"1",page_length:"100",filter_resource_type:"",filter_resource_date:"",filter_sharing_status:""})});if(!t.ok){let e=Error("Error fetching shared resources");throw e.status=t.status,e}let r=await t.json(),o=Array.isArray(r)?r:[];return(0,i.Mt)(o),o.filter(e=>"pending"===e.owner||"view"===e.owner||"edit"===e.owner||"full"===e.owner)},C=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,r=n.PI.getState().searchTerm,o=t||n.PI.getState().idCollectionTerm,s=n.PI.getState().filterType,l=(0,c.getCookie)(a.bbO);if(!o)throw Error("No collection ID provided");let d={lazy_search:r,collection_id:o,page:e.toString(),page_length:"50",filter_resource_type:s,filter_resource_date:"",filter_sharing_status:"owner,edit,full,pen
1ding,view"},p=await fetch(a.YPZ,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":l},body:new URLSearchParams(d)});if(!p.ok)throw Error("Error fetching resources");let u=await p.json(),h=Array.isArray(u)?u:[];return(0,i.Mt)(h),h},I=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=n.SH.getState().searchMention,r=(0,c.getCookie)(a.bbO),o=await fetch(a.clW,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":r},body:new URLSearchParams({lazy_search:t,page:e.toString(),page_length:"10",filter_resource_type:"doc,web,img,aud,vid,collection",filter_resource_date:""})});if(!o.ok)throw Error("Error fetching resources");let i=await o.json();return Array.isArray(i)?i:[]},A=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,r=n.SH.getState().searchMention,o=(0,c.getCookie)(a.bbO);if(t){let n=await fetch(a.YPZ,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:new URLSearchParams({lazy_search:r,collection_id:t,page:e.toString(),page_length:"50"})});if(!n.ok)throw Error("Error fetching collection resources");let i=await n.json();return Array.isArray(i)?i:[]}let i=""===r?a.k2w:a.Qj6,s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:new URLSearchParams({lazy_search:r,page:e.toString(),page_length:"50",filter_resource_type:"",filter_resource_date:"",filter_sharing_status:""})});if(!s.ok){let e=Error("Error fetching resources");throw e.status=s.status,e}let l=await s.json();return Array.isArray(l)?l:[]},R=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,r=(0,c.getCookie)(a.bbO),o={lazy_search:"",page:e.toString(),page_length:"10",filter_resource_type:"collection",filter_resource_date:"",filter_sharing_status:"owner,edit,full"};t&&(o.group_id=t);let n=await fetch(a.clW,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":r},body:new URLSearchParams(o)});if(!n.ok)throw Error("Error fetching resources");let i=await n.json();return Array.isArray(i)?i:[]},P=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,r=n.Vy.getState().searchMention,o=(0,c.getCookie)(a.bbO);if(t){let n=await fetch(a.YPZ,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:new URLSearchParams({lazy_search:r,collection_id:t,page:e.toString(),page_length:"10",filter_resource_type:"collection",filter_sharing_status:"owner,edit,full"})});if(!n.ok)throw Error("Error fetching collection resources");let i=await n.json();return Array.isArray(i)?i:[]}let i=""!==r?a.clW:a.k2w,s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:new URLSearchParams({lazy_search:r,page:e.toString(),page_length:"10",filter_resource_type:"collection",filter_resource_date:"",filter_sharing_status:"owner,edit,full"})});if(!s.ok)throw Error("Error fetching collections");let l=await s.json();return Array.isArray(l)?l:[]},N=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=null!=r?r:n.SH.getState().searchMention,i=(0,c.getCookie)(a.bbO);if(t){let r=await fetch(a.YPZ,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":i},body:new URLSearchParams({lazy_search:o,collection_id:t,page:e.toString(),page_length:"20",filter_resource_type:"chat,doc,web,img,aud,vid,collection",filter_sharing_status:"owner"})});if(!r.ok)throw Error("Error fetching collection resources");let n=await r.json();return Array.isArray(n)?n:[]}let s=""!==o?a.clW:a.k2w,l=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":i},body:new URLSearchParams({lazy_search:o,page:e.toString(),page_length:"20",filter_resource_type:"chat,doc,web,img,aud,vid,collection",filter_resource_date:"",filter_sharing_status:"owner"})});if(!l.ok)throw Error("Error fetching resources");let d=await l.json();return Array.isArray(d)?d:[]},j=async()=>{let e=(0,c.getCookie)("X-access-token-dev"),t=await fetch(a.GLW,{headers:new Headers({"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":e})});if(!t.ok)throw Error("An error occurred while getting available agents.");let r=await t.json();if(null===r||!Array.isArray(r.response))throw Error("Invalid response format from API.");return r.response.map(e=>({personality_name:e.personality_name,id_personality:e.id_personality,id_personality_version_final:e.id_personality_version_final,description:e.description,examples:e.examples}))},U=async e=>{if(!e)throw Error("No collectionId provided.");let t=(0,c.getCookie)(a.bbO),r=new FormData;r.append("collection_id",e);let o=await fetch(a.teG,{method:"POST",headers:{"X-access-token-dev":t},body:r});if(!o.ok)throw Error("Error retrieving collection info");return await o.json()},L=async function(e,t,r){let o=!(arguments.length>3)||void 0===arguments[3]||arguments[3],n=arguments.length>4?arguments[4]:void 0,i=(0,c.getCookie)(a.bbO),s=await fetch(a.qmg,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":i},body:new URLSearchParams({resource_id:e,share_with:JSON.stringify(t),privilege_id:r.toString(),val
1idate_first:o.toString(),...void 0!==n?{target_workspace_id:String(n)}:{}})});if(!s.ok)throw Error((await s.json().catch(()=>({detail:"Error sharing resource"}))).detail||"Error sharing resource");try{return await s.json()}catch(e){return{success:!0,success_count:t.length,failed_recipients:[]}}},D=async function(e,t,r){let o=!(arguments.length>3)||void 0===arguments[3]||arguments[3],n=(0,c.getCookie)(a.bbO),i=await fetch(a.RC2,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":n},body:new URLSearchParams({collection_id:e,share_with:JSON.stringify(t),privilege_id:r.toString(),validate_first:o.toString()})});if(!i.ok)throw Error((await i.json().catch(()=>({detail:"Error sharing collection"}))).detail||"Error sharing collection");return await i.json()},x=async(e,t,r)=>{var o,n,i,s;let l=(0,c.getCookie)(a.bbO),d=new FormData;d.append("name",e),d.append("collection_parent_id",t||""),(null==r?void 0:r.style)&&d.append("card_style",r.style),(null==r?void 0:r.color)&&d.append("card_color",r.color),(null==r?void 0:r.patron)&&d.append("card_patron",r.patron);let p=await fetch(a.B65,{method:"POST",headers:{"X-access-token-dev":l},body:d});if(!p.ok)throw Error("Error creating collection");let u=await p.json().catch(()=>({})),h=(null==u?void 0:u.id_collection)||(null==u?void 0:u.id)||(null==u?void 0:u.collection_id)||(null==u||null==(o=u.collection)?void 0:o.id)||(null==u||null==(n=u.collection)?void 0:n.id_collection)||(null==u||null==(i=u.data)?void 0:i.id_collection)||(null==u||null==(s=u.data)?void 0:s.id);if(h)return String(h);try{let t=(await R(1)).find(t=>(t.title||"").trim()===e.trim());if(null==t?void 0:t.id)return String(t.id)}catch(e){}throw Error("No collection ID returned")},X=async(e,t)=>{if(0===e.length)return;let r=(0,c.getCookie)(a.bbO),o=new FormData;if(o.append("collection_object_id",JSON.stringify(e)),o.append("to_collection_id",t),!(await fetch(a.lsi,{method:"POST",headers:{"X-access-token-dev":r},body:o})).ok)throw Error("Error moving resources to collection")},J=async(e,t)=>{if(0===e.length)return;let r=(0,c.getCookie)(a.bbO),o=new FormData;if(o.append("child_collection_id",JSON.stringify(e)),o.append("to_parent_collection_id",t),!(await fetch(a.gcm,{method:"POST",headers:{"X-access-token-dev":r},body:o})).ok)throw Error("Error nesting collections")},F=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=(0,c.getCookie)(a.bbO),s={page:r.toString(),page_length:o.toString(),include_inherited:n.toString()};if(e)s.resource_id=e;else if(t)s.collection_id=t;else throw Error("Either resource_id or collection_id is required");let l=await fetch(a.x6D,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":i},body:new URLSearchParams(s)});if(!l.ok)throw Error((await l.json().catch(()=>({detail:"Error getting recipients"}))).detail||"Error getting recipients");return await l.json()},B=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return await F(e,t,r,10,o)||[]},M=async(e,t,r,o,n)=>{let i=(0,c.getCookie)(a.bbO),s={recipient_id:e,override_type:t};if(r)s.target_collection=r;else if(o)s.target_user_object=o;else throw Error("Either target_collection or target_user_object is required");"ELEVATE"===t&&void 0!==n&&(s.override_privilege=n.toString());let l=await fetch(a.OLO,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":i},body:new URLSearchParams(s)});if(!l.ok)throw Error((await l.json().catch(()=>({detail:"Error creating override"}))).detail||"Error creating override");return await l.json()},Y=async function(e,t,r){let o=!(arguments.length>3)||void 0===arguments[3]||arguments[3],n=(0,c.getCookie)(a.bbO),i=await fetch(a.WGJ,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":n},body:new URLSearchParams({items:JSON.stringify(e),share_with:JSON.stringify(t),privilege_id:r.toString(),val
1idate_first:o.toString()})});if(!i.ok)throw Error((await i.json().catch(()=>({detail:"Error bulk sharing"}))).detail||"Error bulk sharing");return await i.json()},V=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(0,c.getCookie)(a.bbO),r=new FormData;r.append("page_length","100"),r.append("page","1"),r.append("group_name",e);let o=await fetch(a.Uns,{method:"POST",headers:{"X-access-token-dev":t},body:r});if(!o.ok)throw Error("Error fetching groups");return await o.json()},W=e=>{switch(e){case"view":default:return 1;case"edit":return 2;case"full":return 3}},z=e=>{switch(e){case 1:default:return"view";case 2:return"edit";case 3:return"full";case 4:return"owner"}},G=async e=>{let t=(0,c.getCookie)(a.bbO),r=new FormData;r.append("id_group",e);let o=await fetch(a.mA5,{method:"POST",headers:{"X-access-token-dev":t},body:r});if(!o.ok)throw Error("Error retrieving group info");return await o.json()},H=async(e,t,r)=>{let o=(0,c.getCookie)(a.bbO),n=new URLSearchParams;n.append("id_group",e),null!==t&&""!==t.trim()&&n.append("group_name",t),null!==r&&n.append("group_description",r);let i=await fetch(a.vsQ,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:n.toString()});if(!i.ok)throw Error("Error updating group metadata");return await i.json()},K=async e=>{let t=(0,c.getCookie)(a.bbO),r=new URLSearchParams;r.append("id_group",e);let o=await fetch(a.LMd,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":t},body:r.toString()});if(!o.ok)throw Error(await o.json().then(e=>null==e?void 0:e.detail).catch(()=>void 0)||"Error leaving group")},q=async e=>{let t=(0,c.getCookie)(a.bbO),r=new URLSearchParams;r.append("id_groups",JSON.stringify(e));let o=await fetch(a.mgB,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":t},body:r.toString()});if(!o.ok)throw Error("Error leaving groups");return await o.json()},Z=async(e,t)=>{let r=(0,c.getCookie)(a.bbO),o=new URLSearchParams;o.append("id_groups",JSON.stringify(e)),o.append("new_status",t.toString());let n=await fetch(a.$g9,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":r},body:o.toString()});if(!n.ok)throw Error("Error bulk updating group status");return await n.json()},Q=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=(0,c.getCookie)(a.bbO),n=new FormData;n.append("id_group",e),n.append("id_member_status","1,2"),n.append("limit",t.toString()),n.append("offset",r.toString());let i=await fetch(a.eeH,{method:"POST",headers:{"X-access-token-dev":o},body:n});if(!i.ok)throw Error("Error fetching group members");return await i.json()},$=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=(0,c.getCookie)(a.bbO),n=new URLSearchParams;n.append("id_group",e),n.append("resource_type",""),n.append("limit",t.toString()),n.append("offset",r.toString());let i=await fetch(a.kSz,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:n.toString()});if(!i.ok)throw Error("Error fetching group resources");return await i.json()},ee=async()=>{let e=(await V()).filter(e=>"Pending"!==e.member_status_name).slice(0,10);return(await Promise.all(e.map(async e=>{try{let[r,o]=await Promise.all([$(e.id_group,10,0),Q(e.id_group,50,0).catch(()=>[])]),a=new Map;for(let e of o){var t;let r=null==(t=e.profile_picture)?void 0:t.thumbnail_url;r&&a.set(e.id_user_profile,r)}return r.map(t=>{var r,o;return{id:t.id_resource_link,groupId:e.id_group,groupOwnerParam:e.is_owner?"owner":(e=>{if(!e)return"";let t=e.toLowerCase();return"full access"===t?"full":"editor"===t?"edit":"viewer"===t?"view":t})(e.privilege_name),groupName:e.group_name,resourceName:t.object_name||t.collection_name||"",resourceType:t.resource_type,addedByName:t.user_name||t.user_email||"",addedByEmail:t.user_email||"",addedByAvatarUrl:a.get(t.added_by),createdAt:t.created_at,groupProfilePictureUrl:null!=(o=null==(r=e.profile_picture)?void 0:r.thumbnail_url)?o:void 0}})}catch(e){return[]}}))).flat().filter(e=>"comment"!==e.resourceType)},et=async e=>Promise.all((await V()).filter(e=>"Pending"===e.member_status_name).map(async t=>{var r,o,a,n,i,s,c;let l,d="",p="",u=null!=(o=null==(r=t.profile_picture)?void 0:r.thumbnail_url)?o:void 0;try{let[r,o]=await Promise.all([Q(t.id_group,50,0),u?Promise.resolve(null):G(t.id_group).catch(()=>null)]),h=e?r.find(t=>
1t.id_user_profile===e):void 0,_=null==h?void 0:h.invited_by,g=null!=(n=_?r.find(e=>e.id_user_profile===_):void 0)?n:r.find(e=>e.is_owner);g&&(d=g.user_name||g.display_name||"",p=g.user_email||"",l=null!=(s=null==(i=g.profile_picture)?void 0:i.thumbnail_url)?s:void 0),!u&&o&&(u=null!=(c=null==(a=o.profile_picture)?void 0:a.thumbnail_url)?c:void 0)}catch(e){}return{id_group:t.id_group,group_name:t.group_name,created_at:t.created_at,memberCount:t.member_count,privilegeName:t.privilege_name,inviterName:d,inviterEmail:p,inviterAvatarUrl:l,groupProfilePictureUrl:u}})),er=async(e,t,r,o)=>{let n=(0,c.getCookie)(a.bbO),i=t.filter(e=>"chat"!==e.type),s=i.filter(e=>"collection"!==e.type).map(e=>e.id),l=i.filter(e=>"collection"===e.type).map(e=>e.id),d=new URLSearchParams;d.append("id_group",e),d.append("id_user_objects",JSON.stringify(s)),d.append("id_collections",JSON.stringify(l)),r&&d.append("note",r),void 0!==o&&d.append("target_workspace_id",String(o));let p=await fetch(a.tCW,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":n},body:d.toString()});if(!p.ok)throw Error("Error linking resources to group");return await p.json()},eo=async function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],n=(0,c.getCookie)(a.bbO),i=new URLSearchParams;i.append("id_group",e),i.append("id_user_objects",JSON.stringify(t)),i.append("id_collections",JSON.stringify(r)),i.append("id_group_objects",JSON.stringify(o));let s=await fetch(a.VCD,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":n},body:i.toString()});if(!s.ok)throw Error("Error removing resources from group");return await s.json()},ea=async(e,t)=>{let r=(0,c.getCookie)(a.bbO),o=new URLSearchParams;o.append("id_group",e),o.append("id_user_profiles",JSON.stringify(t));let n=await fetch(a.xED,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":r},body:o.toString()});if(!n.ok)throw Error("Error removing members from group");return await n.json()},en=async(e,t,r)=>{let o=(0,c.getCookie)(a.bbO),n=new URLSearchParams;n.append("id_group",e),n.append("id_group_member",t),n.append("new_privilege",r.toString());let i=await fetch(a.aQV,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:n.toString()});if(!i.ok)throw Error("Error updating member privilege");return await i.json()},ei=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=(0,c.getCookie)(a.bbO),i=new URLSearchParams;i.append("search_filter",e),i.append("project",s.cb),i.append("id_group",t),i.append("limit",r.toString()),i.append("offset",o.toString());let l=await fetch(a.OCA,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":n},body:i.toString()});if(!l.ok)throw Error("Error searching users");return await l.json()},es=async(e,t)=>{let r=(0,c.getCookie)(a.bbO),o=new URLSearchParams;o.append("id_group",e),o.append("new_status",t.toString());let n=await fetch(a.pdK,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":r},body:o.toString()});if(!n.ok)throw Error("Error updating member status");return await n.json()},ec=async(e,t,r,o)=>{let n=(0,c.getCookie)(a.bbO),i=new URLSearchParams;i.append("email",e),i.append("marquisate_id","61"),i.append("parent",""),i.append("membership","1"),i.append("acquisition_channel","Group"),i.append("first_name",t),i.append("last_name",r),i.append("id_group",o);let s=await fetch(a.M6x,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":n},body:i.toString()});if(!s.ok)throw Error("Error inviting user");return await s.json()},el=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=(0,c.getCookie)(a.bbO),n=new URLSearchParams;n.append("id_group",e),n.append("content",t),n.append("id_group_object_type",r.toString());let i=await fetch(a.kYJ,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:n.toString()});if(!i.ok)throw Error("Error creating group object");return await i.json()},ed=async(e,t,r)=>{let o=(0,c.getCookie)(a.bbO),n=new URLSearchParams;n.append("id_group",e),"collection"===r?n.append("id_collection",t):n.append("id_user_object",t);let i=await fetch(a.APH,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":o},body:n.toString()});if(!i.ok){let e=Error(await i.text());throw e.status=i.status,e}return await i.json()},ep=async(e,t)=>{let r=(0,c.getCookie)(a.bbO),o=new URLSearchParams;"collection"===t?o.append("id_collection",e):o.append("id_user_object",e);let n=await fetch(a.tdK,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":r},body:o.toString()});if(!n.ok){let e=Error(await n.text());throw e.status=n.status,e}return await n.json()},eu=async e=>{let t=(0,c.getCookie)(a.bbO),r=new URLSearchParams;r.append("id_user_profile",e.id_user_profile),void 0!==e.id_federation&&r.append("id_federation",String(e.id_federation)),e.label&&r.append("label",e.label),void 0!==e.expires_in_days&&r.append("expires_in_days",String(e.expires_in_days));let o=await fetch(a.yI,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":t},body:r.toString()});if(!o.ok)throw Error((await o.json().catch(()=>({detail:"Failed to create API key"}))).detail||"Failed to create API key");return await o.json()},eh=async e=>{let t=(0,c.getCookie)(a.bbO),r=new URLSearchParams;void 0!==e.id_federation&&r.append("id_federation",String(e.id_federation)),void 0!==e.limit&&r.append("limit",String(e.limit)),void 0!==e.offset&&r.append("offset",String(e.offset));let o=await fetch(a.YHr,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":t},body:r.toString()});if(!o.ok)throw Error((await o.json().catch(()=>({detail:"Failed to list API keys"}))).detail||"Failed to list API keys");return await o.json()},e_=async e=>{let t=(0,c.getCookie)(a.bbO),r=new URLSearchParams;r.append("id_api_key",String(e));let o=await fetch(a.mPq,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-access-token-dev":t},body:r.toString()});if(!o.ok)throw Error((await o.json().catch(()=>({detail:"Failed to revoke API key"}))).detail||"Failed to revoke API key");return await o.json()}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.