2024-11-04 00:22:50 +00:00
const _ _vite _ _mapDeps = ( i , m = _ _vite _ _mapDeps , d = ( m . f || ( m . f = [ "assets/stackoverflow-dark-8CFru5b-.css" , "assets/stackoverflow-light-CpIvNHzo.css" ] ) ) ) => i . map ( i => d [ i ] ) ;
2024-11-06 23:05:30 +00:00
var l5 = Object . defineProperty ; var c5 = ( n , e , t ) => e in n ? l5 ( n , e , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : t } ) : n [ e ] = t ; var pn = ( n , e , t ) => c5 ( n , typeof e != "symbol" ? e + "" : e , t ) ; ( function ( ) { const e = document . createElement ( "link" ) . relList ; if ( e && e . supports && e . supports ( "modulepreload" ) ) return ; for ( const i of document . querySelectorAll ( 'link[rel="modulepreload"]' ) ) r ( i ) ; new MutationObserver ( i => { for ( const s of i ) if ( s . type === "childList" ) for ( const o of s . addedNodes ) o . tagName === "LINK" && o . rel === "modulepreload" && r ( o ) } ) . observe ( document , { childList : ! 0 , subtree : ! 0 } ) ; function t ( i ) { const s = { } ; return i . integrity && ( s . integrity = i . integrity ) , i . referrerPolicy && ( s . referrerPolicy = i . referrerPolicy ) , i . crossOrigin === "use-credentials" ? s . credentials = "include" : i . crossOrigin === "anonymous" ? s . credentials = "omit" : s . credentials = "same-origin" , s } function r ( i ) { if ( i . ep ) return ; i . ep = ! 0 ; const s = t ( i ) ; fetch ( i . href , s ) } } ) ( ) ; / * *
2024-11-04 00:22:50 +00:00
* @ vue / shared v3 . 5.10
* ( c ) 2018 - present Yuxi ( Evan ) You and Vue contributors
* @ license MIT
2024-11-11 23:13:41 +00:00
* * //*! #__NO_SIDE_EFFECTS__ */function j1(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const hn={},ll=[],Ki=()=>{},d5=()=>!1,dh=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Q1=n=>n.startsWith("onUpdate:"),Ln=Object.assign,X1=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},u5=Object.prototype.hasOwnProperty,en=(n,e)=>u5.call(n,e),vt=Array.isArray,cl=n=>Kl(n)==="[object Map]",Wl=n=>Kl(n)==="[object Set]",CE=n=>Kl(n)==="[object Date]",p5=n=>Kl(n)==="[object RegExp]",kt=n=>typeof n=="function",yn=n=>typeof n=="string",Xi=n=>typeof n=="symbol",cn=n=>n!==null&&typeof n=="object",CM=n=>(cn(n)||kt(n))&&kt(n.then)&&kt(n.catch),AM=Object.prototype.toString,Kl=n=>AM.call(n),h5=n=>Kl(n).slice(8,-1),RM=n=>Kl(n)==="[object Object]",Z1=n=>yn(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Pc=j1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),uh=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},m5=/-(\w)/g,di=uh(n=>n.replace(m5,(e,t)=>t?t.toUpperCase():"")),f5=/\B([A-Z])/g,Io=uh(n=>n.replace(f5,"-$1").toLowerCase()),ph=uh(n=>n.charAt(0).toUpperCase()+n.slice(1)),Zu=uh(n=>n?`on${ph(n)}`:""),Co=(n,e)=>!Object.is(n,e),dl=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},MM=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})},bp=n=>{const e=parseFloat(n);return isNaN(e)?n:e},g5=n=>{const e=yn(n)?Number(n):NaN;return isNaN(e)?n:e};let AE;const NM=()=>AE||(AE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function on(n){if(vt(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=yn(r)?y5(r):on(r);if(i)for(const s in i)e[s]=i[s]}return e}else if(yn(n)||cn(n))return n}const _5=/;(?![^(]*\))/g,b5=/:([^]+)/,v5=/\/\*[^]*?\*\//g;function y5(n){const e={};return n.replace(v5,"").split(_5).forEach(t=>{if(t){const r=t.split(b5);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function qe(n){let e="";if(yn(n))e=n;else if(vt(n))for(let t=0;t<n.length;t++){const r=qe(n[t]);r&&(e+=r+" ")}else if(cn(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const E5="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",S5=j1(E5);function kM(n){return!!n||n===""}function x5(n,e){if(n.length!==e.length)return!1;let t=!0;for(let r=0;t&&r<n.length;r++)t=ga(n[r],e[r]);return t}function ga(n,e){if(n===e)return!0;let t=CE(n),r=CE(e);if(t||r)return t&&r?n.getTime()===e.getTime():!1;if(t=Xi(n),r=Xi(e),t||r)return n===e;if(t=vt(n),r=vt(e),t||r)return t&&r?x5(n,e):!1;if(t=cn(n),r=cn(e),t||r){if(!t||!r)return!1;const i=Object.keys(n).length,s=Object.keys(e).length;if(i!==s)return!1;for(const o in n){const a=n.hasOwnProperty(o),l=e.hasOwnProperty(o);if(a&&!l||!a&&l||!ga(n[o],e[o]))return!1}}return String(n)===String(e)}function J1(n,e){return n.findIndex(t=>ga(t,e))}const IM=n=>!!(n&&n.__v_isRef===!0),X=n=>yn(n)?n:n==null?"":vt(n)||cn(n)&&(n.toString===AM||!kt(n.toString))?IM(n)?X(n.value):JSON.stringify(n,OM,2):String(n),OM=(n,e)=>IM(e)?OM(n,e.value):cl(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[r,i],s)=>(t[ym(r,s)+" =>"]=i,t),{})}:Wl(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>ym(t))}:Xi(e)?ym(e):cn(e)&&!vt(e)&&!RM(e)?String(e):e,ym=(n,e="")=>{var t;return Xi(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/**
2024-11-04 00:22:50 +00:00
* @ vue / reactivity v3 . 5.10
* ( c ) 2018 - present Yuxi ( Evan ) You and Vue contributors
* @ license MIT
2024-11-11 23:13:41 +00:00
* * / l e t m r ; c l a s s D M { c o n s t r u c t o r ( e = ! 1 ) { t h i s . d e t a c h e d = e , t h i s . _ a c t i v e = ! 0 , t h i s . e f f e c t s = [ ] , t h i s . c l e a n u p s = [ ] , t h i s . _ i s P a u s e d = ! 1 , t h i s . p a r e n t = m r , ! e & & m r & & ( t h i s . i n d e x = ( m r . s c o p e s | | ( m r . s c o p e s = [ ] ) ) . p u s h ( t h i s ) - 1 ) } g e t a c t i v e ( ) { r e t u r n t h i s . _ a c t i v e } p a u s e ( ) { i f ( t h i s . _ a c t i v e ) { t h i s . _ i s P a u s e d = ! 0 ; l e t e , t ; i f ( t h i s . s c o p e s ) f o r ( e = 0 , t = t h i s . s c o p e s . l e n g t h ; e < t ; e + + ) t h i s . s c o p e s [ e ] . p a u s e ( ) ; f o r ( e = 0 , t = t h i s . e f f e c t s . l e n g t h ; e < t ; e + + ) t h i s . e f f e c t s [ e ] . p a u s e ( ) } } r e s u m e ( ) { i f ( t h i s . _ a c t i v e & & t h i s . _ i s P a u s e d ) { t h i s . _ i s P a u s e d = ! 1 ; l e t e , t ; i f ( t h i s . s c o p e s ) f o r ( e = 0 , t = t h i s . s c o p e s . l e n g t h ; e < t ; e + + ) t h i s . s c o p e s [ e ] . r e s u m e ( ) ; f o r ( e = 0 , t = t h i s . e f f e c t s . l e n g t h ; e < t ; e + + ) t h i s . e f f e c t s [ e ] . r e s u m e ( ) } } r u n ( e ) { i f ( t h i s . _ a c t i v e ) { c o n s t t = m r ; t r y { r e t u r n m r = t h i s , e ( ) } f i n a l l y { m r = t } } } o n ( ) { m r = t h i s } o f f ( ) { m r = t h i s . p a r e n t } s t o p ( e ) { i f ( t h i s . _ a c t i v e ) { l e t t , r ; f o r ( t = 0 , r = t h i s . e f f e c t s . l e n g t h ; t < r ; t + + ) t h i s . e f f e c t s [ t ] . s t o p ( ) ; f o r ( t = 0 , r = t h i s . c l e a n u p s . l e n g t h ; t < r ; t + + ) t h i s . c l e a n u p s [ t ] ( ) ; i f ( t h i s . s c o p e s ) f o r ( t = 0 , r = t h i s . s c o p e s . l e n g t h ; t < r ; t + + ) t h i s . s c o p e s [ t ] . s t o p ( ! 0 ) ; i f ( ! t h i s . d e t a c h e d & & t h i s . p a r e n t & & ! e ) { c o n s t i = t h i s . p a r e n t . s c o p e s . p o p ( ) ; i & & i ! = = t h i s & & ( t h i s . p a r e n t . s c o p e s [ t h i s . i n d e x ] = i , i . i n d e x = t h i s . i n d e x ) } t h i s . p a r e n t = v o i d 0 , t h i s . _ a c t i v e = ! 1 } } } f u n c t i o n T 5 ( n ) { r e t u r n n e w D M ( n ) } f u n c t i o n L M ( ) { r e t u r n m r } f u n c t i o n w 5 ( n , e = ! 1 ) { m r & & m r . c l e a n u p s . p u s h ( n ) } l e t g n ; c o n s t E m = n e w W e a k S e t ; c l a s s P M { c o n s t r u c t o r ( e ) { t h i s . f n = e , t h i s . d e p s = v o i d 0 , t h i s . d e p s T a i l = v o i d 0 , t h i s . f l a g s = 5 , t h i s . n e x t = v o i d 0 , t h i s . c l e a n u p = v o i d 0 , t h i s . s c h e d u l e r = v o i d 0 , m r & & m r . a c t i v e & & m r . e f f e c t s . p u s h ( t h i s ) } p a u s e ( ) { t h i s . f l a g s | = 6 4 } r e s u m e ( ) { t h i s . f l a g s & 6 4 & & ( t h i s . f l a g s & = - 6 5 , E m . h a s ( t h i s ) & & ( E m . d e l e t e ( t h i s ) , t h i s . t r i g g e r ( ) ) ) } n o t i f y ( ) { t h i s . f l a g s & 2 & & ! ( t h i s . f l a g s & 3 2 ) | | t h i s . f l a g s & 8 | | U M ( t h i s ) } r u n ( ) { i f ( ! ( t h i s . f l a g s & 1 ) ) r e t u r n t h i s . f n ( ) ; t h i s . f l a g s | = 2 , R E ( t h i s ) , B M ( t h i s ) ; c o n s t e = g n , t = C i ; g n = t h i s , C i = ! 0 ; t r y { r e t u r n t h i s . f n ( ) } f i n a l l y { G M ( t h i s ) , g n = e , C i = t , t h i s . f l a g s & = - 3 } } s t o p ( ) { i f ( t h i s . f l a g s & 1 ) { f o r ( l e t e = t h i s . d e p s ; e ; e = e . n e x t D e p ) n v ( e ) ; t h i s . d e p s = t h i s . d e p s T a i l = v o i d 0 , R E ( t h i s ) , t h i s . o n S t o p & & t h i s . o n S t o p ( ) , t h i s . f l a g s & = - 2 } } t r i g g e r ( ) { t h i s . f l a g s & 6 4 ? E m . a d d ( t h i s ) : t h i s . s c h e d u l e r ? t h i s . s c h e d u l e r ( ) : t h i s . r u n I f D i r t y ( ) } r u n I f D i r t y ( ) { O b ( t h i s ) & & t h i s . r u n ( ) } g e t d i r t y ( ) { r e t u r n O b ( t h i s ) } } l e t F M = 0 , i l ; f u n c t i o n U M ( n ) { n . f l a g s | = 8 , n . n e x t = i l , i l = n } f u n c t i o n e v ( ) { F M + + } f u n c t i o n t v ( ) { i f ( - - F M > 0 ) r e t u r n ; l e t n ; f o r ( ; i l ; ) { l e t e = i l , t ; f o r ( ; e ; ) e . f l a g s & 1 | | ( e . f l a g s & = - 9 ) , e = e . n e x t ; f o r ( e = i l , i l = v o i d 0 ; e ; ) { i f ( t = e . n e x t , e . n e x t = v o i d 0 , e . f l a g s & = - 9 , e . f l a g s & 1 ) t r y { e . t r i g g e r ( ) } c a t c h ( r ) { n | | ( n = r ) } e = t } } i f ( n ) t h r o w n } f u n c t i o n B M ( n ) { f o r ( l e t e = n . d e p s ; e ; e = e . n e x t D e p ) e . v e r s i o n = - 1 , e . p r e v A c t i v e L i n k = e . d e p . a c t i v e L i n k , e . d e p . a c t i v e L i n k = e } f u n c t i o n G M ( n ) { l e t e , t = n . d e p s T a i l , r = t ; f o r ( ; r ; ) { c o n s t i = r . p r e v D e p ; r . v e r s i o n = = = - 1 ? ( r = = = t & & ( t = i ) , n v ( r ) , C 5 ( r ) ) : e = r , r . d e p . a c t i v e L i n k = r . p r e v A c t i v e L i n k , r . p r e v A c t i v e L i n k = v o i d 0 , r = i } n . d e p s = e , n . d e p s T a i l = t } f u n c t i o n O b ( n ) { f o r ( l e t e = n . d e p s ; e ; e = e . n e x t D e p ) i f ( e . d e p . v e r s i o n ! = = e . v e r s i o n | | e . d e p . c o m p u t e d & & ( z M ( e . d e p . c o m p u t e d ) | | e . d e p . v e r s i o n ! = = e . v e r s i o n ) ) r e t u r n ! 0 ; r e t u r n ! ! n . _ d i r t y } f u n c t i o n z M ( n ) { i f ( n . f l a g s & 4 & & ! ( n . f l a g s & 1 6 ) | | ( n . f l a g s & = - 1 7 , n . g l o b a l V e r s i o n = = = t d ) ) r e t u r n ; n . g l o b a l V e r s i o n = t d ; c o n s t e = n . d e p ; i f ( n . f l a g s | = 2 , e . v e r s i o n > 0 & & ! n . i s S S R & & n . d e p s & & ! O b ( n ) ) { n . f l a g s & = - 3 ; r e t u r n } c o n s t t = g n , r = C i ; g n = n , C i = ! 0 ; t r y { B M ( n ) ; c o n s t i = n . f n ( n . _ v a l u e ) ; ( e . v e r s i o n = = = 0 | | C o ( i , n . _ v a l u e ) ) & & ( n . _ v a l u e = i , e . v e r s i o n + + ) } c a t c h ( i ) { t h r o w e . v e r s i o n + + , i } f i n a l l y { g n = t , C i = r , G M ( n ) , n . f l a g s & = - 3 } } f u n c t i o n n v ( n , e = ! 1 ) { c o n s t { d e p : t , p r e v S u b : r , n e x t S u b : i } = n ; i f ( r & & ( r . n e x t S u b = i , n . p r e v S u b = v o i d 0 ) , i & & ( i . p r e v S u b = r , n . n e x t S u b = v o i d 0 ) , t . s u b s = = = n & & ( t . s u b s = r ) , ! t . s u b s & & t . c o m p u t e d ) { t . c o m p u t e d . f l a g s & = - 5 ; f o r ( l e t s = t . c o m p u t e d . d e p s ; s ; s = s . n e x t D e p ) n v ( s , ! 0 ) } ! e & & ! - - t . s c & & t . m a p & & t . m a p . d e l e t e ( t . k e y ) } f u n c t i o n C 5 ( n ) { c o n s t { p r e v D e p : e , n e x t D e p : t } = n ; e & & ( e . n e x t D e p = t , n . p r e v D e p = v o i d 0 ) , t & & ( t . p r e v D e p = e , n . n e x t D e p = v o i d 0 ) } l e t C i = ! 0 ; c o n s t V M = [ ] ; f u n c t i o n O o ( ) { V M . p u s h ( C i ) , C i = ! 1 } f u n c t i o n D o ( ) { c o n s t n = V M . p o p ( ) ; C i = n = = = v o i d 0 ? ! 0 : n } f u n c t i o n R E ( n ) { c o n s t { c l e a n u p : e } = n ; i f ( n . c l e a n u p = v o i d 0 , e ) { c o n s t t = g n ; g n = v o i d 0 ; t r y { e ( ) } f i n a l l y { g n = t } } } l e t t d = 0 ; c l a s s A 5 { c o n s t r u c t o r ( e , t ) { t h i s . s u b = e , t h i s . d e p = t , t h i s . v e r s i o n = t . v e r s i o n , t h i s . n e x t D e p = t h i s . p r e v D e p = t h i s . n e x t S u b = t h i s . p r e v S u b = t h i s . p r e v A c t i v e L i n k = v o i d 0 } } c l a s s h h { c o n s t r u c t o r ( e ) { t h i s . c o m p u t e d = e , t h i s . v e r s i o n = 0 , t h i s . a c t i v e L i n k = v o i d 0 , t h i s . s u b s = v o i d 0 , t h i s . t a r g e t = v o
2024-11-04 00:22:50 +00:00
* @ vue / runtime - core v3 . 5.10
* ( c ) 2018 - present Yuxi ( Evan ) You and Vue contributors
* @ license MIT
2024-11-11 23:13:41 +00:00
* * /function Sd(n,e,t,r){try{return r?n(...r):n()}catch(i){vh(i,e,t)}}function Ni(n,e,t,r){if(kt(n)){const i=Sd(n,e,t,r);return i&&CM(i)&&i.catch(s=>{vh(s,e,t)}),i}if(vt(n)){const i=[];for(let s=0;s<n.length;s++)i.push(Ni(n[s],e,t,r));return i}}function vh(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||hn;if(e){let a=e.parent;const l=e.proxy,d=`https:/ / vuejs . org / error - reference / # runtime - $ { t } ` ;for(;a;){const u=a.ec;if(u){for(let m=0;m<u.length;m++)if(u[m](n,l,d)===!1)return}a=a.parent}if(s){Oo(),Sd(s,null,10,[n,l,d]),Do();return}}aD(n,t,i,r,o)}function aD(n,e,t,r=!0,i=!1){if(i)throw n;console.error(n)}let rd=!1,Lb=!1;const fr=[];let Fi=0;const pl=[];let io=null,nl=0;const r4=Promise.resolve();let ov=null;function We(n){const e=ov||r4;return n?e.then(this?n.bind(this):n):e}function lD(n){let e=rd?Fi+1:0,t=fr.length;for(;e<t;){const r=e+t>>>1,i=fr[r],s=id(i);s<n||s===n&&i.flags&2?e=r+1:t=r}return e}function av(n){if(!(n.flags&1)){const e=id(n),t=fr[fr.length-1];!t||!(n.flags&2)&&e>=id(t)?fr.push(n):fr.splice(lD(e),0,n),n.flags|=1,i4()}}function i4(){!rd&&!Lb&&(Lb=!0,ov=r4.then(o4))}function cD(n){vt(n)?pl.push(...n):io&&n.id===-1?io.splice(nl+1,0,n):n.flags&1||(pl.push(n),n.flags|=1),i4()}function DE(n,e,t=rd?Fi+1:0){for(;t<fr.length;t++){const r=fr[t];if(r&&r.flags&2){if(n&&r.id!==n.uid)continue;fr.splice(t,1),t--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function s4(n){if(pl.length){const e=[...new Set(pl)].sort((t,r)=>id(t)-id(r));if(pl.length=0,io){io.push(...e);return}for(io=e,nl=0;nl<io.length;nl++){const t=io[nl];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}io=null,nl=0}}const id=n=>n.id==null?n.flags&2?-1:1/0:n.id;function o4(n){Lb=!1,rd=!0;try{for(Fi=0;Fi<fr.length;Fi++){const e=fr[Fi];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Sd(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Fi<fr.length;Fi++){const e=fr[Fi];e&&(e.flags&=-2)}Fi=0,fr.length=0,s4(),rd=!1,ov=null,(fr.length||pl.length)&&o4()}}let Wn=null,a4=null;function Sp(n){const e=Wn;return Wn=n,a4=n&&n.type.__scopeId||null,e}function Ge(n,e=Wn,t){if(!e||n._n)return n;const r=(...i)=>{r._d&&YE(-1);const s=Sp(e);let o;try{o=n(...i)}finally{Sp(s),r._d&&YE(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function F(n,e){if(Wn===null)return n;const t=Ch(Wn),r=n.dirs||(n.dirs=[]);for(let i=0;i<e.length;i++){let[s,o,a,l=hn]=e[i];s&&(kt(s)&&(s={mounted:s,updated:s}),s.deep&&Ss(o),r.push({dir:s,instance:t,value:o,oldValue:void 0,arg:a,modifiers:l}))}return n}function Bo(n,e,t,r){const i=n.dirs,s=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let l=a.dir[r];l&&(Oo(),Ni(l,t,8,[n.el,a,n,e]),Do())}}const l4=Symbol("_vte"),c4=n=>n.__isTeleport,Fc=n=>n&&(n.disabled||n.disabled===""),dD=n=>n&&(n.defer||n.defer===""),LE=n=>typeof SVGElement<"u"&&n instanceof SVGElement,PE=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Pb=(n,e)=>{const t=n&&n.to;return yn(t)?e?e(t):null:t},uD={name:"Teleport",__isTeleport:!0,process(n,e,t,r,i,s,o,a,l,d){const{mc:u,pc:m,pbc:f,o:{insert:g,querySelector:h,createText:v,createComment:b}}=d,_=Fc(e.props);let{shapeFlag:y,children:E,dynamicChildren:x}=e;if(n==null){const A=e.el=v(""),w=e.anchor=v("");g(A,t,r),g(w,t,r);const N=(C,k)=>{y&16&&(i&&i.isCE&&(i.ce._teleportTarget=C),u(E,C,k,i,s,o,a,l))},L=()=>{const C=e.target=Pb(e.props,h),k=d4(C,e,v,g);C&&(o!=="svg"&&LE(C)?o="svg":o!=="mathml"&&PE(C)&&(o="mathml"),_||(N(C,k),Ju(e)))};_&&(N(t,w),Ju(e)),dD(e.props)?Yn(L,s):L()}else{e.el=n.el,e.targetStart=n.targetStart;const A=e.anchor=n.anchor,w=e.target=n.target,N=e.targetAnchor=n.targetAnchor,L=Fc(n.props),C=L?t:w,k=L?A:N;if(o==="svg"||LE(w)?o="svg":(o==="mathml"||PE(w))&&(o="mathml"),x?(f(n.dynamicChildren,x,C,i,s,o,a),uv(n,e,!0)):l||m(n,e,C,k,i,s,o,a,!1),_)L?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):Xd(e,t,A,d,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const H=e.target=Pb(e.props,h);H&&Xd(e,H,null,d,0)}else L&&Xd(e,w,N,d,1);Ju(e)}},remove(n,e,t,{um:r,o:{remove:i}},s){const{shapeF
2024-11-04 00:22:50 +00:00
* @ vue / runtime - dom v3 . 5.10
* ( c ) 2018 - present Yuxi ( Evan ) You and Vue contributors
* @ license MIT
2024-11-11 23:13:41 +00:00
* * /let qb;const jE=typeof window<"u"&&window.trustedTypes;if(jE)try{qb=jE.createPolicy("vue",{createHTML:n=>n})}catch{}const H4=qb?n=>qb.createHTML(n):n=>n,mL="http:/ / www . w3 . org / 2000 / svg ",fL=" http : //www.w3.org/1998/Math/MathML",ys=typeof document<"u"?document:null,QE=ys&&ys.createElement("template"),gL={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,r)=>{const i=e==="svg"?ys.createElementNS(mL,n):e==="mathml"?ys.createElementNS(fL,n):t?ys.createElement(n,{is:t}):ys.createElement(n);return n==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:n=>ys.createTextNode(n),createComment:n=>ys.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>ys.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,r,i,s){const o=t?t.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),t),!(i===s||!(i=i.nextSibling)););else{QE.innerHTML=H4(r==="svg"?`<svg>${n}</svg>`:r==="mathml"?`<math>${n}</math>`:n);const a=QE.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},$s="transition",mc="animation",Sl=Symbol("_vtc"),q4={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Y4=Ln({},p4,q4),_L=n=>(n.displayName="Transition",n.props=Y4,n),ji=_L((n,{slots:e})=>mv(fD,$4(n),e)),zo=(n,e=[])=>{vt(n)?n.forEach(t=>t(...e)):n&&n(...e)},XE=n=>n?vt(n)?n.some(e=>e.length>1):n.length>1:!1;function $4(n){const e={};for(const q in n)q in q4||(e[q]=n[q]);if(n.css===!1)return e;const{name:t="v",type:r,duration:i,enterFromClass:s=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=s,appearActiveClass:d=o,appearToClass:u=a,leaveFromClass:m=`${t}-leave-from`,leaveActiveClass:f=`${t}-leave-active`,leaveToClass:g=`${t}-leave-to`}=n,h=bL(i),v=h&&h[0],b=h&&h[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:E,onLeave:x,onLeaveCancelled:A,onBeforeAppear:w=_,onAppear:N=y,onAppearCancelled:L=E}=e,C=(q,ie,D)=>{ro(q,ie?u:a),ro(q,ie?d:o),D&&D()},k=(q,ie)=>{q._isLeaving=!1,ro(q,m),ro(q,g),ro(q,f),ie&&ie()},H=q=>(ie,D)=>{const $=q?N:y,K=()=>C(ie,q,D);zo($,[ie,K]),ZE(()=>{ro(ie,q?l:s),bs(ie,q?u:a),XE($)||JE(ie,r,v,K)})};return Ln(e,{onBeforeEnter(q){zo(_,[q]),bs(q,s),bs(q,o)},onBeforeAppear(q){zo(w,[q]),bs(q,l),bs(q,d)},onEnter:H(!1),onAppear:H(!0),onLeave(q,ie){q._isLeaving=!0;const D=()=>k(q,ie);bs(q,m),bs(q,f),K4(),ZE(()=>{q._isLeaving&&(ro(q,m),bs(q,g),XE(x)||JE(q,r,b,D))}),zo(x,[q,D])},onEnterCancelled(q){C(q,!1),zo(E,[q])},onAppearCancelled(q){C(q,!0),zo(L,[q])},onLeaveCancelled(q){k(q),zo(A,[q])}})}function bL(n){if(n==null)return null;if(cn(n))return[Mm(n.enter),Mm(n.leave)];{const e=Mm(n);return[e,e]}}function Mm(n){return g5(n)}function bs(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Sl]||(n[Sl]=new Set)).add(e)}function ro(n,e){e.split(/\s+/).forEach(r=>r&&n.classList.remove(r));const t=n[Sl];t&&(t.delete(e),t.size||(n[Sl]=void 0))}function ZE(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let vL=0;function JE(n,e,t,r){const i=n._endId=++vL,s=()=>{i===n._endId&&r()};if(t!=null)return setTimeout(s,t);const{type:o,timeout:a,propCount:l}=W4(n,e);if(!o)return r();const d=o+"end";let u=0;const m=()=>{n.removeEventListener(d,f),s()},f=g=>{g.target===n&&++u>=l&&m()};setTimeout(()=>{u<l&&m()},a+1),n.addEventListener(d,f)}function W4(n,e){const t=window.getComputedStyle(n),r=h=>(t[h]||"").split(", "),i=r(`${$s}Delay`),s=r(`${$s}Duration`),o=eS(i,s),a=r(`${mc}Delay`),l=r(`${mc}Duration`),d=eS(a,l);let u=null,m=0,f=0;e===$s?o>0&&(u=$s,m=o,f=s.length
2024-11-04 00:22:50 +00:00
* vuex v4 . 1.0
* ( c ) 2022 Evan You
* @ license MIT
2024-11-06 23:05:30 +00:00
* /var e3="store";function i6(n){return n===void 0&&(n=null),Gr(n!==null?n:e3)}function Ql(n,e){Object.keys(n).forEach(function(t){return e(n[t],t)})}function t3(n){return n!==null&&typeof n=="object"}function s6(n){return n&&typeof n.then=="function"}function o6(n,e){return function(){return n(e)}}function n3(n,e,t){return e.indexOf(n)<0&&(t&&t.prepend?e.unshift(n):e.push(n)),function(){var r=e.indexOf(n);r>-1&&e.splice(r,1)}}function r3(n,e){n._actions=Object.create(null),n._mutations=Object.create(null),n._wrappedGetters=Object.create(null),n._modulesNamespaceMap=Object.create(null);var t=n.state;Ah(n,t,[],n._modules.root,!0),fv(n,t,e)}function fv(n,e,t){var r=n._state,i=n._scope;n.getters={},n._makeLocalGettersCache=Object.create(null);var s=n._wrappedGetters,o={},a={},l=T5(!0);l.run(function(){Ql(s,function(d,u){o[u]=o6(d,n),a[u]=mt(function(){return o[u]()}),Object.defineProperty(n.getters,u,{get:function(){return a[u].value},enumerable:!0})})}),n._state=yr({data:e}),n._scope=l,n.strict&&u6(n),r&&t&&n._withCommit(function(){r.data=null}),i&&i.stop()}function Ah(n,e,t,r,i){var s=!t.length,o=n._modules.getNamespace(t);if(r.namespaced&&(n._modulesNamespaceMap[o],n._modulesNamespaceMap[o]=r),!s&&!i){var a=gv(e,t.slice(0,-1)),l=t[t.length-1];n._withCommit(function(){a[l]=r.state})}var d=r.context=a6(n,o,t);r.forEachMutation(function(u,m){var f=o+m;l6(n,f,u,d)}),r.forEachAction(function(u,m){var f=u.root?m:o+m,g=u.handler||u;c6(n,f,g,d)}),r.forEachGetter(function(u,m){var f=o+m;d6(n,f,u,d)}),r.forEachChild(function(u,m){Ah(n,e,t.concat(m),u,i)})}function a6(n,e,t){var r=e==="",i={dispatch:r?n.dispatch:function(s,o,a){var l=Mp(s,o,a),d=l.payload,u=l.options,m=l.type;return(!u||!u.root)&&(m=e+m),n.dispatch(m,d)},commit:r?n.commit:function(s,o,a){var l=Mp(s,o,a),d=l.payload,u=l.options,m=l.type;(!u||!u.root)&&(m=e+m),n.commit(m,d,u)}};return Object.defineProperties(i,{getters:{get:r?function(){return n.getters}:function(){return i3(n,e)}},state:{get:function(){return gv(n.state,t)}}}),i}function i3(n,e){if(!n._makeLocalGettersCache[e]){var t={},r=e.length;Object.keys(n.getters).forEach(function(i){if(i.slice(0,r)===e){var s=i.slice(r);Object.defineProperty(t,s,{get:function(){return n.getters[i]},enumerable:!0})}}),n._makeLocalGettersCache[e]=t}return n._makeLocalGettersCache[e]}function l6(n,e,t,r){var i=n._mutations[e]||(n._mutations[e]=[]);i.push(function(o){t.call(n,r.state,o)})}function c6(n,e,t,r){var i=n._actions[e]||(n._actions[e]=[]);i.push(function(o){var a=t.call(n,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:n.getters,rootState:n.state},o);return s6(a)||(a=Promise.resolve(a)),n._devtoolHook?a.catch(function(l){throw n._devtoolHook.emit("vuex:error",l),l}):a})}function d6(n,e,t,r){n._wrappedGetters[e]||(n._wrappedGetters[e]=function(s){return t(r.state,r.getters,s.state,s.getters)})}function u6(n){Zn(function(){return n._state.data},function(){},{deep:!0,flush:"sync"})}function gv(n,e){return e.reduce(function(t,r){return t[r]},n)}function Mp(n,e,t){return t3(n)&&n.type&&(t=e,e=n,n=n.type),{type:n,payload:e,options:t}}var p6="vuex bindings",fS="vuex:mutations",Im="vuex:actions",La="vuex",h6=0;function m6(n,e){r6({id:"org.vuejs.vuex",app:n,label:"Vuex",homepage:"https:/ / next . vuex . vuejs . org / ",logo:" https : //vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[p6]},function(t){t.addTimelineLayer({id:fS,label:"Vuex Mutations",color:gS}),t.addTimelineLayer({id:Im,label:"Vuex Actions",color:gS}),t.addInspector({id:La,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),t.on.getInspectorTree(function(r){if(r.app===n&&r.inspectorId===La)if(r.filter){var i=[];l3(i,e._modules.root,r.filter,""),r.rootNodes=i}else r.rootNodes=[a3(e._modules.root,"")]}),t.on.getInspectorState(function(r){if(r.app===n&&r.inspectorId===La){var i=r.nodeId;i3(e,i),r.state=_6(v6(e._modules,i),i==="root"?e.getters:e._makeLocalGettersCache,i)}}),t.on.editInspectorState(function(r){if(r.app===n&&r.inspectorId===La){var i=r.nodeId,s=r.path;i!=="root"&&(s=i.split("/").fi
` ).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!t||e[t]&&AP[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},SS=Symbol("internals");function gc(n){return n&&String(n).trim().toLowerCase()}function ip(n){return n===!1||n==null?n:Ie.isArray(n)?n.map(ip):String(n)}function MP(n){const e=Object.create(null),t=/([^ \s ,;=]+) \s *(?:= \s *([^,;]+))?/g;let r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}const NP=n=>/^[-_a-zA-Z0-9^ ` | ~ , ! # $ % & ' * + . ] + $ / . test ( n . trim ( ) ) ; function Dm ( n , e , t , r , i ) { if ( Ie . isFunction ( r ) ) return r . call ( this , e , t ) ; if ( i && ( e = t ) , ! ! Ie . isString ( e ) ) { if ( Ie . isString ( r ) ) return e . indexOf ( r ) !== - 1 ; if ( Ie . isRegExp ( r ) ) return r . test ( e ) } } function kP ( n ) { return n . trim ( ) . toLowerCase ( ) . replace ( /([a-z\d])(\w*)/g , ( e , t , r ) => t . toUpperCase ( ) + r ) } function IP ( n , e ) { const t = Ie . toCamelCase ( " " + e ) ; [ "get" , "set" , "has" ] . forEach ( r => { Object . defineProperty ( n , r + t , { value : function ( i , s , o ) { return this [ r ] . call ( this , e , i , s , o ) } , configurable : ! 0 } ) } ) } class Rr { constructor ( e ) { e && this . set ( e ) } set ( e , t , r ) { const i = this ; function s ( a , l , d ) { const u = gc ( l ) ; if ( ! u ) throw new Error ( "header name must be a non-empty string" ) ; const m = Ie . findKey ( i , u ) ; ( ! m || i [ m ] === void 0 || d === ! 0 || d === void 0 && i [ m ] !== ! 1 ) && ( i [ m || l ] = ip ( a ) ) } const o = ( a , l ) => Ie . forEach ( a , ( d , u ) => s ( d , u , l ) ) ; if ( Ie . isPlainObject ( e ) || e instanceof this . constructor ) o ( e , t ) ; else if ( Ie . isString ( e ) && ( e = e . trim ( ) ) && ! NP ( e ) ) o ( RP ( e ) , t ) ; else if ( Ie . isHeaders ( e ) ) for ( const [ a , l ] of e . entries ( ) ) s ( l , a , r ) ; else e != null && s ( t , e , r ) ; return this } get ( e , t ) { if ( e = gc ( e ) , e ) { const r = Ie . findKey ( this , e ) ; if ( r ) { const i = this [ r ] ; if ( ! t ) return i ; if ( t === ! 0 ) return MP ( i ) ; if ( Ie . isFunction ( t ) ) return t . call ( this , i , r ) ; if ( Ie . isRegExp ( t ) ) return t . exec ( i ) ; throw new TypeError ( "parser must be boolean|regexp|function" ) } } } has ( e , t ) { if ( e = gc ( e ) , e ) { const r = Ie . findKey ( this , e ) ; return ! ! ( r && this [ r ] !== void 0 && ( ! t || Dm ( this , this [ r ] , r , t ) ) ) } return ! 1 } delete ( e , t ) { const r = this ; let i = ! 1 ; function s ( o ) { if ( o = gc ( o ) , o ) { const a = Ie . findKey ( r , o ) ; a && ( ! t || Dm ( r , r [ a ] , a , t ) ) && ( delete r [ a ] , i = ! 0 ) } } return Ie . isArray ( e ) ? e . forEach ( s ) : s ( e ) , i } clear ( e ) { const t = Object . keys ( this ) ; let r = t . length , i = ! 1 ; for ( ; r -- ; ) { const s = t [ r ] ; ( ! e || Dm ( this , this [ s ] , s , e , ! 0 ) ) && ( delete this [ s ] , i = ! 0 ) } return i } normalize ( e ) { const t = this , r = { } ; return Ie . forEach ( this , ( i , s ) => { const o = Ie . findKey ( r , s ) ; if ( o ) { t [ o ] = ip ( i ) , delete t [ s ] ; return } const a = e ? kP ( s ) : String ( s ) . trim ( ) ; a !== s && delete t [ s ] , t [ a ] = ip ( i ) , r [ a ] = ! 0 } ) , this } concat ( ... e ) { return this . constructor . concat ( this , ... e ) } toJSON ( e ) { const t = Object . create ( null ) ; return Ie . forEach ( this , ( r , i ) => { r != null && r !== ! 1 && ( t [ i ] = e && Ie . isArray ( r ) ? r . join ( ", " ) : r ) } ) , t } [ Symbol . iterator ] ( ) { return Object . entries ( this . toJSON ( ) ) [ Symbol . iterator ] ( ) } toString ( ) { return Object . entries ( this . toJSON ( ) ) . map ( ( [ e , t ] ) => e + ": " + t ) . join ( `
` )}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[SS]=this[SS]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=gc(o);r[a]||(IP(i,o),r[a]=!0)}return Ie.isArray(e)?e.forEach(s):s(e),this}}Rr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ie.reduceDescriptors(Rr.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(r){this[t]=r}}});Ie.freezeMethods(Rr);function Lm(n,e){const t=this||Cd,r=e||t,i=Rr.from(r.headers);let s=r.data;return Ie.forEach(n,function(a){s=a.call(t,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function C3(n){return!!(n&&n.__CANCEL__)}function Zl(n,e,t){Ft.call(this,n??"canceled",Ft.ERR_CANCELED,e,t),this.name="CanceledError"}Ie.inherits(Zl,Ft,{__CANCEL__:!0});function A3(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new Ft("Request failed with status code "+t.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function OP(n){const e=/^([-+ \w ]{1,25})(:? \/ \/ |:)/.exec(n);return e&&e[1]||""}function DP(n,e){n=n||10;const t=new Array(n),r=new Array(n);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const d=Date.now(),u=r[s];o||(o=d),t[i]=l,r[i]=d;let m=s,f=0;for(;m!==i;)f+=t[m++],m=m%n;if(i=(i+1)%n,i===s&&(s=(s+1)%n),d-o<e)return;const g=u&&d-u;return g?Math.round(f*1e3/g):void 0}}function LP(n,e){let t=0,r=1e3/e,i,s;const o=(d,u=Date.now())=>{t=u,i=null,s&&(clearTimeout(s),s=null),n.apply(null,d)};return[(...d)=>{const u=Date.now(),m=u-t;m>=r?o(d,u):(i=d,s||(s=setTimeout(()=>{s=null,o(i)},r-m)))},()=>i&&o(i)]}const Np=(n,e,t=3)=>{let r=0;const i=DP(50,250);return LP(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,d=i(l),u=o<=a;r=o;const m={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:d||void 0,estimated:d&&a&&u?(a-o)/d:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(m)},t)},xS=(n,e)=>{const t=n!=null;return[r=>e[0]({lengthComputable:t,total:n,loaded:r}),e[1]]},TS=n=>(...e)=>Ie.asap(()=>n(...e)),PP=Ar.hasStandardBrowserEnv?function(){const e=Ar.navigator&&/(msie|trident)/i.test(Ar.navigator.userAgent),t=document.createElement("a");let r;function i(s){let o=s;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/: $ /,""):"",host:t.host,search:t.search?t.search.replace(/^ \? /,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=i(window.location.href),function(o){const a=Ie.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),FP=Ar.hasStandardBrowserEnv?{write(n,e,t,r,i,s){const o=[n+"="+encodeURIComponent(e)];Ie.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),Ie.isString(r)&&o.push("path="+r),Ie.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|; \\ s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function UP(n){return/^([a-z][a-z \d + \- .]*:)? \/ \/ /i.test(n)}function BP(n,e){return e?n.replace(/ \/ ? \/ $ /,"")+"/"+e.replace(/^ \/ +/,""):n}function R3(n,e){return n&&!UP(e)?BP(n,e):e}const wS=n=>n instanceof Rr?{...n}:n;function ba(n,e){e=e||{};const t={};function r(d,u,m){return Ie.isPlainObject(d)&&Ie.isPlainObject(u)?Ie.merge.call({caseless:m},d,u):Ie.isPlainObject(u)?Ie.merge({},u):Ie.isArray(u)?u.slice():u}function i(d,u,m){if(Ie.isUndefined(u)){if(!Ie.isUndefined(d))return r(void 0,d,m)}else return r(d,u,m)}function s(d,u){if(!Ie.isUndefined(u))return r(void 0,u)}function o(d,u){if(Ie.isUndefined(u)){if(!Ie.isUndefined(d))return r(void 0,d)}else return r(void 0,u)}function a(d,u,m){if(m in e)return r(d,u);if(m in n
` +s.map(RS).join( `
` ):" "+RS(s[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Xb};function Pm(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Zl(null,n)}function MS(n){return Pm(n),n.headers=Rr.from(n.headers),n.data=Lm.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),I3.getAdapter(n.adapter||Cd.adapter)(n).then(function(r){return Pm(n),r.data=Lm.call(n,n.transformResponse,r),r.headers=Rr.from(r.headers),r},function(r){return C3(r)||(Pm(n),r&&r.response&&(r.response.data=Lm.call(n,n.transformResponse,r.response),r.response.headers=Rr.from(r.response.headers))),Promise.reject(r)})}const O3="1.7.7",Ev={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Ev[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});const NS={};Ev.transitional=function(e,t,r){function i(s,o){return"[Axios v"+O3+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(e===!1)throw new Ft(i(o," has been removed"+(t?" in "+t:"")),Ft.ERR_DEPRECATED);return t&&!NS[o]&&(NS[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,a):!0}};function ZP(n,e,t){if(typeof n!="object")throw new Ft("options must be an object",Ft.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const a=n[s],l=a===void 0||o(a,s,n);if(l!==!0)throw new Ft("option "+s+" must be "+l,Ft.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Ft("Unknown option "+s,Ft.ERR_BAD_OPTION)}}const Zb={assertOptions:ZP,validators:Ev},Ws=Zb.validators;class ca{constructor(e){this.defaults=e,this.interceptors={request:new ES,response:new ES}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+ \n /,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+ \n .+ \n /,""))&&(r.stack+= `
` +s):r.stack=s}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ba(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:s}=t;r!==void 0&&Zb.assertOptions(r,{silentJSONParsing:Ws.transitional(Ws.boolean),forcedJSONParsing:Ws.transitional(Ws.boolean),clarifyTimeoutError:Ws.transitional(Ws.boolean)},!1),i!=null&&(Ie.isFunction(i)?t.paramsSerializer={serialize:i}:Zb.assertOptions(i,{encode:Ws.function,serialize:Ws.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&Ie.merge(s.common,s[t.method]);s&&Ie.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),t.headers=Rr.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(t)===!1||(l=l&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const d=[];this.interceptors.response.forEach(function(v){d.push(v.fulfilled,v.rejected)});let u,m=0,f;if(!l){const h=[MS.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,d),f=h.length,u=Promise.resolve(t);m<f;)u=u.then(h[m++],h[m++]);return u}f=a.length;let g=t;for(m=0;m<f;){const h=a[m++],v=a[m++];try{g=h(g)}catch(b){v.call(this,b);break}}try{u=MS.call(this,g)}catch(h){return Promise.reject(h)}for(m=0,f=d.length;m<f;)u=u.then(d[m++],d[m++]);return u}getUri(e){e=ba(this.defaults,e);const t=R3(e.baseURL,e.url);return x3(t,e.params,e.paramsSerializer)}}Ie.forEach(["delete","get","head","options"],function(e){ca.prototype[e]=function(t,r){return this.request(ba(r||{},{method:e,url:t,data:(r||{}).data}))}});Ie.forEach(["post","put","patch"],function(e){function t(r){return function(s,o,a){return this.request(ba(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}ca.prototype[e]=t(),ca.prototype[e+"Form"]=t(!0)});class Sv{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new Zl(s,o,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Sv(function(i){e=i}),cancel:e}}}function JP(n){return function(t){return n.apply(null,t)}}function e7(n){return Ie.isObject(n)&&n.isAxiosError===!0}const Jb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticat
2024-11-04 00:22:50 +00:00
* vue - router v4 . 4.5
* ( c ) 2024 Eduardo San Martin Morote
* @ license MIT
2024-11-11 23:13:41 +00:00
* /const rl=typeof document<"u";function L3(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function t7(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&L3(n.default)}const rn=Object.assign;function Fm(n,e){const t={};for(const r in e){const i=e[r];t[r]=ki(i)?i.map(n):n(i)}return t}const Gc=()=>{},ki=Array.isArray,P3=/ # / g , n7 = /&/g , r7 = /\//g , i7 = /=/g , s7 = /\?/g , F3 = /\+/g , o7 = /%5B/g , a7 = /%5D/g , U3 = /%5E/g , l7 = /%60/g , B3 = /%7B/g , c7 = /%7C/g , G3 = /%7D/g , d7 = /%20/g ; function xv ( n ) { return encodeURI ( "" + n ) . replace ( c7 , "|" ) . replace ( o7 , "[" ) . replace ( a7 , "]" ) } function u7 ( n ) { return xv ( n ) . replace ( B3 , "{" ) . replace ( G3 , "}" ) . replace ( U3 , "^" ) } function e1 ( n ) { return xv ( n ) . replace ( F3 , "%2B" ) . replace ( d7 , "+" ) . replace ( P3 , "%23" ) . replace ( n7 , "%26" ) . replace ( l7 , "`" ) . replace ( B3 , "{" ) . replace ( G3 , "}" ) . replace ( U3 , "^" ) } function p7 ( n ) { return e1 ( n ) . replace ( i7 , "%3D" ) } function h7 ( n ) { return xv ( n ) . replace ( P3 , "%23" ) . replace ( s7 , "%3F" ) } function m7 ( n ) { return n == null ? "" : h7 ( n ) . replace ( r7 , "%2F" ) } function ld ( n ) { try { return decodeURIComponent ( "" + n ) } catch { } return "" + n } const f7 = /\/$/ , g7 = n => n . replace ( f7 , "" ) ; function Um ( n , e , t = "/" ) { let r , i = { } , s = "" , o = "" ; const a = e . indexOf ( "#" ) ; let l = e . indexOf ( "?" ) ; return a < l && a >= 0 && ( l = - 1 ) , l > - 1 && ( r = e . slice ( 0 , l ) , s = e . slice ( l + 1 , a > - 1 ? a : e . length ) , i = n ( s ) ) , a > - 1 && ( r = r || e . slice ( 0 , a ) , o = e . slice ( a , e . length ) ) , r = y7 ( r ? ? e , t ) , { fullPath : r + ( s && "?" ) + s + o , path : r , query : i , hash : ld ( o ) } } function _7 ( n , e ) { const t = e . query ? n ( e . query ) : "" ; return e . path + ( t && "?" ) + t + ( e . hash || "" ) } function kS ( n , e ) { return ! e || ! n . toLowerCase ( ) . startsWith ( e . toLowerCase ( ) ) ? n : n . slice ( e . length ) || "/" } function b7 ( n , e , t ) { const r = e . matched . length - 1 , i = t . matched . length - 1 ; return r > - 1 && r === i && Tl ( e . matched [ r ] , t . matched [ i ] ) && z3 ( e . params , t . params ) && n ( e . query ) === n ( t . query ) && e . hash === t . hash } function Tl ( n , e ) { return ( n . aliasOf || n ) === ( e . aliasOf || e ) } function z3 ( n , e ) { if ( Object . keys ( n ) . length !== Object . keys ( e ) . length ) return ! 1 ; for ( const t in n ) if ( ! v7 ( n [ t ] , e [ t ] ) ) return ! 1 ; return ! 0 } function v7 ( n , e ) { return ki ( n ) ? IS ( n , e ) : ki ( e ) ? IS ( e , n ) : n === e } function IS ( n , e ) { return ki ( e ) ? n . length === e . length && n . every ( ( t , r ) => t === e [ r ] ) : n . length === 1 && n [ 0 ] === e } function y7 ( n , e ) { if ( n . startsWith ( "/" ) ) return n ; if ( ! n ) return e ; const t = e . split ( "/" ) , r = n . split ( "/" ) , i = r [ r . length - 1 ] ; ( i === ".." || i === "." ) && r . push ( "" ) ; let s = t . length - 1 , o , a ; for ( o = 0 ; o < r . length ; o ++ ) if ( a = r [ o ] , a !== "." ) if ( a === ".." ) s > 1 && s -- ; else break ; return t . slice ( 0 , s ) . join ( "/" ) + "/" + r . slice ( o ) . join ( "/" ) } const Ks = { path : "/" , name : void 0 , params : { } , query : { } , hash : "" , fullPath : "/" , matched : [ ] , meta : { } , redirectedFrom : void 0 } ; var cd ; ( function ( n ) { n . pop = "pop" , n . push = "push" } ) ( cd || ( cd = { } ) ) ; var zc ; ( function ( n ) { n . back = "back" , n . forward = "forward" , n . unknown = "" } ) ( zc || ( zc = { } ) ) ; function E7 ( n ) { if ( ! n ) if ( rl ) { const e = document . querySelector ( "base" ) ; n = e && e . getAttribute ( "href" ) || "/" , n = n . replace ( /^\w+:\/\/[^\/]+/ , "" ) } else n = "/" ; return n [ 0 ] !== "/" && n [ 0 ] !== "#" && ( n = "/" + n ) , g7 ( n ) } const S7 = /^[^#]+#/ ; function x7 ( n , e ) { return n . replace ( S7 , "#" ) + e } function T7 ( n , e ) { const t = document . documentElement . getBoundingClientRect ( ) , r = n . getBoundingClientRect ( ) ; return { behavior : e . behavior , left : r . left - t . left - ( e . left || 0 ) , top : r . top - t . top - ( e . top || 0 ) } } const Oh = ( ) => ( { left : window . scrollX , top : window . scrollY } ) ; function w7 ( n ) { let e ; if ( "el" in n ) { const t = n . el , r = typeof t == "string" && t . startsWith ( "#" ) , i = typeof t == "string" ? r ? document . getElementById ( t . slice ( 1 ) ) : document . querySelector ( t ) : t ; if ( ! i ) return ; e = T7 ( i , n ) } else e = n ; "scrollBehavior" in document . documentElement . style ? window . scrollTo ( e ) : window . scrollTo ( e . left != null ? e . left : window . scrollX , e . top != null ? e . top : window . scrollY ) } function OS ( n , e ) { return ( history . state ? history . state . position - e : - 1 ) + n } const t1 = new Map ; function C7 ( n , e ) { t1 . set ( n , e ) } function A7 ( n ) { const e = t1 . get ( n ) ; return t1 . delete ( n ) , e } let R7 = ( ) => location . protocol + "//" + location . host ; function V3 ( n , e ) { const { pathname : t , search : r , hash : i } = e , s = n . indexOf ( "#" ) ; if ( s > - 1 ) { let a = i . includes ( n . slice ( s ) ) ? n . slice ( s ) . length : 1 , l = i . slice ( a ) ; return l [ 0 ] !== "/" && ( l = "/" + l ) , kS ( l , "" ) } return kS ( t , n ) + r + i } function M7 ( n , e , t , r ) { let i = [ ] , s = [ ] , o = null ; const a = ( { state : f } ) => { const g = V3 ( n , location ) , h = t . value , v = e . value ; let b = 0 ; if ( f ) { if ( t . value = g , e . value = f , o && o === h ) { o = null ; return } b = v ? f . position
2024-11-04 00:22:50 +00:00
Copyright ( c ) 2016 Jed Watson .
Licensed under the MIT License ( MIT ) , see
http : //jedwatson.github.io/classnames
2024-11-06 23:05:30 +00:00
* /(function(){var a=function(){function l(){}l.prototype=Object.create(null);function d(_,y){for(var E=y.length,x=0;x<E;++x)v(_,y[x])}var u={}.hasOwnProperty;function m(_,y){_[y]=!0}function f(_,y){for(var E in y)u.call(y,E)&&(_[E]=!!y[E])}var g=/ \ s + / ; f u n c t i o n h ( _ , y ) { f o r ( v a r E = y . s p l i t ( g ) , x = E . l e n g t h , A = 0 ; A < x ; + + A ) _ [ E [ A ] ] = ! 0 } f u n c t i o n v ( _ , y ) { i f ( y ) { v a r E = t y p e o f y ; E = = = " s t r i n g " ? h ( _ , y ) : A r r a y . i s A r r a y ( y ) ? d ( _ , y ) : E = = = " o b j e c t " ? f ( _ , y ) : E = = = " n u m b e r " & & m ( _ , y ) } } f u n c t i o n b ( ) { f o r ( v a r _ = a r g u m e n t s . l e n g t h , y = A r r a y ( _ ) , E = 0 ; E < _ ; E + + ) y [ E ] = a r g u m e n t s [ E ] ; v a r x = n e w l ; d ( x , y ) ; v a r A = [ ] ; f o r ( v a r w i n x ) x [ w ] & & A . p u s h ( w ) ; r e t u r n A . j o i n ( " " ) } r e t u r n b } ( ) ; t y p e o f t < " u " & & t . e x p o r t s ? t . e x p o r t s = a : ( s = [ ] , o = ( f u n c t i o n ( ) { r e t u r n a } ) . a p p l y ( r , s ) , o ! = = v o i d 0 & & ( t . e x p o r t s = o ) ) } ) ( ) } , " . / n o d e _ m o d u l e s / c o r e - j s / e s / a r r a y / f r o m . j s " : f u n c t i o n ( t , r , i ) { i ( " . / n o d e _ m o d u l e s / c o r e - j s / m o d u l e s / e s . s t r i n g . i t e r a t o r . j s " ) , i ( " . / n o d e _ m o d u l e s / c o r e - j s / m o d u l e s / e s . a r r a y . f r o m . j s " ) ; v a r s = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / p a t h . j s " ) ; t . e x p o r t s = s . A r r a y . f r o m } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a - f u n c t i o n . j s " : f u n c t i o n ( t , r ) { t . e x p o r t s = f u n c t i o n ( i ) { i f ( t y p e o f i ! = " f u n c t i o n " ) t h r o w T y p e E r r o r ( S t r i n g ( i ) + " i s n o t a f u n c t i o n " ) ; r e t u r n i } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a n - o b j e c t . j s " : f u n c t i o n ( t , r , i ) { v a r s = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / i s - o b j e c t . j s " ) ; t . e x p o r t s = f u n c t i o n ( o ) { i f ( ! s ( o ) ) t h r o w T y p e E r r o r ( S t r i n g ( o ) + " i s n o t a n o b j e c t " ) ; r e t u r n o } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a r r a y - f r o m . j s " : f u n c t i o n ( t , r , i ) { v a r s = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / b i n d - c o n t e x t . j s " ) , o = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - o b j e c t . j s " ) , a = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c a l l - w i t h - s a f e - i t e r a t i o n - c l o s i n g . j s " ) , l = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / i s - a r r a y - i t e r a t o r - m e t h o d . j s " ) , d = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - l e n g t h . j s " ) , u = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c r e a t e - p r o p e r t y . j s " ) , m = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / g e t - i t e r a t o r - m e t h o d . j s " ) ; t . e x p o r t s = f u n c t i o n ( g ) { v a r h = o ( g ) , v = t y p e o f t h i s = = " f u n c t i o n " ? t h i s : A r r a y , b = a r g u m e n t s . l e n g t h , _ = b > 1 ? a r g u m e n t s [ 1 ] : v o i d 0 , y = _ ! = = v o i d 0 , E = 0 , x = m ( h ) , A , w , N , L ; i f ( y & & ( _ = s ( _ , b > 2 ? a r g u m e n t s [ 2 ] : v o i d 0 , 2 ) ) , x ! = n u l l & & ! ( v = = A r r a y & & l ( x ) ) ) f o r ( L = x . c a l l ( h ) , w = n e w v ; ! ( N = L . n e x t ( ) ) . d o n e ; E + + ) u ( w , E , y ? a ( L , _ , [ N . v a l u e , E ] , ! 0 ) : N . v a l u e ) ; e l s e f o r ( A = d ( h . l e n g t h ) , w = n e w v ( A ) ; A > E ; E + + ) u ( w , E , y ? _ ( h [ E ] , E ) : h [ E ] ) ; r e t u r n w . l e n g t h = E , w } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a r r a y - i n c l u d e s . j s " : f u n c t i o n ( t , r , i ) { v a r s = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - i n d e x e d - o b j e c t . j s " ) , o = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - l e n g t h . j s " ) , a = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - a b s o l u t e - i n d e x . j s " ) ; t . e x p o r t s = f u n c t i o n ( l ) { r e t u r n f u n c t i o n ( d , u , m ) { v a r f = s ( d ) , g = o ( f . l e n g t h ) , h = a ( m , g ) , v ; i f ( l & & u ! = u ) { f o r ( ; g > h ; ) i f ( v = f [ h + + ] , v ! = v ) r e t u r n ! 0 } e l s e f o r ( ; g > h ; h + + ) i f ( ( l | | h i n f ) & & f [ h ] = = = u ) r e t u r n l | | h | | 0 ; r e t u r n ! l & & - 1 } } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / b i n d - c o n t e x t . j s " : f u n c t i o n ( t , r , i ) { v a r s = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a - f u n c t i o n . j s " ) ; t . e x p o r t s = f u n c t i o n ( o , a , l ) { i f ( s ( o ) , a = = = v o i d 0 ) r e t u r n o ; s w i t c h ( l ) { c a s e 0 : r e t u r n f u n c t i o n ( ) { r e t u r n o . c a l l ( a ) } ; c a s e 1 : r e t u r n f u n c t i o n ( d ) { r e t u r n o . c a l l ( a , d ) } ; c a s e 2 : r e t u r n f u n c t i o n ( d , u ) { r e t u r n o . c a l l ( a , d , u ) } ; c a s e 3 : r e t u r n f u n c t i o n ( d , u , m ) { r e t u r n o . c a l l ( a , d , u , m ) } } r e t u r n f u n c t i o n ( ) { r e t u r n o . a p p l y ( a , a r g u m e n t s ) } } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c a l l - w i t h - s a f e - i t e r a t i o n - c l o s i n g . j s " : f u n c t i o n ( t , r , i ) { v a r s = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a n - o b j e c t . j s " ) ; t . e x p o r t s = f u n c t i o n ( o , a , l , d ) { t r y { r e t u r n d ? a ( s ( l ) [ 0 ] , l [ 1 ] ) : a ( l ) } c a t c h ( m ) { v a r u = o . r e t u r n ; t h r o w u ! = = v o i d 0 & & s ( u . c a l l ( o ) ) , m } } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c h e c k - c o r r e c t n e s s - o f - i t e r a t i o n . j s " : f u n c t i o n ( t , r , i ) { v a r s = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / w e l l - k n o w n - s y m b o l . j s " ) , o = s ( " i t e r a t o r " ) , a = ! 1 ; t r y { v a r l = 0 , d = { n e x t : f u n c t i o n ( ) { r e t u r n { d o n e : ! ! l + + } } , r e t u r n : f u n c t i o n ( ) { a = ! 0 } } ; d [ o ] = f u n c t i o n ( ) { r e t u r n t h i s } , A r r a y . f r o m ( d , f u n c t i o n ( ) { t h r o w 2 } ) } c a t c h { } t . e x p o r t s = f u n c t i o n ( u , m ) { i f ( ! m & & ! a ) r e t u r n ! 1 ; v a r f = ! 1 ; t r y { v a r g = { } ; g [ o ] = f u n c t i o n ( ) { r e t u r n { n e x t : f u n c t i o n ( ) { r e t u r n { d o n e : f = ! 0 } } } } , u ( g ) } c a t c h { } r e t u r n f } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c l a s s o f - r a w . j s " : f u n c t i o n ( t , r ) { v a r i = { } . t o S t r i n g ; t . e x p o r t s = f u n c t i o n ( s ) { r e t u r n i . c a l l ( s ) . s l i c e ( 8 , - 1 ) } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c l a s s o f . j s " : f u n c t i o n ( t , r , i ) { v a r s = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c l a s s o f
` ,nne="∄",rne="∄",ine="𝔑 ",sne="𝔫 ",one="≧̸",ane="≱",lne="≱",cne="≧̸",dne="⩾̸",une="⩾̸",pne="⋙̸",hne="≵",mne="≫⃒",fne="≯",gne="≯",_ne="≫̸",bne="↮",vne="⇎",yne="⫲",Ene="∋",Sne="⋼",xne="⋺",Tne="∋",wne="Њ",Cne="њ",Ane="↚",Rne="⇍",Mne="‥",Nne="≦̸",kne="≰",Ine="↚",One="⇍",Dne="↮",Lne="⇎",Pne="≰",Fne="≦̸",Une="⩽̸",Bne="⩽̸",Gne="≮",zne="⋘̸",Vne="≴",Hne="≪⃒",qne="≮",Yne="⋪", $ ne="⋬",Wne="≪̸",Kne="∤",jne=" ",Qne=" ",Xne="𝕟 ",Zne="ℕ ",Jne="⫬",ere="¬",tre="≢",nre="≭",rre="∦",ire="∉",sre="≠",ore="≂̸",are="∄",lre="≯",cre="≱",dre="≧̸",ure="≫̸",pre="≹",hre="⩾̸",mre="≵",fre="≎̸",gre="≏̸",_re="∉",bre="⋵̸",vre="⋹̸",yre="∉",Ere="⋷",Sre="⋶",xre="⧏̸",Tre="⋪",wre="⋬",Cre="≮",Are="≰",Rre="≸",Mre="≪̸",Nre="⩽̸",kre="≴",Ire="⪢̸",Ore="⪡̸",Dre="∌",Lre="∌",Pre="⋾",Fre="⋽",Ure="⊀",Bre="⪯̸",Gre="⋠",zre="∌",Vre="⧐̸",Hre="⋫",qre="⋭",Yre="⊏̸", $ re="⋢",Wre="⊐̸",Kre="⋣",jre="⊂⃒",Qre="⊈",Xre="⊁",Zre="⪰̸",Jre="⋡",eie="≿̸",tie="⊃⃒",nie="⊉",rie="≁",iie="≄",sie="≇",oie="≉",aie="∤",lie="∦",cie="∦",die="⫽⃥",uie="∂̸",pie="⨔",hie="⊀",mie="⋠",fie="⊀",gie="⪯̸",_ie="⪯̸",bie="⤳̸",vie="↛",yie="⇏",Eie="↝̸",Sie="↛",xie="⇏",Tie="⋫",wie="⋭",Cie="⊁",Aie="⋡",Rie="⪰̸",Mie="𝒩 ",Nie="𝓃 ",kie="∤",Iie="∦",Oie="≁",Die="≄",Lie="≄",Pie="∤",Fie="∦",Uie="⋢",Bie="⋣",Gie="⊄",zie="⫅̸",Vie="⊈",Hie="⊂⃒",qie="⊈",Yie="⫅̸", $ ie="⊁",Wie="⪰̸",Kie="⊅",jie="⫆̸",Qie="⊉",Xie="⊃⃒",Zie="⊉",Jie="⫆̸",ese="≹",tse="Ñ",nse="ñ",rse="≸",ise="⋪",sse="⋬",ose="⋫",ase="⋭",lse="Ν ",cse="ν ",dse="#",use="№",pse=" ",hse="≍⃒",mse="⊬",fse="⊭",gse="⊮",_se="⊯",bse="≥⃒",vse=">⃒",yse="⤄",Ese="⧞",Sse="⤂",xse="≤⃒",Tse="<⃒",wse="⊴⃒",Cse="⤃",Ase="⊵⃒",Rse="∼⃒",Mse="⤣",Nse="↖",kse="⇖",Ise="↖",Ose="⤧",Dse="Ó",Lse="ó",Pse="⊛",Fse="Ô",Use="ô",Bse="⊚",Gse="О ",zse="о ",Vse="⊝",Hse="Ő",qse="ő",Yse="⨸", $ se="⊙",Wse="⦼",Kse="Œ",jse="œ",Qse="⦿",Xse="𝔒 ",Zse="𝔬 ",Jse="˛ ",eoe="Ò",toe="ò",noe="⧁",roe="⦵",ioe="Ω",soe="∮",ooe="↺",aoe="⦾",loe="⦻",coe="‾",doe="⧀",uoe="Ō",poe="ō",hoe="Ω",moe="ω",foe="Ο ",goe="ο ",_oe="⦶",boe="⊖",voe="𝕆 ",yoe="𝕠 ",Eoe="⦷",Soe="“",xoe="‘ ",Toe="⦹",woe="⊕",Coe="↻",Aoe="⩔",Roe="∨ ",Moe="⩝",Noe="ℴ ",koe="ℴ ",Ioe="ª",Ooe="º",Doe="⊶",Loe="⩖",Poe="⩗",Foe="⩛",Uoe="Ⓢ",Boe="𝒪 ",Goe="ℴ ",zoe="Ø",Voe="ø",Hoe="⊘",qoe="Õ",Yoe="õ", $ oe="⨶",Woe="⨷",Koe="⊗",joe="Ö",Qoe="ö",Xoe="⌽",Zoe="‾",Joe="⏞",eae="⎴",tae="⏜",nae="¶",rae="∥",iae="∥",sae="⫳",oae="⫽",aae="∂",lae="∂",cae="П",dae="п",uae="%",pae=".",hae="‰",mae="⊥",fae="‱",gae="𝔓 ",_ae="𝔭 ",bae="Φ",vae="φ",yae="ϕ",Eae="ℳ ",Sae="☎",xae="Π",Tae="π",wae="⋔",Cae="ϖ",Aae="ℏ",Rae="ℎ ",Mae="ℏ",Nae="⨣",kae="⊞",Iae="⨢",Oae="+",Dae="∔",Lae="⨥",Pae="⩲",Fae="±",Uae="±",Bae="⨦",Gae="⨧",zae="±",Vae="ℌ ",Hae="⨕",qae="𝕡 ",Yae="ℙ ", $ ae="£",Wae="⪷",Kae="⪻",jae="≺",Qae="≼",Xae="⪷",Zae="≺",Jae="≼",ele="≺",tle="⪯",nle="≼",rle="≾",ile="⪯",sle="⪹",ole="⪵",ale="⋨",lle="⪯",cle="⪳",dle="≾",ule="′ ",ple="″",hle="ℙ ",mle="⪹",fle="⪵",gle="⋨",_le="∏",ble="∏",vle="⌮",yle="⌒",Ele="⌓",Sle="∝",xle="∝",Tle="∷",wle="∝",Cle="≾",Ale="⊰",Rle="𝒫 ",Mle="𝓅 ",Nle="Ψ",kle="ψ",Ile=" ",Ole="𝔔 ",Dle="𝔮 ",Lle="⨌",Ple="𝕢 ",Fle="ℚ ",Ule="⁗",Ble="𝒬 ",Gle="𝓆 ",zle="ℍ ",Vle="⨖",Hle="?",qle="≟",Yle='"', $ le='"',Wle="⇛",Kle="∽̱",jle="Ŕ",Qle="ŕ",Xle="√",Zle="⦳",Jle="⟩",ece="⟫",tce="⦒",nce="⦥",rce="⟩",ice="»",sce="⥵",oce="⇥",ace="⤠",lce="⤳",cce="→",dce="↠",uce="⇒",pce="⤞",hce="↪",mce="↬",fce="⥅",gce="⥴",_ce="⤖",bce="↣",vce="↝",yce="⤚",Ece="⤜",Sce="∶ ",xce="ℚ ",Tce="⤍",wce=
2024-11-11 23:13:41 +00:00
` ," "],tve=["{","}","|"," \\ ","^"," ` "].concat(eve),nve=[" '"].concat(tve),XS=["%","/","?",";","#"].concat(nve),ZS=["/","?","#"],rve=255,JS=/^[+a-z0-9A-Z_-]{0,63}$/,ive=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,e2={javascript:!0,"javascript:":!0},t2={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function sve(n,e){if(n&&n instanceof Op)return n;var t=new Op;return t.parse(n,e),t}Op.prototype.parse=function(n,e){var t,r,i,s,o,a=n;if(a=a.trim(),!e&&n.split("#").length===1){var l=J1e.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var d=X1e.exec(a);if(d&&(d=d[0],i=d.toLowerCase(),this.protocol=d,a=a.substr(d.length)),(e||d||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=a.substr(0,2)==="//",o&&!(d&&e2[d])&&(a=a.substr(2),this.slashes=!0)),!e2[d]&&(o||d&&!t2[d])){var u=-1;for(t=0;t<ZS.length;t++)s=a.indexOf(ZS[t]),s!==-1&&(u===-1||s<u)&&(u=s);var m,f;for(u===-1?f=a.lastIndexOf("@"):f=a.lastIndexOf("@",u),f!==-1&&(m=a.slice(0,f),a=a.slice(f+1),this.auth=m),u=-1,t=0;t<XS.length;t++)s=a.indexOf(XS[t]),s!==-1&&(u===-1||s<u)&&(u=s);u===-1&&(u=a.length),a[u-1]===":"&&u--;var g=a.slice(0,u);a=a.slice(u),this.parseHost(g),this.hostname=this.hostname||"";var h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){var v=this.hostname.split(/\./);for(t=0,r=v.length;t<r;t++){var b=v[t];if(b&&!b.match(JS)){for(var _="",y=0,E=b.length;y<E;y++)b.charCodeAt(y)>127?_+="x":_+=b[y];if(!_.match(JS)){var x=v.slice(0,t),A=v.slice(t+1),w=b.match(ive);w&&(x.push(w[1]),A.unshift(w[2])),A.length&&(a=A.join(".")+a),this.hostname=x.join(".");break}}}}this.hostname.length>rve&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var N=a.indexOf("#");N!==-1&&(this.hash=a.substr(N),a=a.slice(0,N));var L=a.indexOf("?");return L!==-1&&(this.search=a.substr(L),a=a.slice(0,L)),a&&(this.pathname=a),t2[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Op.prototype.parseHost=function(n){var e=Z1e.exec(n);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),n=n.substr(0,n.length-e.length)),n&&(this.hostname=n)};var ove=sve;Jl.encode=W1e;Jl.decode=j1e;Jl.format=Q1e;Jl.parse=ove;var Vo={},zm,n2;function eN(){return n2||(n2=1,zm=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),zm}var Vm,r2;function tN(){return r2||(r2=1,Vm=/[\0-\x1F\x7F-\x9F]/),Vm}var Hm,i2;function ave(){return i2||(i2=1,Hm=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/),Hm}var qm,s2;function nN(){return s2||(s2=1,qm=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),qm}var o2;function lve(){return o2||(o2=1,Vo.Any=eN(),Vo.Cc=tN(),Vo.Cf=ave(),Vo.P=Cv,Vo.Z=nN()),Vo}(function(n){function e(D){return Object.prototype.toString.call(D)}function t(D){return e(D)==="[object String]"}var r=Object.prototype.hasOwnProperty;function i(D,$){return r.call(D,$)}function s(D){var $=Array.prototype.slice.call(arguments,1);return $.forEach(function(K){if(K){if(typeof K!="object")throw new TypeError(K+"must be object");Object.keys(K).forEach(function(B){D[B]=K[B]})}}),D}function o(D,$,K){return[].concat(D.slice(0,$),K,D.slice($+1))}function a(D){return!(D>=55296&&D<=57343||D>=64976&&D<=65007||(D&65535)===65535||(D&65535)===65534||D>=0&&D<=8||D===11||D>=14&&D<=31||D>=127&&D<=159||D>1114111)}function l(D){if(D>65535){D-=65536;var $=55296+(D>>10),K=56320+(D&1023);return String.fromCharCode($,K)}return String.fromCharCode(D)}var d=/\\([!"#$%&' ( ) * + , \ - . \ / : ; <= > ? @ [ \ \ \ ] ^ _ ` {|}~])/g,u=/&([a-z#][a-z0-9]{1,31});/gi,m=new RegExp(d.source+"|"+u.source,"gi"),f=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8})) $ /i,g=J3;function h(D, $ ){var K;return i(g, $ )?g[ $ ]: $ .charCodeAt(0)===35&&f.test( $ )&&(K= $ [1].toLowerCase()==="x"?parseInt( $ .slice(2),16):parseInt( $ .slice(1),10),a(K))?l(K):D}function v(D){return D.indexOf(" \\ ")<0?D:D.replace(d," $ 1")}function b(D){return D.indexOf(" \\ ")<0&&D.indexOf("&"
` };ts.fence=function(n,e,t,r,i){var s=n[e],o=s.info?mve(s.info).trim():"",a="",l="",d,u,m,f,g;return o&&(m=o.split(/( \s +)/g),a=m[0],l=m.slice(2).join("")),t.highlight?d=t.highlight(s.content,a,l)||va(s.content):d=va(s.content),d.indexOf("<pre")===0?d+ `
2024-11-04 00:22:50 +00:00
` :o?(u=s.attrIndex("class"),f=s.attrs?s.attrs.slice():[],u<0?f.push(["class",t.langPrefix+a]):(f[u]=f[u].slice(),f[u][1]+=" "+t.langPrefix+a),g={attrs:f},"<pre><code"+i.renderAttrs(g)+">"+d+ ` < / c o d e > < / p r e >
` ):"<pre><code"+i.renderAttrs(s)+">"+d+ ` < / c o d e > < / p r e >
2024-11-11 23:13:41 +00:00
` };ts.image=function(n,e,t,r,i){var s=n[e];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,t,r),i.renderToken(n,e,t)};ts.hardbreak=function(n,e,t){return t.xhtmlOut? ` < br / >
2024-11-04 00:22:50 +00:00
` : ` < br >
2024-11-11 23:13:41 +00:00
` };ts.softbreak=function(n,e,t){return t.breaks?t.xhtmlOut? ` < br / >
2024-11-04 00:22:50 +00:00
` : ` < br >
` : `
2024-11-11 23:13:41 +00:00
` };ts.text=function(n,e){return va(n[e].content)};ts.html_block=function(n,e){return n[e].content};ts.html_inline=function(n,e){return n[e].content};function ec(){this.rules=hve({},ts)}ec.prototype.renderAttrs=function(e){var t,r,i;if(!e.attrs)return"";for(i="",t=0,r=e.attrs.length;t<r;t++)i+=" "+va(e.attrs[t][0])+'="'+va(e.attrs[t][1])+'"';return i};ec.prototype.renderToken=function(e,t,r){var i,s="",o=!1,a=e[t];return a.hidden?"":(a.block&&a.nesting!==-1&&t&&e[t-1].hidden&&(s+= `
2024-11-04 00:22:50 +00:00
` ),s+=(a.nesting===-1?"</":"<")+a.tag,s+=this.renderAttrs(a),a.nesting===0&&r.xhtmlOut&&(s+=" /"),a.block&&(o=!0,a.nesting===1&&t+1<e.length&&(i=e[t+1],(i.type==="inline"||i.hidden||i.nesting===-1&&i.tag===a.tag)&&(o=!1))),s+=o? ` >
2024-11-06 23:05:30 +00:00
` :">",s)};ec.prototype.renderInline=function(n,e,t){for(var r,i="",s=this.rules,o=0,a=n.length;o<a;o++)r=n[o].type,typeof s[r]<"u"?i+=s[r](n,o,e,t,this):i+=this.renderToken(n,o,e);return i};ec.prototype.renderInlineAsText=function(n,e,t){for(var r="",i=0,s=n.length;i<s;i++)n[i].type==="text"?r+=n[i].content:n[i].type==="image"?r+=this.renderInlineAsText(n[i].children,e,t):n[i].type==="softbreak"&&(r+= `
` );return r};ec.prototype.render=function(n,e,t){var r,i,s,o="",a=this.rules;for(r=0,i=n.length;r<i;r++)s=n[r].type,s==="inline"?o+=this.renderInline(n[r].children,e,t):typeof a[s]<"u"?o+=a[s](n,r,e,t,this):o+=this.renderToken(n,r,e,t);return o};var fve=ec;function Di(){this.__rules__=[],this.__cache__=null}Di.prototype.__find__=function(n){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===n)return e;return-1};Di.prototype.__compile__=function(){var n=this,e=[""];n.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),n.__cache__={},e.forEach(function(t){n.__cache__[t]=[],n.__rules__.forEach(function(r){r.enabled&&(t&&r.alt.indexOf(t)<0||n.__cache__[t].push(r.fn))})})};Di.prototype.at=function(n,e,t){var r=this.__find__(n),i=t||{};if(r===-1)throw new Error("Parser rule not found: "+n);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Di.prototype.before=function(n,e,t,r){var i=this.__find__(n),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null};Di.prototype.after=function(n,e,t,r){var i=this.__find__(n),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null};Di.prototype.push=function(n,e,t){var r=t||{};this.__rules__.push({name:n,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};Di.prototype.enable=function(n,e){Array.isArray(n)||(n=[n]);var t=[];return n.forEach(function(r){var i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,t.push(r)},this),this.__cache__=null,t};Di.prototype.enableOnly=function(n,e){Array.isArray(n)||(n=[n]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(n,e)};Di.prototype.disable=function(n,e){Array.isArray(n)||(n=[n]);var t=[];return n.forEach(function(r){var i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,t.push(r)},this),this.__cache__=null,t};Di.prototype.getRules=function(n){return this.__cache__===null&&this.__compile__(),this.__cache__[n]||[]};var Av=Di,gve=/ \r \n ?| \n /g,_ve=/ \0 /g,bve=function(e){var t;t=e.src.replace(gve, `
` ),t=t.replace(_ve,"<22> "),e.src=t},vve=function(e){var t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)},yve=function(e){var t=e.tokens,r,i,s;for(i=0,s=t.length;i<s;i++)r=t[i],r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)},Eve=Jt.arrayReplaceAt;function Sve(n){return/^<a[> \s ]/i.test(n)}function xve(n){return/^< \/ a \s *>/i.test(n)}var Tve=function(e){var t,r,i,s,o,a,l,d,u,m,f,g,h,v,b,_,y=e.tokens,E;if(e.md.options.linkify){for(r=0,i=y.length;r<i;r++)if(!(y[r].type!=="inline"||!e.md.linkify.pretest(y[r].content)))for(s=y[r].children,h=0,t=s.length-1;t>=0;t--){if(a=s[t],a.type==="link_close"){for(t--;s[t].level!==a.level&&s[t].type!=="link_open";)t--;continue}if(a.type==="html_inline"&&(Sve(a.content)&&h>0&&h--,xve(a.content)&&h++),!(h>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(u=a.content,E=e.md.linkify.match(u),l=[],g=a.level,f=0,E.length>0&&E[0].index===0&&t>0&&s[t-1].type==="text_special"&&(E=E.slice(1)),d=0;d<E.length;d++)v=E[d].url,b=e.md.normalizeLink(v),e.md.validateLink(b)&&(_=E[d].text,E[d].schema?E[d].schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText("mailto:"+_).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText("http://"+_).replace(/^http: \/ \/ /,""),m=E[d].index,m>f&&(o=new e.Token("text","",0),o.content=u.slice(f,m),o.level=g,l.push(o)),o=new e.Token("link_open","a",1),o.attrs=[["href",b]],o.level=g++,o.markup="linkify",o.info="auto",l.push(o),o=new e.Token("text","",0),o.content=_,o.level=g,l.push(o),o=new e.Token("link_close","a",-1),o.level=--g,o.markup="linkify",o.info="auto",l.push(o),f=E[d].lastIndex);f<u.length&&(o=new e.Token("text","",0),o.content=u.slice(f),o.level=g,l.push(o)),y[r].children=s=Eve(s,t,l)}}}},rN=/ \+ -| \. \. | \? \? \? \? |!!!!|,,|--/,wve=/ \( (c|tm|r) \) /i,Cve=/ \( (c|tm|r) \) /ig,Ave={c:"©",r:"®",tm:"™"};function Rve(n,e){return Ave[e.toLowerCase()]}function Mve(n){var e,t,r=0;for(e=n.length-1;e>=0;e--)t=n[e],t.type==="text"&&!r&&(t.content=t.content.replace(Cve,Rve)),t.type==="link_open"&&t.info==="auto"&&r--,t.type==="link_close"&&t.info==="auto"&&r++}function Nve(n){var e,t,r=0;for(e=n.length-1;e>=0;e--)t=n[e],t.type==="text"&&!r&&rN.test(t.content)&&(t.content=t.content.replace(/ \+ -/g,"±").replace(/ \. {2,}/g,"…").replace(/([?!])…/g," $ 1..").replace(/([?!]){4,}/g," $ 1 $ 1 $ 1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]| $ )/mg," $ 1—").replace(/(^| \s )--(?= \s | $ )/mg," $ 1– ").replace(/(^|[^- \s ])--(?=[^- \s ]| $ )/mg," $ 1– ")),t.type==="link_open"&&t.info==="auto"&&r--,t.type==="link_close"&&t.info==="auto"&&r++}var kve=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(wve.test(e.tokens[t].content)&&Mve(e.tokens[t].children),rN.test(e.tokens[t].content)&&Nve(e.tokens[t].children))},l2=Jt.isWhiteSpace,c2=Jt.isPunctChar,d2=Jt.isMdAsciiPunct,Ive=/['"]/,u2=/['"]/g,p2="’ ";function eu(n,e,t){return n.slice(0,e)+t+n.slice(e+1)}function Ove(n,e){var t,r,i,s,o,a,l,d,u,m,f,g,h,v,b,_,y,E,x,A,w;for(x=[],t=0;t<n.length;t++){for(r=n[t],l=n[t].level,y=x.length-1;y>=0&&!(x[y].level<=l);y--);if(x.length=y+1,r.type==="text"){i=r.content,o=0,a=i.length;e:for(;o<a&&(u2.lastIndex=o,s=u2.exec(i),!!s);){if(b=_=!0,o=s.index+1,E=s[0]==="'",u=32,s.index-1>=0)u=i.charCodeAt(s.index-1);else for(y=t-1;y>=0&&!(n[y].type==="softbreak"||n[y].type==="hardbreak");y--)if(n[y].content){u=n[y].content.charCodeAt(n[y].content.length-1);break}if(m=32,o<a)m=i.charCodeAt(o);else for(y=t+1;y<n.length&&!(n[y].type==="softbreak"||n[y].type==="hardbreak");y++)if(n[y].content){m=n[y].content.charCodeAt(0);break}if(f=d2(u)||c2(String.fromCharCode(u)),g=d2(m)||c2(String.fromCharCode(m)),h=l2(u),v=l2(m),v?b=!1:g&&(h||f||(b=!1)),h?_=!1:f&&(v||g||(_=!1)),m===34&&s[0]==='"'&&u>=48&&u<=57&&(_=b=!1),b&&_&&(b=f,_=g),!b&&!_){E&&(r.content=eu(r.content,s.index,p2));continue}if(_){for(y=x.length-1;y>=0&&(d=x[y],!(x[y].level<l));y--)if(d.single===E&&x[y].level===l){d=x[y],E?(A=e.md.options.quotes[2],w=e.md.options.quotes[
2024-11-11 23:13:41 +00:00
` ,o.map=[t,e.line],!0},Vve=function(e,t,r,i){var s,o,a,l,d,u,m,f=!1,g=e.bMarks[t]+e.tShift[t],h=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||g+3>h||(s=e.src.charCodeAt(g),s!==126&&s!==96)||(d=g,g=e.skipChars(g,s),o=g-d,o<3)||(m=e.src.slice(d,g),a=e.src.slice(g,h),s===96&&a.indexOf(String.fromCharCode(s))>=0))return!1;if(i)return!0;for(l=t;l++,!(l>=r||(g=d=e.bMarks[l]+e.tShift[l],h=e.eMarks[l],g<h&&e.sCount[l]<e.blkIndent));)if(e.src.charCodeAt(g)===s&&!(e.sCount[l]-e.blkIndent>=4)&&(g=e.skipChars(g,s),!(g-d<o)&&(g=e.skipSpaces(g),!(g<h)))){f=!0;break}return o=e.sCount[t],e.line=l+(f?1:0),u=e.push("fence","code",0),u.info=a,u.content=e.getLines(t+1,l,o,!0),u.markup=m,u.map=[t,e.line],!0},Hve=Jt.isSpace,qve=function(e,t,r,i){var s,o,a,l,d,u,m,f,g,h,v,b,_,y,E,x,A,w,N,L,C=e.lineMax,k=e.bMarks[t]+e.tShift[t],H=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(k)!==62)return!1;if(i)return!0;for(h=[],v=[],y=[],E=[],w=e.md.block.ruler.getRules("blockquote"),_=e.parentType,e.parentType="blockquote",f=t;f<r&&(L=e.sCount[f]<e.blkIndent,k=e.bMarks[f]+e.tShift[f],H=e.eMarks[f],!(k>=H));f++){if(e.src.charCodeAt(k++)===62&&!L){for(l=e.sCount[f]+1,e.src.charCodeAt(k)===32?(k++,l++,s=!1,x=!0):e.src.charCodeAt(k)===9?(x=!0,(e.bsCount[f]+l)%4===3?(k++,l++,s=!1):s=!0):x=!1,g=l,h.push(e.bMarks[f]),e.bMarks[f]=k;k<H&&(o=e.src.charCodeAt(k),Hve(o));){o===9?g+=4-(g+e.bsCount[f]+(s?1:0))%4:g++;k++}u=k>=H,v.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(x?1:0),y.push(e.sCount[f]),e.sCount[f]=g-l,E.push(e.tShift[f]),e.tShift[f]=k-e.bMarks[f];continue}if(u)break;for(A=!1,a=0,d=w.length;a<d;a++)if(w[a](e,f,r,!0)){A=!0;break}if(A){e.lineMax=f,e.blkIndent!==0&&(h.push(e.bMarks[f]),v.push(e.bsCount[f]),E.push(e.tShift[f]),y.push(e.sCount[f]),e.sCount[f]-=e.blkIndent);break}h.push(e.bMarks[f]),v.push(e.bsCount[f]),E.push(e.tShift[f]),y.push(e.sCount[f]),e.sCount[f]=-1}for(b=e.blkIndent,e.blkIndent=0,N=e.push("blockquote_open","blockquote",1),N.markup=">",N.map=m=[t,0],e.md.block.tokenize(e,t,f),N=e.push("blockquote_close","blockquote",-1),N.markup=">",e.lineMax=C,e.parentType=_,m[1]=e.line,a=0;a<E.length;a++)e.bMarks[a+t]=h[a],e.tShift[a+t]=E[a],e.sCount[a+t]=y[a],e.bsCount[a+t]=v[a];return e.blkIndent=b,!0},Yve=Jt.isSpace, $ ve=function(e,t,r,i){var s,o,a,l,d=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||(s=e.src.charCodeAt(d++),s!==42&&s!==45&&s!==95))return!1;for(o=1;d<u;){if(a=e.src.charCodeAt(d++),a!==s&&!Yve(a))return!1;a===s&&o++}return o<3?!1:(i||(e.line=t+1,l=e.push("hr","hr",0),l.map=[t,e.line],l.markup=Array(o+1).join(String.fromCharCode(s))),!0)},sN=Jt.isSpace;function m2(n,e){var t,r,i,s;return r=n.bMarks[e]+n.tShift[e],i=n.eMarks[e],t=n.src.charCodeAt(r++),t!==42&&t!==45&&t!==43||r<i&&(s=n.src.charCodeAt(r),!sN(s))?-1:r}function f2(n,e){var t,r=n.bMarks[e]+n.tShift[e],i=r,s=n.eMarks[e];if(i+1>=s||(t=n.src.charCodeAt(i++),t<48||t>57))return-1;for(;;){if(i>=s)return-1;if(t=n.src.charCodeAt(i++),t>=48&&t<=57){if(i-r>=10)return-1;continue}if(t===41||t===46)break;return-1}return i<s&&(t=n.src.charCodeAt(i),!sN(t))?-1:i}function Wve(n,e){var t,r,i=n.level+2;for(t=e+2,r=n.tokens.length-2;t<r;t++)n.tokens[t].level===i&&n.tokens[t].type==="paragraph_open"&&(n.tokens[t+2].hidden=!0,n.tokens[t].hidden=!0,t+=2)}var Kve=function(e,t,r,i){var s,o,a,l,d,u,m,f,g,h,v,b,_,y,E,x,A,w,N,L,C,k,H,q,ie,D, $ ,K=t,B=!1,Z=!0;if(e.sCount[K]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[K]-e.listIndent>=4&&e.sCount[K]<e.blkIndent)return!1;if(i&&e.parentType==="paragraph"&&e.sCount[K]>=e.blkIndent&&(B=!0),(k=f2(e,K))>=0){if(m=!0,q=e.bMarks[K]+e.tShift[K],_=Number(e.src.slice(q,k-1)),B&&_!==1)return!1}else if((k=m2(e,K))>=0)m=!1;else return!1;if(B&&e.skipSpaces(k)>=e.eMarks[K])return!1;if(i)return!0;for(b=e.src.charCodeAt(k-1),v=e.tokens.length,m?( $ =e.push("ordered_list_open","ol",1),_!==1&&( $ .attrs=[["start",_]])): $ =e.push("bullet_list_open","ul",1), $ .map=h=[K,0], $ .markup=String.fromCharCode(b),H=!1,D=e.md.block.ruler.getRules("list"),A=e.parentType,e.parentType="list";K<r;){for(C=k,y=e.eMarks[K],u=E=e.sCount[K]+k-(e.bMarks[K]+e.tShift[K]);C<y;)
2024-11-04 00:22:50 +00:00
` })),r.tokens.splice(i+3+u.length+1,0,Object.assign(new r.Token("html_block","",0),{content:e.wrapper[1]+ `
2024-11-06 23:05:30 +00:00
` })))});function O2(n,e,t,r){var i=n,s=r;if(t&&Object.prototype.hasOwnProperty.call(e,i))throw new Error("User defined ` id ` attribute ` "+n+" ` is not unique. Please fix it in your Markdown to continue.");for(;Object.prototype.hasOwnProperty.call(e,i);)i=n+"-"+s,s+=1;return e[i]=!0,i}function sl(n,e){e=Object.assign({},sl.defaults,e),n.core.ruler.push("anchor",function(t){for(var r,i={},s=t.tokens,o=Array.isArray(e.level)?(r=e.level,function(m){return r.includes(m)}):function(m){return function(f){return f>=m}}(e.level),a=0;a<s.length;a++){var l=s[a];if(l.type==="heading_open"&&o(Number(l.tag.substr(1)))){var d=e.getTokensText(s[a+1].children),u=l.attrGet("id");u=u==null?O2(e.slugify(d),i,!1,e.uniqueSlugStartIndex):O2(u,i,!0,e.uniqueSlugStartIndex),l.attrSet("id",u),e.tabIndex!==!1&&l.attrSet("tabindex",""+e.tabIndex),typeof e.permalink=="function"?e.permalink(u,e,t,a):(e.permalink||e.renderPermalink&&e.renderPermalink!==s1)&&e.renderPermalink(u,e,t,a),a=s.indexOf(l),e.callback&&e.callback(l,{slug:u,title:d})}}})}Object.assign(I2.defaults,{style:"visually-hidden",space:!0,placement:"after",wrapper:null}),sl.permalink={__proto__:null,legacy:s1,renderHref:yN,renderAttrs:EN,makePermalink:Md,linkInsideHeader:Hh,ariaHidden:Xo,headerLink:SN,linkAfterHeader:I2},sl.defaults={level:1,slugify:function(n){return encodeURIComponent(String(n).trim().toLowerCase().replace(/ \s +/g,"-"))},uniqueSlugStartIndex:1,tabIndex:"-1",getTokensText:function(n){return n.filter(function(e){return["text","code_inline"].includes(e.type)}).map(function(e){return e.content}).join("")},permalink:!1,renderPermalink:s1,permalinkClass:Xo.defaults.class,permalinkSpace:Xo.defaults.space,permalinkSymbol:"¶",permalinkBefore:Xo.defaults.placement==="before",permalinkHref:Xo.defaults.renderHref,permalinkAttrs:Xo.defaults.renderAttrs},sl.default=sl;function Bs(){this.__highest_alphabet__=0,this.__match_alphabets__={},this.__initial_state__=0,this.__accept_states__={},this.__transitions__={},this.__actions__={}}Bs.prototype.set_highest_alphabet=function(n){this.__highest_alphabet__=n};Bs.prototype.set_match_alphabets=function(n){this.__match_alphabets__=n};Bs.prototype.set_initial_state=function(n){this.__initial_state__=n};Bs.prototype.set_accept_states=function(n){for(var e=0;e<n.length;e++)this.__accept_states__[n[e]]=!0};Bs.prototype.set_transitions=function(n){this.__transitions__=n};Bs.prototype.set_actions=function(n){this.__actions__=n};Bs.prototype.update_transition=function(n,e){this.__transitions__[n]=Object.assign(this.__transitions__[n]||Object(),e)};Bs.prototype.execute=function(n,e){var t,r,i;for(t=this.__initial_state__,r=n;t&&r<e;r++){for(i=this.__highest_alphabet__;i>0&&!(t&i&&this.__match_alphabets__[i].call(this,r,t,i));i>>=4);if(this.__actions__(r,t,i),i===0)break;t=this.__transitions__[t][i]||0}return!!this.__accept_states__[t]};var VWe=Bs,HWe=VWe,qWe=function(e,t){var r={multiline:!1,rowspan:!1,headerless:!1,multibody:!0,autolabel:!0};t=e.utils.assign({},r,t||{});function i(u,m){var f=u.bMarks[m]+u.sCount[m],g=u.bMarks[m]+u.blkIndent,h=u.skipSpacesBack(u.eMarks[m],g),v=[],b,_,y=!1,E=!1,x=0;for(b=f;b<h;b++)switch(u.src.charCodeAt(b)){case 92:y=!0;break;case 96:_=u.skipChars(b,96)-1,_>b?(E||(x===0?x=_-b:x===_-b&&(x=0)),b=_):(E||!y&&!x)&&(E=!E),y=!1;break;case 124:!E&&!y&&v.push(b),y=!1;break;default:y=!1;break}return v.length===0||(v[0]>g&&v.unshift(g-1),v[v.length-1]<h-1&&v.push(h)),v}function s(u,m,f){var g={text:null,label:null},h=u.bMarks[f]+u.sCount[f],v=u.eMarks[f],b=/^ \[ (.+?) \] ( \[ ([^ \[ \] ]+) \] )? \s * $ /,_=u.src.slice(h,v).match(b);return _?m?!0:(g.text=_[1],!t.autolabel&&!_[2]||(g.label=_[2]||_[1],g.label=g.label.toLowerCase().replace(/ \W +/g,"")),g):!1}function o(u,m,f){var g={bounds:null,multiline:null},h=i(u,f),v,b,_;return h.length<2?!1:m?!0:(g.bounds=h,t.multiline&&(v=u.bMarks[f]+u.sCount[f],b=u.eMarks[f]-1,g.multiline=u.src.charCodeAt(b)===92,g.multiline&&(_=u.eMarks[f],u.eMarks[f]=u.skipSpacesBack(b,v),g.bounds=i(u,f),u.eMarks[f]=_)),g)}function a(u,m,f){var g={aligns:[],wraps:[]},h=i(u,f),v=/^:?(-+|=+):? \+ ? $ /,b,_,y;if(u.sCount[f]-u.bl
` ),u.md,u.env,[]),B.level=E.level+1,u.md.block.tokenize(B,E.map[0],B.lineMax),K=0;K<B.tokens.length;K++)u.tokens.push(B.tokens[K])}else _=u.push("inline","",0),_.content=H.trim(),_.map=E.map,_.level=E.level+1,_.children=[];_=u.push(k+"_close",k,-1)}u.push("tr_close","tr",-1),E.meta.grp&1&&(k=E.meta.type===256?"thead":"tbody",_=u.push(k+"_close",k,-1),C[1]=E.map[1])}return L[1]=Math.max(C[1],y.meta.sep.map[1],y.meta.cap?y.meta.cap.map[1]:-1),_=u.push("table_close","table",-1),u.line=L[1],!0}e.block.ruler.at("table",d,{alt:["paragraph","reference"]})};const YWe=Ra(qWe);var $ We=function(e,t){t=t||{};function r(i){for(var s=1,o=1,a=i.tokens.length;o<a-1;++o){var l=i.tokens[o];if(l.type==="inline"&&!(!l.children||l.children.length!==1&&l.children.length!==3)&&!(l.children.length===1&&l.children[0].type!=="image")&&!(l.children.length===3&&(l.children[0].type!=="link_open"||l.children[1].type!=="image"||l.children[2].type!=="link_close"))&&!(o!==0&&i.tokens[o-1].type!=="paragraph_open")&&!(o!==a-1&&i.tokens[o+1].type!=="paragraph_close")){var d=i.tokens[o-1];d.type="figure_open",d.tag="figure",i.tokens[o+1].type="figure_close",i.tokens[o+1].tag="figure",t.dataType==!0&&i.tokens[o-1].attrPush(["data-type","image"]);var u;if(t.link==!0&&l.children.length===1&&(u=l.children[0],l.children.unshift(new i.Token("link_open","a",1)),l.children[0].attrPush(["href",u.attrGet("src")]),l.children.push(new i.Token("link_close","a",-1))),u=l.children.length===1?l.children[0]:l.children[1],t.figcaption==!0&&u.children&&u.children.length&&(l.children.push(new i.Token("figcaption_open","figcaption",1)),l.children.splice(l.children.length,0,...u.children),l.children.push(new i.Token("figcaption_close","figcaption",-1)),u.children.length=0),t.copyAttrs&&u.attrs){const m=t.copyAttrs===!0?"":t.copyAttrs;d.attrs=u.attrs.filter(([f,g])=>f.match(m))}t.tabindex==!0&&(i.tokens[o-1].attrPush(["tabindex",s]),s++),t.lazyLoading==!0&&u.attrPush(["loading","lazy"])}}}e.core.ruler.before("linkify","implicit_figures",r)};const WWe=Ra( $ We),KWe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Lo={};Lo.getAttrs=function(n,e,t){const r=/[^ \t \n \f />"'=]/,i=" ",s="=",o=".",a="#",l=[];let d="",u="",m=!0,f=!1;for(let g=e+t.leftDelimiter.length;g<n.length;g++){if(n.slice(g,g+t.rightDelimiter.length)===t.rightDelimiter){d!==""&&l.push([d,u]);break}const h=n.charAt(g);if(h===s&&m){m=!1;continue}if(h===o&&d===""){n.charAt(g+1)===o?(d="css-module",g+=1):d="class",m=!1;continue}if(h===a&&d===""){d="id",m=!1;continue}if(h==='"'&&u===""&&!f){f=!0;continue}if(h==='"'&&f){f=!1;continue}if(h===i&&!f){if(d==="")continue;l.push([d,u]),d="",u="",m=!0;continue}if(!(m&&h.search(r)===-1)){if(m){d+=h;continue}u+=h}}if(t.allowedAttributes&&t.allowedAttributes.length){const g=t.allowedAttributes;return l.filter(function(h){const v=h[0];function b(_){return v===_||_ instanceof RegExp&&_.test(v)}return g.some(b)})}return l};Lo.addAttrs=function(n,e){for(let t=0,r=n.length;t<r;++t){const i=n[t][0];i==="class"?e.attrJoin("class",n[t][1]):i==="css-module"?e.attrJoin("css-module",n[t][1]):e.attrPush(n[t])}return e};Lo.hasDelimiters=function(n,e){if(!n)throw new Error('Parameter ` where ` not passed. Should be "start", "end" or "only".');return function(t){const r=e.leftDelimiter.length+1+e.rightDelimiter.length;if(!t||typeof t!="string"||t.length<r)return!1;function i(u){const m=u.charAt(e.leftDelimiter.length)===".",f=u.charAt(e.leftDelimiter.length)==="#";return m||f?u.length>=r+1:u.length>=r}let s,o,a,l;const d=r-e.rightDelimiter.length;switch(n){case"start":a=t.slice(0,e.leftDelimiter.length),s=a===e.leftDelimiter?0:-1,o=s===-1?-1:t.indexOf(e.rightDelimiter,d),l=t.charAt(o+e.rightDelimiter.length),l&&e.rightDelimiter.indexOf(l)!==-1&&(o=-1);break;case"end":s=t.lastIndexOf(e.leftDelimiter),o=s===-1?-1:t.indexOf(e.rightDelimiter,s+d),o=o===t.length-e.rightDelimiter.length?o:-1;break;case"only":a=t.slice(0,e.leftDelimiter.length),s=a===e.leftDelimiter?0:-1,a=t.slice(t.length-e.rightDelimiter.length),o=a===e.rightDelimiter?t.length-e.rightDelimiter.
{ . a } softbreak then curly in start ` ,tests:[{shift:0,type:"inline",children:[{position:-2,type:"softbreak"},{position:-1,type:"text",content:qt.hasDelimiters("only",n)}]}],transform:(t,r,i)=>{const s=t[r].children[i],o=qt.getAttrs(s.content,0,n);let a=r+1;for(;t[a+1]&&t[a+1].nesting===-1;)a++;const l=qt.getMatchingOpeningToken(t,a);qt.addAttrs(o,l),t[r].children=t[r].children.slice(0,-2)}},{name:"horizontal rule",tests:[{shift:0,type:"paragraph_open"},{shift:1,type:"inline",children:t=>t.length===1,content:t=>t.match(e)!==null},{shift:2,type:"paragraph_close"}],transform:(t,r)=>{const i=t[r];i.type="hr",i.tag="hr",i.nesting=0;const s=t[r+1].content,o=s.lastIndexOf(n.leftDelimiter),a=qt.getAttrs(s,o,n);qt.addAttrs(a,i),i.markup=s,t.splice(r+1,2)}},{name:"end of block",tests:[{shift:0,type:"inline",children:[{position:-1,content:qt.hasDelimiters("end",n),type:t=>t!=="code_inline"&&t!=="math_inline"}]}],transform:(t,r,i)=>{const s=t[r].children[i],o=s.content,a=qt.getAttrs(o,o.lastIndexOf(n.leftDelimiter),n);let l=r+1;do if(t[l]&&t[l].nesting===-1)break;while(l++<t.length);const d=qt.getMatchingOpeningToken(t,l);qt.addAttrs(a,d);const u=o.slice(0,o.lastIndexOf(n.leftDelimiter));s.content=D2(u)!==" "?u:u.slice(0,-1)}}]};function D2(n){return n.slice(-1)[0]}const eKe=JWe,tKe={leftDelimiter:"{",rightDelimiter:"}",allowedAttributes:[]};var nKe=function(e,t){let r=Object.assign({},tKe);r=Object.assign(r,t);const i=eKe(r);function s(o){const a=o.tokens;for(let l=0;l<a.length;l++)for(let d=0;d<i.length;d++){const u=i[d];let m=null;u.tests.every(g=>{const h=a1(a,l,g);return h.j!==null&&(m=h.j),h.match})&&(u.transform(a,l,m),(u.name==="inline attributes"||u.name==="inline nesting 0")&&d--)}}e.core.ruler.before("linkify","curly_attributes",s)};function a1(n,e,t){const r={match:!1,j:null},i=t.shift!==void 0?e+t.shift:t.position;if(t.shift!==void 0&&i<0)return r;const s=sKe(n,i);if(s===void 0)return r;for(const o of Object.keys(t))if(!(o==="shift"||o==="position")){if(s[o]===void 0)return r;if(o==="children"&&rKe(t.children)){if(s.children.length===0)return r;let a;const l=t.children,d=s.children;if(l.every(u=>u.position!==void 0)){if(a=l.every(u=>a1(d,u.position,u).match),a){const u=oKe(l).position;r.j=u>=0?u:d.length+u}}else for(let u=0;u<d.length;u++)if(a=l.every(m=>a1(d,u,m).match),a){r.j=u;break}if(a===!1)return r;continue}switch(typeof t[o]){case"boolean":case"number":case"string":if(s[o]!==t[o])return r;break;case"function":if(!t[o](s[o]))return r;break;case"object":if(iKe(t[o])){if(t[o].every(l=>l(s[o]))===!1)return r;break}default:throw new Error( ` Unknown type of pattern test ( key : $ { o } ) . Test should be of type boolean , number , string , function or array of functions . ` )}}return r.match=!0,r}function rKe(n){return Array.isArray(n)&&n.length&&n.every(e=>typeof e=="object")}function iKe(n){return Array.isArray(n)&&n.length&&n.every(e=>typeof e=="function")}function sKe(n,e){return e>=0?n[e]:n[n.length+e]}function oKe(n){return n.slice(-1)[0]||{}}const aKe=Ra(nKe);function xN(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e],r=typeof t;(r==="object"||r==="function")&&!Object.isFrozen(t)&&xN(t)}),n}let L2=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function TN(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function go(n,...e){const t=Object.create(null);for(const r in n)t[r]=n[r];return e.forEach(function(r){for(const i in r)t[i]=r[i]}),t}const lKe="</span>",P2=n=>!!n.scope,cKe=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[ ` $ { e } $ { t . shift ( ) } ` ,...t.map((r,i)=> ` $ { r } $ { "_" . repeat ( i + 1 ) } ` )].join(" ")}return ` $ { e } $ { n } ` };class dKe{constructor(e,t){this.buffer="",this.classPrefix=t.classPref
https : //github.com/highlightjs/highlight.js/issues/2277`),xe=B,ue=Z),ce===void 0&&(ce=!0);const Ce={code:ue,language:xe};$("before:highlight",Ce);const me=Ce.result?Ce.result:m(Ce.language,Ce.code,ce);return me.code=Ce.code,$("after:highlight",me),me}function m(B,Z,ce,ue){const xe=Object.create(null);function Ce(ne,pe){return ne.keywords[pe]}function me(){if(!fe.keywords){Pe.addText(Re);return}let ne=0;fe.keywordPatternRe.lastIndex=0;let pe=fe.keywordPatternRe.exec(Re),De="";for(;pe;){De+=Re.substring(ne,pe.index);const Le=ge.case_insensitive?pe[0].toLowerCase():pe[0],Ve=Ce(fe,Le);if(Ve){const[ot,wt]=Ve;if(Pe.addText(De),De="",xe[Le]=(xe[Le]||0)+1,xe[Le]<=JKe&&(U+=wt),ot.startsWith("_"))De+=pe[0];else{const $e=ge.classNameAliases[ot]||ot;ze(pe[0],$e)}}else De+=pe[0];ne=fe.keywordPatternRe.lastIndex,pe=fe.keywordPatternRe.exec(Re)}De+=Re.substring(ne),Pe.addText(De)}function Ae(){if(Re==="")return;let ne=null;if(typeof fe.subLanguage=="string"){if(!e[fe.subLanguage]){Pe.addText(Re);return}ne=m(fe.subLanguage,Re,!0,Ue[fe.subLanguage]),Ue[fe.subLanguage]=ne._top}else ne=g(Re,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(U+=ne.relevance),Pe.__addSublanguage(ne._emitter,ne.language)}function Fe(){fe.subLanguage!=null?Ae():me(),Re=""}function ze(ne,pe){ne!==""&&(Pe.startScope(pe),Pe.addText(ne),Pe.endScope())}function te(ne,pe){let De=1;const Le=pe.length-1;for(;De<=Le;){if(!ne._emit[De]){De++;continue}const Ve=ge.classNameAliases[ne[De]]||ne[De],ot=pe[De];Ve?ze(ot,Ve):(Re=ot,me(),Re=""),De++}}function ye(ne,pe){return ne.scope&&typeof ne.scope=="string"&&Pe.openNode(ge.classNameAliases[ne.scope]||ne.scope),ne.beginScope&&(ne.beginScope._wrap?(ze(Re,ge.classNameAliases[ne.beginScope._wrap]||ne.beginScope._wrap),Re=""):ne.beginScope._multi&&(te(ne.beginScope,pe),Re="")),fe=Object.create(ne,{parent:{value:fe}}),fe}function Se(ne,pe,De){let Le=fKe(ne.endRe,De);if(Le){if(ne["on:end"]){const Ve=new L2(ne);ne["on:end"](pe,Ve),Ve.isMatchIgnored&&(Le=!1)}if(Le){for(;ne.endsParent&&ne.parent;)ne=ne.parent;return ne}}if(ne.endsWithParent)return Se(ne.parent,pe,De)}function Oe(ne){return fe.matcher.regexIndex===0?(Re+=ne[0],1):(we=!0,0)}function Ye(ne){const pe=ne[0],De=ne.rule,Le=new L2(De),Ve=[De.__beforeBegin,De["on:begin"]];for(const ot of Ve)if(ot&&(ot(ne,Le),Le.isMatchIgnored))return Oe(pe);return De.skip?Re+=pe:(De.excludeBegin&&(Re+=pe),Fe(),!De.returnBegin&&!De.excludeBegin&&(Re=pe)),ye(De,ne),De.returnBegin?0:pe.length}function le(ne){const pe=ne[0],De=Z.substring(ne.index),Le=Se(fe,ne,De);if(!Le)return z2;const Ve=fe;fe.endScope&&fe.endScope._wrap?(Fe(),ze(pe,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(Fe(),te(fe.endScope,ne)):Ve.skip?Re+=pe:(Ve.returnEnd||Ve.excludeEnd||(Re+=pe),Fe(),Ve.excludeEnd&&(Re=pe));do fe.scope&&Pe.closeNode(),!fe.skip&&!fe.subLanguage&&(U+=fe.relevance),fe=fe.parent;while(fe!==Le.parent);return Le.starts&&ye(Le.starts,ne),Ve.returnEnd?0:pe.length}function V(){const ne=[];for(let pe=fe;pe!==ge;pe=pe.parent)pe.scope&&ne.unshift(pe.scope);ne.forEach(pe=>Pe.openNode(pe))}let G={};function oe(ne,pe){const De=pe&&pe[0];if(Re+=ne,De==null)return Fe(),0;if(G.type==="begin"&&pe.type==="end"&&G.index===pe.index&&De===""){if(Re+=Z.slice(pe.index,pe.index+1),!i){const Le=new Error(`0 width match regex (${B})`);throw Le.languageName=B,Le.badRule=G.rule,Le}return 1}if(G=pe,pe.type==="begin")return Ye(pe);if(pe.type==="illegal"&&!ce){const Le=new Error('Illegal lexeme "'+De+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw Le.mode=fe,Le}else if(pe.type==="end"){const Le=le(pe);if(Le!==z2)return Le}if(pe.type==="illegal"&&De==="")return 1;if(ee>1e5&&ee>pe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Re+=De,De.length}const ge=C(B);if(!ge)throw da(s.replace("{}",B)),new Error('Unknown language: "'+B+'"');const Ee=jKe(ge);let Te="",fe=ue||Ee;const Ue={},Pe=new a.__emitter(a);V();let Re="",U=0,I=0,ee=0,we=!1;try{if(ge.__emitTokens)ge.__emitTokens(Z,Pe);else{for(fe.matcher.considerAll();;){ee++,we?we=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=I;
` },h]}}return zg=i,zg}var Vg,AT;function GQe(){if(AT)return Vg;AT=1;function n(e){const t="[a-zA-Z_][ \\ w.]*",r="< \\ ?(lasso(script)?|=)",i=" \\ ]| \\ ?>",s={ $ pattern:t+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},o=e.COMMENT("<!--","-->",{relevance:0}),a={className:"meta",begin:" \\ [noprocess \\ ]",starts:{end:" \\ [/noprocess \\ ]",returnEnd:!0,contains:[o]}},l={className:"meta",begin:" \\ [/noprocess|"+r},d={className:"symbol",begin:"'"+t+"'"},u=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN) \\ b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:" ` ",end:" ` "},{variants:[{begin:"[# $ ]"+t},{begin:"#",end:" \\ d+",illegal:" \\ W"}]},{className:"type",begin:":: \\ s*",end:t,illegal:" \\ W"},{className:"params",variants:[{begin:"-(?!infinity)"+t,relevance:0},{begin:"( \\ . \\ . \\ .)"}]},{begin:/(->| \. ) \s */,relevance:0,contains:[d]},{className:"class",beginKeywords:"define",returnEnd:!0,end:" \\ (|=>",contains:[e.inherit(e.TITLE_MODE,{begin:t+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:s,contains:[{className:"meta",begin:i,relevance:0,starts:{end:" \\ [|"+r,returnEnd:!0,relevance:0,contains:[o]}},a,l,{className:"meta",begin:" \\ [no_square_brackets",starts:{end:" \\ [/no_square_brackets \\ ]",keywords:s,contains:[{className:"meta",begin:i,relevance:0,starts:{end:" \\ [noprocess \\ ]|"+r,returnEnd:!0,contains:[o]}},a,l].concat(u)}},{className:"meta",begin:" \\ [",relevance:0},{className:"meta",begin:"^#!",end:"lasso9 $ ",relevance:10}].concat(u)}}return Vg=n,Vg}var Hg,RT;function zQe(){if(RT)return Hg;RT=1;function n(e){const r=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(H=>H+"(?![a-zA-Z@:_])")),i=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-
] ` ,h={scope:"string",variants:[u,d,m,f]},v={scope:"number",variants:[{begin:" \\ b0[bB][01]+(?:_[01]+)* \\ b"},{begin:" \\ b0[oO][0-7]+(?:_[0-7]+)* \\ b"},{begin:" \\ b0[xX][ \\ da-fA-F]+(?:_[ \\ da-fA-F]+)* \\ b"},{begin:"(?: \\ b \\ d+(?:_ \\ d+)*( \\ .(?: \\ d+(?:_ \\ d+)*))?| \\ B \\ . \\ d+)(?:[eE][+-]? \\ d+)?"}],relevance:0},b=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],x={keyword:_,literal:(D=>{const $ =[];return D.forEach(K=>{ $ .push(K),K.toLowerCase()===K? $ .push(K.toUpperCase()): $ .push(K.toLowerCase())}), $ })(b),built_in:y},A=D=>D.map( $ => $ .replace(/ \| \d + $ /,"")),w={variants:[{match:[/new/,t.concat(g,"+"),t.concat("(?!",A(y).join(" \\ b|")," \\ b)"),s],scope:{1:"keyword",4:"title.class"}}]},N=t.concat(i," \\ b(?! \\ ()"),L={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class \b )/)),N],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class \b )/)),N],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class \b )/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},C={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},k={relevance:0,begin:/ \( /,end:/ \) /,keywords:x,contains:[C,o,L,e.C_BLOCK_COMMENT_MODE,h,v,w]},H={relevance:0,match:[/ \b /,t.concat("(?!fn \\ b|function \\ b|",A(_).join(" \\ b|"),"|",A(y).join(" \\ b|")," \\ b)"),i,t.concat(g,"*"),t.lookahead(/(?= \( )/)],scope:{3:"title.function.invoke"},contains:[k]};k.contains.push(H);const q=[C,L,e.C_BLOCK_COMMENT_MODE,h,v,w],ie={begin:t.concat(/# \[ \s */,s),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/ \[ /,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...q]},...q,{
] * ; ` ,relevance:0},{begin:"[vp][0-9]+"}]}}return t0=n,t0}var n0,zw;function eZe(){if(zw)return n0;zw=1;function n(e){const t="[a-z][a-zA-Z0-9_]*",r={className:"string",begin:" \\ $ .{1}"},i={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:" \\ b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:t+":",relevance:0},e.C_NUMBER_MODE,i,r,{begin:" \\ |[ ]*"+t+"([ ]+"+t+")*[ ]* \\ |",returnBegin:!0,end:/ \| /,illegal:/ \S /,contains:[{begin:"( \\ |[ ]*)?"+t}]},{begin:"# \\ (",end:" \\ )",contains:[e.APOS_STRING_MODE,r,e.C_NUMBER_MODE,i]}]}}return n0=n,n0}var r0,Vw;function tZe(){if(Vw)return r0;Vw=1;function n(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{ $ pattern:"[a-z_] \\ w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/ \/ \/ |>>/,contains:[{className:"literal",begin:/ \[ ( \| \| )? \] | \( \) /,relevance:0},e.COMMENT(" \\ ( \\ *"," \\ * \\ )",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[ \\ w']*"},{className:"type",begin:" ` [ A - Z ] [ \ \ w ']*"},{className:"type",begin:"\\b[A-Z][\\w' ] * ",relevance:0},{begin:" [ a - z _ ] \ \ w * '[\\w' ] * "},e.inherit(e.APOS_STRING_MODE,{className:" string ",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:" number ",begin:" \ \ b ( 0 [ xX ] [ a - fA - F0 - 9_ ] + [ Lln ] ? | 0 [ oO ] [ 0 - 7_ ] + [ Lln ] ? | 0 [ bB ] [ 01_ ] + [ Lln ] ? | [ 0 - 9 ] [ 0 - 9_ ] * ( [ Lln ] | ( \ \ . [ 0 - 9_ ] * ) ? ( [ eE ] [ - + ] ? [ 0 - 9_ ] + ) ? ) ? ) ",relevance:0},{begin:/[-=]>/}]}}return r0=n,r0}var i0,Hw;function nZe(){if(Hw)return i0;Hw=1;function n(e){const t={className:" variable ",begin:/\b_+[a-zA-Z]\w*/},r={className:" title ",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},i={className:" string ",variants:[{begin:'" ',end:' "',contains:[{begin:'" "',relevance:0}]},{begin:" '",end:"' ",contains:[{begin:" '' ",relevance:0}]}]},s=[" break "," breakWith "," breakOut "," breakTo "," case "," catch "," continue "," continueWith "," default "," do "," else "," exit "," exitWith "," for "," forEach "," from "," if "," local "," private "," switch "," step "," then "," throw "," to "," try "," waitUntil "," while "," with "],o=[" blufor "," civilian "," configNull "," controlNull "," displayNull "," diaryRecordNull "," east "," endl "," false "," grpNull "," independent "," lineBreak "," locationNull "," nil "," objNull "," opfor "," pi "," resistance "," scriptNull "," sideAmbientLife "," sideEmpty "," sideEnemy "," sideFriendly "," sideLogic "," sideUnknown "," taskNull "," teamMemberNull "," true "," west "],a=[" abs "," accTime "," acos "," action "," actionIDs "," actionKeys "," actionKeysEx "," actionKeysImages "," actionKeysNames "," actionKeysNamesArray "," actionName "," actionParams "," activateAddons "," activatedAddons "," activateKey "," activeTitleEffectParams "," add3DENConnection "," add3DENEventHandler "," add3DENLayer "," addAction "," addBackpack "," addBackpackCargo "," addBackpackCargoGlobal "," addBackpackGlobal "," addBinocularItem "," addCamShake "," addCuratorAddons "," addCuratorCameraArea "," addCuratorEditableObjects "," addCuratorEditingArea "," addCuratorPoints "," addEditorObject "," addEventHandler "," addForce "," addForceGeneratorRTD "," addGoggles "," addGroupIcon "," addHandgunItem "," addHeadgear "," addItem "," addItemCargo "," addItemCargoGlobal "," addItemPool "," addItemToBackpack "," addItemToUniform "," addItemToVest "," addLiveStats "," addMagazine "," addMagazineAmmoCargo "," addMagazineCargo "," addMagazineCargoGlobal "," addMagazineGlobal "," addMagazinePool "," addMagazines "," addMagazineTurret "," addMenu "," addMenuItem "," addMissionEventHandler "," addMPEventHandler "," addMusicEventHandler "," addonFiles "," addOwnedMine "," addPlayerScores "," addPrimaryWeaponItem "," addPublicVariableEventHandler "," addRating "," addResources "," addScore "," addScoreSide "," addSecondaryWeaponItem "," addSwitchableUnit "," addTeamMember "," addToRemainsCollector "," addTorque "," addUniform "," addUserActionEventHandler "," a
2024-11-04 00:22:50 +00:00
] * ? "'`},{begin:`" [ ^ \ r
2024-11-06 23:05:30 +00:00
"]*" ` }]},{className:"built_in",variants:[{begin:" \\ b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?= \\ ()"}]},e.COMMENT("^[ ]* \\ *.* $ ",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return a0=n,a0}var l0,Ww;function oZe(){if(Ww)return l0;Ww=1;function n(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{ $ pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/ \\ * \\ *!"," \\ */"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:" \\ d+",illegal:" \\ W"}]}]}}return l0=n,l0}var c0,Kw;function aZe(){if(Kw)return c0;Kw=1;const n=d=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:d.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4})) \b /},FUNCTION_DISPATCH:{className:"built_in",begin:/[ \w -]+(?= \( )/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/ \[ /,end:/ \] /,illegal:" $ ",contains:[d.APOS_STRING_MODE,d.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:d.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...e,...t],i=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","i
2024-11-04 00:22:50 +00:00
( multipart ) ? ` ,end: ` \ \ ]
2024-11-06 23:05:30 +00:00
` },{className:"string",begin:" \\ d{4}- \\ d{2}- \\ d{2}( \\ s+) \\ d{2}: \\ d{2}: \\ d{2}. \\ d+Z"},{className:"string",begin:"( \\ +|-) \\ d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?) \\ s+(test)?"},{begin:"^progress(:?)( \\ s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return d0=n,d0}var u0,Qw;function cZe(){if(Qw)return u0;Qw=1;function n(L){return L?typeof L=="string"?L:L.source:null}function e(L){return t("(?=",L,")")}function t(...L){return L.map(k=>n(k)).join("")}function r(L){const C=L[L.length-1];return typeof C=="object"&&C.constructor===Object?(L.splice(L.length-1,1),C):{}}function i(...L){return"("+(r(L).capture?"":"?:")+L.map(H=>n(H)).join("|")+")"}const s=L=>t(/ \b /,L,/ \w $ /.test(L)?/ \b /:/ \B /),o=["Protocol","Type"].map(s),a=["init","self"].map(s),l=["Any","Self"],d=["actor","any","associatedtype","async","await",/as \? /,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate \( set \) /,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init \? /,/init!/,"inout",/internal \( set \) /,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open \( set \) /,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private \( set \) /,"private","protocol",/public \( set \) /,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try \? /,/try!/,"try","typealias",/unowned \( safe \) /,/unowned \( unsafe \) /,"unowned","var","weak","where","while","willSet"],u=["false","nil","true"],m=["assignment","associativity","higherThan","left","lowerThan","none","right"],f=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],g=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],h=i(/[/= \- +!*%<>&|^~?]/,/[ \u 00A1- \u 00A7]/,/[ \u 00A9 \u 00AB]/,/[ \u 00AC \u 00AE]/,/[ \u 00B0 \u 00B1]/,/[ \u 00B6 \u 00BB \u 00BF \u 00D7 \u 00F7]/,/[ \u 2016- \u 2017]/,/[ \u 2020- \u 2027]/,/[ \u 2030- \u 203E]/,/[ \u 2041- \u 2053]/,/[ \u 2055- \u 205E]/,/[ \u 2190- \u 23FF]/,/[ \u 2500- \u 2775]/,/[ \u 2794- \u 2BFF]/,/[ \u 2E00- \u 2E7F]/,/[ \u 3001- \u 3003]/,/[ \u 3008- \u 3020]/,/[ \u 3030]/),v=i(h,/[ \u 0300- \u 036F]/,/[ \u 1DC0- \u 1DFF]/,/[ \u 20D0- \u 20FF]/,/[ \u FE00- \u FE0F]/,/[ \u FE20- \u FE2F]/),b=t(h,v,"*"),_=i(/[a-zA-Z_]/,/[ \u 00A8 \u 00AA \u 00AD \u 00AF \u 00B2- \u 00B5 \u 00B7- \u 00BA]/,/[ \u 00BC- \u 00BE \u 00C0- \u 00D6 \u 00D8- \u 00F6 \u 00F8- \u 00FF]/,/[ \u 0100- \u 02FF \u 0370- \u 167F \u 1681- \u 180D \u 180F- \u 1DBF]/,/[ \u 1E00- \u 1FFF]/,/[ \u 200B- \u 200D \u 202A- \u 202E \u 203F- \u 2040 \u 2054 \u 2060- \u 206F]/,/[ \u 2070- \u 20CF \u 2100- \u 218F \u 2460- \u 24FF \u 2776- \u 2793]/,/[ \u 2C00- \u 2DFF \u 2E80- \u 2FFF]/,/[ \u 3004- \u 3007 \u 3021- \u 302F \u 3031- \u 303F \u 3040- \u D7FF]/,/[ \u F900- \u FD3D \u FD40- \u FDCF \u FDF0- \u FE1F \u FE30- \u FE44]/,/[ \u FE47- \u FEFE \u FF00- \u FFFD]/),y=i(_,/ \d /,/[ \u 0300- \u 036F \u 1DC0- \u 1DFF \u 20D0- \u 20FF \u FE20- \u FE2F]/),E=t(_,y,"*"),x=t(/[A-Z]/,y,"*"),A=["attached","autoclosure",t(/convention \( /,i("swift","block","c"),/ \) /),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",t(/objc \( /,E,/ \) /),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplica
` ),r=t.length.toString().length,i=t.map((d,u)=>(u+1).toString().padStart(r," ")),s=document.createElement("div");s.classList.add("line-numbers"),s.innerHTML=i.join("<br>");const o=document.createElement("div");o.classList.add("code-container");const a=document.createElement("pre"),l=document.createElement("code");return l.classList.add("code-content"),l.innerHTML=ya.highlight(e,{language:n,ignoreIllegals:!0}).value,a.appendChild(l),o.appendChild(s),o.appendChild(a),o.outerHTML}},methods:{copyCode(){this.isCopied=!0,console.log("Copying code");const n=document.createElement("textarea");n.value=this.code,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),We(()=>{Ze.replace()})},executeCode(){this.isExecuting=!0;const n=JSON.stringify({client_id:this.client_id,code:this.code,discussion_id:this.discussion_id?this.discussion_id:0,message_id:this.message_id?this.message_id:0,language:this.language});console.log(n),fetch( ` $ { this . host } / execute _code ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>(this.isExecuting=!1,e.json())).then(e=>{console.log(e),this.executionOutput=e.output}).catch(e=>{this.isExecuting=!1,console.error("Fetch error:",e)})},executeCode_in_new_tab(){this.isExecuting=!0;const n=JSON.stringify({client_id:this.client_id,code:this.code,discussion_id:this.discussion_id,message_id:this.message_id,language:this.language});console.log(n),fetch( ` $ { this . host } / execute _code _in _new _tab ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>(this.isExecuting=!1,e.json())).then(e=>{console.log(e),this.executionOutput=e.output}).catch(e=>{this.isExecuting=!1,console.error("Fetch error:",e)})},openFolderVsCode(){const n=JSON.stringify({client_id:this.client_id,code:this.code,discussion_id:this.discussion_id,message_id:this.message_id});console.log(n),fetch( ` $ { this . host } / open _discussion _folder _in _vs _code ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>e.json()).then(e=>{console.log(e)}).catch(e=>{console.error("Fetch error:",e)})},openVsCode(){const n=JSON.stringify({client_id:this.client_id,discussion_id:typeof this.discussion_id=="string"?parseInt(this.discussion_id):this.discussion_id,message_id:this.message_id,code:this.code});console.log(n),fetch( ` $ { this . host } / open _code _in _vs _code ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>e.json()).then(e=>{console.log(e)}).catch(e=>{console.error("Fetch error:",e)})},openFolder(){const n=JSON.stringify({client_id:this.client_id,discussion_id:this.discussion_id});console.log(n),fetch( ` $ { this . host } / open _discussion _folder ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>e.json()).then(e=>{console.log(e)}).catch(e=>{console.error("Fetch error:",e)})}}},LZe={class:"bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel p-2 rounded-lg shadow-sm"},PZe={class:"hljs p-1 rounded-md break-all grid grid-cols-1"},FZe={class:"code-container"},UZe=["innerHTML"],BZe={class:"flex flex-row bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel p-2 rounded-lg shadow-sm"},GZe={class:"text-2xl mr-2"},zZe=["title"],VZe={key:0,class:"text-2xl"},HZe={key:1,class:"hljs mt-0 p-1 rounded-md break-all grid grid-cols-1"},qZe={class:"container h-[200px] overflow-x-auto break-all scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},YZe=["innerHTML"];function $ Ze(n,e,t,r,i,s){return T(),M("div",LZe,[c("pre",PZe,[e[9]||(e[9]=pt(" ")),c("div",FZe,[e[7]||(e[7]=pt( `
` )),c("div",{class:"code-content overflow-x-auto break-all scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:s.highlightedCode,contenteditable:"true",onInput:e[0]||(e[0]=(...o)=>n.updateCode&&n.updateCode(...o))},null,40,UZe),e[8]||(e[8]=pt( `
2024-11-04 00:22:50 +00:00
` ))]),e[10]||(e[10]=pt( `
2024-11-06 23:05:30 +00:00
` ))]),c("div",BZe,[c("span",GZe,X(t.language.trim()),1),c("button",{onClick:e[1]||(e[1]=(...o)=>s.copyCode&&s.copyCode(...o)),title:i.isCopied?"Copied!":"Copy code",class:qe([i.isCopied?"bg-green-500":"","px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200"])},e[11]||(e[11]=[c("i",{"data-feather":"copy"},null,-1)]),10,zZe),["function","python","sh","shell","bash","cmd","powershell","latex","mermaid","graphviz","dot","javascript","html","html5","svg","lilypond"].includes(t.language)?(T(),M("button",{key:0,ref:"btn_code_exec",onClick:e[2]||(e[2]=(...o)=>s.executeCode&&s.executeCode(...o)),title:"execute",class:qe(["px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200",i.isExecuting?"bg-green-500":""])},e[12]||(e[12]=[c("i",{"data-feather":"play-circle"},null,-1)]),2)):Y("",!0),["airplay","mermaid","graphviz","dot","javascript","html","html5","svg","css"].includes(t.language.trim())?(T(),M("button",{key:1,ref:"btn_code_exec_in_new_tab",onClick:e[3]||(e[3]=(...o)=>s.executeCode_in_new_tab&&s.executeCode_in_new_tab(...o)),title:"execute",class:qe(["px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200",i.isExecuting?"bg-green-500":""])},e[13]||(e[13]=[c("i",{"data-feather":"airplay"},null,-1)]),2)):Y("",!0),c("button",{onClick:e[4]||(e[4]=(...o)=>s.openFolder&&s.openFolder(...o)),title:"open code project folder",class:"px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200"},e[14]||(e[14]=[c("i",{"data-feather":"folder"},null,-1)])),["python","latex","html"].includes(t.language.trim())?(T(),M("button",{key:2,onClick:e[5]||(e[5]=(...o)=>s.openFolderVsCode&&s.openFolderVsCode(...o)),title:"open code project folder in vscode",class:"px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200"},e[15]||(e[15]=[c("img",{src:IZe,width:"25",height:"25"},null,-1)]))):Y("",!0),["python","latex","html"].includes(t.language.trim())?(T(),M("button",{key:3,onClick:e[6]||(e[6]=(...o)=>s.openVsCode&&s.openVsCode(...o)),title:"open code in vscode",class:"px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200"},e[16]||(e[16]=[c("img",{src:OZe,width:"25",height:"25"},null,-1)]))):Y("",!0)]),i.executionOutput?(T(),M("span",VZe,"Execution output")):Y("",!0),i.executionOutput?(T(),M("pre",HZe,[e[19]||(e[19]=pt(" ")),c("div",qZe,[e[17]||(e[17]=pt( `
` )),c("div",{ref:"execution_output",class:"w-full h-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:i.executionOutput},null,8,YZe),e[18]||(e[18]=pt( `
2024-11-04 00:22:50 +00:00
` ))]),e[20]||(e[20]=pt( `
2024-11-06 23:05:30 +00:00
` ))])):Y("",!0)])}const WZe=bt(DZe,[["render", $ Ze]]);var KZe={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(Q3,function(){function t(a,l){var d=a.pos;if(a.src.charCodeAt(d)!==92)return!1;var u=a.src.slice(++d).match(/^(?: \\ \[ | \\ \( |begin \{ ([^}]*) \} )/);if(!u)return!1;d+=u[0].length;var m,f,g;u[0]===" \\ ["?(m="display_math",f=" \\ \\ ]"):u[0]===" \\ ("?(m="inline_math",f=" \\ \\ )"):u[1]&&(m="math",f=" \\ end{"+u[1]+"}",g=!0);var h=a.src.indexOf(f,d);if(h===-1)return!1;var v=h+f.length;if(!l){var b=a.push(m,"",0);b.content=g?a.src.slice(a.pos,v):a.src.slice(d,h)}return a.pos=v,!0}function r(a,l){var d=a.pos;if(a.src.charCodeAt(d)!==36)return!1;var u=" $ ",m=a.src.charCodeAt(++d);if(m===36){if(u=" $ $ ",a.src.charCodeAt(++d)===36)return!1}else if(m===32||m===9||m===10)return!1;var f=a.src.indexOf(u,d);if(f===-1||a.src.charCodeAt(f-1)===92)return!1;var g=f+u.length;if(u.length===1){var h=a.src.charCodeAt(f-1);if(h===32||h===9||h===10)return!1;var v=a.src.charCodeAt(g);if(v>=48&&v<58)return!1}if(!l){var b=a.push(u.length===1?"inline_math":"display_math","",0);b.content=a.src.slice(d,f)}return a.pos=g,!0}function i(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/ \u 00a0/g," ")}function s(a,l){return Object.keys(l).reduce(function(d,u){return d[u]===void 0&&(d[u]=l[u]),d},a)}var o={math:"Math",inline_math:"InlineMath",display_math:"DisplayMath"};return function(a){var l={beforeMath:"",afterMath:"",beforeInlineMath:" \\ (",afterInlineMath:" \\ )",beforeDisplayMath:" \\ [",afterDisplayMath:" \\ ]"};return a=s(a||{},l),function(d){d.inline.ruler.before("escape","math",t),d.inline.ruler.push("texMath",r),Object.keys(o).forEach(function(u){var m=a["before"+o[u]],f=a["after"+o[u]];d.renderer.rules[u]=function(g,h){return m+i(g[h].content)+f}})}}})})(KZe);var jZe={exports:{}};class Fr{constructor(e,t,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=r}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new Fr(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class li{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new li(t,Fr.range(this,e))}}class Qe{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,i,s,o=t&&t.loc;if(o&&o.start<=o.end){var a=o.lexer.input;i=o.start,s=o.end,i===a.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var l=a.slice(i,s).replace(/[^]/g," $ &̲"),d;i>15?d="…"+a.slice(i-15,i):d=a.slice(0,i);var u;s+15<a.length?u=a.slice(s,s+15)+"…":u=a.slice(s),r+=d+l+u}var m=new Error(r);return m.name="ParseError",m.__proto__=Qe.prototype,m.position=i,i!=null&&s!=null&&(m.length=s-i),m.rawMessage=e,m}}Qe.prototype.__proto__=Error.prototype;var QZe=function(e,t){return e.indexOf(t)!==-1},XZe=function(e,t){return e===void 0?t:e},ZZe=/([A-Z])/g,JZe=function(e){return e.replace(ZZe,"- $ 1").toLowerCase()},eJe={"&":"&",">":">","<":"<",'"':""","'":"'"},tJe=/[&><"']/g;function nJe(n){return String(n).replace(tJe,e=>eJe[e])}var LN=function n(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?n(e.body[0]):e:e.type==="font"?n(e.body):e},rJe=function(e){var t=LN(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},iJe=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},sJe=function(e){var t=/^[ \x 00- \x 20]*([^ \\ /#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+ \- .]* $ /.test(t[1])?null:t[1].toLowerCase():"_relative"},Et={contains:QZe,deflt:XZe,escape:nJe,hyphenate:JZe,getBaseElem:LN,isCharacterBox:rJe,protocolFromUrl:sJe},sp={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\ int and \\ sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type
2024-11-04 00:22:50 +00:00
c - 2.7 , 0 , - 7.17 , - 2.7 , - 13.5 , - 8 c - 5.8 , - 5.3 , - 9.5 , - 10 , - 9.5 , - 14
c0 , - 2 , 0.3 , - 3.3 , 1 , - 4 c1 . 3 , - 2.7 , 23.83 , - 20.7 , 67.5 , - 54
c44 . 2 , - 33.3 , 65.8 , - 50.3 , 66.5 , - 51 c1 . 3 , - 1.3 , 3 , - 2 , 5 , - 2 c4 . 7 , 0 , 8.7 , 3.3 , 12 , 10
s173 , 378 , 173 , 378 c0 . 7 , 0 , 35.3 , - 71 , 104 , - 213 c68 . 7 , - 142 , 137.5 , - 285 , 206.5 , - 429
c69 , - 144 , 104.5 , - 217.7 , 106.5 , - 221
l ` +e/2.075+" -"+e+ `
c5 . 3 , - 9.3 , 12 , - 14 , 20 , - 14
H400000v ` +(40+e)+ ` H845 . 2724
s - 225.272 , 467 , - 225.272 , 467 s - 235 , 486 , - 235 , 486 c - 2.7 , 4.7 , - 9 , 7 , - 19 , 7
c - 6 , 0 , - 10 , - 1 , - 12 , - 3 s - 194 , - 422 , - 194 , - 422 s - 65 , 47 , - 65 , 47 z
2024-11-06 23:05:30 +00:00
M ` +(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},fJe=function(e,t){return"M263,"+(601+e+t)+ ` c0 . 7 , 0 , 18 , 39.7 , 52 , 119
2024-11-04 00:22:50 +00:00
c34 , 79.3 , 68.167 , 158.7 , 102.5 , 238 c34 . 3 , 79.3 , 51.8 , 119.3 , 52.5 , 120
c340 , - 704.7 , 510.7 , - 1060.3 , 512 , - 1067
l ` +e/2.084+" -"+e+ `
c4 . 7 , - 7.3 , 11 , - 11 , 19 , - 11
H40000v ` +(40+e)+ ` H1012 . 3
s - 271.3 , 567 , - 271.3 , 567 c - 38.7 , 80.7 , - 84 , 175 , - 136 , 283 c - 52 , 108 , - 89.167 , 185.3 , - 111.5 , 232
c - 22.3 , 46.7 , - 33.8 , 70.3 , - 34.5 , 71 c - 4.7 , 4.7 , - 12.3 , 7 , - 23 , 7 s - 12 , - 1 , - 12 , - 1
s - 109 , - 253 , - 109 , - 253 c - 72.7 , - 168 , - 109.3 , - 252 , - 110 , - 252 c - 10.7 , 8 , - 22 , 16.7 , - 34 , 26
c - 22 , 17.3 , - 33.3 , 26 , - 34 , 26 s - 26 , - 26 , - 26 , - 26 s76 , - 59 , 76 , - 59 s76 , - 60 , 76 , - 60 z
2024-11-06 23:05:30 +00:00
M ` +(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},gJe=function(e,t){return"M983 "+(10+e+t)+ `
2024-11-04 00:22:50 +00:00
l ` +e/3.13+" -"+e+ `
c4 , - 6.7 , 10 , - 10 , 18 , - 10 H400000v ` +(40+e)+ `
H1013 . 1 s - 83.4 , 268 , - 264.1 , 840 c - 180.7 , 572 , - 277 , 876.3 , - 289 , 913 c - 4.7 , 4.7 , - 12.7 , 7 , - 24 , 7
s - 12 , 0 , - 12 , 0 c - 1.3 , - 3.3 , - 3.7 , - 11.7 , - 7 , - 25 c - 35.3 , - 125.3 , - 106.7 , - 373.3 , - 214 , - 744
c - 10 , 12 , - 21 , 25 , - 33 , 39 s - 32 , 39 , - 32 , 39 c - 6 , - 5.3 , - 15 , - 14 , - 27 , - 26 s25 , - 30 , 25 , - 30
c26 . 7 , - 32.7 , 52 , - 63 , 76 , - 91 s52 , - 60 , 52 , - 60 s208 , 722 , 208 , 722
c56 , - 175.3 , 126.3 , - 397.3 , 211 , - 666 c84 . 7 , - 268.7 , 153.8 , - 488.2 , 207.5 , - 658.5
c53 . 7 , - 170.3 , 84.5 , - 266.8 , 92.5 , - 289.5 z
2024-11-06 23:05:30 +00:00
M ` +(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},_Je=function(e,t){return"M424,"+(2398+e+t)+ `
2024-11-04 00:22:50 +00:00
c - 1.3 , - 0.7 , - 38.5 , - 172 , - 111.5 , - 514 c - 73 , - 342 , - 109.8 , - 513.3 , - 110.5 , - 514
c0 , - 2 , - 10.7 , 14.3 , - 32 , 49 c - 4.7 , 7.3 , - 9.8 , 15.7 , - 15.5 , 25 c - 5.7 , 9.3 , - 9.8 , 16 , - 12.5 , 20
s - 5 , 7 , - 5 , 7 c - 4 , - 3.3 , - 8.3 , - 7.7 , - 13 , - 13 s - 13 , - 13 , - 13 , - 13 s76 , - 122 , 76 , - 122 s77 , - 121 , 77 , - 121
s209 , 968 , 209 , 968 c0 , - 2 , 84.7 , - 361.7 , 254 , - 1079 c169 . 3 , - 717.3 , 254.7 , - 1077.7 , 256 , - 1081
l ` +e/4.223+" -"+e+ ` c4 , - 6.7 , 10 , - 10 , 18 , - 10 H400000
v ` +(40+e)+ ` H1014 . 6
s - 87.3 , 378.7 , - 272.6 , 1166 c - 185.3 , 787.3 , - 279.3 , 1182.3 , - 282 , 1185
c - 2 , 6 , - 10 , 9 , - 24 , 9
c - 8 , 0 , - 12 , - 0.7 , - 12 , - 2 z M ` +(1001+e)+" "+t+ `
2024-11-06 23:05:30 +00:00
h400000v ` +(40+e)+"h-400000z"},bJe=function(e,t){return"M473,"+(2713+e+t)+ `
2024-11-04 00:22:50 +00:00
c339 . 3 , - 1799.3 , 509.3 , - 2700 , 510 , - 2702 l ` +e/5.298+" -"+e+ `
c3 . 3 , - 7.3 , 9.3 , - 11 , 18 , - 11 H400000v ` +(40+e)+ ` H1017 . 7
s - 90.5 , 478 , - 276.2 , 1466 c - 185.7 , 988 , - 279.5 , 1483 , - 281.5 , 1485 c - 2 , 6 , - 10 , 9 , - 24 , 9
c - 8 , 0 , - 12 , - 0.7 , - 12 , - 2 c0 , - 1.3 , - 5.3 , - 32 , - 16 , - 92 c - 50.7 , - 293.3 , - 119.7 , - 693.3 , - 207 , - 1200
c0 , - 1.3 , - 5.3 , 8.7 , - 16 , 30 c - 10.7 , 21.3 , - 21.3 , 42.7 , - 32 , 64 s - 16 , 33 , - 16 , 33 s - 26 , - 26 , - 26 , - 26
s76 , - 153 , 76 , - 153 s77 , - 151 , 77 , - 151 c0 . 7 , 0.7 , 35.7 , 202 , 105 , 604 c67 . 3 , 400.7 , 102 , 602.7 , 104 ,
2024-11-06 23:05:30 +00:00
606 zM ` +(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},vJe=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},yJe=function(e,t,r){var i=r-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+ `
2024-11-04 00:22:50 +00:00
H742v ` +i+ ` l - 4 4 - 4 4 c - . 667.7 - 2 1.5 - 4 2.5 s - 4.167 1.833 - 6.5 2.5 - 5.5 1 - 9.5 1
h - 12 l - 28 - 84 c - 16.667 - 52 - 96.667 - 294.333 - 240 - 727 l - 212 - 643 - 85 170
c - 4 - 3.333 - 8.333 - 7.667 - 13 - 13 l - 13 - 13 l77 - 155 77 - 156 c66 199.333 139 419.667
2024-11-06 23:05:30 +00:00
219 661 l218 661 zM702 ` +t+"H400000v"+(40+e)+"H742z"},EJe=function(e,t,r){t=1e3*t;var i="";switch(e){case"sqrtMain":i=mJe(t,Ua);break;case"sqrtSize1":i=fJe(t,Ua);break;case"sqrtSize2":i=gJe(t,Ua);break;case"sqrtSize3":i=_Je(t,Ua);break;case"sqrtSize4":i=bJe(t,Ua);break;case"sqrtTall":i=yJe(t,Ua,r)}return i},SJe=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣ ":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},bC={doubleleftarrow: ` M262 157
2024-11-04 00:22:50 +00:00
l10 - 10 c34 - 36 62.7 - 77 86 - 123 3.3 - 8 5 - 13.3 5 - 16 0 - 5.3 - 6.7 - 8 - 20 - 8 - 7.3
0 - 12.2 . 5 - 14.5 1.5 - 2.3 1 - 4.8 4.5 - 7.5 10.5 - 49.3 97.3 - 121.7 169.3 - 217 216 - 28
14 - 57.3 25 - 88 33 - 6.7 2 - 11 3.8 - 13 5.5 - 2 1.7 - 3 4.2 - 3 7.5 s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13 h6c12 - . 7 18 - 4 18 - 10 0 - 2 - 1.7 - 7 - 5 - 15 - 23.3 - 46 - 52 - 87
- 86 - 123 l - 10 - 10 h399738v - 40 H218c328 0 0 0 0 0 l - 10 - 8 c - 26.7 - 20 - 65.7 - 43 - 117 - 69 2.7
- 2 6 - 3.7 10 - 5 36.7 - 16 72.3 - 37.3 107 - 64 l10 - 8 h399782v - 40 z
m8 0 v40h399730v - 40 zm0 194 v40h399730v - 40 z ` ,doublerightarrow: ` M399738 392 l
- 10 10 c - 34 36 - 62.7 77 - 86 123 - 3.3 8 - 5 13.3 - 5 16 0 5.3 6.7 8 20 8 7.3 0 12.2 - . 5
14.5 - 1.5 2.3 - 1 4.8 - 4.5 7.5 - 10.5 49.3 - 97.3 121.7 - 169.3 217 - 216 28 - 14 57.3 - 25 88
- 33 6.7 - 2 11 - 3.8 13 - 5.5 2 - 1.7 3 - 4.2 3 - 7.5 s - 1 - 5.8 - 3 - 7.5 c - 2 - 1.7 - 6.3 - 3.5 - 13 - 5.5 - 68
- 17.3 - 128.2 - 47.8 - 180.5 - 91.5 - 52.3 - 43.7 - 93.8 - 96.2 - 124.5 - 157.5 - 9.3 - 8 - 15.3 - 12.3 - 18
- 13 h - 6 c - 12 . 7 - 18 4 - 18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123 l10 10 H0v40h399782
c - 328 0 0 0 0 0 l10 8 c26 . 7 20 65.7 43 117 69 - 2.7 2 - 6 3.7 - 10 5 - 36.7 16 - 72.3 37.3
- 107 64 l - 10 8 H0v40zM0 157 v40h399730v - 40 zm0 194 v40h399730v - 40 z ` ,leftarrow: ` M400000 241 H110l3 - 3 c68 . 7 - 52.7 113.7 - 120
135 - 202 4 - 14.7 6 - 23 6 - 25 0 - 7.3 - 7 - 11 - 21 - 11 - 8 0 - 13.2 . 8 - 15.5 2.5 - 2.3 1.7 - 4.2 5.8
- 5.5 12.5 - 1.3 4.7 - 2.7 10.3 - 4 17 - 12 48.7 - 34.8 92 - 68.5 130 S65 . 3 228.3 18 247
c - 10 4 - 16 7.7 - 18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85 S196 441.3 208
490 c . 7 2 1.3 5 2 9 s1 . 2 6.7 1.5 8 c . 3 1.3 1 3.3 2 6 s2 . 2 4.5 3.5 5.5 c1 . 3 1 3.3
1.8 6 2.5 s6 1 10 1 c14 0 21 - 3.7 21 - 11 0 - 2 - 2 - 10.3 - 6 - 25 - 20 - 79.3 - 65 - 146.7 - 135 - 202
l - 3 - 3 h399890zM100 241 v40h399900v - 40 z ` ,leftbrace: ` M6 548 l - 6 - 6 v - 35 l6 - 11 c56 - 104 135.3 - 181.3 238 - 232 57.3 - 28.7 117
- 45 179 - 50 h399577v120H403c - 43.3 7 - 81 15 - 113 26 - 100.7 33 - 179.7 91 - 237 174 - 2.7
5 - 6 9 - 10 13 - . 7 1 - 7.3 1 - 20 1 H6z ` ,leftbraceunder: ` M0 6 l6 - 6 h17c12 . 688 0 19.313 . 3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5 . 688
0 2 . 3 4 1 18.688 2.7 76 4.3 172 5 h399450v120H429l - 6 - 1 c - 124.688 - 8 - 235 - 61.7
- 331 - 161 C60 . 687 138.7 32.312 99.3 7 54 L0 41 V6z ` ,leftgroup: ` M400000 80
H435C64 80 168.3 229.4 21 260 c - 5.9 1.2 - 18 0 - 18 0 - 2 0 - 3 - 1 - 3 - 3 v - 38 C76 61 257 0
435 0 h399565z ` ,leftgroupunder: ` M400000 262
H435C64 262 168.3 112.6 21 82 c - 5.9 - 1.2 - 18 0 - 18 0 - 2 0 - 3 1 - 3 3 v38c76 158 257 219
435 219 h399565z ` ,leftharpoon: ` M0 267 c . 7 5.3 3 10 7 14 h399993v - 40 H93c3 . 3
- 3.3 10.2 - 9.5 20.5 - 18.5 s17 . 8 - 15.8 22.5 - 20.5 c50 . 7 - 52 88 - 110.3 112 - 175 4 - 11.3 5
- 18.3 3 - 21 - 1.3 - 4 - 7.3 - 6 - 18 - 6 - 8 0 - 13 . 7 - 15 2 s - 4.7 6.7 - 8 16 c - 42 98.7 - 107.3 174.7
- 196 228 - 6.7 4.7 - 10.7 8 - 12 10 - 1.3 2 - 2 5.7 - 2 11 zm100 - 26 v40h399900v - 40 z ` ,leftharpoonplus: ` M0 267 c . 7 5.3 3 10 7 14 h399993v - 40 H93c3 . 3 - 3.3 10.2 - 9.5
20.5 - 18.5 s17 . 8 - 15.8 22.5 - 20.5 c50 . 7 - 52 88 - 110.3 112 - 175 4 - 11.3 5 - 18.3 3 - 21 - 1.3
- 4 - 7.3 - 6 - 18 - 6 - 8 0 - 13 . 7 - 15 2 s - 4.7 6.7 - 8 16 c - 42 98.7 - 107.3 174.7 - 196 228 - 6.7 4.7
- 10.7 8 - 12 10 - 1.3 2 - 2 5.7 - 2 11 zm100 - 26 v40h399900v - 40 zM0 435 v40h400000v - 40 z
m0 0 v40h400000v - 40 z ` ,leftharpoondown: ` M7 241 c - 4 4 - 6.333 8.667 - 7 14 0 5.333 . 667 9 2 11 s5 . 333
5.333 12 10 c90 . 667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 . 667 5
1 9 1 h5c10 . 667 0 16.667 - 2 18 - 6 2 - 2.667 1 - 9.667 - 3 - 21 - 32 - 87.333 - 82.667 - 157.667
- 152 - 211 l - 3 - 3 h399907v - 40 zM93 281 H400000 v - 40 L7 241 z ` ,leftharpoondownplus: ` M7 435 c - 4 4 - 6.3 8.7 - 7 14 0 5.3 . 7 9 2 11 s5 . 3 5.3 12
10 c90 . 7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 . 7 5 1 9 1 h5c10 . 7 0 16.7
- 2 18 - 6 2 - 2.7 1 - 9.7 - 3 - 21 - 32 - 87.3 - 82.7 - 157.7 - 152 - 211 l - 3 - 3 h399907v - 40 H7zm93 0
v40h399900v - 40 zM0 241 v40h399900v - 40 zm0 0 v40h399900v - 40 z ` ,lefthook: ` M400000 281 H103s - 33 - 11.2 - 61 - 33.5 S0 197.3 0 164 s14 . 2 - 61.2 42.5
- 83.5 C70 . 8 58.2 104 47 142 47 c16 . 7 0 25 6.7 25 20 0 12 - 8.7 18.7 - 26 20 - 40 3.3
- 68.7 15.7 - 86 37 - 10 12 - 15 25.3 - 15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23 h399859zM103 281 v - 40 h399897v40z ` ,leftlinesegment: ` M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z ` ,leftmapsto: ` M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z ` ,leftToFrom: ` M0 147 h400000v40H0zm0 214 c68 40 115.7 95.7 143 167 h22c15 . 3 0 23
- . 3 23 - 1 0 - 1.3 - 5.3 - 13.7 - 16 - 37 - 18 - 35.3 - 41.3 - 69 - 70 - 101 l - 7 - 8 h399905v - 40 H95l7 - 8
c28 . 7 - 32 52 - 65.7 70 - 101 10.7 - 23.3 16 - 35.7 16 - 37 0 - . 7 - 7.7 - 1 - 23 - 1 h - 22 C115 . 7 265.3
68 321 0 361 zm0 - 174 v - 40 h399900v40zm100 154 v40h399900v - 40 z ` ,longequal: ` M0 50 h400000 v40H0z m0 194 h40000v40H0z
M0 50 h400000 v40H0z m0 194 h40000v40H0z ` ,midbrace: ` M200428 334
c - 100.7 - 8.3 - 195.3 - 44 - 280 - 108 - 55.3 - 42 - 101.7 - 93 - 139 - 153 l - 9 - 14 c - 2.7 4 - 5.7 8.7 - 9 14
- 53.3 86.7 - 123.7 153 - 211 199 - 66.7 36 - 137.3 56.3 - 212 62 H0V214h199568c178 . 3 - 11.7
311.7 - 78.3 403 - 201 6 - 8 9.7 - 12 11 - 12 . 7 - . 7 6.7 - 1 18 - 1 s17 . 3.3 18 1 c1 . 3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141 s145 . 3 54.3 229 60 h199572v120z ` ,midbraceunder: ` M199572 214
c100 . 7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153 l9 14 c2 . 7 - 4 5.7 - 8.7 9 - 14
53.3 - 86.7 123.7 - 153 211 - 199 66.7 - 36 137.3 - 56.3 212 - 62 h199568v120H200432c - 178.3
11.7 - 311.7 78.3 - 403 201 - 6 8 - 9.7 12 - 11 12 - . 7.7 - 6.7 1 - 18 1 s - 17.3 - . 3 - 18 - 1 c - 1.3 0
- 5 - 4 - 11 - 12 - 44.7 - 59.3 - 101.3 - 106.3 - 170 - 141 s - 145.3 - 54.3 - 229 - 60 H0V214z ` ,oiintSize1: ` M512 . 6 71.6 c272 . 6 0 320.3 106.8 320.3 178.2 0 70.8 - 47.7 177.6
- 320.3 177.6 S193 . 1 320.6 193.1 249.8 c0 - 71.4 46.9 - 178.2 319.5 - 178.2 z
m368 . 1 178.2 c0 - 86.4 - 60.9 - 215.4 - 368.1 - 215.4 - 306.4 0 - 367.3 129 - 367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1 - 129 368.1 - 214.8 z ` ,oiintSize2: ` M757 . 8 100.1 c384 . 7 0 451.1 137.6 451.1 230 0 91.3 - 66.4 228.8
- 451.1 228.8 - 386.3 0 - 452.7 - 137.5 - 452.7 - 228.8 0 - 92.4 66.4 - 230 452.7 - 230 z
m502 . 4 230 c0 - 111.2 - 82.4 - 277.2 - 502.4 - 277.2 s - 504 166 - 504 277.2
c0 110 84 276 504 276 s502 . 4 - 166 502.4 - 276 z ` ,oiiintSize1: ` M681 . 4 71.6 c408 . 9 0 480.5 106.8 480.5 178.2 0 70.8 - 71.6 177.6
- 480.5 177.6 S202 . 1 320.6 202.1 249.8 c0 - 71.4 70.5 - 178.2 479.3 - 178.2 z
m525 . 8 178.2 c0 - 86.4 - 86.8 - 215.4 - 525.7 - 215.4 - 437.9 0 - 524.7 129 - 524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7 - 129 525.7 - 214.8 z ` ,oiiintSize2: ` M1021 . 2 53 c603 . 6 0 707.8 165.8 707.8 277.2 0 110 - 104.2 275.8
- 707.8 275.8 - 606 0 - 710.2 - 165.8 - 710.2 - 275.8 C311 218.8 415.2 53 1021.2 53 z
m770 . 4 277.1 c0 - 131.2 - 126.4 - 327.6 - 770.5 - 327.6 S248 . 4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4 s770 . 5 - 196.4 770.5 - 326.4 z ` ,rightarrow: ` M0 241 v40h399891c - 47.3 35.3 - 84 78 - 110 128
- 16.7 32 - 27.7 63.7 - 33 95 0 1.3 - . 2 2.7 - . 5 4 - . 3 1.3 - . 5 2.3 - . 5 3 0 7.3 6.7 11 20
11 8 0 13.2 - . 8 15.5 - 2.5 2.3 - 1.7 4.2 - 5.5 5.5 - 11.5 2 - 13.3 5.7 - 27 11 - 41 14.7 - 44.7
39 - 84.5 73 - 119.5 s73 . 7 - 60.2 119 - 75.5 c6 - 2 9 - 5.7 9 - 11 s - 3 - 9 - 9 - 11 c - 45.3 - 15.3 - 85
- 40.5 - 119 - 75.5 s - 58.3 - 74.8 - 73 - 119.5 c - 4.7 - 14 - 8.3 - 27.3 - 11 - 40 - 1.3 - 6.7 - 3.2 - 10.8 - 5.5
- 12.5 - 2.3 - 1.7 - 7.5 - 2.5 - 15.5 - 2.5 - 14 0 - 21 3.7 - 21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205 zm0 0 v40h399900v - 40 z ` ,rightbrace: ` M400000 542 l
- 6 6 h - 17 c - 12.7 0 - 19.3 - . 3 - 20 - 1 - 4 - 4 - 7.3 - 8.3 - 10 - 13 - 35.3 - 51.3 - 80.8 - 93.8 - 136.5 - 127.5
s - 117.2 - 55.8 - 184.5 - 66.5 c - . 7 0 - 2 - . 3 - 4 - 1 - 18.7 - 2.7 - 76 - 4.3 - 172 - 5 H0V214h399571l6 1
c124 . 7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118 l7 13 v35z ` ,rightbraceunder: ` M399994 0 l6 6 v35l - 6 11 c - 56 104 - 135.3 181.3 - 238 232 - 57.3
28.7 - 117 45 - 179 50 H - 300 V214h399897c43 . 3 - 7 81 - 15 113 - 26 100.7 - 33 179.7 - 91 237
- 174 2.7 - 5 6 - 9 10 - 13 . 7 - 1 7.3 - 1 20 - 1 h17z ` ,rightgroup: ` M0 80 h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3 - 1 3 - 3 v - 38 c - 76 - 158 - 257 - 219 - 435 - 219 H0z ` ,rightgroupunder: ` M0 262 h399565c371 0 266.7 - 149.4 414 - 180 5.9 - 1.2 18 0 18
0 2 0 3 1 3 3 v38c - 76 158 - 257 219 - 435 219 H0z ` ,rightharpoon: ` M0 241 v40h399993c4 . 7 - 4.7 7 - 9.3 7 - 14 0 - 9.3
- 3.7 - 15.3 - 11 - 18 - 92.7 - 56.7 - 159 - 133.7 - 199 - 231 - 3.3 - 9.3 - 6 - 14.7 - 8 - 16 - 2 - 1.3 - 7 - 2 - 15 - 2
- 10.7 0 - 16.7 2 - 18 6 - 2 2.7 - 1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5 zm0 0 v40h399900v - 40 z ` ,rightharpoonplus: ` M0 241 v40h399993c4 . 7 - 4.7 7 - 9.3 7 - 14 0 - 9.3 - 3.7 - 15.3 - 11
- 18 - 92.7 - 56.7 - 159 - 133.7 - 199 - 231 - 3.3 - 9.3 - 6 - 14.7 - 8 - 16 - 2 - 1.3 - 7 - 2 - 15 - 2 - 10.7 0 - 16.7
2 - 18 6 - 2 2.7 - 1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5 z
m0 0 v40h399900v - 40 z m100 194 v40h399900v - 40 zm0 0 v40h399900v - 40 z ` ,rightharpoondown: ` M399747 511 c0 7.3 6.7 11 20 11 8 0 13 - . 8 15 - 2.5 s4 . 7 - 6.8
8 - 15.5 c40 - 94 99.3 - 166.3 178 - 217 13.3 - 8 20.3 - 12.3 21 - 13 5.3 - 3.3 8.5 - 5.8 9.5
- 7.5 1 - 1.7 1.5 - 5.2 1.5 - 10.5 s - 2.3 - 10.3 - 7 - 15 H0v40h399908c - 34 25.3 - 64.7 57 - 92 95
- 27.3 38 - 48.7 77.7 - 64 119 - 3.3 8.7 - 5 14 - 5 16 zM0 241 v40h399900v - 40 z ` ,rightharpoondownplus: ` M399747 705 c0 7.3 6.7 11 20 11 8 0 13 - . 8
15 - 2.5 s4 . 7 - 6.8 8 - 15.5 c40 - 94 99.3 - 166.3 178 - 217 13.3 - 8 20.3 - 12.3 21 - 13 5.3 - 3.3
8.5 - 5.8 9.5 - 7.5 1 - 1.7 1.5 - 5.2 1.5 - 10.5 s - 2.3 - 10.3 - 7 - 15 H0v40h399908c - 34 25.3
- 64.7 57 - 92 95 - 27.3 38 - 48.7 77.7 - 64 119 - 3.3 8.7 - 5 14 - 5 16 zM0 435 v40h399900v - 40 z
m0 - 194 v40h400000v - 40 zm0 0 v40h400000v - 40 z ` ,righthook: ` M399859 241 c - 764 0 0 0 0 0 40 - 3.3 68.7 - 15.7 86 - 37 10 - 12 15 - 25.3
15 - 40 0 - 22.7 - 9.8 - 40.7 - 29.5 - 54 - 19.7 - 13.3 - 43.5 - 21 - 71.5 - 23 - 17.3 - 1.3 - 26 - 8 - 26 - 20 0
- 13.3 8.7 - 20 26 - 20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8 s - 14 61.2 - 42 83.5 c - 28 22.3 - 61 33.5 - 99 33.5 L0 241 z M0 281 v - 40 h399859v40z ` ,rightlinesegment: ` M399960 241 V94 h40 V428 h - 40 V281 H0 v - 40 z
M399960 241 V94 h40 V428 h - 40 V281 H0 v - 40 z ` ,rightToFrom: ` M400000 167 c - 70.7 - 42 - 118 - 97.7 - 142 - 167 h - 23 c - 15.3 0 - 23 . 3 - 23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101 l7 8 H0v40h399905l - 7 8 c - 28.7 32
- 52 65.7 - 70 101 - 10.7 23.3 - 16 35.7 - 16 37 0 . 7 7.7 1 23 1 h23c24 - 69.3 71.3 - 125 142
- 167 z M100 147 v40h399900v - 40 zM0 341 v40h399900v - 40 z ` ,twoheadleftarrow: ` M0 167 c68 40
115.7 95.7 143 167 h22c15 . 3 0 23 - . 3 23 - 1 0 - 1.3 - 5.3 - 13.7 - 16 - 37 - 18 - 35.3 - 41.3 - 69
- 70 - 101 l - 7 - 8 h125l9 7 c50 . 7 39.3 85 86 103 140 h46c0 - 4.7 - 6.3 - 18.7 - 19 - 42 - 18 - 35.3
- 40 - 67.3 - 66 - 96 l - 9 - 9 h399716v - 40 H284l9 - 9 c26 - 28.7 48 - 60.7 66 - 96 12.7 - 23.333 19
- 37.333 19 - 42 h - 46 c - 18 54 - 52.3 100.7 - 103 140 l - 9 7 H95l7 - 8 c28 . 7 - 32 52 - 65.7 70 - 101
10.7 - 23.333 16 - 35.7 16 - 37 0 - . 7 - 7.7 - 1 - 23 - 1 h - 22 C115 . 7 71.3 68 127 0 167 z ` ,twoheadrightarrow: ` M400000 167
c - 68 - 40 - 115.7 - 95.7 - 143 - 167 h - 22 c - 15.3 0 - 23 . 3 - 23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101 l7 8 h - 125 l - 9 - 7 c - 50.7 - 39.3 - 85 - 86 - 103 - 140 h - 46 c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96 l9 9 H0v40h399716l - 9 9 c - 26 28.7 - 48 60.7 - 66 96 - 12.7 23.333
- 19 37.333 - 19 42 h46c18 - 54 52.3 - 100.7 103 - 140 l9 - 7 h125l - 7 8 c - 28.7 32 - 52 65.7 - 70
101 - 10.7 23.333 - 16 35.7 - 16 37 0 . 7 7.7 1 23 1 h22c27 . 3 - 71.3 75 - 127 143 - 167 z ` ,tilde1: ` M200 55.538 c - 77 0 - 168 73.953 - 177 73.953 - 3 0 - 7
- 2.175 - 9 - 5.437 L2 97 c - 1 - 2 - 2 - 4 - 2 - 6 0 - 4 2 - 7 5 - 9 l20 - 12 C116 12 171 0 207 0 c86 0
114 68 191 68 78 0 168 - 68 177 - 68 4 0 7 2 9 5 l12 19 c1 2.175 2 4.35 2 6.525 0
4.35 - 2 7.613 - 5 9.788 l - 19 13.05 c - 92 63.077 - 116.937 75.308 - 183 76.128
- 68.267 . 847 - 113 - 73.952 - 191 - 73.952 z ` ,tilde2: ` M344 55.266 c - 142 0 - 300.638 81.316 - 311.5 86.418
- 8.01 3.762 - 22.5 10.91 - 23.5 5.562 L1 120 c - 1 - 2 - 1 - 3 - 1 - 4 0 - 5 3 - 9 8 - 10 l18 . 4 - 9 C160 . 9
31.9 283 0 358 0 c148 0 188 122 331 122 s314 - 97 326 - 97 c4 0 8 2 10 7 l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347 - 3 9.626 - 7 10.696 l - 22.3 12.622 C852 . 6 158.372 751
181.476 676 181.476 c - 149 0 - 189 - 126.21 - 332 - 126.21 z ` ,tilde3: ` M786 59 C457 59 32 175.242 13 175.242 c - 6 0 - 10 - 3.457
- 11 - 10.37 L . 15 138 c - 1 - 7 3 - 12 10 - 13 l19 . 2 - 6.4 C378 . 4 40.7 634.3 0 804.3 0 c337 0
411.8 157 746.8 157 328 0 754 - 112 773 - 112 5 0 10 3 11 9 l1 14.075 c1 8.066 - . 697
16.595 - 6.697 17.492 l - 21.052 7.31 c - 367.9 98.146 - 609.15 122.696 - 778.15 122.696
- 338 0 - 409 - 156.573 - 744 - 156.573 z ` ,tilde4: ` M786 58 C457 58 32 177.487 13 177.487 c - 6 0 - 10 - 3.345
- 11 - 10.035 L . 15 143 c - 1 - 7 3 - 12 10 - 13 l22 - 6.7 C381 . 2 35 637.15 0 807.15 0 c337 0 409
177 744 177 328 0 754 - 127 773 - 127 5 0 10 3 11 9 l1 14.794 c1 7.805 - 3 13.38 - 9
14.495 l - 20.7 5.574 c - 366.85 99.79 - 607.3 139.372 - 776.3 139.372 - 338 0 - 409
- 175.236 - 744 - 175.236 z ` ,vec: ` M377 20 c0 - 5.333 1.833 - 10 5.5 - 14 S391 0 397 0 c4 . 667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6 - 1 10 - 3 12 s - 6.667 5 - 14 9 c - 28.667 14.667 - 53.667 35.667 - 75 63
- 1.333 1.333 - 3.167 3.5 - 5.5 6.5 s - 4 4.833 - 5 5.5 c - 1 . 667 - 2.5 1.333 - 4.5 2 s - 4.333 1
- 7 1 c - 4.667 0 - 9.167 - 1.833 - 13.5 - 5.5 S337 184 337 178 c0 - 12.667 15.667 - 32.333 47 - 59
H213l - 171 - 1 c - 8.667 - 6 - 13 - 12.333 - 13 - 19 0 - 4.667 4.333 - 11.333 13 - 20 h359
c - 16 - 25.333 - 24 - 45 - 24 - 59 z ` ,widehat1: ` M529 0 h5l519 115 c5 1 9 5 9 10 0 1 - 1 2 - 1 3 l - 4 22
c - 1 5 - 5 9 - 11 9 h - 2 L532 67 19 159 h - 2 c - 5 0 - 9 - 4 - 11 - 9 l - 5 - 22 c - 1 - 6 2 - 12 8 - 13 z ` ,widehat2: ` M1181 0 h2l1171 176 c6 0 10 5 10 11 l - 2 23 c - 1 6 - 5 10
- 11 10 h - 1 L1182 67 15 220 h - 1 c - 6 0 - 10 - 4 - 11 - 10 l - 2 - 23 c - 1 - 6 4 - 11 10 - 11 z ` ,widehat3: ` M1181 0 h2l1171 236 c6 0 10 5 10 11 l - 2 23 c - 1 6 - 5 10
- 11 10 h - 1 L1182 67 15 280 h - 1 c - 6 0 - 10 - 4 - 11 - 10 l - 2 - 23 c - 1 - 6 4 - 11 10 - 11 z ` ,widehat4: ` M1181 0 h2l1171 296 c6 0 10 5 10 11 l - 2 23 c - 1 6 - 5 10
- 11 10 h - 1 L1182 67 15 340 h - 1 c - 6 0 - 10 - 4 - 11 - 10 l - 2 - 23 c - 1 - 6 4 - 11 10 - 11 z ` ,widecheck1: ` M529 , 159 h5l519 , - 115 c5 , - 1 , 9 , - 5 , 9 , - 10 c0 , - 1 , - 1 , - 2 , - 1 , - 3 l - 4 , - 22 c - 1 ,
- 5 , - 5 , - 9 , - 11 , - 9 h - 2 l - 512 , 92 l - 513 , - 92 h - 2 c - 5 , 0 , - 9 , 4 , - 11 , 9 l - 5 , 22 c - 1 , 6 , 2 , 12 , 8 , 13 z ` ,widecheck2: ` M1181 , 220 h2l1171 , - 176 c6 , 0 , 10 , - 5 , 10 , - 11 l - 2 , - 23 c - 1 , - 6 , - 5 , - 10 ,
- 11 , - 10 h - 1 l - 1168 , 153 l - 1167 , - 153 h - 1 c - 6 , 0 , - 10 , 4 , - 11 , 10 l - 2 , 23 c - 1 , 6 , 4 , 11 , 10 , 11 z ` ,widecheck3: ` M1181 , 280 h2l1171 , - 236 c6 , 0 , 10 , - 5 , 10 , - 11 l - 2 , - 23 c - 1 , - 6 , - 5 , - 10 ,
- 11 , - 10 h - 1 l - 1168 , 213 l - 1167 , - 213 h - 1 c - 6 , 0 , - 10 , 4 , - 11 , 10 l - 2 , 23 c - 1 , 6 , 4 , 11 , 10 , 11 z ` ,widecheck4: ` M1181 , 340 h2l1171 , - 296 c6 , 0 , 10 , - 5 , 10 , - 11 l - 2 , - 23 c - 1 , - 6 , - 5 , - 10 ,
- 11 , - 10 h - 1 l - 1168 , 273 l - 1167 , - 273 h - 1 c - 6 , 0 , - 10 , 4 , - 11 , 10 l - 2 , 23 c - 1 , 6 , 4 , 11 , 10 , 11 z ` ,baraboveleftarrow: ` M400000 620 h - 399890 l3 - 3 c68 . 7 - 52.7 113.7 - 120 135 - 202
c4 - 14.7 6 - 23 6 - 25 c0 - 7.3 - 7 - 11 - 21 - 11 c - 8 0 - 13.2 0.8 - 15.5 2.5
c - 2.3 1.7 - 4.2 5.8 - 5.5 12.5 c - 1.3 4.7 - 2.7 10.3 - 4 17 c - 12 48.7 - 34.8 92 - 68.5 130
s - 74.2 66.3 - 121.5 85 c - 10 4 - 16 7.7 - 18 11 c0 8.7 6 14.3 18 17 c47 . 3 18.7 87.8 47
121.5 85 s56 . 5 81.3 68.5 130 c0 . 7 2 1.3 5 2 9 s1 . 2 6.7 1.5 8 c0 . 3 1.3 1 3.3 2 6
s2 . 2 4.5 3.5 5.5 c1 . 3 1 3.3 1.8 6 2.5 s6 1 10 1 c14 0 21 - 3.7 21 - 11
c0 - 2 - 2 - 10.3 - 6 - 25 c - 20 - 79.3 - 65 - 146.7 - 135 - 202 l - 3 - 3 h399890z
M100 620 v40h399900v - 40 z M0 241 v40h399900v - 40 zM0 241 v40h399900v - 40 z ` ,rightarrowabovebar: ` M0 241 v40h399891c - 47.3 35.3 - 84 78 - 110 128 - 16.7 32
- 27.7 63.7 - 33 95 0 1.3 - . 2 2.7 - . 5 4 - . 3 1.3 - . 5 2.3 - . 5 3 0 7.3 6.7 11 20 11 8 0
13.2 - . 8 15.5 - 2.5 2.3 - 1.7 4.2 - 5.5 5.5 - 11.5 2 - 13.3 5.7 - 27 11 - 41 14.7 - 44.7 39
- 84.5 73 - 119.5 s73 . 7 - 60.2 119 - 75.5 c6 - 2 9 - 5.7 9 - 11 s - 3 - 9 - 9 - 11 c - 45.3 - 15.3 - 85 - 40.5
- 119 - 75.5 s - 58.3 - 74.8 - 73 - 119.5 c - 4.7 - 14 - 8.3 - 27.3 - 11 - 40 - 1.3 - 6.7 - 3.2 - 10.8 - 5.5
- 12.5 - 2.3 - 1.7 - 7.5 - 2.5 - 15.5 - 2.5 - 14 0 - 21 3.7 - 21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205 zm96 379 h399894v40H0zm0 0 h399904v40H0z ` ,baraboveshortleftharpoon: ` M507 , 435 c - 4 , 4 , - 6.3 , 8.7 , - 7 , 14 c0 , 5.3 , 0.7 , 9 , 2 , 11
c1 . 3 , 2 , 5.3 , 5.3 , 12 , 10 c90 . 7 , 54 , 156 , 130 , 196 , 228 c3 . 3 , 10.7 , 6.3 , 16.3 , 9 , 17
c2 , 0.7 , 5 , 1 , 9 , 1 c0 , 0 , 5 , 0 , 5 , 0 c10 . 7 , 0 , 16.7 , - 2 , 18 , - 6 c2 , - 2.7 , 1 , - 9.7 , - 3 , - 21
c - 32 , - 87.3 , - 82.7 , - 157.7 , - 152 , - 211 c0 , 0 , - 3 , - 3 , - 3 , - 3 l399351 , 0 l0 , - 40
c - 398570 , 0 , - 399437 , 0 , - 399437 , 0 z M593 435 v40 H399500 v - 40 z
M0 281 v - 40 H399908 v40z M0 281 v - 40 H399908 v40z ` ,rightharpoonaboveshortbar: ` M0 , 241 l0 , 40 c399126 , 0 , 399993 , 0 , 399993 , 0
c4 . 7 , - 4.7 , 7 , - 9.3 , 7 , - 14 c0 , - 9.3 , - 3.7 , - 15.3 , - 11 , - 18 c - 92.7 , - 56.7 , - 159 , - 133.7 , - 199 ,
- 231 c - 3.3 , - 9.3 , - 6 , - 14.7 , - 8 , - 16 c - 2 , - 1.3 , - 7 , - 2 , - 15 , - 2 c - 10.7 , 0 , - 16.7 , 2 , - 18 , 6
c - 2 , 2.7 , - 1 , 9.7 , 3 , 21 c15 . 3 , 42 , 36.7 , 81.8 , 64 , 119.5 c27 . 3 , 37.7 , 58 , 69.2 , 92 , 94.5 z
M0 241 v40 H399908 v - 40 z M0 475 v - 40 H399500 v40z M0 475 v - 40 H399500 v40z ` ,shortbaraboveleftharpoon: ` M7 , 435 c - 4 , 4 , - 6.3 , 8.7 , - 7 , 14 c0 , 5.3 , 0.7 , 9 , 2 , 11
c1 . 3 , 2 , 5.3 , 5.3 , 12 , 10 c90 . 7 , 54 , 156 , 130 , 196 , 228 c3 . 3 , 10.7 , 6.3 , 16.3 , 9 , 17 c2 , 0.7 , 5 , 1 , 9 ,
1 c0 , 0 , 5 , 0 , 5 , 0 c10 . 7 , 0 , 16.7 , - 2 , 18 , - 6 c2 , - 2.7 , 1 , - 9.7 , - 3 , - 21 c - 32 , - 87.3 , - 82.7 , - 157.7 ,
- 152 , - 211 c0 , 0 , - 3 , - 3 , - 3 , - 3 l399907 , 0 l0 , - 40 c - 399126 , 0 , - 399993 , 0 , - 399993 , 0 z
M93 435 v40 H400000 v - 40 z M500 241 v40 H400000 v - 40 z M500 241 v40 H400000 v - 40 z ` ,shortrightharpoonabovebar: ` M53 , 241 l0 , 40 c398570 , 0 , 399437 , 0 , 399437 , 0
c4 . 7 , - 4.7 , 7 , - 9.3 , 7 , - 14 c0 , - 9.3 , - 3.7 , - 15.3 , - 11 , - 18 c - 92.7 , - 56.7 , - 159 , - 133.7 , - 199 ,
- 231 c - 3.3 , - 9.3 , - 6 , - 14.7 , - 8 , - 16 c - 2 , - 1.3 , - 7 , - 2 , - 15 , - 2 c - 10.7 , 0 , - 16.7 , 2 , - 18 , 6
c - 2 , 2.7 , - 1 , 9.7 , 3 , 21 c15 . 3 , 42 , 36.7 , 81.8 , 64 , 119.5 c27 . 3 , 37.7 , 58 , 69.2 , 92 , 94.5 z
2024-11-06 23:05:30 +00:00
M500 241 v40 H399408 v - 40 z M500 435 v40 H400000 v - 40 z ` },xJe=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+ ` v1759 h347 v - 84
2024-11-04 00:22:50 +00:00
H403z M403 1759 V0 H319 V1759 v ` +t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+ ` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v ` +t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+ ` v585 c2 . 667 , 10 , 9.667 , 15 , 21 , 15
c10 , 0 , 16.667 , - 5 , 20 , - 15 v - 585 v ` +-t+ ` v - 585 c - 2.667 , - 10 , - 9.667 , - 15 , - 21 , - 15
c - 10 , 0 , - 16.667 , 5 , - 20 , 15 z M188 15 H145 v585 v ` +t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+ ` v585 c2 . 667 , 10 , 9.667 , 15 , 21 , 15
c10 , 0 , 16.667 , - 5 , 20 , - 15 v - 585 v ` +-t+ ` v - 585 c - 2.667 , - 10 , - 9.667 , - 15 , - 21 , - 15
c - 10 , 0 , - 16.667 , 5 , - 20 , 15 z M188 15 H145 v585 v ` +t+ ` v585 h43z
M367 15 v585 v ` +t+ ` v585 c2 . 667 , 10 , 9.667 , 15 , 21 , 15
c10 , 0 , 16.667 , - 5 , 20 , - 15 v - 585 v ` +-t+ ` v - 585 c - 2.667 , - 10 , - 9.667 , - 15 , - 21 , - 15
c - 10 , 0 , - 16.667 , 5 , - 20 , 15 z M410 15 H367 v585 v ` +t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+ ` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v ` +t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+ ` v1799 H0 v - 84 H319z
MM319 602 V0 H403 V602 v ` +t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+ ` v602 h84z
M403 1759 V0 H319 V1759 v ` +t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+ ` v602 h84z
M347 1759 V0 h - 84 V1759 v ` +t+" v602 h84z";case"lparen":return ` M863 , 9 c0 , - 2 , - 2 , - 5 , - 6 , - 9 c0 , 0 , - 17 , 0 , - 17 , 0 c - 12.7 , 0 , - 19.3 , 0.3 , - 20 , 1
c - 5.3 , 5.3 , - 10.3 , 11 , - 15 , 17 c - 242.7 , 294.7 , - 395.3 , 682 , - 458 , 1162 c - 21.3 , 163.3 , - 33.3 , 349 ,
- 36 , 557 l0 , ` +(t+84)+ ` c0 . 2 , 6 , 0 , 26 , 0 , 60 c2 , 159.3 , 10 , 310.7 , 24 , 454 c53 . 3 , 528 , 210 ,
949.7 , 470 , 1265 c4 . 7 , 6 , 9.7 , 11.7 , 15 , 17 c0 . 7 , 0.7 , 7 , 1 , 19 , 1 c0 , 0 , 18 , 0 , 18 , 0 c4 , - 4 , 6 , - 7 , 6 , - 9
c0 , - 2.7 , - 3.3 , - 8.7 , - 10 , - 18 c - 135.3 , - 192.7 , - 235.5 , - 414.3 , - 300.5 , - 665 c - 65 , - 250.7 , - 102.5 ,
- 544.7 , - 112.5 , - 882 c - 2 , - 104 , - 3 , - 167 , - 3 , - 189
l0 , - ` +(t+92)+ ` c0 , - 162.7 , 5.7 , - 314 , 17 , - 454 c20 . 7 , - 272 , 63.7 , - 513 , 129 , - 723 c65 . 3 ,
- 210 , 155.3 , - 396.3 , 270 , - 559 c6 . 7 , - 9.3 , 10 , - 15.3 , 10 , - 18 z ` ;case"rparen":return ` M76 , 0 c - 16.7 , 0 , - 25 , 3 , - 25 , 9 c0 , 2 , 2 , 6.3 , 6 , 13 c21 . 3 , 28.7 , 42.3 , 60.3 ,
63 , 95 c96 . 7 , 156.7 , 172.8 , 332.5 , 228.5 , 527.5 c55 . 7 , 195 , 92.8 , 416.5 , 111.5 , 664.5
c11 . 3 , 139.3 , 17 , 290.7 , 17 , 454 c0 , 28 , 1.7 , 43 , 3.3 , 45 l0 , ` +(t+9)+ `
c - 3 , 4 , - 3.3 , 16.7 , - 3.3 , 38 c0 , 162 , - 5.7 , 313.7 , - 17 , 455 c - 18.7 , 248 , - 55.8 , 469.3 , - 111.5 , 664
c - 55.7 , 194.7 , - 131.8 , 370.3 , - 228.5 , 527 c - 20.7 , 34.7 , - 41.7 , 66.3 , - 63 , 95 c - 2 , 3.3 , - 4 , 7 , - 6 , 11
c0 , 7.3 , 5.7 , 11 , 17 , 11 c0 , 0 , 11 , 0 , 11 , 0 c9 . 3 , 0 , 14.3 , - 0.3 , 15 , - 1 c5 . 3 , - 5.3 , 10.3 , - 11 , 15 , - 17
c242 . 7 , - 294.7 , 395.3 , - 681.7 , 458 , - 1161 c21 . 3 , - 164.7 , 33.3 , - 350.7 , 36 , - 558
l0 , - ` +(t+144)+ ` c - 2 , - 159.3 , - 10 , - 310.7 , - 24 , - 454 c - 53.3 , - 528 , - 210 , - 949.7 ,
2024-11-11 23:13:41 +00:00
- 470 , - 1265 c - 4.7 , - 6 , - 9.7 , - 11.7 , - 15 , - 17 c - 0.7 , - 0.7 , - 6.7 , - 1 , - 18 , - 1 z ` ;default:throw new Error("Unknown stretchy delimiter.")}};class Nd{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Et.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var $ i={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.755
` +N+" children.");for(var H=0;H<N;H++){var q=new No(E[H]),ie=new Os([q],{width:"400em",height:Je(w),viewBox:"0 0 "+a+" "+A,preserveAspectRatio:C[H]+" slice"}),D=ve.makeSvgSpan([L[H]],[ie],t);if(N===1)return{span:D,minWidth:x,height:w};D.style.height=Je(w),_.push(D)}return{span:ve.makeSpan(["stretchy"],_,t),minWidth:x,height:w}}}var{span:i,minWidth:s,height:o}=r();return i.height=o,i.style.height=Je(o),s>0&&(i.style.minWidth=Je(s)),i},aet=function(e,t,r,i,s){var o,a=e.height+e.depth+r+i;if(/fbox|color|angl/.test(t)){if(o=ve.makeSpan(["stretchy",t],[],s),t==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var d=[];/^[bx]cancel $ /.test(t)&&d.push(new d1({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel $ /.test(t)&&d.push(new d1({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Os(d,{width:"100%",height:Je(a)});o=ve.makeSvgSpan([],[u],s)}return o.height=a,o.style.height=Je(a),o},Ls={encloseSpan:aet,mathMLnode:ret,svgSpan:oet};function Ut(n,e){if(!n||n.type!==e)throw new Error("Expected node of type "+e+", but got "+(n?"node of type "+n.type:String(n)));return n}function Wv(n){var e=Wh(n);if(!e)throw new Error("Expected node of symbol group type, but got "+(n?"node of type "+n.type:String(n)));return e}function Wh(n){return n&&(n.type==="atom"||IJe.hasOwnProperty(n.type))?n:null}var Kv=(n,e)=>{var t,r,i;n&&n.type==="supsub"?(r=Ut(n.base,"accent"),t=r.base,n.base=t,i=NJe(Zt(n,e)),n.base=r):(r=Ut(n,"accent"),t=r.base);var s=Zt(t,e.havingCrampedStyle()),o=r.isShifty&&Et.isCharacterBox(t),a=0;if(o){var l=Et.getBaseElem(t),d=Zt(l,e.havingCrampedStyle());a=SC(d).skew}var u=r.label===" \\ c",m=u?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),f;if(r.isStretchy)f=Ls.svgSpan(r,e),f=ve.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+Je(2*a)+")",marginLeft:Je(2*a)}:void 0}]},e);else{var g,h;r.label===" \\ vec"?(g=ve.staticSvg("vec",e),h=ve.svgData.vec[1]):(g=ve.makeOrd({mode:r.mode,text:r.label},e,"textord"),g=SC(g),g.italic=0,h=g.width,u&&(m+=g.depth)),f=ve.makeSpan(["accent-body"],[g]);var v=r.label===" \\ textcircled";v&&(f.classes.push("accent-full"),m=s.height);var b=a;v||(b-=h/2),f.style.left=Je(b),r.label===" \\ textcircled"&&(f.style.top=".2em"),f=ve.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-m},{type:"elem",elem:f}]},e)}var _=ve.makeSpan(["mord","accent"],[f],e);return i?(i.children[0]=_,i.height=Math.max(_.height,i.height),i.classes[0]="mord",i):_},XN=(n,e)=>{var t=n.isStretchy?Ls.mathMLnode(n.label):new Ke.MathNode("mo",[mi(n.label,n.mode)]),r=new Ke.MathNode("mover",[fn(n.base,e),t]);return r.setAttribute("accent","true"),r},cet=new RegExp([" \\ acute"," \\ grave"," \\ ddot"," \\ tilde"," \\ bar"," \\ breve"," \\ check"," \\ hat"," \\ vec"," \\ dot"," \\ mathring"].map(n=>" \\ "+n).join("|"));st({type:"accent",names:[" \\ acute"," \\ grave"," \\ ddot"," \\ tilde"," \\ bar"," \\ breve"," \\ check"," \\ hat"," \\ vec"," \\ dot"," \\ mathring"," \\ widecheck"," \\ widehat"," \\ widetilde"," \\ overrightarrow"," \\ overleftarrow"," \\ Overrightarrow"," \\ overleftrightarrow"," \\ overgroup"," \\ overlinesegment"," \\ overleftharpoon"," \\ overrightharpoon"],props:{numArgs:1},handler:(n,e)=>{var t=zp(e[0]),r=!cet.test(n.funcName),i=!r||n.funcName===" \\ widehat"||n.funcName===" \\ widetilde"||n.funcName===" \\ widecheck";return{type:"accent",mode:n.parser.mode,label:n.funcName,isStretchy:r,isShifty:i,base:t}},htmlBuilder:Kv,mathmlBuilder:XN});st({type:"accent",names:[" \\ '"," \\ ` "," \ \ ^ "," \ \ ~ "," \ \ = "," \ \ u "," \ \ . ",'\\" ',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(n,e)=>{var t=e[0],r=n.parser.mode;return r==="math"&&(n.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX' s accent "+n.funcName+" works only in text mode "),r=" text "),{type:" accent ",mode:r,label:n.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Kv,mathmlBuilder:XN});st({type:" accentUnder ",names:[" \ \ underleftar
2024-11-06 23:05:30 +00:00
] ` ,Fet=" \\ \\ [a-zA-Z@]+",Uet=" \\ \\ [^ \u D800- \u DFFF]",Bet="("+Fet+")"+Tk+"*",Get= ` \ \ \ \ (
2024-11-04 00:22:50 +00:00
| [ \ r ] +
2024-11-06 23:05:30 +00:00
? ) [ \ r ] * ` ,g1="[̀-ͯ]",zet=new RegExp(g1+"+ $ "),Vet="("+Tk+"+)|"+(Get+"|")+"([!- \\ [ \\ ]-‧-豈-]"+(g1+"*")+"|[ \u D800- \u DBFF][ \u DC00- \u DFFF]"+(g1+"*")+"| \\ \\ verb \\ *([^]).*? \\ 4| \\ \\ verb([^*a-zA-Z]).*? \\ 5"+("|"+Bet)+("|"+Uet+")");class WC{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Vet,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new li("EOF",new Fr(this,t,t));var r=this.tokenRegex.exec(e);if(r===null||r.index!==t)throw new Qe("Unexpected character: '"+e[t]+"'",new li(e[t],new Fr(this,t,t+1)));var i=r[6]||r[3]||(r[2]?" \\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf( `
` ,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $ )")):this.tokenRegex.lastIndex=s+1,this.lex()}return new li(i,new Fr(this,t,this.tokenRegex.lastIndex))}}class Het{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Qe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,r){if(r===void 0&&(r=!1),r){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var qet=hk;P(" \\ noexpand",function(n){var e=n.popToken();return n.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});P(" \\ expandafter",function(n){var e=n.popToken();return n.expandOnce(!0),{tokens:[e],numArgs:0}});P(" \\ @firstoftwo",function(n){var e=n.consumeArgs(2);return{tokens:e[0],numArgs:0}});P(" \\ @secondoftwo",function(n){var e=n.consumeArgs(2);return{tokens:e[1],numArgs:0}});P(" \\ @ifnextchar",function(n){var e=n.consumeArgs(3);n.consumeSpaces();var t=n.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});P(" \\ @ifstar"," \\ @ifnextchar *{ \\ @firstoftwo{#1}}");P(" \\ TextOrMath",function(n){var e=n.consumeArgs(2);return n.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var KC={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};P(" \\ char",function(n){var e=n.popToken(),t,r="";if(e.text==="'")t=8,e=n.popToken();else if(e.text==='"')t=16,e=n.popToken();else if(e.text===" ` ")if(e=n.popToken(),e.text[0]===" \ \ ")r=e.text.charCodeAt(1);else{if(e.text===" EOF ")throw new Qe(" \ \ char ` missing argument");r=e.text.charCodeAt(0)}else t=10;if(t){if(r=KC[e.text],r==null||r>=t)throw new Qe("Invalid base-"+t+" digit "+e.text);for(var i;(i=KC[n.future().text])!=null&&i<t;)r*=t,r+=i,n.popToken()}return" \\ @char{"+r+"}"});var ny=(n,e,t)=>{var r=n.consumeArg().tokens;if(r.length!==1)throw new Qe(" \\ newcommand's first argument must be a macro name");var i=r[0].text,s=n.isDefined(i);if(s&&!e)throw new Qe(" \\ newcommand{"+i+"} attempting to redefine "+(i+"; use \\ renewcommand"));if(!s&&!t)throw new Qe(" \\ renewcommand{"+i+"} when command "+i+" does not yet exist; use \\ newcommand");var o=0;if(r=n.consumeArg().tokens,r.length===1&&r[0].text==="["){for(var a="",l=n.expandNextToken();l.text!=="]"&&l.text!=="EOF";)a+=l.text,l=n.expandNextToken();if(!a.match(/^ \s *[0-9]+ \s * $ /))throw new Qe("Invalid number of arguments: "+a);o=parseInt(a),r=n.consumeArg().tokens}return n.macros.set(i,{tokens:r,numArgs:o}),""};P(" \\ newcommand",n=>ny(n,!1,!0));P(" \\ renewcommand",n=>ny(n,!0,!1));P(" \\ providecommand",n=>ny(n,!0,!0));P(" \\ message",n=>{var e=n.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});P(" \\ errmessage",n=>{var e=n.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});P(" \\ show",n=>{var e=n.popToken(),t=e.text;return console.log(e,n.macros.get(t),_o[t],_n.math[t],_n.text[t]),""});P(" \\ bgroup","{");P(" \\ egroup","}");P("~"," \\ nobreakspace");P(" \\ lq"," ` ");P(" \ \ rq "," ' ");P(" \ \ aa "," \ \ r a ");P(" \ \ AA "," \ \ r A ");P(" \ \ textcopyright "," \ \ html @ mathml { \ \ textcircled { c } } { \ \ char ` ©}");P(" \\ copyright"," \\ TextOrMath{ \\ textcopyright
please report what input caused this bug ` );return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}XC.hasOwnProperty(t[0])&&!_n[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=XC[t[0]]+t.slice(1));var s=zet.exec(t);s&&(t=t.substring(0,s.index),t==="i"?t="ı ":t==="j"&&(t="ȷ"));var o;if(_n[this.mode][t]){this.settings.strict&&this.mode==="math"&&u1.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a=_n[this.mode][t].group,l=Fr.range(e),d;if(kJe.hasOwnProperty(a)){var u=a;d={type:"atom",mode:this.mode,family:u,loc:l,text:t}}else d={type:a,mode:this.mode,loc:l,text:t};o=d}else if(t.charCodeAt(0)>=128)this.settings.strict&&(PN(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:Fr.range(e),text:t};else return null;if(this.consume(),s)for(var m=0;m<s[0].length;m++){var f=s[0][m];if(! $ 0[f])throw new Qe("Unknown accent ' "+f+"'",e);var g= $ 0[f][this.mode]|| $ 0[f].text;if(!g)throw new Qe("Accent "+f+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Fr.range(e),label:g,isStretchy:!1,isShifty:!0,base:o}}return o}}Xh.endOfExpression=["}"," \\ endgroup"," \\ end"," \\ right","&"];var iy=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Xh(e,t);delete r.gullet.macros.current[" \\ df@tag"];var i=r.parse();if(delete r.gullet.macros.current[" \\ current@color"],delete r.gullet.macros.current[" \\ color"],r.gullet.macros.get(" \\ df@tag")){if(!t.displayMode)throw new Qe(" \\ tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new li(" \\ df@tag")])}]}return i},Rk=function(e,t,r){t.textContent="";var i=sy(e,r).toNode();t.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Rk=function(){throw new Qe("KaTeX doesn't work in quirks mode.")});var $ et=function(e,t){var r=sy(e,t).toMarkup();return r},Wet=function(e,t){var r=new Gv(t);return iy(e,r)},Mk=function(e,t,r){if(r.throwOnError||!(e instanceof Qe))throw e;var i=ve.makeSpan(["katex-error"],[new hi(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+r.errorColor),i},sy=function(e,t){var r=new Gv(t);try{var i=iy(e,r);return eet(i,e,r)}catch(s){return Mk(s,e,r)}},Ket=function(e,t){var r=new Gv(t);try{var i=iy(e,r);return tet(i,e,r)}catch(s){return Mk(s,e,r)}},jet={version:"0.16.11",render:Rk,renderToString: $ et,ParseError:Qe,SETTINGS_SCHEMA:sp,__parse:Wet,__renderToDomTree:sy,__renderToHTMLTree:Ket,__setFontMetrics:TJe,__defineSymbol:S,__defineFunction:st,__defineMacro:P,__domTree:{Span:kd,Anchor:Hv,SymbolNode:hi,SvgNode:Os,PathNode:No,LineNode:d1}};const Qet=Object.freeze(Object.defineProperty({__proto__:null,default:jet},Symbol.toStringTag,{value:"Module"})),Xet=X3(Qet);(function(n){function e(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function t(r,i){const s=t.mergeDelimiters(i&&i.delimiters),o=i&&i.outerSpace||!1,a=i&&i.katexOptions||{};a.throwOnError=a.throwOnError||!1,a.macros=a.macros||i&&i.macros,t.katex||(i&&typeof i.engine=="object"?t.katex=i.engine:t.katex=Xet);for(const l of s.inline)o&&"outerSpace"in l&&(l.outerSpace=!0),r.inline.ruler.before("escape",l.name,t.inline(l)),r.renderer.rules[l.name]=(d,u)=>l.tmpl.replace(/ \$ 1/,t.render(d[u].content,!!l.displayMode,a));for(const l of s.block)r.block.ruler.before("fence",l.name,t.block(l)),r.renderer.rules[l.name]=(d,u)=>l.tmpl.replace(/ \$ 2/,e(d[u].info)).replace(
2024-11-11 23:13:41 +00:00
` }),t=yt([]),r=()=>{if(n.markdownText){let s=e.parse(n.markdownText,{}),o=[];t.value=[];for(let a=0;a<s.length;a++)s[a].type!=="fence"?o.push(s[a]):(o.length>0&&(t.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[]),t.value.push({type:"code",language:Zet(s[a].info),code:s[a].content}));o.length>0&&(t.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[])}else t.value=[];We(()=>{Ze.replace()})},i=(s,o)=>{t.value[s].code=o};return Zn(()=>n.markdownText,r),es(()=>{r(),We(()=>{window.MathJax&&window.MathJax.typesetPromise()})}),{markdownItems:t,updateCode:i}}},ett={class:"break-all container w-full"},ttt={ref:"mdRender",class:"markdown-content"},ntt=["innerHTML"];function rtt(n,e,t,r,i,s){const o=ht("code-block");return T(),M("div",ett,[c("div",ttt,[(T(!0),M(je,null,at(r.markdownItems,(a,l)=>(T(),M("div",{key:l},[a.type==="code"?(T(),Tt(o,{key:0,host:t.host,language:a.language,code:a.code,discussion_id:t.discussion_id,message_id:t.message_id,client_id:t.client_id,onUpdateCode:d=>r.updateCode(l,d)},null,8,["host","language","code","discussion_id","message_id","client_id","onUpdateCode"])):(T(),M("div",{key:1,innerHTML:a.html},null,8,ntt))]))),128))],512)])}const Zh=bt(Jet,[["render",rtt]]),itt={data(){return{show:!1,has_button:!0,message:""}},components:{MarkdownRenderer:Zh},methods:{hide(){this.show=!1,this. $ emit("ok")},showMessage(n){this.message=n,this.has_button=!0,this.show=!0},showBlockingMessage(n){this.message=n,this.has_button=!1,this.show=!0},updateMessage(n){this.message=n,this.show=!0},hideMessage(){this.show=!1}}},stt={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 z-50"},ott={class:"pl-10 pr-10 bg-bg-light dark:bg-bg-dark p-8 rounded-lg shadow-lg"},att={class:"container max-h-500 overflow-y-auto"},ltt={class:"text-lg font-medium"},ctt={class:"mt-4 flex justify-center"},dtt={key:1,"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function utt(n,e,t,r,i,s){const o=ht("MarkdownRenderer");return i.show?(T(),M("div",stt,[c("div",ott,[c("div",att,[c("div",ltt,[W(o,{ref:"mdRender",host:"","markdown-text":i.message,message_id:0,discussion_id:0},null,8,["markdown-text"])])]),c("div",ctt,[i.has_button?(T(),M("button",{key:0,onClick:e[0]||(e[0]=(...a)=>s.hide&&s.hide(...a)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")):Y("",!0),i.has_button?Y("",!0):(T(),M("svg",dtt,e[1]||(e[1]=[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),c("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1)])))])])])):Y("",!0)}const ptt=bt(itt,[["render",utt]]),htt={props:{progress:{type:Number,required:!0}}},mtt={class:"progress-bar-container"};function ftt(n,e,t,r,i,s){return T(),M("div",mtt,[c("div",{class:"progress-bar",style:on({width: ` $ { t . progress } % ` })},null,4)])}const oy=bt(htt,[["render",ftt]]),gtt={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButt
2024-11-06 23:05:30 +00:00
c - 3 - 0.3 - 6 - 0.5 - 8.9 - 0.5 c - 21.7 , 0 - 42.2 , 8.5 - 57.5 , 23.8 l - 20.8 , 20.8 c - 6.7 , 6.7 - 6.7 , 17.6 , 0 , 24.3 l108 . 5 , 108.5 l - 132.4 , 132.4 \ r
c - 6.7 , 6.7 - 6.7 , 17.6 , 0 , 24.3 c3 . 3 , 3.3 , 7.7 , 5 , 12.1 , 5 s8 . 8 - 1.7 , 12.1 - 5 l132 . 5 - 132.5 l108 . 5 , 108.5 c3 . 3 , 3.3 , 7.7 , 5 , 12.1 , 5 s8 . 8 - 1.7 , 12.1 - 5 \ r
l20 . 8 - 20.8 c17 . 6 - 17.6 , 26.1 - 41.8 , 23.3 - 66.4 l - 7 - 63.5 l40 . 3 - 40.3 l16 . 2 , 16.2 c6 . 7 , 6.7 , 17.6 , 6.7 , 24.3 , 0 l72 . 6 - 72.6 c3 . 2 - 3.2 , 5 - 7.6 , 5 - 12.1 \ r
s - 1.8 - 8.9 - 5 - 12.1 L300 . 625 , 5.025 z M400 . 425 , 250.025 l - 16.2 - 16.3 c - 6.4 - 6.4 - 17.8 - 6.4 - 24.3 , 0 l - 58.2 , 58.3 c - 3.7 , 3.7 - 5.5 , 8.8 - 4.9 , 14 \ r
l7 . 9 , 71.6 c1 . 6 , 14.3 - 3.3 , 28.3 - 13.5 , 38.4 l - 8.7 , 8.7 l - 217.1 - 217.1 l8 . 7 - 8.6 c10 . 1 - 10.1 , 24.2 - 15 , 38.4 - 13.5 l71 . 7 , 7.9 \ r
2024-11-11 23:13:41 +00:00
c5 . 2 , 0.6 , 10.3 - 1.2 , 14 - 4.9 l58 . 2 - 58.2 c6 . 7 - 6.7 , 6.7 - 17.6 , 0 - 24.3 l - 16.3 - 16.3 l48 . 3 - 48.3 l160 . 3 , 160.3 L400 . 425 , 250.025 z ` })],-1)]),8,drt))],8,crt),W(o),c("div",{class:"toolbar-button",onMouseleave:e[5]||(e[5]=(...b)=>s.hideInfosMenu&&s.hideInfosMenu(...b))},[c("div",urt,[i.isInfosMenuVisible?(T(),M("div",{key:0,onMouseenter:e[3]||(e[3]=(...b)=>s.showInfosMenu&&s.showInfosMenu(...b)),class:"absolute m-0 p-0 z-50 top-full right-0 transform bg-white dark:bg-gray-900 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[c("div",prt,[c("div",hrt,[s.isModelOK?(T(),M("div",mrt,e[16]||(e[16]=[c("svg",{class:"w-8 h-8",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[c("path",{d:"M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),c("path",{d:"M9 12L11 14L15 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))):(T(),M("div",frt,e[17]||(e[17]=[c("svg",{class:"w-8 h-8",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[c("path",{d:"M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),c("path",{d:"M15 9L9 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),c("path",{d:"M9 9L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))),s.isGenerating?(T(),M("div",_rt,e[19]||(e[19]=[c("svg",{class:"w-6 h-6 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)]))):(T(),M("div",grt,e[18]||(e[18]=[c("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})],-1)]))),s.isConnected?(T(),M("div",brt,e[20]||(e[20]=[c("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1)]))):(T(),M("div",vrt,e[21]||(e[21]=[c("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})],-1)])))]),c("div",yrt,[W(a,{onClick:n.restartProgram,icon:"power",title:"restart program"},null,8,["onClick"]),W(a,{onClick:s.refreshPage,icon:"refresh-ccw",title:"refresh page"},null,8,["onClick"]),W(a,{href:"/docs",icon:"file-text",title:"Fast API doc"})]),W(l,{href:"https://github.com/ParisNeo/lollms-webui",icon:"github"}),W(l,{href:"https://www.youtube.com/channel/UCJzrg0cyQV2Z30SQ1v2FdSQ",icon:"youtube"}),W(l,{href:"https://x.com/ParisNeo_AI",icon:"x"}),W(l,{href:"https://discord.com/channels/1092918764925882418",icon:"discord"}),c("div",Ert,[c("div",{onClick:e[2]||(e[2]=b=>s.showNews()),class:"text-2xl w-8 h-8 cursor-pointer transition-colors duration-300 text-gray-600 hover:text-primary dark:text-gray-300 dark:hover:text-primary"},e[22]||(e[22]=[c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-full h-full"},[c("path",{d:"M19 20H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1m2 13a2 2 0 0 1-2-2V7m2 13a2 2 0 0 0 2-2V9a2
2024-11-04 00:22:50 +00:00
< div class = "bg-white p-6 rounded-md shadow-md w-80" >
< h2 class = "text-lg font-semibold mb-3" > $ { n } < / h 2 >
< textarea id = "replacementInput" class = "w-full h-32 border rounded p-2 mb-3" > $ { e } < / t e x t a r e a >
< div class = "flex justify-end" >
< button id = "cancelButton" class = "mr-2 px-4 py-2 border rounded" > Cancel < / b u t t o n >
< button id = "okButton" class = "px-4 py-2 bg-blue-500 text-white rounded" > OK < / b u t t o n >
< / d i v >
< / d i v >
` :s.innerHTML= `
< div class = "bg-white p-6 rounded-md shadow-md w-80" >
< h2 class = "text-lg font-semibold mb-3" > $ { n } < / h 2 >
< select id = "options_selector" class = "form-control w-full h-25 border rounded p-2 mb-3" >
$ { t . map ( l => ` <option value=" ${ l } "> ${ l } </option> ` ) }
< / s e l e c t >
< div class = "flex justify-end" >
< button id = "cancelButton" class = "mr-2 px-4 py-2 border rounded" > Cancel < / b u t t o n >
< button id = "okButton" class = "px-4 py-2 bg-blue-500 text-white rounded" > OK < / b u t t o n >
< / d i v >
< / d i v >
2024-11-06 23:05:30 +00:00
` ,document.body.appendChild(s);const o=s.querySelector("#cancelButton"),a=s.querySelector("#okButton");o.addEventListener("click",()=>{document.body.removeChild(s),r(null)}),a.addEventListener("click",()=>{if(t.length===0){const d=s.querySelector("#replacementInput").value.trim();document.body.removeChild(s),r(d)}else{const d=s.querySelector("#options_selector").value.trim();document.body.removeChild(s),r(d)}})})}function yot(n,e){console.log(n);let t={},r=/@<([^>]+)>@/g,i=[],s;for(;(s=r.exec(n))!==null;)i.push("@<"+s[1]+">@");console.log("matches"),console.log(i),i=[...new Set(i)];async function o(l){console.log(l);let d=l.toLowerCase().substring(2,l.length-2);if(d!=="generation_placeholder")if(d.includes(":")){Object.entries({all_language_options:"english:french:german:chinese:japanese:spanish:italian:russian:portuguese:swedish:danish:dutch:norwegian:slovak:czech:hungarian:polish:ukrainian:bulgarian:latvian:lithuanian:estonian:maltese:irish:galician:basque:welsh:breton:georgian:turkmen:kazakh:uzbek:tajik:afghan:sri-lankan:filipino:vietnamese:lao:cambodian:thai:burmese:kenyan:botswanan:zimbabwean:malawian:mozambican:angolan:namibian:south-african:madagascan:seychellois:mauritian:haitian:peruvian:ecuadorian:bolivian:paraguayan:chilean:argentinean:uruguayan:brazilian:colombian:venezuelan:puerto-rican:cuban:dominican:honduran:nicaraguan:salvadorean:guatemalan:el-salvadoran:belizean:panamanian:costa-rican:antiguan:barbudan:dominica's:grenada's:st-lucia's:st-vincent's:gibraltarian:faroe-islander:greenlandic:icelandic:jamaican:trinidadian:tobagonian:barbadian:anguillan:british-virgin-islander:us-virgin-islander:turkish:israeli:palestinian:lebanese:egyptian:libyan:tunisian:algerian:moroccan:bahraini:kuwaiti:saudi-arabian:yemeni:omani:irani:iraqi:afghanistan's:pakistani:indian:nepalese:sri-lankan:maldivan:burmese:thai:lao:vietnamese:kampuchean:malaysian:bruneian:indonesian:australian:new-zealanders:fijians:tongans:samoans:vanuatuans:wallisians:kiribatians:tuvaluans:solomon-islanders:marshallese:micronesians:hawaiians",all_programming_language_options:"python:c:c++:java:javascript:php:ruby:go:swift:kotlin:rust:haskell:erlang:lisp:scheme:prolog:cobol:fortran:pascal:delphi:d:eiffel:h:basic:visual_basic:smalltalk:objective-c:html5:node.js:vue.js:svelte:react:angular:ember:clipper:stex:arduino:brainfuck:r:assembly:mason:lepton:seacat:bbc_microbit:raspberry_pi_gpio:raspberry_pi_spi:raspberry_pi_i2c:raspberry_pi_uart:raspberry_pi_adc:raspberry_pi_ddio"}).forEach(([b,_])=>{console.log( ` Key : $ { b } , Value : $ { _ } ` );function y(A){return A.replace(/[.*+?^ ${ } ()|[ \] \\ ]/g," \\ $ &")}const E=y(b),x=new RegExp(E,"g");d=d.replace(x,_)});let m=d.split(":"),f=m[0],g=m[1]||"",h=[];m.length>2&&(h=m.slice(1));let v=await pA(f,g,h);v!==null&&(t[l]=v)}else{let u=await pA(d);u!==null&&(t[l]=u)}}let a=Promise.resolve();i.forEach(l=>{a=a.then(()=>o(l)).then(d=>{console.log(d)})}),a.then(()=>{Object.entries(t).forEach(([l,d])=>{console.log( ` Key : $ { l } , Value : $ { d } ` );function u(g){return g.replace(/[.*+?^ ${ } ()|[ \] \\ ]/g," \\ $ &")}const m=u(l),f=new RegExp(m,"g");n=n.replace(f,d)}),e(n)})}const Eot={name:"PlayGroundView",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},showSettings:!1,pending:!1,is_recording:!1,is_deaf_transcribing:!1,cpp_block:Qk,html5_block:Xk,LaTeX_block:Zk,javascript_block:Kk,json_block:jk,code_block: $ k,python_block:Wk,bash_block:Jk,tokenize_icon:est,deaf_off:nst,deaf_on:tst,rec_off:ist,rec_on:rst,loading_icon:eI,isSynthesizingVoice:!1,audio_url:null,mdRenderHeight:300,selecting_model:!1,tab_id:"source",generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:[],selectedPreset:"",cursorPosition:0,namedTokens:[],text:"",pre_text:"",post_text:"",temperature:.1,top_k:50,top_p:.9,repeat_penalty:1.3,repeat_last_n:50,n_crop:-1,n_predicts:2e3,seed:-1,silenceTimeout:5e3}},components:{Toast:ay,MarkdownRenderer:Zh,ClipBoardTextInput:hy,TokensHilighter:Wit,ChatBarButton:Yk,Card:tm,ToolbarButton:my,DropdownMenu:dI},mounted(){de.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,th
2024-11-04 00:22:50 +00:00
` ?(this.text=this.text.slice(0,e)+" ` ` ` "+n+" \ n \ n ` ` ` \n "+this.text.slice(e),e=e+4+n.length):(this.text=this.text.slice(0,e)+" \n ` ` ` "+n+" \ n \ n ` ` ` \n "+this.text.slice(e),e=e+3+n.length):speechSynthesis==0||this.text[e-1]== `
` ?(this.text=this.text.slice(0,e)+" ` ` ` " + n + `
` +this.text.slice(e,t)+" \n ` ` ` \ n "+this.text.slice(t),e=e+4+n.length):(this.text=this.text.slice(0,e)+" \ n ` ` ` "+n+ `
` +this.text.slice(e,t)+" \n ` ` ` \ n "+this.text.slice(t),e=e+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},insertTab(n){const e=n.target,t=e.selectionStart,r=e.selectionEnd,i=e.value.substring(0,t),s=e.value.substring(r),o=i+" "+s;this.text=o,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4}),n.preventDefault()},mdTextarea_changed(){console.log(" mdTextarea _changed "),this.cursorPosition=this.$refs.mdTextarea.selectionStart},mdTextarea_clicked(){console.log(`mdTextarea_clicked: ${this.$refs.mdTextarea.selectionStart}`),this.cursorPosition=this.$refs.mdTextarea.selectionStart},setModel(){this.selecting_model=!0,de.post(" / update _setting ",{client_id:this.$store.state.client_id,setting_name:" model _name ",setting_value:this.selectedModel}).then(n=>{console.log(n),n.status&&this.$refs.toast.showToast(`Model changed to ${this.selectedModel}`,4,!0),this.selecting_model=!1}).catch(n=>{this.$refs.toast.showToast(`Error ${n}`,4,!0),this.selecting_model=!1})},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){console.log(" READING ... "),this.isSynthesizingVoice=!0;let n=this.$refs.mdTextarea.selectionStart,e=this.$refs.mdTextarea.selectionEnd,t=this.text;n!=e&&(t=t.slice(n,e)),de.post(" . / text2Wave ",{client_id:this.$store.state.client_id,text:t}).then(r=>{console.log(r.data.url);let i=r.data.url;this.audio_url=i,this.isSynthesizingVoice=!1,We(()=>{Ze.replace()})}).catch(r=>{this.$refs.toast.showToast(`Error: ${r}`,4,!1),this.isSynthesizingVoice=!1,We(()=>{Ze.replace()})})},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log(" voice on "),this.isSpeaking=!0;const e=200;this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(i=>i.name===this.$store.state.config.audio_out_voice)[0]);const t=i=>{let s=this.text.substring(i,i+e);const o=[" . "," ! "," ? " , `
2024-11-06 23:05:30 +00:00
` ];let a=-1;return o.forEach(l=>{const d=s.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=s.length),console.log(a),a+i+1},r=()=>{const i=t(n),s=this.text.substring(n,i);this.msg.text=s,n=i+1,this.msg.onend=o=>{n<this.text.length-2?setTimeout(()=>{r()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",i))},this.speechSynthesis.speak(this.msg)};r()},getCursorPosition(){return this. $ refs.mdTextarea.selectionStart},appendToOutput(n){this.pre_text+=n,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let n=this.text.indexOf("@<generation_placeholder>@");if(n<0){this. $ refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,n)+this.text.substring(n+26,this.text.length),this.pre_text=this.text.substring(0,n),this.post_text=this.text.substring(n,this.text.length);var e=this.text.substring(0,n);console.log(e),rt.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},async tokenize_text(){const n=await de.post("/lollms_tokenize",{prompt:this.text},{headers:this.posts_headers});console.log(n.data.named_tokens),this.namedTokens=n.data.named_tokens},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var n=this.text.substring(0,this.getCursorPosition());console.log(this.text),console.log( ` cursor position : $ { this . getCursorPosition ( ) } ` ),console.log( ` pretext : $ { this . pre _text } ` ),console.log( ` post _text : $ { this . post _text } ` ),console.log( ` prompt : $ { n } ` ),rt.emit("generate_text",{prompt:n,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){rt.emit("cancel_text_generation",{})},exportText(){const n=this.text,e=document.createElement("a"),t=new Blob([n],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const n=document.getElementById("import-input");n&&(n.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const t=new FileReader;t.onload=()=>{this.text=t.result},t.readAsText(e.target.files[0])}else alert("Please select a file.")}),n.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=yot(this.selectedPreset.content,n=>{console.log("Done"),console.log(n),this.text=n})},addPreset(){let n=prompt("Enter the title of the preset:");this.presets[n]={client_id:this. $ store.state.client_id,name:n,content:this.text},de.post("./add_preset",this.presets[n]).then(e=>{console.log(e.data)}).catch(e=>{this. $ refs.toast.showToast( ` Error : $ { e } ` ,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){de.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this. $ refs.toast.showToast( ` Error : $ { n } ` ,4,!1)})},startRecording(){this.pending=!0,this.is_recording?de.post("/stop_recording",{client_id:this. $ store.state.client_id}).then(n=>{this.is_recording=!1,this.pending=!1,console.log(n),this.text+=n.data,console.log("text"),console.log(this.text),console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this. $ refs.toast.showToast( ` Error : $ { n } ` ,4,!1)}):de.post("/start_recording",{client_id:this. $ store.state.client_id}).then(n=>{this.is_recording=!0,this.pending=!1,console.log(n.data)}).catch(n=>{this. $ refs.toast.showToast( ` Error : $ { n } ` ,4,!1)})},startRecordingAndTranscribing(){this.pending=!0,this.is_deaf_transcribing?de.get("/stop_recording").then(n=>{this.is_dea
2024-11-04 00:22:50 +00:00
` ).map(i=>{const s=i.match(/^ \s +/);if(s===null)return i;const[o]=s;return o.length>=r.length?i.slice(r.length):i}).join( `
` )}class Hp{constructor(e){pn(this,"options");pn(this,"rules");pn(this,"lexer");this.options=e||ka}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(/^(?: {1,4}| {0,3} \t )/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:yc(r, `
2024-11-06 23:05:30 +00:00
` )}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],i=vat(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation," $ 1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/# $ /.test(r)){const i=yc(r,"#");(this.options.pedantic||!i||/ $ /.test(i))&&(r=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:yc(t[0], `
2024-11-04 00:22:50 +00:00
` )}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=yc(t[0], `
` ).split( `
` ),i="",s="";const o=[];for(;r.length>0;){let a=!1;const l=[];let d;for(d=0;d<r.length;d++)if(/^ {0,3}>/.test(r[d]))l.push(r[d]),a=!0;else if(!a)l.push(r[d]);else break;r=r.slice(d);const u=l.join( `
` ),m=u.replace(/ \n {0,3}((?:=+|-+) *)(?= \n | $ )/g, `
$1 ` ).replace(/^ {0,3}>[ \t ]?/gm,"");i=i? ` $ { i }
$ { u } ` :u,s=s? ` $ { s }
$ { m } ` :m;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,o,!0),this.lexer.state.top=f,r.length===0)break;const g=o[o.length-1];if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){const h=g,v=h.raw+ `
` +r.join( `
` ),b=this.blockquote(v);o[o.length-1]=b,i=i.substring(0,i.length-h.raw.length)+b.raw,s=s.substring(0,s.length-h.text.length)+b.text;break}else if((g==null?void 0:g.type)==="list"){const h=g,v=h.raw+ `
` +r.join( `
` ),b=this.list(v);o[o.length-1]=b,i=i.substring(0,i.length-g.raw.length)+b.raw,s=s.substring(0,s.length-h.raw.length)+b.raw,r=v.substring(o[o.length-1].raw.length).split( `
` );continue}}return{type:"blockquote",raw:i,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const i=r.length>1,s={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i? ` \ \ d { 1 , 9 } \ \ $ { r . slice ( - 1 ) } ` : ` \ \ $ { r } ` ,this.options.pedantic&&(r=i?r:"[*+-]");const o=new RegExp( ` ^ ( { 0 , 3 } $ { r } ) ( ( ? : [ ] [ ^ \ \ n ] * ) ? ( ? : \ \ n | $ ) ) ` );let a=!1;for(;e;){let l=!1,d="",u="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let m=t[2].split( `
` ,1)[0].replace(/^ \t +/,_=>" ".repeat(3*_.length)),f=e.split( `
` ,1)[0],g=!m.trim(),h=0;if(this.options.pedantic?(h=2,u=m.trimStart()):g?h=t[1].length+1:(h=t[2].search(/[^ ]/),h=h>4?1:h,u=m.slice(h),h+=t[1].length),g&&/^[ \t ]* $ /.test(f)&&(d+=f+ `
` ,e=e.substring(f.length+1),l=!0),!l){const _=new RegExp( ` ^ { 0 , $ { Math . min ( 3 , h - 1 ) } } ( ? : [ * + - ] | \ \ d { 1 , 9 } [ . ) ] ) ( ( ? : [ ] [ ^ \ \ n ] * ) ? ( ? : \ \ n | $ ) ) ` ),y=new RegExp( ` ^ { 0 , $ { Math . min ( 3 , h - 1 ) } } ( ( ? : - * ) { 3 , } | ( ? : _ * ) { 3 , } | ( ? : \ \ * * ) { 3 , } ) ( ? : \ \ n + | $ ) ` ),E=new RegExp( ` ^ { 0 , $ { Math . min ( 3 , h - 1 ) } } ( ? : \ ` \` \` |~~~) ` ) , x = new RegExp ( ` ^ {0, ${ Math . min ( 3 , h - 1 ) } }# ` ) , A = new RegExp ( ` ^ {0, ${ Math . min ( 3 , h - 1 ) } }<[a-z].*> ` , "i" ) ; for ( ; e ; ) { const w = e . split ( `
` ,1)[0];let N;if(f=w,this.options.pedantic?(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," "),N=f):N=f.replace(/ \t /g," "),E.test(f)||x.test(f)||A.test(f)||_.test(f)||y.test(f))break;if(N.search(/[^ ]/)>=h||!f.trim())u+= `
` +N.slice(h);else{if(g||m.replace(/ \t /g," ").search(/[^ ]/)>=4||E.test(m)||x.test(m)||y.test(m))break;u+= `
` +f}!g&&!f.trim()&&(g=!0),d+=w+ `
2024-11-06 23:05:30 +00:00
` ,e=e.substring(w.length+1),m=N.slice(h)}}s.loose||(a?s.loose=!0:/ \n [ \t ]* \n [ \t ]* $ /.test(d)&&(a=!0));let v=null,b;this.options.gfm&&(v=/^ \[ [ xX] \] /.exec(u),v&&(b=v[0]!=="[ ] ",u=u.replace(/^ \[ [ xX] \] +/,""))),s.items.push({type:"list_item",raw:d,task:!!v,checked:b,loose:!1,text:u,tokens:[]}),s.raw+=d}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const d=s.items[l].tokens.filter(m=>m.type==="space"),u=d.length>0&&d.some(m=>/ \n .* \n /.test(m.raw));s.loose=u}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(/ \s +/g," "),i=t[2]?t[2].replace(/^<(.*)> $ /," $ 1").replace(this.rules.inline.anyPunctuation," $ 1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation," $ 1"):t[3];return{type:"def",tag:r,raw:t[0],href:i,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const r=fA(t[1]),i=t[2].replace(/^ \| | \| * $ /g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/ \n [ \t ]* $ /,"").split( `
` ):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===i.length){for(const a of i)/^ *-+: * $ /.test(a)?o.align.push("right"):/^ *:-+: * $ /.test(a)?o.align.push("center"):/^ *:-+ * $ /.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(const a of s)o.rows.push(fA(a,o.header.length).map((l,d)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[d]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)=== `
` ?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ur(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^< \/ a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)( \s |>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^< \/ (pre|code|kbd|script)( \s |>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/> $ /.test(r))return;const o=yc(r.slice(0,-1)," \\ ");if((r.length-o.length)%2===0)return}else{const o=bat(t[2],"()");if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^ \s ]) \s +(['"])(.*) \2 /.exec(i);o&&(i=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/> $ /.test(r)?i=i.slice(1):i=i.slice(1,-1)),gA(t,{href:i&&i.replace(this.rules.inline.anyPunctuation," $ 1"),title:s&&s.replace(this.rules.inline.anyPunctuation," $ 1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const i=(r[2]||r[1]).replace(/ \s +/g," "),s=t[i.toLowerCase()];if(!s){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return gA(r,s,r[0],this.lexer)}}emStrong(e,t,r=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&r.match(/[ \p {L} \p {N}]/u))return;if(!(i[1]||i[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const o=[...i[0]].length-1;let a,l,d=o,u=0;const m=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+o);(i=m.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(l=[...a].length,i[3]||i[4]){d+=l;continue}else if((i[5]||i[6])&&o%3&&!((o+l)%3)){u+=l;continue}if(d-=l,d>0)continue;l=Math.min(l,l+d+u);const f=[...i[0]][0].length,g=e.slice(0,o+i.index+f+l);if(Math.min(o,l)%2){const v=g.slice(1,-1);return{type:"em",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}const h=g.slice(2,-2);return{type:"strong",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/ \n /g," ");const i=/[^ ]/.test(r),s=/^ /.test(r)&&/ $ /.test(r);return i&&s&&(r=r.substring(1,r.length-1)),r=Ur(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,i;return t[2]==="@"?(r=Ur(t[1]),i="mailto:"+r):(r=Ur(t[1]),i=r),{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let t;if(t=this.rules.inline.url.exec(e)){let i,s;if(t[2]==="@")i=Ur(t[0]),s="mailto:"+i;else{let o;do o=t[0],t[0]=((r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])??"";while(o!==t[0]);i=Ur(t[0]),t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let r;return this.lexer.state.inRawBlock?r=t[0]:r=Ur(t[0]),{type:"text",raw:t[0],text:r}}}}const yat=/^(?:[ \t ]*(?: \n | $ ))+/,Eat=/^((?: {4}| {0,3} \t )[^ \n ]+(?: \n (?:[ \t ]*(?: \n | $ ))*)?)+/,Sat=/^ {0,3}( ` { 3 , } ( ? = [ ^ ` \n ]*(?: \n | $ ))|~{3,})([^ \n ]*)(?: \n | $ )(?:|([ \s \S ]*?)(?: \n | $ ))(?: {0,3} \1 [~ ` ] * * ( ? = \ n | $ ) | $ ) / , Ld = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/ , xat = / ^ { 0 , 3 } ( # { 1 , 6 } ) ( ? = \ s | $
] ` ).replace("lheading",fI).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_I=/^ \\ ([!"# $ %&'()*+, \- ./:;<=>?@ \[ \] \\ ^_ ` { | } ~ ] ) / , kat = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/ , bI = /^( {2,}|\\)\n(?!\s*$)/ , Iat = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/ , Pd = "\\p{P}\\p{S}" , Oat = dn ( /^((?![*_])[\spunctuation])/ , "u" ) . replace ( /punctuation/g , Pd ) . getRegex ( ) , Dat = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g , Lat = dn ( /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/ , "u" ) . replace ( /punct/g , Pd ) . getRegex ( ) , Pat = dn ( "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])" , "gu" ) . replace ( /punct/g , Pd ) . getRegex ( ) , Fat = dn ( "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])" , "gu" ) . replace ( /punct/g , Pd ) . getRegex ( ) , Uat = dn ( /\\([punct])/ , "gu" ) . replace ( /punct/g , Pd ) . getRegex ( ) , Bat = dn ( /^<(scheme:[^\s\x00-\x1f<>]*|email)>/ ) . replace ( "scheme" , /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/ ) . replace ( "email" , /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/ ) . getRegex ( ) , Gat = dn ( wy ) . replace ( "(?:-->|$)" , "-->" ) . getRegex ( ) , zat = dn ( "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>" ) . replace ( "comment" , Gat ) . replace ( "attribute" , /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/ ) . getRegex ( ) , qp = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/ , Vat = dn ( /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/ ) . replace ( "label" , qp ) . replace ( "href" , /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/ ) . replace ( "title" , /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/ ) . getRegex ( ) , vI = dn ( /^!?\[(label)\]\[(ref)\]/ ) . replace ( "label" , qp ) . replace ( "ref" , Ty ) . getRegex ( ) , yI = dn ( /^!?\[(ref)\](?:\[\])?/ ) . replace ( "ref" , Ty ) . getRegex ( ) , Hat = dn ( "reflink|nolink(?!\\()" , "g" ) . replace ( "reflink" , vI ) . replace ( "nolink" , yI ) . getRegex ( ) , Ay = { _backpedal : Wc , anyPunctuation : Uat , autolink : Bat , blockSkip : Dat , br : bI , code : kat , del : Wc , emStrongLDelim : Lat , emStrongRDelimAst : Pat , emStrongRDelimUnd : Fat , escape : _I , link : Vat , nolink : yI , punctuation : Oat , reflink : vI , reflinkSearch : Hat , tag : zat , text : Iat , url : Wc } , qat = { ... Ay , link : dn ( /^!?\[(label)\]\((.*?)\)/ ) . replace ( "label" , qp ) . getRegex ( ) , reflink : dn ( /^!?\[(label)\]\s*\[([^\]]*)\]/ ) . replace ( "label" , qp ) . getRegex ( ) } , w1 = { ... Ay , escape : dn ( _I ) . replace ( "])" , "~|])" ) . getRegex ( ) , url : dn ( /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/ , "i" ) . replace ( "email" , /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/ ) . getRegex ( ) , _backpedal : /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/ , del : /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/ , text : /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ } , Yat = { ... w1 , br : dn ( bI ) . replace ( "{2,}" , "*" ) . getRegex ( ) , text : dn ( w1 . text ) . replace ( "\\b_" , "\\b_| {2,}\\n" ) . replace ( /\{2,\}/g , "*" ) . getRegex ( ) } , gu = { normal : Cy , gfm : Mat , pedantic : Nat } , Ec = { normal : Ay , gfm : w1 , breaks : Yat , pedantic : qat } ; class ii { constructor ( e ) { pn ( this , "tokens" ) ; pn ( this , "options" ) ; pn ( this , "state" ) ; pn ( this , "tokenizer" ) ; pn ( this , "inlineQueue" ) ; this . tokens = [ ] , this . tokens . links = Object . create ( null ) , this . options = e || ka , this . options . tokenizer = this . options . tokenizer || new Hp , this . tokenizer = this . options . tokenizer , this . tokenizer . options = this . options , this . tokenizer . lexer = this , this . inlineQueue = [ ] , this . state = { inLink : ! 1 , inRawBlock : ! 1 , top : ! 0 } ; const t = { block : gu . normal , inline : Ec . normal } ; this . options . pedantic ? ( t . block = gu
2024-11-04 00:22:50 +00:00
` ),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){this.options.pedantic&&(e=e.replace(/ \t /g," ").replace(/^ + $ /gm,""));let i,s,o;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&t.length>0?t[t.length-1].raw+= `
` :t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+= `
` +i.raw,s.text+= `
` +i.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+= `
` +i.raw,s.text+= `
` +i.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=e.slice(1);let d;this.options.extensions.startBlock.forEach(u=>{d=u.call({lexer:this},l),typeof d=="number"&&d>=0&&(a=Math.min(a,d))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){s=t[t.length-1],r&&(s==null?void 0:s.type)==="paragraph"?(s.raw+= `
` +i.raw,s.text+= `
` +i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(i),r=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+= `
` +i.raw,s.text+= `
` +i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(i);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,i,s,o=e,a,l,d;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(d=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),i=t[t.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,o,d)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const m=e.slice(1);let f;this.options.extensions.startInline.forEach(g=>{f=g.call({lexer:this},m),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(s=e.substring(0,u+1))}if(r=this.tokenizer.inlineText(s)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(d=r.raw.slice(-1)),l=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}}class Yp{constructor(e){pn(this,"options");pn(this,"parser");this.options=e||ka}space(e){return""}code({text:e,lang:t,escaped:r}){var o;const i=(o=(t||"").match(/^ \S */))==null?void 0:o[0],s=e.replace(/ \n $ /,"")+ `
` ;return i?'<pre><code class="language-'+Ur(i)+'">'+(r?s:Ur(s,!0))+ ` < / c o d e > < / p r e >
` :"<pre><code>"+(r?s:Ur(s,!0))+ ` < / c o d e > < / p r e >
` }blockquote({tokens:e}){return ` < blockquote >
$ { this . parser . parse ( e ) } < / b l o c k q u o t e >
` }html({text:e}){return e}heading({tokens:e,depth:t}){return ` < h$ { t } > $ { this . parser . parseInline ( e ) } < / h $ { t } >
` }hr(e){return ` < hr >
` }list(e){const t=e.ordered,r=e.start;let i="";for(let a=0;a<e.items.length;a++){const l=e.items[a];i+=this.listitem(l)}const s=t?"ol":"ul",o=t&&r!==1?' start="'+r+'"':"";return"<"+s+o+ ` >
` +i+"</"+s+ ` >
` }listitem(e){let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" "}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose), ` < li > $ { t } < / l i >
` }checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return ` < p > $ { this . parser . parseInline ( e ) } < / p >
` }table(e){let t="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);t+=this.tablerow({text:r});let i="";for(let s=0;s<e.rows.length;s++){const o=e.rows[s];r="";for(let a=0;a<o.length;a++)r+=this.tablecell(o[a]);i+=this.tablerow({text:r})}return i&&(i= ` < tbody > $ { i } < / t b o d y > ` ) , ` < t a b l e >
< thead >
` +t+ ` < / t h e a d >
` +i+ ` < / t a b l e >
` }tablerow({text:e}){return ` < tr >
$ { e } < / t r >
` }tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align? ` < $ { r } align = "${e.align}" > ` : ` < $ { r } > ` )+t+ ` < / $ { r } >
2024-11-06 23:05:30 +00:00
` }strong({tokens:e}){return ` < strong > $ { this . parser . parseInline ( e ) } < / s t r o n g > ` } e m ( { t o k e n s : e } ) { r e t u r n ` < e m > $ { t h i s . p a r s e r . p a r s e I n l i n e ( e ) } < / e m > ` } c o d e s p a n ( { t e x t : e } ) { r e t u r n ` < c o d e > $ { e } < / c o d e > ` } b r ( e ) { r e t u r n " < b r > " } d e l ( { t o k e n s : e } ) { r e t u r n ` < d e l > $ { t h i s . p a r s e r . p a r s e I n l i n e ( e ) } < / d e l > ` } l i n k ( { h r e f : e , t i t l e : t , t o k e n s : r } ) { c o n s t i = t h i s . p a r s e r . p a r s e I n l i n e ( r ) , s = m A ( e ) ; i f ( s = = = n u l l ) r e t u r n i ; e = s ; l e t o = ' < a h r e f = " ' + e + ' " ' ; r e t u r n t & & ( o + = ' t i t l e = " ' + t + ' " ' ) , o + = " > " + i + " < / a > " , o } i m a g e ( { h r e f : e , t i t l e : t , t e x t : r } ) { c o n s t i = m A ( e ) ; i f ( i = = = n u l l ) r e t u r n r ; e = i ; l e t s = ` < i m g s r c = " $ { e } " a l t = " $ { r } " ` ; r e t u r n t & & ( s + = ` t i t l e = " $ { t } " ` ) , s + = " > " , s } t e x t ( e ) { r e t u r n " t o k e n s " i n e & & e . t o k e n s ? t h i s . p a r s e r . p a r s e I n l i n e ( e . t o k e n s ) : e . t e x t } } c l a s s R y { s t r o n g ( { t e x t : e } ) { r e t u r n e } e m ( { t e x t : e } ) { r e t u r n e } c o d e s p a n ( { t e x t : e } ) { r e t u r n e } d e l ( { t e x t : e } ) { r e t u r n e } h t m l ( { t e x t : e } ) { r e t u r n e } t e x t ( { t e x t : e } ) { r e t u r n e } l i n k ( { t e x t : e } ) { r e t u r n " " + e } i m a g e ( { t e x t : e } ) { r e t u r n " " + e } b r ( ) { r e t u r n " " } } c l a s s s i { c o n s t r u c t o r ( e ) { p n ( t h i s , " o p t i o n s " ) ; p n ( t h i s , " r e n d e r e r " ) ; p n ( t h i s , " t e x t R e n d e r e r " ) ; t h i s . o p t i o n s = e | | k a , t h i s . o p t i o n s . r e n d e r e r = t h i s . o p t i o n s . r e n d e r e r | | n e w Y p , t h i s . r e n d e r e r = t h i s . o p t i o n s . r e n d e r e r , t h i s . r e n d e r e r . o p t i o n s = t h i s . o p t i o n s , t h i s . r e n d e r e r . p a r s e r = t h i s , t h i s . t e x t R e n d e r e r = n e w R y } s t a t i c p a r s e ( e , t ) { r e t u r n n e w s i ( t ) . p a r s e ( e ) } s t a t i c p a r s e I n l i n e ( e , t ) { r e t u r n n e w s i ( t ) . p a r s e I n l i n e ( e ) } p a r s e ( e , t = ! 0 ) { l e t r = " " ; f o r ( l e t i = 0 ; i < e . l e n g t h ; i + + ) { c o n s t s = e [ i ] ; i f ( t h i s . o p t i o n s . e x t e n s i o n s & & t h i s . o p t i o n s . e x t e n s i o n s . r e n d e r e r s & & t h i s . o p t i o n s . e x t e n s i o n s . r e n d e r e r s [ s . t y p e ] ) { c o n s t a = s , l = t h i s . o p t i o n s . e x t e n s i o n s . r e n d e r e r s [ a . t y p e ] . c a l l ( { p a r s e r : t h i s } , a ) ; i f ( l ! = = ! 1 | | ! [ " s p a c e " , " h r " , " h e a d i n g " , " c o d e " , " t a b l e " , " b l o c k q u o t e " , " l i s t " , " h t m l " , " p a r a g r a p h " , " t e x t " ] . i n c l u d e s ( a . t y p e ) ) { r + = l | | " " ; c o n t i n u e } } c o n s t o = s ; s w i t c h ( o . t y p e ) { c a s e " s p a c e " : { r + = t h i s . r e n d e r e r . s p a c e ( o ) ; c o n t i n u e } c a s e " h r " : { r + = t h i s . r e n d e r e r . h r ( o ) ; c o n t i n u e } c a s e " h e a d i n g " : { r + = t h i s . r e n d e r e r . h e a d i n g ( o ) ; c o n t i n u e } c a s e " c o d e " : { r + = t h i s . r e n d e r e r . c o d e ( o ) ; c o n t i n u e } c a s e " t a b l e " : { r + = t h i s . r e n d e r e r . t a b l e ( o ) ; c o n t i n u e } c a s e " b l o c k q u o t e " : { r + = t h i s . r e n d e r e r . b l o c k q u o t e ( o ) ; c o n t i n u e } c a s e " l i s t " : { r + = t h i s . r e n d e r e r . l i s t ( o ) ; c o n t i n u e } c a s e " h t m l " : { r + = t h i s . r e n d e r e r . h t m l ( o ) ; c o n t i n u e } c a s e " p a r a g r a p h " : { r + = t h i s . r e n d e r e r . p a r a g r a p h ( o ) ; c o n t i n u e } c a s e " t e x t " : { l e t a = o , l = t h i s . r e n d e r e r . t e x t ( a ) ; f o r ( ; i + 1 < e . l e n g t h & & e [ i + 1 ] . t y p e = = = " t e x t " ; ) a = e [ + + i ] , l + = `
` +this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l}]}):r+=l;continue}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}const o=s;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}}class Kc{constructor(e){pn(this,"options");pn(this,"block");this.options=e||ka}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ii.lex:ii.lexInline}provideParser(){return this.block?si.parse:si.parseInline}}pn(Kc,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class $ at{constructor(...e){pn(this,"defaults",Sy());pn(this,"options",this.setOptions);pn(this,"parse",this.parseMarkdown(!0));pn(this,"parseInline",this.parseMarkdown(!1));pn(this,"Parser",si);pn(this,"Renderer",Yp);pn(this,"TextRenderer",Ry);pn(this,"Lexer",ii);pn(this,"Tokenizer",Hp);pn(this,"Hooks",Kc);this.use(...e)}walkTokens(e,t){var i,s;let r=[];for(const o of e)switch(r=r.concat(t.call(this,o)),o.type){case"table":{const a=o;for(const l of a.header)r=r.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const d of l)r=r.concat(this.walkTokens(d.tokens,t));break}case"list":{const a=o;r=r.concat(this.walkTokens(a.items,t));break}default:{const a=o;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const d=a[l].flat(1/0);r=r.concat(this.walkTokens(d,t))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const o=t.renderers[s.name];o?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),r.renderer){const s=this.defaults.renderer||new Yp(this.defaults);for(const o in r.renderer){if(!(o in s))throw new Error( ` renderer '${o}' does not exist ` );if(["options","parser"].includes(o))continue;const a=o,l=r.renderer[a],d=s[a];s[a]=(...u)=>{let m=l.apply(s,u);return m===!1&&(m=d.apply(s,u)),m||""}}i.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new Hp(this.defaults);for(const o in r.tokenizer){if(!(o in s))throw new Error( ` tokenizer '${o}' does not exist ` );if(["options","rules","lexer"].includes(o))continue;const a=o,l=r.tokenizer[a],d=s[a];s[a]=(...u)=>{let m=l.apply(s,u);return m===!1&&(m=d.apply(s,u)),m}}i.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new Kc;for(const o in r.hooks){if(!(o in s))throw new Error( ` hook ' $
2024-11-11 23:13:41 +00:00
Please report this to https : //github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+Ur(r.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(r);throw r}}}const Sa=new $at;function nn(n,e){return Sa.parse(n,e)}nn.options=nn.setOptions=function(n){return Sa.setOptions(n),nn.defaults=Sa.defaults,uI(nn.defaults),nn};nn.getDefaults=Sy;nn.defaults=ka;nn.use=function(...n){return Sa.use(...n),nn.defaults=Sa.defaults,uI(nn.defaults),nn};nn.walkTokens=function(n,e){return Sa.walkTokens(n,e)};nn.parseInline=Sa.parseInline;nn.Parser=si;nn.parser=si.parse;nn.Renderer=Yp;nn.TextRenderer=Ry;nn.Lexer=ii;nn.lexer=ii.lex;nn.Tokenizer=Hp;nn.Hooks=Kc;nn.parse=nn;nn.options;nn.setOptions;nn.use;nn.walkTokens;nn.parseInline;si.parse;ii.lex;const Wat={name:"HelpView",data(){return{helpSections:[]}},methods:{toggleSection(n){this.helpSections[n].isOpen=!this.helpSections[n].isOpen},async loadMarkdownFile(n){try{const t=await(await fetch(`/help/${n}`)).text();return nn(t)}catch(e){return console.error("Error loading markdown file:",e),"Error loading help content."}},async loadHelpSections(){const n=[{title:"About LoLLMs",file:"lollms-context.md"},{title:"Getting Started",file:"getting-started.md"},{title:"Uploading Files",file:"uploading-files.md"},{title:"Sending Images",file:"sending-images.md"},{title:"Using Code Interpreter",file:"code-interpreter.md"},{title:"Internet Search",file:"internet-search.md"}];for(const e of n){const t=await this.loadMarkdownFile(e.file);this.helpSections.push({title:e.title,content:t,isOpen:!1})}}},mounted(){this.loadHelpSections()}},Kat={class:"help-view background-color p-6 w-full"},jat={class:"big-card w-full"},Qat={class:"help-sections-container"},Xat={class:"help-sections space-y-4"},Zat=["onClick"],Jat={class:"toggle-icon"},elt={key:0,class:"help-content mt-4"},tlt=["innerHTML"];function nlt(n,e,t,r,i,s){return T(),M("div",Kat,[c("div",jat,[e[0]||(e[0]=c("h1",{class:"text-4xl md:text-5xl font-bold text-gray-800 dark:text-gray-100 mb-6"},"LoLLMs Help",-1)),c("div",Qat,[c("div",Xat,[(T(!0),M(je,null,at(i.helpSections,(o,a)=>(T(),M("div",{key:a,class:"help-section message"},[c("h2",{onClick:l=>s.toggleSection(a),class:"menu-item cursor-pointer flex justify-between items-center"},[pt(X(o.title)+" ",1),c("span",Jat,X(o.isOpen?"▼":"▶"),1)],8,Zat),o.isOpen?(T(),M("div",elt,[c("div",{innerHTML:o.content,class:"prose dark:prose-invert"},null,8,tlt)])):Y("",!0)]))),128))])])])])}const rlt=bt(Wat,[["render",nlt],["__scopeId","data-v-8c1798f3"]]);function Wi(n,e=!0,t=1){const r=e?1e3:1024;if(Math.abs(n)<r)return n+" B";const i=e?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let s=-1;const o=10**t;do n/=r,++s;while(Math.round(Math.abs(n)*o)/o>=r&&s<i.length-1);return n.toFixed(t)+" "+i[s]}const wr="/assets/logo-B22RoIQ8.png",ilt={props:{title:{type:String,required:!1,value:"menu"},icon:{type:String,required:!1,value:"feather:menu"},commands:{type:Array,required:!0},force_position:{required:!1,value:0},execute_cmd:{type:Function,required:!1},menuIconClass:{type:String,required:!1,default:""},selected_entry:{type:String,required:!1}},data(){return{isMenuOpen:!1,menuPosition:{bottom:"auto",top:"calc(100% + 10px)"}}},methods:{handleClickOutside(n){const e=this.$refs.menu,t=this.$refs.menuButton;e&&!e.contains(n.target)&&!t.contains(n.target)&&(this.isMenuOpen=!1,window.removeEventListener("click",this.handleClickOutside))},toggleMenu(){this.positionMenu(),this.isMenuOpen=!this.isMenuOpen,this.isMenuOpen?window.addEventListener("click",this.handleClickOutside):window.removeEventListener("click",this.handleClickOutside),We(()=>{Ze.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClien
2024-11-04 00:22:50 +00:00
` ,this.configFile.start_user_header_id_template="!@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="!@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="lollms_simplified"?(console.log("Using lollms template"),this.configFile.start_header_id_template="@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template= `
` ,this.configFile.start_user_header_id_template="@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="bare"?(console.log("Using lollms template"),this.configFile.start_header_id_template="",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template= `
` ,this.configFile.start_user_header_id_template="",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="llama3"?(console.log("Using llama3 template"),this.configFile.start_header_id_template="<|start_header_id|>",this.configFile.system_message_template="system",this.configFile.end_header_id_template="<|end_header_id|>",this.configFile.separator_template="<|eot_id|>",this.configFile.start_user_header_id_template="<|start_header_id|>",this.configFile.end_user_header_id_template="<|end_header_id|>",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="<|start_header_id|>",this.configFile.end_ai_header_id_template="<|end_header_id|>",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="mistral"?(console.log("Using mistral template"),this.configFile.start_header_id_template="[INST]",this.configFile.system_message_template=" Using this information",this.configFile.end_header_id_template=": ",this.configFile.separator_template= `
` ,this.configFile.start_user_header_id_template="[INST]",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="[/INST]",this.configFile.start_ai_header_id_template="[INST]",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="[/INST]",this.settingsChanged=!0):e==="deepseek"&&(console.log("Using deepseek template"),this.configFile.start_header_id_template="",this.configFile.system_message_template=" Using this information",this.configFile.end_header_id_template=": ",this.configFile.separator_template= `
` ,this.configFile.start_user_header_id_template="",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0)},install_model(){},reinstallDiffusersService(){de.post("/install_diffusers",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeDiffusersService(){de.post("install_diffusers",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallXTTSService(){de.post("install_xtts",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallWhisperService(){de.post("install_whisper",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallSDService(){de.post("/install_sd",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeSDService(){de.post("upgrade_sd",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},startSDService(){de.post("start_sd",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},showSD(){de.post("show_sd",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallComfyUIService(){de.post("install_comfyui",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},upgradeComfyUIService(){de.post("upgrade_comfyui",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startComfyUIService(){de.post("start_comfyui",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},showComfyui(){de.post("show_comfyui",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){de.post("install_vllm",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){de.post("start_vllm",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){de.post("start_ollama",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){de.post("install_petals",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){de.post("install_ollama",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){de.post("install_vllm",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){de.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10<this.models_zoo.length?this.models_zoo_initialLoadCount+=10:this.models_zoo_initialLoadCount=this.models_zoo.length},async modelsZooToggleCollapse(){this.mzc_collapsed=!this.mzc_collapsed,We(()=>{Ze.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this. $ store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this. $ store.state.sort_type=n,this.updateModelsZoo(),console.log( ` Selected sorting : $ { n } ` ),console.log( ` models : $ { this . models _zoo } ` )},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(console.log("voice synthesis"),this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.a
` +e.model.name+ `
installed ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage")}}else rt.off("install_progress",r),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",i.error),this. $ store.state.toast.showToast( ` Model :
` +e.model.name+ `
failed to install ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage");console.log("Here")};rt.on("install_progress",r),rt.emit("install_model",{path:t,name:e.model.name,variant_name:this.selected_variant.name,type:e.model.type}),console.log("Started installation, please wait")},resetLogo(){this.configFile.app_custom_logo="",this.settingsChanged=!0},resetAvatar(){this.configFile.user_avatar="",this.settingsChanged=!0},uploadLogo(n){const e=n.target.files[0],t=new FormData;t.append("logo",e),console.log("Uploading logo"),de.post("/upload_logo",t).then(r=>{console.log("Logo uploaded successfully"),this. $ store.state.toast.showToast("Avatar uploaded successfully!",4,!0);const i=r.data.fileName;console.log("response",r),this.app_custom_logo=i,this. $ store.state.config.app_custom_logo=i,this.settingsChanged=!0}).catch(r=>{console.error("Error uploading avatar:",r)})},uploadAvatar(n){const e=n.target.files[0],t=new FormData;t.append("avatar",e),console.log("Uploading avatar"),de.post("/upload_avatar",t).then(r=>{console.log("Avatar uploaded successfully"),this. $ store.state.toast.showToast("Avatar uploaded successfully!",4,!0);const i=r.data.fileName;console.log("response",r),this.user_avatar=i,this. $ store.state.config.user_avatar=i,this.settingsChanged=!0}).catch(r=>{console.error("Error uploading avatar:",r)})},async update_software(){console.log("Posting");const n=await this.api_post_req("update_software");console.log("Posting done"),n.status?this. $ store.state.toast.showToast("Success!",4,!0):this. $ store.state.toast.showToast("Failure!",4,!1)},async restart_software(){console.log("Posting");const n=await this.api_post_req("restart_program");console.log("Posting done"),n.status?this. $ store.state.toast.showToast("Success!",4,!0):this. $ store.state.toast.showToast("Failure!",4,!1)},on_loading_text(n){console.log("Loading text",n),this.loading_text=n},async load_everything(){for(this.isLoading=!0,We(()=>{Ze.replace()});this.isReady===!1;)await new Promise(n=>setTimeout(n,100));this.refresh(),console.log("Ready"),this.configFile.model_name&&(this.isModelSelected=!0),this.persCatgArr=await this.api_get_req("list_personalities_categories"),this.persArr=await this.api_get_req("list_personalities?category="+this.configFile.personality_category),console.log("category"),this.personality_category=this.configFile.personality_category,this.personalitiesFiltered=this. $ store.state.personalities.filter(n=>n.category===this.configFile.personality_category),this.modelsFiltered=[],this.updateModelsZoo(),this.isLoading=!1,this.isMounted=!0,console.log("READY Stuff")},async open_mzl(){this.mzl_collapsed=!this.mzl_collapsed,console.log("Fetching models")},async getVramUsage(){await this.api_get_req("vram_usage")},async progressListener(n){if(console.log("received something"),n.status==="progress"){if(this. $ refs.modelZoo){const e=this. $ refs.modelZoo.findIndex(r=>r.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(console.log("model entry",t),t.installing=!0,t.progress=n.progress,console.log( ` Progress = $ { n . progress } ` ),n.progress>=100?(t.installing=!1,t.isInstalled=!0):(t.installing=!0,t.isInstalled=!0))}}else if(n.status==="succeeded"){if(console.log("Received succeeded"),this. $ refs.modelZoo){const e=this. $ refs.modelZoo.findIndex(r=>r.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];n.progress>=100&&(t.installing=!1,t.isInstalled=!0)}if(console.log("Installed successfully"),this. $ refs.modelZoo){const e=this. $ refs.modelZoo.findIndex(r=>r.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(t.installing=!1,t.isInstalled=!0)}this. $ store.state.toast.showToast( ` Model :
` +model_object.name+ `
installed ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage")}else if(n.status==="failed"&&(console.log("Install failed"),this. $ refs.modelZoo)){const e=this. $ refs.modelZoo.findIndex(r=>r.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(t.installing=!1,t.isInstalled=!1),console.error("Installation failed:",n.error),this. $ store.state.toast.showToast( ` Model :
` +model_object.name+ `
failed to install ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage")}},showAddModelDialog(){this. $ refs.addmodeldialog.showDialog("").then(()=>{console.log(this. $ refs.addmodeldialog.model_path);const n=this. $ refs.addmodeldialog.model_path;rt.emit("install_model",{path:n,type:this.models_zoo[0].type},e=>{console.log("Model installation successful:",e)}),console.log(this. $ refs.addmodeldialog.model_path)})},closeAddModelDialog(){this.addModelDialogVisibility=!1},collapseAll(n){this.servers_conf_collapsed=n,this.mainconf_collapsed=n,this.bec_collapsed=n,this.mzc_collapsed=n,this.pzc_collapsed=n,this.bzc_collapsed=n,this.pc_collapsed=n,this.mc_collapsed=n,this.sc_collapsed=n,this.mzdc_collapsed=n},fetchPersonalities(){this.api_get_req("list_personalities_categories").then(n=>{this.persCatgArr=n,this.persCatgArr.sort()}),this.api_get_req("list_personalities").then(n=>{this.persArr=n,this.persArr.sort(),console.log( ` Listed personalities :
$ { n } ` )})},fetchHardwareInfos(){this. $ store.dispatch("refreshDiskUsage"),this. $ store.dispatch("refreshRamUsage")},async onPersonalitySelected(n){if(console.log("on pers",n),this.isLoading&&this. $ store.state.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("selecting ",n),n){if(n.selected){this. $ store.state.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}let e=n.language==null?n.full_path:n.full_path+":"+n.language;if(console.log("pth",e),n.isMounted&&this.configFile.personalities.includes(e)){const t=await this.select_personality(n);console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this. $ store.state.toast.showToast( ` Selected personality :
` +n.name,4,!0):this. $ store.state.toast.showToast( ` Error on select personality :
` +n.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(n);We(()=>{Ze.replace()})}},onModelSelected(n){if(this.isLoading){this. $ store.state.toast.showToast("Loading... please wait",4,!1);return}n&&(n.isInstalled?this.update_model(n.model.name).then(e=>{console.log("update_model",e),this.configFile.model_name=n.model.name,e.status?(this. $ store.state.toast.showToast( ` Selected model :
` +n.name,4,!0),We(()=>{Ze.replace(),this.is_loading_zoo=!1}),this.updateModelsZoo(),this.api_get_req("get_model_status").then(t=>{this. $ store.commit("setIsModelOk",t)})):(this. $ store.state.toast.showToast( ` Couldn ' t select model :
` +n.name,4,!1),We(()=>{Ze.replace()})),this.settingsChanged=!0,this.isModelSelected=!0}):this. $ store.state.toast.showToast( ` Model :
` +n.model.name+ `
is not installed ` ,4,!1),We(()=>{Ze.replace()}))},onCopy(n){let e;n.model.isCustomModel?e= ` Model name : $ { n . name }
File size : $ { n . fileSize }
Manually downloaded model ` :e= ` Model name : $ { n . name }
File size : $ { n . fileSize }
Download : $ { "https://huggingface.co/" + n . quantizer + "/" + n . name }
License : $ { n . license }
Owner : $ { n . quantizer }
Website : $ { "https://huggingface.co/" + n . quantizer }
Description : $ { n . description } ` ,this. $ store.state.toast.showToast("Copied model info to clipboard!",4,!0),navigator.clipboard.writeText(e.trim())},onCopyLink(n){this. $ store.state.toast.showToast("Copied link to clipboard!",4,!0),navigator.clipboard.writeText(n.model.name)},onCopyPersonalityName(n){this. $ store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},async onCopyToCustom(n){await de.post("/copy_to_custom_personas",{client_id:this. $ store.state.client_id,category:n.personality.category,name:n.personality.name})},async handleOpenFolder(n){await de.post("/open_personality_folder",{client_id:this. $ store.state.client_id,personality_folder:n.personality.category/n.personality.folder})},onCancelInstall(){const n=this.addModel;console.log("cancel install",n),this.modelDownlaodInProgress=!1,this.addModel={},rt.emit("cancel_install",{model_name:n.model_name,binding_folder:n.binding_folder,model_url:n.model_url,patreon:n.patreon?n.patreon:"None"}),this. $ store.state.toast.showToast("Model installation aborted",4,!1)},onInstall(n){this.variant_choices=n.model.variants,this.currenModelToInstall=n,console.log("variant_choices"),console.log(this.variant_choices),console.log(n),this.variantSelectionDialogVisible=!0},onCreateReference(){de.post("/add_reference_to_local_model",{path:this.reference_path}).then(n=>{n.status?(this. $ store.state.toast.showToast("Reference created",4,!0),this.is_loading_zoo=!0,this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.is_loading_zoofalse})):this. $ store.state.toast.showToast("Couldn't create reference",4,!1)})},onInstallAddModel(){if(!this.addModel.url){this. $ store.state.toast.showToast("Link is empty",4,!1);return}let n=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=t=>{console.log("received something"),t.status&&t.progress<=100?(console.log("Progress",t),this.addModel=t,this.addModel.url=n,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),rt.off("install_progress",e),console.log("Installed successfully"),this.addModel={},this. $ store.state.toast.showToast( ` Model :
` +this.addModel.model_name+ `
installed ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage"))):(rt.off("install_progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",t.error),this. $ store.state.toast.showToast( ` Model :
` +this.addModel.model_name+ `
failed to install ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage"))};rt.on("install_progress",e),rt.emit("install_model",{path:n,type:this.models_zoo[0].type}),console.log("Started installation, please wait")},uploadLocalModel(){if(this.uploadData.length==0){this. $ store.state.toast.showToast("No files to upload",4,!1);return}let n=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=t=>{console.log("received something"),t.status&&t.progress<=100?(console.log("Progress",t),this.addModel=t,this.addModel.url=n,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),rt.off("progress",e),console.log("Installed successfully"),this.addModel={},this. $ store.state.toast.showToast( ` Model :
` +this.addModel.model_name+ `
installed ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage"))):(rt.off("progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",t.error),this. $ store.state.toast.showToast( ` Model :
` +this.addModel.model_name+ `
failed to install ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage"))};rt.on("progress",e),console.log("Started installation, please wait")},setFileList(n){this.uploadData=n.target.files,console.log("set file list",this.uploadData)},onUninstall(n){this. $ store.state.yesNoDialog.askQuestion( ` Are you sure you want to delete this model ?
[ ` +n.name+"]","Yes","Cancel").then(e=>{if(e){console.log("uninstalling model...");const t=r=>{console.log("uninstalling res",r),r.status?(console.log("uninstalling success",r),n.uninstalling=!1,rt.off("install_progress",t),this.showProgress=!1,this.is_loading_zoo=!0,this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.is_loading_zoo=!1}),this.modelsFiltered=this.models_zoo,this. $ store.state.toast.showToast( ` Model :
` +n.model.name+ `
was uninstalled ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage")):(console.log("uninstalling failed",r),n.uninstalling=!1,this.showProgress=!1,rt.off("uninstall_progress",t),console.error("Uninstallation failed:",r.error),this. $ store.state.toast.showToast( ` Model :
` +n.model.name+ `
failed to uninstall ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage"))};rt.on("uninstall_progress",t),this.selected_variant!=null?rt.emit("uninstall_model",{path:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name+"/resolve/main/"+this.selected_variant.name,type:n.model.type}):rt.emit("uninstall_model",{path:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,type:n.model.type})}})},onBindingSelected(n){if(console.log("Binding selected"),!n.binding.installed){this. $ store.state.toast.showToast( ` Binding is not installed :
` +n.binding.name,4,!1);return}this.mzc_collapsed=!0,this.configFile.binding_name!=n.binding.folder&&(this.update_binding(n.binding.folder),this.binding_changed=!0),this.api_get_req("get_model_status").then(e=>{this. $ store.commit("setIsModelOk",e)})},onInstallBinding(n){this.configFile.binding_name!=n.binding.folder?(this.isLoading=!0,n.disclaimer&&this. $ store.state.yesNoDialog.askQuestion(n.disclaimer,"Proceed","Cancel"),de.post("/install_binding",{name:n.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("install_binding",e),e.data.status?(this. $ store.state.toast.showToast("Binding installed successfully!",4,!0),this. $ store.state.messageBox.showMessage( ` It is advised to reboot the application after installing a binding .
Page will refresh in 5 s . ` ),setTimeout(()=>{window.location.href="/"},5e3)):this. $ store.state.toast.showToast("Could not reinstall binding",4,!1),this.isLoading=!1,e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reinstall binding
` +e.message,4,!1),{status:!1}))):this.update_binding(n.binding.folder)},onUnInstallBinding(n){this.isLoading=!0,de.post("/unInstall_binding",{name:n.binding.folder}).then(e=>{if(e){if(this.isLoading=!1,console.log("unInstall_binding",e),e.data.status){const t=this.bindingsZoo.findIndex(i=>i.folder==n.binding.folder),r=this.bindingsZoo[t];r?r.installed=!0:r.installed=!1,this.settingsChanged=!0,this.binding_changed=!0,this. $ store.state.toast.showToast("Binding uninstalled successfully!",4,!0)}else this. $ store.state.toast.showToast("Could not uninstall binding",4,!1);return e.data}this.isLoading=!1,n.isInstalled=False}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not uninstall binding
` +e.message,4,!1),{status:!1}))},onReinstallBinding(n){this.isLoading=!0,de.post("/reinstall_binding",{name:n.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_binding",e),e.data.status?(this. $ store.state.toast.showToast("Binding reinstalled successfully!",4,!0),this. $ store.state.messageBox.showMessage("It is advised to reboot the application after installing a binding")):this. $ store.state.toast.showToast("Could not reinstall binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reinstall binding
` +e.message,4,!1),{status:!1}))},onSettingsBinding(n){try{this.isLoading=!0,de.get("/get_active_binding_settings").then(e=>{console.log(e),this.isLoading=!1,e&&(console.log("binding setting",e),e.data&&Object.keys(e.data).length>0?this. $ store.state.universalForm.showForm(e.data,"Binding settings - "+n.binding.name,"Save changes","Cancel").then(t=>{try{de.post("/set_active_binding_settings",{client_id:this. $ store.state.client_id,settings:t},{headers:this.posts_headers}).then(r=>{r&&r.data?(console.log("binding set with new settings",r.data),this. $ store.state.toast.showToast("Binding settings updated successfully!",4,!0),de.post("/update_binding_settings",{client_id:this. $ store.state.client_id}).then(i=>{this. $ store.state.toast.showToast("Binding settings committed successfully!",4,!0),window.location.href="/"})):(this. $ store.state.toast.showToast( ` Did not get binding settings responses .
` +r,4,!1),this.isLoading=!1)})}catch(r){this. $ store.state.toast.showToast( ` Did not get binding settings responses .
Endpoint error : ` +r.message,4,!1),this.isLoading=!1}}):(this. $ store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this. $ store.state.toast.showToast("Could not open binding settings. Endpoint error: "+e.message,4,!1)}},onReloadBinding(n){console.log("Reloading binding"),this.isLoading=!0,de.post("/reload_binding",{name:n.binding.folder},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reload_binding",e),e.data.status?this. $ store.state.toast.showToast("Binding reloaded successfully!",4,!0):this. $ store.state.toast.showToast("Could not reload binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reload binding
` +e.message,4,!1),{status:!1}))},onSettingsPersonality(n){try{this.isLoading=!0,de.get("/get_active_personality_settings").then(e=>{this.isLoading=!1,e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this. $ store.state.universalForm.showForm(e.data,"Personality settings - "+n.personality.name,"Save changes","Cancel").then(t=>{try{de.post("/set_active_personality_settings",t).then(r=>{r&&r.data?(console.log("personality set with new settings",r.data),this. $ store.state.toast.showToast("Personality settings updated successfully!",4,!0)):(this. $ store.state.toast.showToast( ` Did not get Personality settings responses .
` +r,4,!1),this.isLoading=!1)})}catch(r){this. $ store.state.toast.showToast( ` Did not get Personality settings responses .
Endpoint error : ` +r.message,4,!1),this.isLoading=!1}}):(this. $ store.state.toast.showToast("Personality has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this. $ store.state.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},onMessageBoxOk(){console.log("OK button clicked")},update_personality_category(n,e){this.personality_category=n,e()},refresh(){console.log("Refreshing"),this. $ store.dispatch("refreshConfig").then(()=>{console.log(this.personality_category),this.api_get_req("list_personalities_categories").then(n=>{console.log("cats",n),this.persCatgArr=n,this.personalitiesFiltered=this. $ store.state.personalities.filter(e=>e.category===this.personality_category),this.personalitiesFiltered.sort()})})},toggleAccordion(){this.showAccordion=!this.showAccordion},async update_setting(n,e,t){this.isLoading=!0;const r={client_id:this. $ store.state.client_id,setting_name:n,setting_value:e};console.log("Updating setting",n,":",e);let i=await de.post("/update_setting",r,{headers:this.posts_headers});if(i)return this.isLoading=!1,console.log("update_setting",i),i.status?this. $ store.state.toast.showToast( ` Setting updated successfully .
` ,4,!0):this. $ store.state.toast.showToast( ` Setting update failed .
Please view the console for more details . ` ,4,!1),t!==void 0&&t(i),i.data;this.isLoading=!1},async refreshModelsZoo(){this.models_zoo=[],console.log("refreshing models"),this.is_loading_zoo=!0,await this. $ store.dispatch("refreshModelsZoo"),console.log("ModelsZoo refreshed"),await this. $ store.dispatch("refreshModels"),console.log("Models refreshed"),this.updateModelsZoo(),console.log("Models updated"),this.is_loading_zoo=!1},async updateModelsZoo(){let n=this. $ store.state.modelsZoo;if(n.length!=0){console.log( ` REFRESHING models using sorting $ { this . sort _type } ` ),n.length>1?(this.sort_type==0?(n.sort((e,t)=>{const r=new Date(e.last_commit_time);return new Date(t.last_commit_time)-r}),console.log("Sorted")):this.sort_type==1?n.sort((e,t)=>t.rank-e.rank):this.sort_type==2?n.sort((e,t)=>e.name.localeCompare(t.name)):this.sort_type==3&&n.sort((e,t)=>e.name.localeCompare(t.name)),console.log("Sorted")):console.log("No sorting needed"),n.forEach(e=>{e.name==this. $ store.state.config.model_name?e.selected=!0:e.selected=!1}),console.log("Selected models");for(let e=0;e<this. $ store.state.modelsArr.length;e++){const t=this. $ store.state.modelsArr[e];let r=n.findIndex(i=>i.name==t);if(r==-1)for(let i=0;i<n.length;i++){let s=n[i].variants;if(s!=null&&(r=s.findIndex(o=>o.name==t),r!=-1)){r=i,console.log( ` Found $ { t } at index $ { r } ` );break}}if(r==-1){let i={};i.name=t,i.icon=this.imgBinding,i.isCustomModel=!0,i.isInstalled=!0,n.push(i)}else n[r].isInstalled=!0}console.log("Determined models"),n.sort((e,t)=>e.isInstalled&&!t.isInstalled?-1:!e.isInstalled&&t.isInstalled?1:0),console.log("Done"),this.models_zoo=this. $ store.state.modelsZoo}},update_binding(n){this.isLoading=!0,this. $ store.state.modelsZoo=[],this.configFile.model_name=null,this. $ store.state.config.model_name=null,console.log("updating binding_name"),this.update_setting("binding_name",n,async e=>{console.log("updated binding_name"),await this. $ store.dispatch("refreshConfig"),this.models_zoo=[],this.mzc_collapsed=!0;const t=this.bindingsZoo.findIndex(i=>i.folder==n),r=this.bindingsZoo[t];r?r.installed=!0:r.installed=!1,this.settingsChanged=!0,this.isLoading=!1,We(()=>{Ze.replace()}),console.log("updating model"),this.update_model(null).then(()=>{}),We(()=>{Ze.replace()})}),We(()=>{Ze.replace()})},async update_model(n){n||(this.isModelSelected=!1),this.isLoading=!0;let e=await this.update_setting("model_name",n);return this.isLoading=!1,We(()=>{Ze.replace()}),e},async cancelConfiguration(){await this. $ store.dispatch("refreshConfig"),this.settingsChanged=!1},applyConfiguration(){this.isLoading=!0,de.post("/apply_settings",{client_id:this. $ store.state.client_id,config:this.configFile},{headers:this.posts_headers}).then(n=>{this.isLoading=!1,n.data.status?(this. $ store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this. $ store.state.toast.showToast("Configuration change failed.",4,!1),We(()=>{Ze.replace()})})},save_configuration(){this.showConfirmation=!1,de.post("/save_settings",{},{headers:this.posts_headers}).then(n=>{if(n)return n.status||this. $ store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this. $ store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},reset_configuration(){this. $ store.state.yesNoDialog.askQuestion( ` Are you sure ?
This will delete all your configurations and get back to default configuration . ` ).then(n=>{n&&de.post("/reset_settings",{},{headers:this.posts_headers}).then(e=>{if(e)return e.status?this. $ store.state.messageBox.showMessage("Settings have been reset correctly"):this. $ store.state.messageBox.showMessage("Couldn't reset settings!"),e.data}).catch(e=>(console.log(e.message,"reset_configuration"),this. $ store.state.messageBox.showMessage("Couldn't reset settings!"),{status:!1}))})},async api_get_req(n){try{const e=await de.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - settings");return}},async api_post_req(n){try{const e=await de.post("/"+n,{client_id:this. $ store.state.client_id});if(e)return e.data}catch(e){console.log(e.message,"api_post_req - settings");return}},closeToast(){this.showToast=!1},async getPersonalitiesArr(){this.isLoading=!0,this. $ store.state.personalities=[];const n=await this.api_get_req("get_all_personalities"),e=this. $ store.state.config;console.log("recovering all_personalities");const t=Object.keys(n);for(let r=0;r<t.length;r++){const i=t[r],o=n[i].map(a=>{const l=e.personalities.includes(i+"/"+a.folder);let d={};return d=a,d.category=i,d.language="",d.full_path=i+"/"+a.folder,d.isMounted=l,d});this. $ store.state.personalities.length==0?this. $ store.state.personalities=o:this. $ store.state.personalities=this. $ store.state.personalities.concat(o)}this. $ store.state.personalities.sort((r,i)=>r.name.localeCompare(i.name)),this.personalitiesFiltered=this. $ store.state.personalities.filter(r=>r.category===this.configFile.personality_category),this.personalitiesFiltered.sort(),console.log("per filtered",this.personalitiesFiltered),this.isLoading=!1},async filterPersonalities(){if(!this.searchPersonality){this.personalitiesFiltered=this. $ store.state.personalities.filter(t=>t.category===this.configFile.personality_category),this.personalitiesFiltered.sort(),this.searchPersonalityInProgress=!1;return}const n=this.searchPersonality.toLowerCase(),e=this. $ store.state.personalities.filter(t=>{if(t.name&&t.name.toLowerCase().includes(n)||t.description&&t.description.toLowerCase().includes(n)||t.full_path&&t.full_path.toLowerCase().includes(n))return t});e.length>0?this.personalitiesFiltered=e.sort():(this.personalitiesFiltered=this. $ store.state.personalities.filter(t=>t.category===this.configFile.personality_category),this.personalitiesFiltered.sort()),this.searchPersonalityInProgress=!1},async filterModels(){const n=this.searchModel.toLowerCase();this.is_loading_zoo=!0,console.log("filtering models"),console.log(this.models_zoo);const e=this.models_zoo.filter(t=>{if(t.name&&t.name.toLowerCase().includes(n)||t.description&&t.description.toLowerCase().includes(n)||t.category&&t.category.toLowerCase().includes(n))return t});this.is_loading_zoo=!1,e.length>0?this.modelsFiltered=e:this.modelsFiltered=[],this.searchModelInProgress=!1},computedFileSize(n){return Wi(n)},async mount_personality(n){if(!n)return{status:!1,error:"no personality - mount_personality"};try{const e={client_id:this. $ store.state.client_id,language:n.language?n.language:"",category:n.category?n.category:"",folder:n.folder?n.folder:""},t=await de.post("/mount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this. $ store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await de.post("/unmount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};let e=n.language==null?n.full_path:n.full_path+":"+n.language;console.log("pth",e);const t=this.configFile.personalities.findIndex(i=>i===e),r={client_id:this. $ store.state.client_id,id:t};try{const i=await de.post("/select_personality",r,{headers:this.posts_headers});if(i)return
` +n.personality.name,4,!0),this. $ store.dispatch("refreshMountedPersonalities")):(n.isMounted=!1,this. $ store.state.toast.showToast( ` Could not mount personality
Error : ` +e.error+ `
Response :
` +e,4,!1)),this.isLoading=!1},async unmountAll(){await de.post("/unmount_all_personalities",{client_id:this. $ store.state.client_id},{headers:this.posts_headers}),this. $ store.dispatch("refreshMountedPersonalities"),this. $ store.dispatch("refreshConfig"),this. $ store.state.toast.showToast("All personas unmounted",4,!0)},async unmountPersonality(n){if(this.isLoading=!0,!n)return;const e=await this.unmount_personality(n.personality||n);if(e.status){this.configFile.personalities=e.personalities,this. $ store.state.toast.showToast("Personality unmounted",4,!0);const t=this. $ store.state.personalities.findIndex(a=>a.full_path==n.full_path),r=this.personalitiesFiltered.findIndex(a=>a.full_path==n.full_path),i=this. $ refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path);console.log("ppp",this. $ store.state.personalities[t]),this. $ store.state.personalities[t].isMounted=!1,r>-1&&(this.personalitiesFiltered[r].isMounted=!1),i>-1&&(this. $ refs.personalitiesZoo[i].isMounted=!1),this. $ store.dispatch("refreshMountedPersonalities");const s=this.mountedPersArr[this.mountedPersArr.length-1];console.log(s,this.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this. $ store.state.toast.showToast( ` Selected personality :
` +s.name,4,!0)}else this. $ store.state.toast.showToast( ` Could not unmount personality
Error : ` +e.error,4,!1);this.isLoading=!1},editPersonality(n){n=n.personality,de.post("/get_personality_config",{client_id:this. $ store.state.client_id,category:n.category,name:n.folder}).then(e=>{const t=e.data;console.log("Done"),t.status?(this. $ store.state.currentPersonConfig=t.config,this. $ store.state.showPersonalityEditor=!0,this. $ store.state.personality_editor.showPanel(),this. $ store.state.selectedPersonality=n):console.error(t.error)}).catch(e=>{console.error(e)})},copyToCustom(n){n=n.personality,de.post("/copy_to_custom_personas",{category:n.category,name:n.folder}).then(e=>{e.status?(this. $ store.state.messageBox.showMessage( ` Personality copied to the custom personalities folder :
Now it ' s up to you to modify it , enhance it , and maybe even share it .
Feel free to add your name as an author , but please remember to keep the original creator ' s name as well .
You have the freedom to give , sell , or keep the personas you create for yourself .
The possibilities are endless , they are now yours to mold and customize as you see fit . ` ),this. $ store.dispatch("refreshPersonalitiesZoo")):this. $ store.state.toast.showToast( ` Personality couldn ' t be copied to the custom personalities folder :
Verify that the personality is not already copied there . ` ,4,!1)}).catch(e=>{this. $ store.state.toast.showToast( ` Personality couldn ' t be copied to the custom personalities folder :
` ,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),de.post("/reinstall_personality",{client_id:this. $ store.state.client_id,name:n.personality.path},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this. $ store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this. $ store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reinstall personality
` +e.message,4,!1),{status:!1}))},personalityImgPlacehodler(n){n.target.src=Ai},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){this.filterModels()}},async mounted(){console.log("Getting voices"),this.getVoices(),console.log("Constructing"),this.load_everything(),this.getSeviceVoices();try{console.log("Loading input devices list");const n=await de.get("/get_snd_input_devices");this.snd_input_devices=n.data.device_names,this.snd_input_devices_indexes=n.data.device_indexes}catch{console.log("Couldin't list input devices")}try{console.log("Loading output devices list");const n=await de.get("/get_snd_output_devices");this.snd_output_devices=n.data.device_names,this.snd_output_devices_indexes=n.data.device_indexes}catch{console.log("Couldin't list output devices")}try{if(console.log("Getting comfyui models"),this.configFile.activate_lollms_tti_server&&this.configFile.active_tti_service=="comfyui"){const n=await de.get("/list_comfyui_models");n.data.status&&(this.comfyui_models=n.data.models)}}catch{console.log("Couldin't list output devices")}this.fetchElevenLabsVoices()},activated(){},computed:{full_template:{get(){return(this.configFile.start_header_id_template+this.configFile.system_message_template+this.configFile.end_header_id_template+" system message"+this.configFile.separator_template+this.configFile.start_user_header_id_template+"user name"+this.configFile.end_user_header_id_template+" User prompt"+this.configFile.separator_template+this.configFile.end_user_message_id_template+this.configFile.separator_template+this.configFile.start_ai_header_id_template+"ai personality"+this.configFile.end_ai_header_id_template+"ai response"+this.configFile.end_ai_message_id_template).replace( `
2024-11-06 23:05:30 +00:00
` ,"<br>")}},rendered_models_zoo:{get(){return this.searchModel?this.show_only_installed_models?this.modelsFiltered.filter(n=>n.isInstalled===!0):this.modelsFiltered.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)):(console.log("this.models_zoo"),console.log(this.models_zoo),console.log(this.models_zoo_initialLoadCount),this.show_only_installed_models?this.models_zoo.filter(n=>n.isInstalled===!0):this.models_zoo.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)))}},imgBinding:{get(){if(!this.isMounted)return wr;try{return this. $ refs.bindingZoo[this. $ refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)]. $ refs.imgElement.src}catch{return wr}}},imgModel:{get(){try{let n=this. $ store.state.modelsZoo.findIndex(e=>e.name==this. $ store.state.selectedModel);return n>=0?(console.log( ` model avatar : $ { this . $store . state . modelsZoo [ n ] . icon } ` ),this. $ store.state.modelsZoo[n].icon):wr}catch{console.log("error")}if(!this.isMounted)return wr;try{return this. $ refs.bindingZoo[this. $ refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)]. $ refs.imgElement.src}catch{return wr}}},isReady:{get(){return this. $ store.state.ready}},audio_out_voice:{get(){return this. $ store.state.config.audio_out_voice},set(n){this. $ store.state.config.audio_out_voice=n}},openaiWhisperModels(){return["whisper-1"]},whisperModels(){return["tiny.en","tiny","base.en","base","small.en","small","medium.en","medium","large-v1","large-v2","large-v3","large"]},audioLanguages(){return[{code:"en-US",name:"English (US)"},{code:"en-GB",name:"English (UK)"},{code:"es-ES",name:"Spanish (Spain)"},{code:"es-MX",name:"Spanish (Mexico)"},{code:"fr-FR",name:"French (France)"},{code:"fr-CA",name:"French (Canada)"},{code:"de-DE",name:"German (Germany)"},{code:"it-IT",name:"Italian (Italy)"},{code:"pt-BR",name:"Portuguese (Brazil)"},{code:"pt-PT",name:"Portuguese (Portugal)"},{code:"ru-RU",name:"Russian (Russia)"},{code:"zh-CN",name:"Chinese (China)"},{code:"ja-JP",name:"Japanese (Japan)"},{code:"ar-SA",name:"Arabic (Saudi Arabia)"},{code:"tr-TR",name:"Turkish (Turkey)"},{code:"ms-MY",name:"Malay (Malaysia)"},{code:"ko-KR",name:"Korean (South Korea)"},{code:"nl-NL",name:"Dutch (Netherlands)"},{code:"sv-SE",name:"Swedish (Sweden)"},{code:"da-DK",name:"Danish (Denmark)"},{code:"fi-FI",name:"Finnish (Finland)"},{code:"no-NO",name:"Norwegian (Norway)"},{code:"pl-PL",name:"Polish (Poland)"},{code:"el-GR",name:"Greek (Greece)"},{code:"hu-HU",name:"Hungarian (Hungary)"},{code:"cs-CZ",name:"Czech (Czech Republic)"},{code:"th-TH",name:"Thai (Thailand)"},{code:"hi-IN",name:"Hindi (India)"},{code:"he-IL",name:"Hebrew (Israel)"},{code:"id-ID",name:"Indonesian (Indonesia)"},{code:"vi-VN",name:"Vietnamese (Vietnam)"},{code:"uk-UA",name:"Ukrainian (Ukraine)"},{code:"ro-RO",name:"Romanian (Romania)"},{code:"bg-BG",name:"Bulgarian (Bulgaria)"},{code:"hr-HR",name:"Croatian (Croatia)"},{code:"sr-RS",name:"Serbian (Serbia)"},{code:"sk-SK",name:"Slovak (Slovakia)"},{code:"sl-SI",name:"Slovenian (Slovenia)"},{code:"et-EE",name:"Estonian (Estonia)"},{code:"lv-LV",name:"Latvian (Latvia)"},{code:"lt-LT",name:"Lithuanian (Lithuania)"},{code:"ka-GE",name:"Georgian (Georgia)"},{code:"hy-AM",name:"Armenian (Armenia)"},{code:"az-AZ",name:"Azerbaijani (Azerbaijan)"},{code:"kk-KZ",name:"Kazakh (Kazakhstan)"},{code:"uz-UZ",name:"Uzbek (Uzbekistan)"},{code:"kkj-CM",name:"Kako (Cameroon)"},{code:"my-MM",name:"Burmese (Myanmar)"},{code:"ne-NP",name:"Nepali (Nepal)"},{code:"si-LK",name:"Sinhala (Sri Lanka)"}]},configFile:{get(){return this. $ store.state.config},set(n){this. $ store.commit("setConfig",n)}},userName:{get(){return this. $ store.state.config.user_name},set(n){this. $ store.state.config.user_name=n}},user_avatar:{get(){return this. $ store.state.config.user_avatar!=""?"/user_infos/"+this. $ store.state.config.user_avatar:Ai},set(n){this. $ store.state.config.user_avatar=n}},hardware_mode:{get(){return this. $ store.state.config.hardware_mode},set(n){this. $ store.state.config.hardware_mode=n}},auto_update:{get(){return this. $ store.state.co
2024-11-04 00:22:50 +00:00
If you are using windows , this uses wsl which requires you to have it installed or at least activated .
If You are using windows , this will install wsl so you need to activate it .
2024-11-06 23:05:30 +00:00
< a href = 'https://techcommunity.microsoft.com/t5/windows-11/how-to-install-the-linux-windows-subsystem-in-windows-11/m-p/2701207' target = '_blank' > Here is how you can do that < / a > ` ) ) } , e [ 7 0 6 ] | | ( e [ 7 0 6 ] = [ c ( " i " , { " d a t a - f e a t h e r " : " h e l p - c i r c l e " , c l a s s : " w - 5 h - 5 " } , n u l l , - 1 ) ] ) ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 0 8 ] | | ( e [ 7 0 8 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " o l l a m a _ b a s e _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " I n s t a l l O l l a m a s e r v i c e : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , U f t , [ c ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 3 8 3 ] | | ( e [ 3 8 3 ] = ( . . . h ) = > s . r e i n s t a l l O L L A M A S e r v i c e & & s . r e i n s t a l l O L L A M A S e r v i c e ( . . . h ) ) } , " i n s t a l l o l l a m a s e r v i c e " ) , c ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 3 8 4 ] | | ( e [ 3 8 4 ] = ( . . . h ) = > s . s t a r t o l l a m a S e r v i c e & & s . s t a r t o l l a m a S e r v i c e ( . . . h ) ) } , " s t a r t o l l a m a s e r v i c e " ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 0 9 ] | | ( e [ 7 0 9 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " o l l a m a _ b a s e _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " o l l a m a b a s e u r l : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , B f t , [ F ( c ( " i n p u t " , { t y p e : " t e x t " , i d : " o l l a m a _ b a s e _ u r l " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 8 5 ] | | ( e [ 3 8 5 ] = h = > s . c o n f i g F i l e . o l l a m a _ b a s e _ u r l = h ) , o n C h a n g e : e [ 3 8 6 ] | | ( e [ 3 8 6 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . o l l a m a _ b a s e _ u r l ] ] ) ] ) ] ) ] ) ] ) ] ) , _ : 1 } ) , W ( a , { t i t l e : " v L L M s e r v i c e " , i s _ s u b c a r d : ! 0 , c l a s s : " p b - 2 m - 2 " } , { d e f a u l t : G e ( ( ) = > [ c ( " t a b l e " , G f t , [ c ( " t r " , n u l l , [ e [ 7 1 1 ] | | ( e [ 7 1 1 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " e n a b l e _ v l l m _ s e r v i c e " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " E n a b l e v L L M s e r v i c e : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , z f t , [ F ( c ( " i n p u t " , { t y p e : " c h e c k b o x " , i d : " e n a b l e _ v l l m _ s e r v i c e " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 8 7 ] | | ( e [ 3 8 7 ] = h = > s . c o n f i g F i l e . e n a b l e _ v l l m _ s e r v i c e = h ) , o n C h a n g e : e [ 3 8 8 ] | | ( e [ 3 8 8 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ t t , s . c o n f i g F i l e . e n a b l e _ v l l m _ s e r v i c e ] ] ) ] ) ] ) , c ( " t d " , n u l l , [ c ( " d i v " , { c l a s s : " h o v e r : t e x t - s e c o n d a r y d u r a t i o n - 7 5 a c t i v e : s c a l e - 9 0 p e e r - c h e c k e d : t e x t - p r i m a r y " , o n C l i c k : e [ 3 8 9 ] | | ( e [ 3 8 9 ] = h = > t h i s . $ s t o r e . s t a t e . m e s s a g e B o x . s h o w M e s s a g e ( ` A c t i v a t e s v l l m s e r v i c e . T h e s e r v i c e w i l l b e a u t o m a t i c a l l y l o a d e d a t s t a r t u p a l o w i n g y o u t o u s e t h e e l f b i n d i n g .
2024-11-04 00:22:50 +00:00
If you are using windows , this uses wsl which requires you to have it installed or at least activated .
If You are using windows , this will install wsl so you need to activate it .
2024-11-06 23:05:30 +00:00
< a href = 'https://techcommunity.microsoft.com/t5/windows-11/how-to-install-the-linux-windows-subsystem-in-windows-11/m-p/2701207' target = '_blank' > Here is how you can do that < / a > ` ) ) } , e [ 7 1 0 ] | | ( e [ 7 1 0 ] = [ c ( " i " , { " d a t a - f e a t h e r " : " h e l p - c i r c l e " , c l a s s : " w - 5 h - 5 " } , n u l l , - 1 ) ] ) ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 1 2 ] | | ( e [ 7 1 2 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " v l l m _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " I n s t a l l v L L M s e r v i c e : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , V f t , [ c ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 3 9 0 ] | | ( e [ 3 9 0 ] = ( . . . h ) = > s . r e i n s t a l l v L L M S e r v i c e & & s . r e i n s t a l l v L L M S e r v i c e ( . . . h ) ) } , " i n s t a l l v L L M s e r v i c e " ) , c ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 3 9 1 ] | | ( e [ 3 9 1 ] = ( . . . h ) = > s . s t a r t v L L M S e r v i c e & & s . s t a r t v L L M S e r v i c e ( . . . h ) ) } , " s t a r t v l l m s e r v i c e " ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 1 3 ] | | ( e [ 7 1 3 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " v l l m _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " v l l m b a s e u r l : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , H f t , [ F ( c ( " i n p u t " , { t y p e : " t e x t " , i d : " v l l m _ u r l " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 9 2 ] | | ( e [ 3 9 2 ] = h = > s . c o n f i g F i l e . v l l m _ u r l = h ) , o n C h a n g e : e [ 3 9 3 ] | | ( e [ 3 9 3 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . v l l m _ u r l ] ] ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 1 5 ] | | ( e [ 7 1 5 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " g p u m e m o r y u t i l i z a t i o n : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , q f t , [ c ( " d i v " , Y f t , [ e [ 7 1 4 ] | | ( e [ 7 1 4 ] = c ( " p " , { c l a s s : " a b s o l u t e l e f t - 0 m t - 6 " } , [ c ( " l a b e l " , { f o r : " v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n " , c l a s s : " t e x t - s m f o n t - m e d i u m " } , " v l l m g p u m e m o r y u t i l i z a t i o n : " ) ] , - 1 ) ) , c ( " p " , $ f t , [ F ( c ( " i n p u t " , { t y p e : " t e x t " , i d : " t e m p - v a l " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 9 4 ] | | ( e [ 3 9 4 ] = h = > s . c o n f i g F i l e . v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n = h ) , o n C h a n g e : e [ 3 9 5 ] | | ( e [ 3 9 5 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 2 w - 1 6 t e x t - r i g h t p - 2 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d - l g b g - g r a y - 5 0 s m : t e x t - x s f o c u s : r i n g - b l u e - 5 0 0 f o c u s : b o r d e r - b l u e - 5 0 0 d a r k : b g - g r a y - 7 0 0 d a r k : b o r d e r - g r a y - 6 0 0 d a r k : p l a c e h o l d e r - g r a y - 4 0 0 d a r k : f o c u s : r i n g - b l u e - 5 0 0 d a r k : f o c u s : b o r d e r - b l u e - 5 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n ] ] ) ] ) ] ) , F ( c ( " i n p u t " , { i d : " v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n " , o n C h a n g e : e [ 3 9 6 ] | | ( e [ 3 9 6 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , t y p e : " r a n g e " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 9 7 ] | | ( e [ 3 9 7 ] = h = > s . c o n f i g F i l e . v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n = h ) , m i n : " 0 . 1 0 " , m a x : " 1 " , s t e p : " 0 . 0 1 " , c l a s s : " f l e x - n o n e h - 2 m t - 1 4 m b - 2 w - f u l l b g - g r a y - 2 0 0 r o u n d e d - l g a p p e a r a n c e - n o n e c u r s o r - p o i n t e r d a r k : b g - g r a y - 7 0 0 f o c u s : r i n g - b l u e - 5 0 0 f o c u s : b o r d e r - b l u e - 5 0 0 d a r k : b o r d e r - g r a y - 6 0 0 d a r k : p l a c e h o l d e r - g r a y - 4 0 0 d a r k : f o c u s : r i n g - b l u e - 5 0 0 d a r k : f o c u s : b o r d e r - b l u e - 5 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n ] ] ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 1 6 ] | | ( e [ 7 1 6 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " v l l m _ m a x _ n u m _ s e q s " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " v l l m m a x n u m s e q s : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , W f t , [ F ( c ( " i n p u t " , { t y p e : " n u m b e r " , i d : " v l l m _ m a x _ n u m _ s e q s " , m i n : " 6 4 " , m a x : " 2 0 4 8 " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 9 8 ] | | ( e [ 3 9 8 ] = h = > s . c o n f i g F i l e . v l l m _ m a x _ n u m _ s e q s = h ) , o n C h a n g e : e [ 3 9 9 ] | | ( e [ 3 9 9 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . v l l m _ m a x _ n u m _ s e q s ] ] ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 1 7 ] | | ( e [ 7 1 7 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " v l l m _ m a x _ m o d e l _ l e n " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " m a x m o d e l l e n : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , K f t , [ F ( c ( " i n p u t " , { t y p e : " n u m b e r " , i d : " v l l m _ m a x _ m o d e l _ l e n " , m i n : " 2 0 4 8 " , m a x : " 1 0 0 0 0 0 0 " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 0 0 ] | | ( e [ 4 0 0 ] = h = > s . c o n f i g F i l e . v l l m _ m a x _ m o d e l _ l e n = h ) , o n C h a n g e : e [ 4 0 1 ] | | ( e [ 4 0 1 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . v l l m _ m a x _ m o d e l _ l e n ] ] ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 1 8 ] | | ( e [ 7 1 8 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " v l l m _ m o d e l _ p a t h " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " v l l m m o
2024-11-04 00:22:50 +00:00
If You are using windows , this will install wsl so you need to activate it .
2024-11-06 23:05:30 +00:00
< a href = 'https://techcommunity.microsoft.com/t5/windows-11/how-to-install-the-linux-windows-subsystem-in-windows-11/m-p/2701207' target = '_blank' > Here is how you can do that < / a > ` ) ) } , e [ 7 1 9 ] | | ( e [ 7 1 9 ] = [ c ( " i " , { " d a t a - f e a t h e r " : " h e l p - c i r c l e " , c l a s s : " w - 5 h - 5 " } , n u l l , - 1 ) ] ) ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 2 1 ] | | ( e [ 7 2 1 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " p e t a l s _ b a s e _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " I n s t a l l P e t a l s s e r v i c e : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , Z f t , [ c ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 4 0 7 ] | | ( e [ 4 0 7 ] = ( . . . h ) = > s . r e i n s t a l l P e t a l s S e r v i c e & & s . r e i n s t a l l P e t a l s S e r v i c e ( . . . h ) ) } , " i n s t a l l p e t a l s s e r v i c e " ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 2 2 ] | | ( e [ 7 2 2 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " p e t a l s _ b a s e _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " p e t a l s b a s e u r l : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , J f t , [ F ( c ( " i n p u t " , { t y p e : " t e x t " , i d : " p e t a l s _ b a s e _ u r l " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 0 8 ] | | ( e [ 4 0 8 ] = h = > s . c o n f i g F i l e . p e t a l s _ b a s e _ u r l = h ) , o n C h a n g e : e [ 4 0 9 ] | | ( e [ 4 0 9 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . p e t a l s _ b a s e _ u r l ] ] ) ] ) ] ) ] ) ] ) ] ) , _ : 1 } ) ] ) , _ : 1 } ) , W ( a , { t i t l e : " T T V s e t t i n g s " , i s _ s u b c a r d : ! 0 , c l a s s : " p b - 2 m - 2 " } , { d e f a u l t : G e ( ( ) = > [ c ( " t a b l e " , e g t , [ c ( " t r " , n u l l , [ e [ 7 2 3 ] | | ( e [ 7 2 3 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " l u m a l a b s _ k e y " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " L u m a l a b s k e y : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , t g t , [ F ( c ( " i n p u t " , { t y p e : " t e x t " , i d : " l u m a l a b s _ k e y " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 1 0 ] | | ( e [ 4 1 0 ] = h = > s . c o n f i g F i l e . l u m a l a b s _ k e y = h ) , o n C h a n g e : e [ 4 1 1 ] | | ( e [ 4 1 1 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . l u m a l a b s _ k e y ] ] ) ] ) ] ) ] ) ] ) ] ) , _ : 1 } ) , W ( a , { t i t l e : " M i s c " , i s _ s h r u n k : ! 0 , i s _ s u b c a r d : ! 0 , c l a s s : " p b - 2 m - 2 " } , { d e f a u l t : G e ( ( ) = > [ W ( a , { t i t l e : " E l a s t i c s e a r c h S e r v i c e ( u n d e r c o n s t r u c t i o n ) " , i s _ s u b c a r d : ! 0 , c l a s s : " p b - 2 m - 2 " } , { d e f a u l t : G e ( ( ) = > [ c ( " t a b l e " , n g t , [ c ( " t r " , n u l l , [ e [ 7 2 4 ] | | ( e [ 7 2 4 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " e l a s t i c _ s e a r c h _ s e r v i c e " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " E n a b l e e l a s t i c s e a r c h s e r v i c e : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , r g t , [ F ( c ( " i n p u t " , { t y p e : " c h e c k b o x " , i d : " e l a s t i c _ s e a r c h _ s e r v i c e " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 1 2 ] | | ( e [ 4 1 2 ] = h = > s . c o n f i g F i l e . e l a s t i c _ s e a r c h _ s e r v i c e = h ) , o n C h a n g e : e [ 4 1 3 ] | | ( e [ 4 1 3 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ t t , s . c o n f i g F i l e . e l a s t i c _ s e a r c h _ s e r v i c e ] ] ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 2 5 ] | | ( e [ 7 2 5 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " i n s t a l l _ e l a s t i c _ s e a r c h _ s e r v i c e " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " R e i n s t a l l E l a s t i c S e a r c h s e r v i c e : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , i g t , [ c ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 4 1 4 ] | | ( e [ 4 1 4 ] = ( . . . h ) = > s . r e i n s t a l l E l a s t i c S e a r c h S e r v i c e & & s . r e i n s t a l l E l a s t i c S e a r c h S e r v i c e ( . . . h ) ) } , " i n s t a l l E l a s t i c S e a r c h s e r v i c e " ) ] ) ] ) ] ) , c ( " t r " , n u l l , [ e [ 7 2 6 ] | | ( e [ 7 2 6 ] = c ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ c ( " l a b e l " , { f o r : " e l a s t i c _ s e a r c h _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " e l a s t i c s e a r c h b a s e u r l : " ) ] , - 1 ) ) , c ( " t d " , n u l l , [ c ( " d i v " , s g t , [ F ( c ( " i n p u t " , { t y p e : " t e x t " , i d : " e l a s t i c _ s e a r c h _ u r l " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 1 5 ] | | ( e [ 4 1 5 ] = h = > s . c o n f i g F i l e . e l a s t i c _ s e a r c h _ u r l = h ) , o n C h a n g e : e [ 4 1 6 ] | | ( e [ 4 1 6 ] = h = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ _ e , s . c o n f i g F i l e . e l a s t i c _ s e a r c h _ u r l ] ] ) ] ) ] ) ] ) ] ) ] ) , _ : 1 } ) ] ) , _ : 1 } ) ] , 2 ) ] ) , c ( " d i v " , o g t , [ c ( " d i v " , a g t , [ c ( " b u t t o n " , { o n C l i c k : e [ 4 1 7 ] | | ( e [ 4 1 7 ] = J ( h = > i . b z c _ c o l l a p s e d = ! i . b z c _ c o l l a p s e d , [ " s t o p " ] ) ) , c l a s s : " t e x t - 2 x l h o v e r : t e x t - p r i m a r y p - 2 - m - 2 w - f u l l t e x t - l e f t f l e x f l e x - r o w i t e m s - c e n t e r " } , [ F ( c ( " d i v " , n u l l , e [ 7 2 7 ] | | ( e [ 7 2 7 ] = [ c ( " i " , { " d a t a - f e a t h e r " : " c h e v r o n - r i g h t " } , n u l l , - 1 ) ] ) , 5 1 2 ) , [ [ D t , i . b z c _ c o l l a p s e d ] ] ) , F ( c ( " d i v " , n u l l , e [ 7 2 8 ] | | ( e [ 7 2 8 ] = [ c ( " i " , { " d a t a - f e a t h e r " : " c h e v r o n - d o w n " } , n u l l , - 1 ) ] ) , 5 1 2 ) , [ [ D t , ! i . b z c _ c o l l a p s e d ] ] ) , e [ 7 3 0 ] | | ( e [ 7 3 0 ] = c ( " p
2024-11-04 00:22:50 +00:00
` ).map(u=>u.trim()===""?u:i?u.startsWith(" ")?u.substring(4):u:" "+u),a=e.value.substring(0,t),l=e.value.substring(r),d=a+o.join( `
` )+l;this.message.content=d,this. $ nextTick(()=>{e.selectionStart=t,e.selectionEnd=r+o.length*4})}n.preventDefault()},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this. $ refs.audio_player.pause()):(this.isSynthesizingVoice=!0,de.post("./text2wav",{text:this.message.content}).then(n=>{this.isSynthesizingVoice=!1;let e=n.data.url;console.log(e),this.audio_url=e,this.message.metadata||(this.message.metadata=[]);let t=!1;for(let r of this.message.metadata)Object.prototype.hasOwnProperty.call(r,"audio_url")&&(r.audio_url=this.audio_url,t=!0);t||this.message.metadata.push({audio_url:this.audio_url}),this. $ emit("updateMessage",this.message.id,this.message.content,this.audio_url)}).catch(n=>{this. $ store.state.toast.showToast( ` Error : $ { n } ` ,4,!1),this.isSynthesizingVoice=!1}))},async speak(){if(this. $ store.state.config.active_tts_service!="browser"&&this. $ store.state.config.active_tts_service!="None")this.isSpeaking?(this.isSpeaking=!0,de.post("./stop",{text:this.message.content}).then(n=>{this.isSpeaking=!1}).catch(n=>{this. $ store.state.toast.showToast( ` Error : $ { n } ` ,4,!1),this.isSpeaking=!1})):(this.isSpeaking=!0,de.post("./text2Audio",{client_id:this. $ store.state.client_id,text:this.message.content}).then(n=>{this.isSpeaking=!1}).catch(n=>{this. $ store.state.toast.showToast( ` Error : $ { n } ` ,4,!1),this.isSpeaking=!1}));else{if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.message.content,this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this. $ store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(i=>i.name===this. $ store.state.config.audio_out_voice)[0]);const t=i=>{let s=this.message.content.substring(i,i+e);const o=[".","!","?", `
` ];let a=-1;return o.forEach(l=>{const d=s.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=s.length),console.log(a),a+i+1},r=()=>{if(this.message.status_message=="Done"||this.message.content.includes(".")||this.message.content.includes("?")||this.message.content.includes("!")){const i=t(n),s=this.message.content.substring(n,i);this.msg.text=s,n=i+1,this.msg.onend=o=>{n<this.message.content.length-2?setTimeout(()=>{r()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",i))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{r()},1)};console.log("Speaking chunk"),r()}},toggleModel(){this.expanded=!this.expanded},addBlock(n){let e=this. $ refs.mdTextarea.selectionStart,t=this. $ refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.message.content[e-1]== `
` ?(this.message.content=this.message.content.slice(0,e)+" ` ` ` "+n+" \ n \ n ` ` ` \n "+this.message.content.slice(e),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+" \n ` ` ` "+n+" \ n \ n ` ` ` \n "+this.message.content.slice(e),e=e+3+n.length):speechSynthesis==0||this.message.content[e-1]== `
` ?(this.message.content=this.message.content.slice(0,e)+" ` ` ` " + n + `
` +this.message.content.slice(e,t)+" \n ` ` ` \ n "+this.message.content.slice(t),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+" \ n ` ` ` "+n+ `
2024-11-06 23:05:30 +00:00
` +this.message.content.slice(e,t)+" \n ` ` ` \ n "+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit(" copy ",this)},deleteMsg(){this.$emit(" delete ",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit(" rankUp ",this.message.id)},rankDown(){this.$emit(" rankDown ",this.message.id)},updateMessage(){this.$emit(" updateMessage ",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit(" resendMessage ",this.message.id,this.message.content,n)},continueMessage(){this.$emit(" continueMessage ",this.message.id,this.message.content)},getImgUrl(){return this.avatar?ybt+this.avatar:(console.log(" No avatar found "),Ai)},defaultImg(n){n.target.src=Ai},parseDate(n){let e=new Date(Date.parse(n)),r=Math.floor((new Date-e)/1e3);return r<=1?" just now ":r<20?r+" seconds ago ":r<40?" half a minute ago ":r<60?" less than a minute ago ":r<=90?" one minute ago ":r<=3540?Math.round(r/60)+" minutes ago ":r<=5400?" 1 hour ago ":r<=86400?Math.round(r/3600)+" hours ago ":r<=129600?" 1 day ago ":r<604800?Math.round(r/86400)+" days ago ":r<=777600?" 1 week ago ":n},prettyDate(n){let e=new Date((n||" ").replace(/-/g," / ").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,r=Math.floor(t/86400);if(!(isNaN(r)||r<0||r>=31))return r==0&&(t<60&&" just now "||t<120&&" 1 minute ago "||t<3600&&Math.floor(t/60)+" minutes ago "||t<7200&&" 1 hour ago "||t<86400&&Math.floor(t/3600)+" hours ago ")||r==1&&" Yesterday "||r<7&&r+" days ago "||r<31&&Math.ceil(r/7)+" weeks ago "},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)}," message . content ":function(n){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())}," message . ui ":function(n){console.log(" ui changed to ",n),this.ui_componentKey++},showConfirmation(){We(()=>{Ze.replace()})},deleteMsgMode(){We(()=>{Ze.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty(" open ")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,We(()=>{Ze.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!n.getTime()||!e.getTime())return;let[r,i,s]=this.computeTimeDiff(n,e);function o(l){return l<10&&(l=" 0 "+l),l}return o(r)+" h : "+o(i)+" m : "+o(s)+" s "},warmup_duration(){const n=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(console.log(" Computing the warmup duration , ",n," - > ",e),e.getTime()===n.getTime())return 0;if(!n.getTime()||!e.getTime())return;let r,i,s;[r,i,s]=this.computeTimeDiff(n,e);function o(l){return l<10&&(l=" 0 "+l),l}return o(r)+" h : "+o(i)+" m : "+o(s)+" s "},generation_rate(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),t=this.message.nb_tokens;if(e.getTime()===n.getTime()||!t||!n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const s=Math.floor(i/1e3),o=t/s;return Math.round(o)+" t / s "}}},Sbt={class:" relative message w - full group rounded - lg m - 2 shadow - lg hover : border - primary dark : hover : border - primary hover : border - solid hover : border - 2 border - 2 border - transparent flex flex - col flex - grow flex - wrap overflow - visible p - 4 pb - 2 "},xbt={class:" flex flex - row gap - 2 "},Tbt={class:" flex - shrink - 0 "},wbt={class:" group / avatar "},Cbt=[" src "," data - popover - target "],Abt={class:" flex flex - col w - full flex - grow - 0 "},Rbt={class:" flex fle
2024-11-12 16:41:39 +00:00
` +r.error,4,!1),this.loading=!1,rt.off("file_received")}),rt.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){We(()=>{Ze.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this. $ el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},v1t={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"};function y1t(n,e,t,r,i,s){const o=ht("InteractiveMenu");return i.loading?(T(),M("div",v1t,e[0]||(e[0]=[c("div",{role:"status"},[c("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),c("span",{class:"sr-only"},"Loading...")],-1)]))):(T(),Tt(o,{key:1,commands:t.commandsList,execute_cmd:s.execute_cmd},null,8,["commands","execute_cmd"]))}const E1t=bt(b1t,[["render",y1t],["__scopeId","data-v-1a32c141"]]),S1t="data:image/svg+xml,%3csvg%20aria-hidden='true'%20class='w-6%20h-6%20animate-spin%20fill-secondary'%20viewBox='0%200%20100%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M100%2050.5908C100%2078.2051%2077.6142%20100.591%2050%20100.591C22.3858%20100.591%200%2078.2051%200%2050.5908C0%2022.9766%2022.3858%200.59082%2050%200.59082C77.6142%200.59082%20100%2022.9766%20100%2050.5908ZM9.08144%2050.5908C9.08144%2073.1895%2027.4013%2091.5094%2050%2091.5094C72.5987%2091.5094%2090.9186%2073.1895%2090.9186%2050.5908C90.9186%2027.9921%2072.5987%209.67226%2050%209.67226C27.4013%209.67226%209.08144%2027.9921%209.08144%2050.5908Z'%20fill='currentColor'%20/%3e%3cpath%20d='M93.9676%2039.0409C96.393%2038.4038%2097.8624%2035.9116%2097.0079%2033.5539C95.2932%2028.8227%2092.871%2024.3692%2089.8167%2020.348C85.8452%2015.1192%2080.8826%2010.7238%2075.2124%207.41289C69.5422%204.10194%2063.2754%201.94025%2056.7698%201.05124C51.7666%200.367541%2046.6976%200.446843%2041.7345%201.27873C39.2613%201.69328%2037.813%204.19778%2038.4501%206.62326C39.0873%209.04874%2041.5694%2010.4717%2044.0505%2010.1071C47.8511%209.54855%2051.7191%209.52689%2055.5402%2010.0491C60.8642%2010.7766%2065.9928%2012.5457%2070.6331%2015.2552C75.2735%2017.9648%2079.3347%2021.5619%2082.5849%2025.841C84.9175%2028.9121%2086.7997%2032.2913%2088.1811%2035.8758C89.083%2038.2158%2091.5421%2039.6781%2093.9676%2039.0409Z'%20fill='currentFill'%20/%3e%3c/svg%3e",x1t="/",T1t={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{PersonalitiesCommands:E1t,ChatBarButton:Yk},setup(){},data(){return{isSendMenuVisible:!1,is_rt:!1,bindi
` +r,4,!1)})}catch(r){this. $ store.state.toast.showToast( ` Did not get Personality settings responses .
2024-11-12 21:28:49 +00:00
Endpoint error : ` +r.message,4,!1)}}):this. $ store.state.toast.showToast("Personality has no settings",4,!1))})}catch(e){this. $ store.state.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},async constructor(){for(We(()=>{Ze.replace()});this. $ store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await de.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=Ny}}},Bvt={class:"relative group/item"},Gvt=["src","alt"],zvt={class:"absolute bottom-6 left-0 w-full flex items-center justify-center opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 p-1"},Vvt={class:"p-1 bg-gray-500 rounded-full text-white hover:bg-gray-600 focus:outline-none ml-1",title:"Show more"},Hvt={class:"text-xs font-bold"};function qvt(n,e,t,r,i,s){const o=ht("UniversalForm");return T(),M(je,null,[c("div",Bvt,[c("button",{onClick:e[1]||(e[1]=J((...a)=>s.onSettingsPersonality&&s.onSettingsPersonality(...a),["prevent"])),class:"w-6 h-6 rounded-full overflow-hidden transition-transform duration-200 transform group-hover/item:scale-110 focus:outline-none"},[c("img",{src:s.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>s.personalityImgPlacehodler&&s.personalityImgPlacehodler(...a)),alt:s.mountedPers.name,class:qe(["w-full h-full object-cover",{"border-2 border-secondary":n.isActive}])},null,42,Gvt)]),c("div",zvt,[c("button",{onClick:e[2]||(e[2]=J(a=>s.remount_personality(),["prevent"])),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Remount"},e[4]||(e[4]=[c("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])),c("button",{onClick:e[3]||(e[3]=J(a=>s.handleOnTalk(),["prevent"])),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none ml-1",title:"Talk"},e[5]||(e[5]=[c("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})],-1)])),c("button",Vvt,[c("span",Hvt,"+"+X(s.mountedPersArr.length-1),1)])])]),W(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const GI=bt(Uvt,[["render",qvt]]),Yvt={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center overflow-hidden"}, $ vt={class:"absolute inset-0 pointer-events-none overflow-hidden"},Wvt={class:"flex flex-col items-center text-center max-w-4xl w-full px-4 relative z-10"},Kvt={class:"mb-8 w-full"},jvt={class:"bottom-0 text-2xl text-gray-600 dark:text-gray-300 italic"},Qvt={class:"text-lg text-gray-700 dark:text-gray-300"},Xvt=["innerHTML"],Zvt={class:"animated-progressbar-bg"},Jvt={class:"w-full max-w-2xl"},eyt={role:"status",class:"w-full"},tyt={class:"text-xl text-gray-700 dark:text-gray-300"},nyt={class:"text-2xl font-bold text-blue-600 dark:text-blue-400 mt-2"},ryt={key:0,class:"relative flex flex-col no-scrollbar shadow-lg min-w-[15rem] max-w-[15rem]"},iyt={class:"logo-container"},syt=["src"],oyt={class:"toolbar discussion"},ayt={class:"toolbar-container"},lyt={class:"p-4 flex flex-wrap gap-2 items-center"},cyt={class:"relative"},dyt={class:"relative"},uyt={key:4,title:"Loading..",class:"flex justify-center"},pyt={key:5,class:"flex justify-center space-x-4"},hyt={key:6,class:"flex flex-col space-y-2"},myt={class:"relative inline-block"},fyt={class:"p-2 border-b border-gray-200 dark:border-gray-700"},gyt={class:"p-4 grid grid-cols-3 gap-4 max-h-80 overflow-y-auto custom-scrollbar"},_yt={class:"flex flex-col items-center hover:bg-blue-100 dark:hover:bg-blue-900 p-2 rounded-md w-full cursor-pointer"},by
2024-11-04 00:22:50 +00:00
< ! DOCTYPE html >
< html lang = "en" >
< head >
< meta charset = "UTF-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< title > Default Render Panel < / t i t l e >
< style >
body , html {
margin : 0 ;
padding : 0 ;
height : 100 % ;
font - family : Arial , sans - serif ;
background - color : # f0f0f0 ;
}
. container {
display : flex ;
flex - direction : column ;
align - items : center ;
justify - content : center ;
height : 100 % ;
padding : 20 px ;
box - sizing : border - box ;
}
. message {
text - align : center ;
padding : 30 px ;
background - color : white ;
border - radius : 12 px ;
box - shadow : 0 4 px 20 px rgba ( 0 , 0 , 0 , 0.1 ) ;
max - width : 600 px ;
width : 100 % ;
}
h1 {
color : # 2 c3e50 ;
margin - bottom : 20 px ;
font - size : 28 px ;
}
p {
color : # 34495 e ;
margin : 0 0 15 px ;
line - height : 1.6 ;
}
. highlight {
color : # e74c3c ;
font - weight : bold ;
}
< / s t y l e >
< / h e a d >
< body >
< div class = "container" >
< div class = "message" >
< h1 > Welcome to the Interactive Render Panel < / h 1 >
< p > This space is designed to bring your ideas to life ! Currently , it ' s empty because no HTML has been generated yet . < / p >
< p > To see something amazing here , try asking the AI to < span class = "highlight" > create a specific web component or application < / s p a n > . F o r e x a m p l e : < / p >
< p > "Create a responsive image gallery" or "Build a simple todo list app" < / p >
< p > Once you request a web component , the AI will generate the necessary HTML , CSS , and JavaScript , and it will be rendered right here in this panel ! < / p >
< / d i v >
< / d i v >
< / b o d y >
< / h t m l >
2024-11-06 23:05:30 +00:00
` ,memory_icon:Ivt,active_skills:Ovt,inactive_skills:Dvt,skillsRegistry:Lvt,robot:Pvt,posts_headers:{accept:"application/json","Content-Type":"application/json"},host:"",progress_visibility_val:!0,progress_value:0,msgTypes:{MSG_TYPE_CONTENT:1,MSG_TYPE_CONTENT_INVISIBLE_TO_AI:2,MSG_TYPE_CONTENT_INVISIBLE_TO_USER:3},operationTypes:{MSG_OPERATION_TYPE_ADD_CHUNK:0,MSG_OPERATION_TYPE_SET_CONTENT:1,MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_AI:2,MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_USER:3,MSG_OPERATION_TYPE_EXCEPTION:4,MSG_OPERATION_TYPE_WARNING:5,MSG_OPERATION_TYPE_INFO:6,MSG_OPERATION_TYPE_STEP:7,MSG_OPERATION_TYPE_STEP_START:8,MSG_OPERATION_TYPE_STEP_PROGRESS:9,MSG_OPERATION_TYPE_STEP_END_SUCCESS:10,MSG_OPERATION_TYPE_STEP_END_FAILURE:11,MSG_OPERATION_TYPE_JSON_INFOS:12,MSG_OPERATION_TYPE_REF:13,MSG_OPERATION_TYPE_CODE:14,MSG_OPERATION_TYPE_UI:15,MSG_OPERATION_TYPE_NEW_MESSAGE:16,MSG_OPERATION_TYPE_FINISHED_MESSAGE:17},senderTypes:{SENDER_TYPES_USER:0,SENDER_TYPES_AI:1,SENDER_TYPES_SYSTEM:2},list:[],tempList:[],currentDiscussion:{},discussionArr:[],loading:!1,filterTitle:"",filterInProgress:!1,isCreated:!1,isCheckbox:!1,isSelectAll:!1,showSaveConfirmation:!1,showBrainConfirmation:!1,showConfirmation:!1,chime:new Audio("chime_aud.wav"),showToast:!1,isDiscussionBottom:!1,personalityAvatars:[],fileList:[],database_selectorDialogVisible:!1,isDragOverDiscussion:!1,isDragOverChat:!1,isOpen:!1,discussion_id:0}},methods:{updateRandomFact(){let n;do n=this.interestingFacts[Math.floor(Math.random()*this.interestingFacts.length)];while(n===this.randomFact&&this.interestingFacts.length>1);this.randomFact=n},handleOnTalk(n){console.log("talking"),this.showPersonalities=!1,this. $ store.state.toast.showToast( ` Personality $ { n . name } is Talking ` ,4,!0),this.onTalk(n)},onPersonalitiesReadyFun(){this. $ store.state.personalities_ready=!0},async showBindingHoveredIn(n){this.bindingHoveredIndex=n},async showBindingHoveredOut(){this.bindingHoveredIndex=null},async showModelHoveredIn(n){this.modelHoveredIndex=n},async showModelHoveredOut(){this.modelHoveredIndex=null},async showPersonalityHoveredIn(n){this.personalityHoveredIndex=n},async showPersonalityHoveredOut(){this.personalityHoveredIndex=null},async onPersonalitySelected(n){if(this.hidePersonalitiesMenu(),n){if(n.selected){this. $ store.state.toast.showToast("Personality already selected",4,!0);return}const e=n.full_path;if(console.log("pers_path",e),console.log("this. $ store.state.config.personalities",this. $ store.state.config.personalities),this. $ store.state.config.personalities.includes(e)){const t=await this.select_personality(n);await this. $ store.dispatch("refreshConfig"),await this. $ store.dispatch("refreshBindings"),await this. $ store.dispatch("refreshModelsZoo"),await this. $ store.dispatch("refreshModels"),await this. $ store.dispatch("refreshMountedPersonalities"),await this. $ store.dispatch("refreshConfig"),await this. $ store.dispatch("fetchLanguages"),await this. $ store.dispatch("fetchLanguage"),await this. $ store.dispatch("fetchisRTOn"),console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this. $ store.state.toast.showToast( ` Selected personality :
2024-11-04 00:22:50 +00:00
` +n.name,4,!0):this. $ store.state.toast.showToast( ` Error on select personality :
2024-11-12 16:41:39 +00:00
` +n.name,4,!1)}else console.log("mounting pers");this. $ emit("personalitySelected"),We(()=>{Ze.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.full_path;console.log("Selecting personality ",e);const t=this. $ store.state.config.personalities.findIndex(i=>i===e),r={client_id:this. $ store.state.client_id,id:t};try{const i=await de.post("/select_personality",r);if(i)return this. $ store.dispatch("refreshConfig").then(()=>{this. $ store.dispatch("refreshPersonalitiesZoo").then(()=>{this. $ store.dispatch("refreshMountedPersonalities")})}),i.data}catch(i){console.log(i.message,"select_personality - settings");return}},showPersonalitiesMenu(){clearTimeout(this.hideMenuTimeout),this.isPersonalitiesMenuVisible=!0},hidePersonalitiesMenu(){this.hideMenuTimeout=setTimeout(()=>{this.isPersonalitiesMenuVisible=!1},300)},copyModelName(){navigator.clipboard.writeText(this.binding_name+"::"+this.model_name),this. $ store.state.toast.showToast("Model name copyed to clipboard: "+this.binding_name+"::"+this.model_name,4,!0)},copyModelNameFrom(n){navigator.clipboard.writeText(this.binding_name+"::"+n),this. $ store.state.toast.showToast("Model name copyed to clipboard: "+this.binding_name+"::"+this.model_name,4,!0)},showBindingsMenu(){clearTimeout(this.hideBindingsMenuTimeout),this.isBindingsMenuVisible=!0},hideBindingsMenu(){this.hideBindingsMenuTimeout=setTimeout(()=>{this.isBindingsMenuVisible=!1},300)},setBinding(n){console.log("Setting binding to "+n.name),this.selecting_binding=!0,this.selectedBinding=n,this. $ store.state.messageBox.showBlockingMessage("Loading binding"),de.post("/update_setting",{client_id:this. $ store.state.client_id,setting_name:"binding_name",setting_value:n.name}).then(async e=>{this. $ store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this. $ store.dispatch("refreshConfig"),await this. $ store.dispatch("refreshBindings"),await this. $ store.dispatch("refreshModelsZoo"),await this. $ store.dispatch("refreshModels"),this. $ store.state.toast.showToast( ` Binding changed to $ { this . currentBinding . name } ` ,4,!0),this.selecting_binding=!1}).catch(e=>{this. $ store.state.messageBox.hideMessage(),this. $ store.state.toast.showToast( ` Error $ { e } ` ,4,!0),this.selecting_binding=!1})},showModelsMenu(){clearTimeout(this.hideModelsMenuTimeout),this.isModelsMenuVisible=!0},hideModelsMenu(){this.hideModelsMenuTimeout=setTimeout(()=>{this.isModelsMenuVisible=!1},300)},setModel(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,this. $ store.state.messageBox.showBlockingMessage("Loading model"),de.post("/update_setting",{client_id:this. $ store.state.client_id,setting_name:"model_name",setting_value:n.name}).then(async e=>{this. $ store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this. $ store.dispatch("refreshConfig"),await this. $ store.dispatch("refreshModels"),this. $ store.state.toast.showToast( ` Model changed to $ { this . currentModel . name } ` ,4,!0),this.selecting_model=!1}).catch(e=>{this. $ store.state.messageBox.hideMessage(),this. $ store.state.toast.showToast( ` Error $ { e } ` ,4,!0),this.selecting_model=!1})},showModelConfig(){try{this.isLoading=!0,de.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this. $ store.state.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{de.post("/set_active_binding_settings",{client_id:this. $ store.state.client_id,settings:e}).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this. $ store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this. $ store.state.toast.showToast( ` Did not get binding settings responses .
2024-11-04 00:22:50 +00:00
` +t,4,!1),this.isLoading=!1)})}catch(t){this. $ store.state.toast.showToast( ` Did not get binding settings responses .
Endpoint error : ` +t.message,4,!1),this.isLoading=!1}}):(this. $ store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(n){this.isLoading=!1,this. $ store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},async remount_personality(n){if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this. $ store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await de.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this. $ store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},async unmountPersonality(n){if(console.log("Unmounting personality:",n),!n)return;const e=await this.unmount_personality(n.personality||n);if(console.log(e),e.status){this. $ store.state.config.personalities=e.personalities,this. $ store.state.toast.showToast("Personality unmounted",4,!0),this. $ store.dispatch("refreshMountedPersonalities");const t=this. $ store.state.mountedPersArr[this. $ store.state.mountedPersArr.length-1];console.log(t,this. $ store.state.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this. $ store.state.toast.showToast( ` Selected personality :
` +t.name,4,!0)}else this. $ store.state.toast.showToast( ` Could not unmount personality
Error : ` +e.error,4,!1)},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this. $ store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await de.post("/unmount_personality",e);if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},handleShortcut(n){n.ctrlKey&&n.key==="d"&&(n.preventDefault(),n.stopPropagation(),this.createNewDiscussion())},toggleMenu(){this.isMenuVisible=!this.isMenuVisible,this.isMenuVisible&&(this.isinfosMenuVisible=!1),We(()=>{Ze.replace()})},showMenu(){this.isMenuVisible=!0,We(()=>{Ze.replace()})},hideMenu(){this.isMenuVisible=!1,We(()=>{Ze.replace()})},adjustMenuPosition(){const n=this. $ refs.languageMenu;if(n){const e=n.getBoundingClientRect(),t=window.innerWidth;e.right>t?(n.style.left="auto",n.style.right="0"):(n.style.left="0",n.style.right="auto")}},restartProgram(n){n.preventDefault(),this. $ store.state.api_post_req("restart_program",this. $ store.state.client_id),this.rebooting_audio.play(),this. $ store.state.toast.showToast("Rebooting the app. Please wait...",410,!1),console.log("this. $ store.state.api_get_req",this. $ store.state.api_get_req),setTimeout(()=>{window.close()},2e3)},applyConfiguration(){this.isLoading=!0,console.log(this. $ store.state.config),de.post("/apply_settings",{client_id:this. $ store.state.client_id,config:this. $ store.state.config},{headers:this.posts_headers}).then(n=>{this.isLoading=!1,n.data.status?(this. $ store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this. $ store.state.toast.showToast("Configuration change failed.",4,!1),We(()=>{Ze.replace()})})},getRandomEdgePosition(){switch(Math.floor(Math.random()*4)){case 0:return 0;case 1:return 100;case 2:return Math.random()*100;case 3:return Math.random()*100}},extractTitle(n){const e=n.match(/@<(.*?)>@/);return e?e[1]:null},getPromptContent(n){return n.replace(/@<.*?>@/,"").trim()},handlePromptSelection(n){this.selectedPrompt=n;const e=this.extractTitle(n);console.log("title"),console.log(e),e?this.previewPrompt=this.getPromptContent(n):this.previewPrompt=n,this.placeholders=this.extractPlaceholders(n),this.placeholders.length>0?(this.showPlaceholderModal=!0,this.placeholderValues={}):this.setPromptInChatbox(n)},updatePreview(){let n=this.selectedPrompt;this.parsedPlaceholders.forEach((e,t)=>{const r=this.placeholderValues[t],i=new RegExp(this.escapeRegExp(e.fullText),"g");n=n.replace(i,r||e.fullText)}),this.previewPrompt=n,console.log("previewPrompt"),console.log(this.previewPrompt)},escapeRegExp(n){return n.replace(/[.*+?^ ${ } ()|[ \] \\ ]/g," \\ $ &")},cancelPlaceholders(){this.showPlaceholderModal=!1,this.placeholders=[],this.placeholderValues={},this.previewPrompt=""},applyPlaceholders(){let n=this.selectedPrompt;this.parsedPlaceholders.forEach((e,t)=>{const r=this.placeholderValues[t];if(r){const i=new RegExp(this.escapeRegExp(e.fullText),"g");n=n.replace(i,r)}}),this.finalPrompt=n,this.showPlaceholderModal=!1,console.log("previewPrompt apply"),console.log(this.previewPrompt),this.setPromptInChatbox(this.getPromptContent(this.previewPrompt))},extractPlaceholders(n){const e=/ \[ (.*?) \] /g;return[...n.matchAll(e)].map(t=>t[0])},setPromptInChatbox(n){this. $ refs.chatBox.message=n},extractHtml(){if(this.discussionArr.length>0){const n=this.discussionArr[this.discussionArr.length-1].content,e=" ` ` ` html ",t=" ` ` ` ";let r=n.indexOf(e);if(r===-1)return this.lastMessageHtml=this.defaultMessageHtml,this.renderIsolatedContent(),this.defaultMessageHtml;r+=e.length;let i=n.indexOf(t,r);i===-1?this.lastMessageHtml=n.slice(r).trim():this.lastMessageHtml=n.slice(r,i).trim()}else this.lastMessageHtml=this.defaultMessageHtml;this.renderIsolatedContent()},renderIsolatedContent(){const n=document.createElement("iframe");if(n.style.border="none",n.style.width="100%",n.style.height="100%",this. $ refs.isolatedContent){this. $ refs.isolatedContent.innerHTML="",this. $ refs.isolatedContent.appendChild(n);const e=n.contentDocument||n.contentWindow.document;e.open(),e.write( `
$ { this . lastMessageHtml }
` ),e.close()}},async triggerRobotAction(){this.rightPanelCollapsed=!this.rightPanelCollapsed,this.rightPanelCollapsed||(this. $ store.commit("setleftPanelCollapsed",!1),this. $ nextTick(()=>{this.extractHtml()})),console.log(this.rightPanelCollapsed)},add_webpage(){console.log("addWebLink received"),this. $ refs.web_url_input_box.showPanel()},addWebpage(){de.post("/add_webpage",{client_id:this.client_id,url:this. $ refs.web_url_input_box.inputText},{headers:this.posts_headers}).then(n=>{n&&n.status&&(console.log("Done"),this.recoverFiles())})},show_progress(n){this.progress_visibility_val=!0},hide_progress(n){this.progress_visibility_val=!1},update_progress(n){console.log("Progress update"),this.progress_value=n.value},onSettingsBinding(){try{this.isLoading=!0,de.get("/get_active_binding_settings").then(n=>{if(this.isLoading=!1,n)if(n.data&&Object.keys(n.data).length>0){const e=this. $ store.state.bindingsZoo.find(t=>t.name==this.state.config.binding_name);this. $ store.state.universalForm.showForm(n.data,"Binding settings - "+e.binding.name,"Save changes","Cancel").then(t=>{try{de.post("/set_active_binding_settings",{client_id:this. $ store.state.client_id,settings:t}).then(r=>{r&&r.data?(console.log("binding set with new settings",r.data),this. $ store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this. $ store.state.toast.showToast( ` Did not get binding settings responses .
` +r,4,!1),this.isLoading=!1)})}catch(r){this. $ store.state.toast.showToast( ` Did not get binding settings responses .
Endpoint error : ` +r.message,4,!1),this.isLoading=!1}})}else this. $ store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1})}catch(n){this.isLoading=!1,this. $ store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},showDatabaseSelector(){this.database_selectorDialogVisible=!0},async ondatabase_selectorDialogRemoved(n){console.log("Deleted:",n)},async ondatabase_selectorDialogSelected(n){console.log("Selected:",n)},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async onvalidatedatabase_selectorChoice(n){this.database_selectorDialogVisible=!1;const e={client_id:this.client_id,name:typeof n=="string"?n:n.name};if(console.log("data:"),console.log(e),(await de.post("/select_database",e,{headers:this.posts_headers})).status){console.log("Selected database"),this. $ store.state.config=await de.post("/get_config",{client_id:this.client_id}),console.log("new config loaded :",this. $ store.state.config);let r=await de.get("/list_databases").data;console.log("New list of database: ",r),this. $ store.state.databases=r,console.log("New list of database: ",this. $ store.state.databases),location.reload()}},async addDiscussion2SkillsLibrary(){(await de.post("/add_discussion_to_skills_library",{client_id:this.client_id},{headers:this.posts_headers})).status&&console.log("done")},async toggleSkillsLib(){this. $ store.state.config.activate_skills_lib=!this. $ store.state.config.activate_skills_lib,await this.applyConfiguration()},async showSkillsLib(){this. $ refs.skills_lib.showSkillsLibrary()},async applyConfiguration(){this.loading=!0;const n=await de.post("/apply_settings",{client_id:this. $ store.state.client_id,config:this. $ store.state.config});this.loading=!1,n.data.status?this. $ store.state.toast.showToast("Configuration changed successfully.",4,!0):this. $ store.state.toast.showToast("Configuration change failed.",4,!1),We(()=>{Ze.replace()})},save_configuration(){this.showConfirmation=!1,de.post("/save_settings",{}).then(n=>{if(n)return n.status?this. $ store.state.toast.showToast("Settings saved!",4,!0):this. $ store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this. $ store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(n,e,t){console.log("sending",n),this. $ store.state.toast.showToast(n,e,t)},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(n){try{const e=await de.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const n=await de.get("/list_discussions");if(n)return this.createDiscussionList(n.data),n.data}catch(n){return console.log("Error: Could not list discussions",n.message),[]}},load_discussion(n,e){n&&(console.log("Loading discussion",n),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(n,this.loading),rt.on("discussion",t=>{console.log("Discussion recovered"),this.loading=!1,this.setDiscussionLoading(n,this.loading),t&&(this.discussionArr=t.filter(r=>r.message_type==this.msgTypes.MSG_TYPE_CONTENT||r.message_type==this.msgTypes.MSG_TYPE_CONTENT_INVISIBLE_TO_AI),this.discussionArr.forEach(r=>{r.status_message="Done"}),console.log("this.discussionArr"),console.log(this.discussionArr),e&&e()),rt.off("discussion"),this.extractHtml()}),rt.emit("load_discussion",{id:n}))},recoverFiles(){console.log("Recovering files"),de.post("/get_discussion_files_list",{client_id:this. $ store.state.client_id}).then(n=>{this. $ refs.chatBox.filesList=n.data.files,this. $ refs.chatBox.isFileSentList=n.data.files.map(e=>!0),console.log( ` Files recovered : $ { this . $refs . chatBox . filesList } ` )})},new_discussion(n){try{this.loading=!0,rt.on("discussion_created",e=>{rt.off("discussion_created"),this.list_discussions().then(()=>{const t=this.list.findIndex(i=>i.id==e.id),r=this.list[t];this.selectDiscussion(r),this.load_discussion(e.id,()=>{this.loading=!1,this.recoverFiles(),We(()=>{const i=document.getElementById("dis-"+e.id);this.scrollToElement(i),console.log("Scro
Personality : $ { n . message . personality } ` );let i="";n.created_at_parsed&&(i= `
Created : $ { n . created _at _parsed } ` );let s="";n.message.model&&(s= ` Model : $ { n . message . model } ` );let o="";n.message.seed&&(o= ` Seed : $ { n . message . seed } ` );let a="";n.time_spent&&(a= `
Time spent : $ { n . time _spent } ` );let l="";l= ` $ { t } $ { s } $ { o } $ { a } ` .trim();const d= ` $ { n . message . sender } $ { r } $ { i }
$ { e }
$ { l } ` ;navigator.clipboard.writeText(d)}else navigator.clipboard.writeText(e);this. $ store.state.toast.showToast("Copied to clipboard successfully",4,!0),We(()=>{Ze.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(n,e){e=e||"data.json";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([JSON.stringify(n,null,2)],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},saveMarkdowntoFile(n,e){e=e||"data.md";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([n],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},parseJsonObj(n){try{return JSON.parse(n)}catch(e){return this. $ store.state.toast.showToast( ` Could not parse JSON .
` +e.message,4,!1),null}},async parseJsonFile(n){return new Promise((e,t)=>{const r=new FileReader;r.onload=i=>e(this.parseJsonObj(i.target.result)),r.onerror=i=>t(i),r.readAsText(n)})},async exportDiscussionsAsMarkdown(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),r=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+r+"."+i+"."+s+o+a)+".md";this.loading=!0;const u=await this.export_multiple_discussions(n,"markdown");u?(this.saveMarkdowntoFile(u,d),this. $ store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this. $ store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async exportDiscussions(){},async exportDiscussionsAsJson(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),r=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+r+"."+i+"."+s+o+a)+".json";this.loading=!0;const u=await this.export_multiple_discussions(n,"json");u?(this.saveJSONtoFile(u,d),this. $ store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this. $ store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async importDiscussionsBundle(n){},async importDiscussions(n){const e=await this.parseJsonFile(n.target.files[0]);await this.import_multiple_discussions(e)?(this. $ store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this. $ store.state.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this. $ store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let n=this. $ store.state.personalities;this.personalityAvatars=n.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(n){if(n.toLowerCase().trim()==this. $ store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this. $ store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(r=>r.name===n),t=this.personalityAvatars[e];if(t)return console.log("Avatar",t.avatar),t.avatar},setFileListChat(n){try{this. $ refs.chatBox.fileList=this. $ refs.chatBox.fileList.concat(n)}catch(e){this. $ store.state.toast.showToast( ` Failed to set filelist in chatbox
2024-11-11 23:13:41 +00:00
` +e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this. $ store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this. $ store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this. $ store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){this.randomFact=this.interestingFacts[Math.floor(Math.random()*this.interestingFacts.length)],console.log("Created discussions view");const e=(await de.get("/get_versionID")).data.versionId;rt.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),console.log( ` Saved discussion to : $ { this . currentDiscussion . id } ` ),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.versionId!==e&&(this. $ store.commit("updateVersionId",e),window.location.reload(!0)),this. $ nextTick(()=>{Ze.replace()}),console.log("Connected to socket io");try{this. $ store.state.loading_infos="Getting version",this. $ store.state.loading_progress=30,await this. $ store.dispatch("getVersion")}catch(t){console.log("Error cought:",t)}try{for(this. $ store.state.loading_infos="Loading Configuration";rt.id===void 0;)await new Promise(t=>setTimeout(t,100));this. $ store.state.client_id=rt.id,console.log(this. $ store.state.client_id),await this. $ store.dispatch("refreshConfig"),console.log("Config ready")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Loading Database",this. $ store.state.loading_progress=20,await this. $ store.dispatch("refreshDatabase")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting Bindings list",this. $ store.state.loading_progress=40,await this. $ store.dispatch("refreshBindings")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting personalities zoo",this. $ store.state.loading_progress=70,await this. $ store.dispatch("refreshPersonalitiesZoo")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting mounted personalities",this. $ store.state.loading_progress=80,await this. $ store.dispatch("refreshMountedPersonalities")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting models zoo",this. $ store.state.loading_progress=90,await this. $ store.dispatch("refreshModelsZoo")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting active models",this. $ store.state.loading_progress=100,await this. $ store.dispatch("refreshModels"),await this. $ store.dispatch("refreshModelStatus")}catch(t){console.log("Error cought:",t)}try{await this. $ store.dispatch("fetchLanguages"),await this. $ store.dispatch("fetchLanguage")}catch(t){console.log("Error cought:",t)}try{await this. $ store.dispatch("fetchisRTOn")}catch(t){console.log("Error cought:",t)}this. $ store.state.isConnected=!0,this. $ store.state.client_id=rt.id,console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),this.isCreated=!0,this. $ store.state.ready=!0,rt.on("connected",this.socketIOConnected),rt.on("disconnected",this.socketIODisconnected),console.log("Added events"),rt.on("show_progress",this.show_progress),rt.on("hide_progress",this.hide_progress),rt.on("update_progress",this.update_progress),rt.on("notification",this.notify),rt.on("new_message",this.new_message),rt.on("update_message",this.update_message),rt.on("close_message",this.finalMsgEvent),rt.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const r=this.list.findIndex(s=>s.id==t.discussion_id),i=this.list[r];i.title=t.title}),rt.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnect
2024-11-04 00:22:50 +00:00
2 px 2 px 0 px white , \ r
- 2 px - 2 px 0 px white , \ r
2 px - 2 px 0 px white , \ r
2024-11-12 21:28:49 +00:00
- 2 px 2 px 0 px white ` ,background:"linear-gradient(45deg, #f59e0b, #fbbf24)","-webkit-background-clip":"text","background-clip":"text"}},[pt(" L"),c("span",{class:"animate-pulse"},"⭐"),pt("LLMS ")],-1)),t[60]||(t[60]=c("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic"}," One tool to rule them all ",-1)),t[61]||(t[61]=c("p",{class:"text-xl text-gray-500 dark:text-gray-400 mb-6"}," by ParisNeo ",-1)),c("p",jvt,X(e.version_info),1),c("div",{class:"interesting-facts transition-transform duration-300 cursor-pointer",onClick:t[0]||(t[0]=(...r)=>e.updateRandomFact&&e.updateRandomFact(...r))},[c("p",Qvt,[t[57]||(t[57]=c("span",{class:"font-semibold text-blue-600 dark:text-blue-400"},"🤔 Fun Fact: ",-1)),c("span",{innerHTML:e.randomFact},null,8,Xvt)])]),c("div",Zvt,[c("div",{class:"animated-progressbar-fg",style:on({width: ` $ { e . loading _progress } % ` })},null,4),c("div",{class:"absolute top-0 h-full flex items-center transition-all duration-300",style:on({left: ` $ { e . loading _progress } % ` ,transform:"translateX(-50%)"})},t[58]||(t[58]=[c("p",{style:{"font-size":"48px","line-height":"1"}},"🌟",-1)]),4)])]),c("div",Jvt,[c("div",eyt,[c("p",tyt,X(e.loading_infos)+"... ",1),c("p",nyt,X(Math.round(e.loading_progress))+"% ",1)])])])]))]),_:1}),W(ji,{name:"slide-right"},{default:Ge(()=>[e.showLeftPanel?(T(),M("div",ryt,[W(Pt(Ip),{to:{name:"discussions"},class:"flex items-center space-x-2"},{default:Ge(()=>[c("div",iyt,[c("img",{class:"w-12 h-12 rounded-full object-cover logo-image",src:e. $ store.state.config==null?Pt(Ai):e. $ store.state.config.app_custom_logo!=""?"/user_infos/"+e. $ store.state.config.app_custom_logo:Pt(Ai),alt:"Logo",title:"LoLLMS WebUI"},null,8,syt)]),t[62]||(t[62]=c("div",{class:"flex flex-col justify-center"},[c("div",{class:"text-center p-2"},[c("div",{class:"text-md relative inline-block"},[c("span",{class:"relative inline-block font-bold tracking-wide text-black dark:text-white"}," LoLLMS "),c("div",{class:"absolute -bottom-0.5 left-0 w-full h-0.5 bg-black dark:bg-white transform origin-left transition-transform duration-300 hover:scale-x-100 scale-x-0"})])]),c("p",{class:"text-gray-400 text-sm"},"One tool to rule them all")],-1))]),_:1}),c("div",oyt,[c("div",ayt,[c("button",{class:"toolbar-button",title:"Create new discussion",onClick:t[1]||(t[1]=(...r)=>e.createNewDiscussion&&e.createNewDiscussion(...r))},t[63]||(t[63]=[c("i",{"data-feather":"plus"},null,-1)])),e.loading?Y("",!0):(T(),M("div",{key:0,class:"toolbar-button",onMouseleave:t[19]||(t[19]=(...r)=>e.hideMenu&&e.hideMenu(...r))},[F(c("div",{onMouseenter:t[17]||(t[17]=(...r)=>e.showMenu&&e.showMenu(...r)),class:"absolute m-0 p-0 z-50 top-full left-0 transform bg-white dark:bg-bg-dark rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[c("div",lyt,[c("button",{class:qe(["text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95",e.isCheckbox?"text-secondary dark:text-secondary-light":"text-gray-700 dark:text-gray-300"]),title:"Edit discussion list",type:"button",onClick:t[2]||(t[2]=r=>e.isCheckbox=!e.isCheckbox)},t[64]||(t[64]=[c("i",{"data-feather":"check-square"},null,-1)]),2),c("button",{class:"text-3xl hover:text-red-500 dark:hover:text-red-400 duration-150 active:scale-95",title:"Reset database, remove all discussions",onClick:t[3]||(t[3]=J(()=>{},["stop"]))},t[65]||(t[65]=[c("i",{"data-feather":"trash-2"},null,-1)])),c("button",{class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95",title:"Export database",type:"button",onClick:t[4]||(t[4]=J(r=>e.database_selectorDialogVisible=!0,["stop"]))},t[66]||(t[66]=[c("i",{"data-feather":"database"},null,-1)])),c("div",cyt,[c("input",{type:"file",ref:"fileDialog",class:"hidden",onChange:t[5]||(t[5]=(...r)=>e.importDiscussions&&e.importDiscussions(...r))},null,544),c("button",{class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95 rotate-90",title:"Import discussions",type:"button",o
2024-11-04 00:22:50 +00:00
* @ license
* Copyright 2010 - 2023 Three . js Authors
* SPDX - License - Identifier : MIT
2024-11-11 23:13:41 +00:00
* / c o n s t q y = " 1 5 9 " , j E t = 0 , E A = 1 , Q E t = 2 , z I = 1 , X E t = 2 , v s = 3 , F s = 0 , k r = 1 , V i = 2 , S o = 0 , b l = 1 , S A = 2 , x A = 3 , T A = 4 , Z E t = 5 , n a = 1 0 0 , J E t = 1 0 1 , e S t = 1 0 2 , w A = 1 0 3 , C A = 1 0 4 , t S t = 2 0 0 , n S t = 2 0 1 , r S t = 2 0 2 , i S t = 2 0 3 , R 1 = 2 0 4 , M 1 = 2 0 5 , s S t = 2 0 6 , o S t = 2 0 7 , a S t = 2 0 8 , l S t = 2 0 9 , c S t = 2 1 0 , d S t = 2 1 1 , u S t = 2 1 2 , p S t = 2 1 3 , h S t = 2 1 4 , m S t = 0 , f S t = 1 , g S t = 2 , t h = 3 , _ S t = 4 , b S t = 5 , v S t = 6 , y S t = 7 , Y y = 0 , E S t = 1 , S S t = 2 , x o = 0 , x S t = 1 , T S t = 2 , w S t = 3 , C S t = 4 , A S t = 5 , A A = " a t t a c h e d " , R S t = " d e t a c h e d " , V I = 3 0 0 , O l = 3 0 1 , D l = 3 0 2 , N 1 = 3 0 3 , k 1 = 3 0 4 , s m = 3 0 6 , L l = 1 e 3 , J r = 1 0 0 1 , n h = 1 0 0 2 , $ n = 1 0 0 3 , I 1 = 1 0 0 4 , m p = 1 0 0 5 , C r = 1 0 0 6 , H I = 1 0 0 7 , x a = 1 0 0 8 , T o = 1 0 0 9 , M S t = 1 0 1 0 , N S t = 1 0 1 1 , $ y = 1 0 1 2 , q I = 1 0 1 3 , b o = 1 0 1 4 , T s = 1 0 1 5 , _ d = 1 0 1 6 , Y I = 1 0 1 7 , $ I = 1 0 1 8 , p a = 1 0 2 0 , k S t = 1 0 2 1 , e i = 1 0 2 3 , I S t = 1 0 2 4 , O S t = 1 0 2 5 , h a = 1 0 2 6 , P l = 1 0 2 7 , D S t = 1 0 2 8 , W I = 1 0 2 9 , L S t = 1 0 3 0 , K I = 1 0 3 1 , j I = 1 0 3 3 , Q 0 = 3 3 7 7 6 , X 0 = 3 3 7 7 7 , Z 0 = 3 3 7 7 8 , J 0 = 3 3 7 7 9 , R A = 3 5 8 4 0 , M A = 3 5 8 4 1 , N A = 3 5 8 4 2 , k A = 3 5 8 4 3 , Q I = 3 6 1 9 6 , I A = 3 7 4 9 2 , O A = 3 7 4 9 6 , D A = 3 7 8 0 8 , L A = 3 7 8 0 9 , P A = 3 7 8 1 0 , F A = 3 7 8 1 1 , U A = 3 7 8 1 2 , B A = 3 7 8 1 3 , G A = 3 7 8 1 4 , z A = 3 7 8 1 5 , V A = 3 7 8 1 6 , H A = 3 7 8 1 7 , q A = 3 7 8 1 8 , Y A = 3 7 8 1 9 , $ A = 3 7 8 2 0 , W A = 3 7 8 2 1 , e b = 3 6 4 9 2 , K A = 3 6 4 9 4 , j A = 3 6 4 9 5 , P S t = 3 6 2 8 3 , Q A = 3 6 2 8 4 , X A = 3 6 2 8 5 , Z A = 3 6 2 8 6 , b d = 2 3 0 0 , F l = 2 3 0 1 , t b = 2 3 0 2 , J A = 2 4 0 0 , e R = 2 4 0 1 , t R = 2 4 0 2 , F S t = 2 5 0 0 , U S t = 0 , X I = 1 , O 1 = 2 , Z I = 3 e 3 , m a = 3 0 0 1 , B S t = 3 2 0 0 , G S t = 3 2 0 1 , W y = 0 , z S t = 1 , t i = " " , M n = " s r g b " , e r = " s r g b - l i n e a r " , K y = " d i s p l a y - p 3 " , o m = " d i s p l a y - p 3 - l i n e a r " , r h = " l i n e a r " , b n = " s r g b " , i h = " r e c 7 0 9 " , s h = " p 3 " , B a = 7 6 8 0 , n R = 5 1 9 , V S t = 5 1 2 , H S t = 5 1 3 , q S t = 5 1 4 , J I = 5 1 5 , Y S t = 5 1 6 , $ S t = 5 1 7 , W S t = 5 1 8 , K S t = 5 1 9 , D 1 = 3 5 0 4 4 , r R = " 3 0 0 e s " , L 1 = 1 0 3 5 , w s = 2 e 3 , o h = 2 0 0 1 ; c l a s s s c { a d d E v e n t L i s t e n e r ( e , t ) { t h i s . _ l i s t e n e r s = = = v o i d 0 & & ( t h i s . _ l i s t e n e r s = { } ) ; c o n s t r = t h i s . _ l i s t e n e r s ; r [ e ] = = = v o i d 0 & & ( r [ e ] = [ ] ) , r [ e ] . i n d e x O f ( t ) = = = - 1 & & r [ e ] . p u s h ( t ) } h a s E v e n t L i s t e n e r ( e , t ) { i f ( t h i s . _ l i s t e n e r s = = = v o i d 0 ) r e t u r n ! 1 ; c o n s t r = t h i s . _ l i s t e n e r s ; r e t u r n r [ e ] ! = = v o i d 0 & & r [ e ] . i n d e x O f ( t ) ! = = - 1 } r e m o v e E v e n t L i s t e n e r ( e , t ) { i f ( t h i s . _ l i s t e n e r s = = = v o i d 0 ) r e t u r n ; c o n s t i = t h i s . _ l i s t e n e r s [ e ] ; i f ( i ! = = v o i d 0 ) { c o n s t s = i . i n d e x O f ( t ) ; s ! = = - 1 & & i . s p l i c e ( s , 1 ) } } d i s p a t c h E v e n t ( e ) { i f ( t h i s . _ l i s t e n e r s = = = v o i d 0 ) r e t u r n ; c o n s t r = t h i s . _ l i s t e n e r s [ e . t y p e ] ; i f ( r ! = = v o i d 0 ) { e . t a r g e t = t h i s ; c o n s t i = r . s l i c e ( 0 ) ; f o r ( l e t s = 0 , o = i . l e n g t h ; s < o ; s + + ) i [ s ] . c a l l ( t h i s , e ) ; e . t a r g e t = n u l l } } } c o n s t r r = [ " 0 0 " , " 0 1 " , " 0 2 " , " 0 3 " , " 0 4 " , " 0 5 " , " 0 6 " , " 0 7 " , " 0 8 " , " 0 9 " , " 0 a " , " 0 b " , " 0 c " , " 0 d " , " 0 e " , " 0 f " , " 1 0 " , " 1 1 " , " 1 2 " , " 1 3 " , " 1 4 " , " 1 5 " , " 1 6 " , " 1 7 " , " 1 8 " , " 1 9 " , " 1 a " , " 1 b " , " 1 c " , " 1 d " , " 1 e " , " 1 f " , " 2 0 " , " 2 1 " , " 2 2 " , " 2 3 " , " 2 4 " , " 2 5 " , " 2 6 " , " 2 7 " , " 2 8 " , " 2 9 " , " 2 a " , " 2 b " , " 2 c " , " 2 d " , " 2 e " , " 2 f " , " 3 0 " , " 3 1 " , " 3 2 " , " 3 3 " , " 3 4 " , " 3 5 " , " 3 6 " , " 3 7 " , " 3 8 " , " 3 9 " , " 3 a " , " 3 b " , " 3 c " , " 3 d " , " 3 e " , " 3 f " , " 4 0 " , " 4 1 " , " 4 2 " , " 4 3 " , " 4 4 " , " 4 5 " , " 4 6 " , " 4 7 " , " 4 8 " , " 4 9 " , " 4 a " , " 4 b " , " 4 c " , " 4 d " , " 4 e " , " 4 f " , " 5 0 " , " 5 1 " , " 5 2 " , " 5 3 " , " 5 4 " , " 5 5 " , " 5 6 " , " 5 7 " , " 5 8 " , " 5 9 " , " 5 a " , " 5 b " , " 5 c " , " 5 d " , " 5 e " , " 5 f " , " 6 0 " , " 6 1 " , " 6 2 " , " 6 3 " , " 6 4 " , " 6 5 " , " 6 6 " , " 6 7 " , " 6 8 " , " 6 9 " , " 6 a " , " 6 b " , " 6 c " , " 6 d " , " 6 e " , " 6 f " , " 7 0 " , " 7 1 " , " 7 2 " , " 7 3 " , " 7 4 " , " 7 5 " , " 7 6 " , " 7 7 " , " 7 8 " , " 7 9 " , " 7 a " , " 7 b " , " 7 c " , " 7 d " , " 7 e " , " 7 f " , " 8 0 " , " 8 1 " , " 8 2 " , " 8 3 " , " 8 4 " , " 8 5 " , " 8 6 " , " 8 7 " , " 8 8 " , " 8 9 " , " 8 a " , " 8 b " , " 8 c " , " 8 d " , " 8 e " , " 8 f " , " 9 0 " , " 9 1 " , " 9 2 " , " 9 3 " , " 9 4 " , " 9 5 " , " 9 6 " , " 9 7 " , " 9 8 " , " 9 9 " , " 9 a " , " 9 b " , " 9 c " , " 9 d " , " 9 e " , " 9 f " , " a 0 " , " a 1 " , " a 2 " , " a 3 " , " a 4 " , " a 5 " , " a 6 " , " a 7 " , " a 8 " , " a 9 " , " a a " , " a b " , " a c " , " a d " , " a e " , " a f " , " b 0 " , " b 1 " , " b 2 " , " b 3 " , " b 4 " , " b 5 " , " b 6 " , " b 7 " , " b 8 " , " b 9 " , " b a " , " b b " , " b c " , " b d " , " b e " , " b f " , " c 0 " , " c 1 " , " c 2 " , " c 3 " , " c 4 " , " c 5 " , " c 6 " , " c 7 " , " c 8 " , " c 9 " , " c a " , " c b " , " c c " , " c d " , " c e " , " c f " , " d 0 " , " d 1 " , " d 2 " , " d 3 " , " d 4 " , " d 5 " , " d 6 " , " d 7 " , " d 8 " , " d 9 " , " d a " , " d b " , " d c " , " d d " , " d e " , " d f " , " e 0 " , " e 1 " , " e 2 " , " e 3 " , " e 4 " , " e 5 " , " e 6 " , " e 7 " , " e 8 " , " e 9 " , " e a " , " e b " , " e c " , " e d " , " e e " , " e f " , " f 0 " , " f 1 " , " f 2 " , " f 3 " , " f 4 " , " f 5 " , " f 6 " , " f 7 " , " f 8 " , " f 9 " , " f a " , " f b " , " f c " , " f d " , " f e " , " f f " ] ; l e t i R = 1 2 3 4 5 6 7 ; c o n s t Q c = M a t h . P I / 1 8 0 , U l = 1 8 0 / M a t h . P I ; f u n c t i o n R i ( ) { c o n s t n = M a t h . r a n d o m ( ) * 4 2 9 4 9 6 7 2 9 5 | 0 , e = M a t h . r a n d o m ( ) * 4 2 9 4 9 6 7 2 9 5 | 0 , t = M a t h . r a n d o m ( ) * 4 2 9 4 9 6 7 2 9 5 | 0 , r = M a t h . r a n d o m ( ) * 4 2 9 4 9 6 7 2 9 5 | 0 ; r e t u r n ( r r [ n & 2 5 5 ] + r r [ n > > 8 & 2 5 5 ] + r r [ n > > 1 6 & 2 5 5 ] + r r [ n > > 2 4 & 2 5 5 ] + " - " + r r [ e & 2 5 5 ] + r r [ e > > 8 & 2 5 5 ] + " - " + r r [ e > > 1 6 & 1 5 | 6 4 ] + r r [ e > > 2 4 & 2 5 5 ] + " - " + r r [ t & 6 3 | 1 2 8 ] + r r [ t > > 8 & 2 5 5 ] + " - " + r r [ t > > 1 6 & 2 5 5 ] + r r [ t > > 2 4 & 2 5 5 ] + r r [ r & 2 5 5 ] + r r [ r > > 8 & 2 5 5 ] + r r [ r > > 1 6 & 2 5 5 ] + r r [ r > > 2 4 & 2 5 5 ] ) . t o L o w e r C a s e ( ) } f u n c t i o n o r ( n , e , t ) { r e t u r n M a t h . m a x ( e , M a t h . m i n ( t , n ) ) } f u n c t i o n j y ( n , e ) { r e t u r n ( n % e + e ) % e } f u n c t i o n j S t ( n , e , t , r , i ) { r e t u r n r + ( n - e ) * ( i - r ) / ( t - e ) } f u n c t i o n Q S t ( n , e , t ) { r e t u r n n ! = = e ? ( t - n ) / ( e - n ) : 0 } f u n c t i o n X c ( n , e , t ) { r e t u r n ( 1 - t ) * n + t * e } f u n c t i o n X S t ( n , e , t , r ) { r e t u r n X c ( n , e , 1 - M a t h . e x p ( - t * r ) ) } f u n c t i o n Z S t ( n , e = 1 ) { r e t u r n e - M a t h . a b s ( j y ( n , e * 2 ) - e ) } f u n c t i o n J S t ( n , e , t ) { r e t u r n n < = e ? 0 : n > = t ? 1 : ( n = ( n - e ) / ( t - e ) , n * n * ( 3 - 2 * n ) ) } f u n c t i o n e 2 t ( n , e , t ) { r e t u r n
2024-11-04 00:22:50 +00:00
gl _Position = projectionMatrix * modelViewMatrix * vec4 ( position , 1.0 ) ;
2024-11-05 00:44:58 +00:00
} ` ,N2t= ` void main ( ) {
2024-11-04 00:22:50 +00:00
gl _FragColor = vec4 ( 1.0 , 0.0 , 0.0 , 1.0 ) ;
2024-11-11 23:13:41 +00:00
} ` ;class wa extends Mi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=M2t,this.fragmentShader=N2t,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Bl(e.uniforms),this.uniformsGroups=A2t(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class cO extends wn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ht,this.projectionMatrix=new Ht,this.projectionMatrixInverse=new Ht,this.coordinateSystem=ws}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class gr extends cO{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ul*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Qc*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ul*2*Math.atan(Math.tan(Qc*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,r,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Qc*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-
2024-11-04 00:22:50 +00:00
varying vec3 vWorldDirection ;
vec3 transformDirection ( in vec3 dir , in mat4 matrix ) {
return normalize ( ( matrix * vec4 ( dir , 0.0 ) ) . xyz ) ;
}
void main ( ) {
vWorldDirection = transformDirection ( position , modelMatrix ) ;
# include < begin _vertex >
# include < project _vertex >
}
` ,fragmentShader: `
uniform sampler2D tEquirect ;
varying vec3 vWorldDirection ;
# include < common >
void main ( ) {
vec3 direction = normalize ( vWorldDirection ) ;
vec2 sampleUV = equirectUv ( direction ) ;
gl _FragColor = texture2D ( tEquirect , sampleUV ) ;
}
2024-11-11 23:13:41 +00:00
` },i=new wo(5,5,5),s=new wa({name:"CubemapFromEquirect",uniforms:Bl(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:kr,blending:So});s.uniforms.tEquirect.value=t;const o=new br(i,s),a=t.minFilter;return t.minFilter===xa&&(t.minFilter=Cr),new k2t(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,r,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,i);e.setRenderTarget(s)}}const bb=new he,O2t=new he,D2t=new Vt;class Zo{constructor(e=new he(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=bb.subVectors(r,t).cross(O2t.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(bb),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||D2t.getNormalMatrix(e),i=this.coplanarPoint(bb).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ko=new os,zu=new he;class Qy{constructor(e=new Zo,t=new Zo,r=new Zo,i=new Zo,s=new Zo,o=new Zo){this.planes=[e,t,r,i,s,o]}set(e,t,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=ws){const r=this.planes,i=e.elements,s=i[0],o=i[1],a=i[2],l=i[3],d=i[4],u=i[5],m=i[6],f=i[7],g=i[8],h=i[9],v=i[10],b=i[11],_=i[12],y=i[13],E=i[14],x=i[15];if(r[0].setComponents(l-s,f-d,b-g,x-_).normalize(),r[1].setComponents(l+s,f+d,b+g,x+_).normalize(),r[2].setComponents(l+o,f+u,b+h,x+y).normalize(),r[3].setComponents(l-o,f-u,b-h,x-y).normalize(),r[4].setComponents(l-a,f-m,b-v,x-E).normalize(),t===ws)r[5].setComponents(l+a,f+m,b+v,x+E).normalize();else if(t===oh)r[5].setComponents(a,m,v,E).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ko.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ko.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ko)}intersectsSprite(e){return Ko.center.set(0,0,0),Ko.radius=.7071067811865476,Ko.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ko)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const i=t[r];if(zu.x=i.normal.x>0?e.max.x:e.min.x,zu.y=i.normal.y>0?e.max.y:e.min.y,zu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(zu)<0)return!1}ret
2024-11-04 00:22:50 +00:00
if ( diffuseColor . a < getAlphaHashThreshold ( vPosition ) ) discard ;
2024-11-05 00:44:58 +00:00
# endif ` ,F2t= ` # ifdef USE _ALPHAHASH
2024-11-04 00:22:50 +00:00
const float ALPHA _HASH _SCALE = 0.05 ;
float hash2D ( vec2 value ) {
return fract ( 1.0 e4 * sin ( 17.0 * value . x + 0.1 * value . y ) * ( 0.1 + abs ( sin ( 13.0 * value . y + value . x ) ) ) ) ;
}
float hash3D ( vec3 value ) {
return hash2D ( vec2 ( hash2D ( value . xy ) , value . z ) ) ;
}
float getAlphaHashThreshold ( vec3 position ) {
float maxDeriv = max (
length ( dFdx ( position . xyz ) ) ,
length ( dFdy ( position . xyz ) )
) ;
float pixScale = 1.0 / ( ALPHA _HASH _SCALE * maxDeriv ) ;
vec2 pixScales = vec2 (
exp2 ( floor ( log2 ( pixScale ) ) ) ,
exp2 ( ceil ( log2 ( pixScale ) ) )
) ;
vec2 alpha = vec2 (
hash3D ( floor ( pixScales . x * position . xyz ) ) ,
hash3D ( floor ( pixScales . y * position . xyz ) )
) ;
float lerpFactor = fract ( log2 ( pixScale ) ) ;
float x = ( 1.0 - lerpFactor ) * alpha . x + lerpFactor * alpha . y ;
float a = min ( lerpFactor , 1.0 - lerpFactor ) ;
vec3 cases = vec3 (
x * x / ( 2.0 * a * ( 1.0 - a ) ) ,
( x - 0.5 * a ) / ( 1.0 - a ) ,
1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
) ;
float threshold = ( x < ( 1.0 - a ) )
? ( ( x < a ) ? cases . x : cases . y )
: cases . z ;
return clamp ( threshold , 1.0 e - 6 , 1.0 ) ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,U2t= ` # ifdef USE _ALPHAMAP
2024-11-04 00:22:50 +00:00
diffuseColor . a *= texture2D ( alphaMap , vAlphaMapUv ) . g ;
2024-11-05 00:44:58 +00:00
# endif ` ,B2t= ` # ifdef USE _ALPHAMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D alphaMap ;
2024-11-05 00:44:58 +00:00
# endif ` ,G2t= ` # ifdef USE _ALPHATEST
2024-11-04 00:22:50 +00:00
if ( diffuseColor . a < alphaTest ) discard ;
2024-11-05 00:44:58 +00:00
# endif ` ,z2t= ` # ifdef USE _ALPHATEST
2024-11-04 00:22:50 +00:00
uniform float alphaTest ;
2024-11-05 00:44:58 +00:00
# endif ` ,V2t= ` # ifdef USE _AOMAP
2024-11-04 00:22:50 +00:00
float ambientOcclusion = ( texture2D ( aoMap , vAoMapUv ) . r - 1.0 ) * aoMapIntensity + 1.0 ;
reflectedLight . indirectDiffuse *= ambientOcclusion ;
# if defined ( USE _CLEARCOAT )
clearcoatSpecularIndirect *= ambientOcclusion ;
# endif
# if defined ( USE _SHEEN )
sheenSpecularIndirect *= ambientOcclusion ;
# endif
# if defined ( USE _ENVMAP ) && defined ( STANDARD )
float dotNV = saturate ( dot ( geometryNormal , geometryViewDir ) ) ;
reflectedLight . indirectSpecular *= computeSpecularOcclusion ( dotNV , ambientOcclusion , material . roughness ) ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,H2t= ` # ifdef USE _AOMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D aoMap ;
uniform float aoMapIntensity ;
2024-11-05 00:44:58 +00:00
# endif ` ,q2t= ` # ifdef USE _BATCHING
2024-11-04 00:22:50 +00:00
attribute float batchId ;
uniform highp sampler2D batchingTexture ;
mat4 getBatchingMatrix ( const in float i ) {
int size = textureSize ( batchingTexture , 0 ) . x ;
int j = int ( i ) * 4 ;
int x = j % size ;
int y = j / size ;
vec4 v1 = texelFetch ( batchingTexture , ivec2 ( x , y ) , 0 ) ;
vec4 v2 = texelFetch ( batchingTexture , ivec2 ( x + 1 , y ) , 0 ) ;
vec4 v3 = texelFetch ( batchingTexture , ivec2 ( x + 2 , y ) , 0 ) ;
vec4 v4 = texelFetch ( batchingTexture , ivec2 ( x + 3 , y ) , 0 ) ;
return mat4 ( v1 , v2 , v3 , v4 ) ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,Y2t= ` # ifdef USE _BATCHING
2024-11-04 00:22:50 +00:00
mat4 batchingMatrix = getBatchingMatrix ( batchId ) ;
2024-11-05 00:44:58 +00:00
# endif ` , $ 2t= ` vec3 transformed = vec3 ( position ) ;
2024-11-04 00:22:50 +00:00
# ifdef USE _ALPHAHASH
vPosition = vec3 ( position ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,W2t= ` vec3 objectNormal = vec3 ( normal ) ;
2024-11-04 00:22:50 +00:00
# ifdef USE _TANGENT
vec3 objectTangent = vec3 ( tangent . xyz ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,K2t= ` float G _BlinnPhong _Implicit ( ) {
2024-11-04 00:22:50 +00:00
return 0.25 ;
}
float D _BlinnPhong ( const in float shininess , const in float dotNH ) {
return RECIPROCAL _PI * ( shininess * 0.5 + 1.0 ) * pow ( dotNH , shininess ) ;
}
vec3 BRDF _BlinnPhong ( const in vec3 lightDir , const in vec3 viewDir , const in vec3 normal , const in vec3 specularColor , const in float shininess ) {
vec3 halfDir = normalize ( lightDir + viewDir ) ;
float dotNH = saturate ( dot ( normal , halfDir ) ) ;
float dotVH = saturate ( dot ( viewDir , halfDir ) ) ;
vec3 F = F _Schlick ( specularColor , 1.0 , dotVH ) ;
float G = G _BlinnPhong _Implicit ( ) ;
float D = D _BlinnPhong ( shininess , dotNH ) ;
return F * ( G * D ) ;
2024-11-05 00:44:58 +00:00
} // validated`,j2t=`#ifdef USE_IRIDESCENCE
2024-11-04 00:22:50 +00:00
const mat3 XYZ _TO _REC709 = mat3 (
3.2404542 , - 0.9692660 , 0.0556434 ,
- 1.5371385 , 1.8760108 , - 0.2040259 ,
- 0.4985314 , 0.0415560 , 1.0572252
) ;
vec3 Fresnel0ToIor ( vec3 fresnel0 ) {
vec3 sqrtF0 = sqrt ( fresnel0 ) ;
return ( vec3 ( 1.0 ) + sqrtF0 ) / ( vec3 ( 1.0 ) - sqrtF0 ) ;
}
vec3 IorToFresnel0 ( vec3 transmittedIor , float incidentIor ) {
return pow2 ( ( transmittedIor - vec3 ( incidentIor ) ) / ( transmittedIor + vec3 ( incidentIor ) ) ) ;
}
float IorToFresnel0 ( float transmittedIor , float incidentIor ) {
return pow2 ( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ) ) ;
}
vec3 evalSensitivity ( float OPD , vec3 shift ) {
float phase = 2.0 * PI * OPD * 1.0 e - 9 ;
vec3 val = vec3 ( 5.4856 e - 13 , 4.4201 e - 13 , 5.2481 e - 13 ) ;
vec3 pos = vec3 ( 1.6810 e + 06 , 1.7953 e + 06 , 2.2084 e + 06 ) ;
vec3 var = vec3 ( 4.3278 e + 09 , 9.3046 e + 09 , 6.6121 e + 09 ) ;
vec3 xyz = val * sqrt ( 2.0 * PI * var ) * cos ( pos * phase + shift ) * exp ( - pow2 ( phase ) * var ) ;
xyz . x += 9.7470 e - 14 * sqrt ( 2.0 * PI * 4.5282 e + 09 ) * cos ( 2.2399 e + 06 * phase + shift [ 0 ] ) * exp ( - 4.5282 e + 09 * pow2 ( phase ) ) ;
xyz /= 1.0685 e - 7 ;
vec3 rgb = XYZ _TO _REC709 * xyz ;
return rgb ;
}
vec3 evalIridescence ( float outsideIOR , float eta2 , float cosTheta1 , float thinFilmThickness , vec3 baseF0 ) {
vec3 I ;
float iridescenceIOR = mix ( outsideIOR , eta2 , smoothstep ( 0.0 , 0.03 , thinFilmThickness ) ) ;
float sinTheta2Sq = pow2 ( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2 ( cosTheta1 ) ) ;
float cosTheta2Sq = 1.0 - sinTheta2Sq ;
if ( cosTheta2Sq < 0.0 ) {
return vec3 ( 1.0 ) ;
}
float cosTheta2 = sqrt ( cosTheta2Sq ) ;
float R0 = IorToFresnel0 ( iridescenceIOR , outsideIOR ) ;
float R12 = F _Schlick ( R0 , 1.0 , cosTheta1 ) ;
float T121 = 1.0 - R12 ;
float phi12 = 0.0 ;
if ( iridescenceIOR < outsideIOR ) phi12 = PI ;
float phi21 = PI - phi12 ;
vec3 baseIOR = Fresnel0ToIor ( clamp ( baseF0 , 0.0 , 0.9999 ) ) ; vec3 R1 = IorToFresnel0 ( baseIOR , iridescenceIOR ) ;
vec3 R23 = F _Schlick ( R1 , 1.0 , cosTheta2 ) ;
vec3 phi23 = vec3 ( 0.0 ) ;
if ( baseIOR [ 0 ] < iridescenceIOR ) phi23 [ 0 ] = PI ;
if ( baseIOR [ 1 ] < iridescenceIOR ) phi23 [ 1 ] = PI ;
if ( baseIOR [ 2 ] < iridescenceIOR ) phi23 [ 2 ] = PI ;
float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2 ;
vec3 phi = vec3 ( phi21 ) + phi23 ;
vec3 R123 = clamp ( R12 * R23 , 1e-5 , 0.9999 ) ;
vec3 r123 = sqrt ( R123 ) ;
vec3 Rs = pow2 ( T121 ) * R23 / ( vec3 ( 1.0 ) - R123 ) ;
vec3 C0 = R12 + Rs ;
I = C0 ;
vec3 Cm = Rs - T121 ;
for ( int m = 1 ; m <= 2 ; ++ m ) {
Cm *= r123 ;
vec3 Sm = 2.0 * evalSensitivity ( float ( m ) * OPD , float ( m ) * phi ) ;
I += Cm * Sm ;
}
return max ( I , vec3 ( 0.0 ) ) ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,Q2t= ` # ifdef USE _BUMPMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D bumpMap ;
uniform float bumpScale ;
vec2 dHdxy _fwd ( ) {
vec2 dSTdx = dFdx ( vBumpMapUv ) ;
vec2 dSTdy = dFdy ( vBumpMapUv ) ;
float Hll = bumpScale * texture2D ( bumpMap , vBumpMapUv ) . x ;
float dBx = bumpScale * texture2D ( bumpMap , vBumpMapUv + dSTdx ) . x - Hll ;
float dBy = bumpScale * texture2D ( bumpMap , vBumpMapUv + dSTdy ) . x - Hll ;
return vec2 ( dBx , dBy ) ;
}
vec3 perturbNormalArb ( vec3 surf _pos , vec3 surf _norm , vec2 dHdxy , float faceDirection ) {
vec3 vSigmaX = normalize ( dFdx ( surf _pos . xyz ) ) ;
vec3 vSigmaY = normalize ( dFdy ( surf _pos . xyz ) ) ;
vec3 vN = surf _norm ;
vec3 R1 = cross ( vSigmaY , vN ) ;
vec3 R2 = cross ( vN , vSigmaX ) ;
float fDet = dot ( vSigmaX , R1 ) * faceDirection ;
vec3 vGrad = sign ( fDet ) * ( dHdxy . x * R1 + dHdxy . y * R2 ) ;
return normalize ( abs ( fDet ) * surf _norm - vGrad ) ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,X2t= ` # if NUM _CLIPPING _PLANES > 0
2024-11-04 00:22:50 +00:00
vec4 plane ;
# pragma unroll _loop _start
for ( int i = 0 ; i < UNION _CLIPPING _PLANES ; i ++ ) {
plane = clippingPlanes [ i ] ;
if ( dot ( vClipPosition , plane . xyz ) > plane . w ) discard ;
}
# pragma unroll _loop _end
# if UNION _CLIPPING _PLANES < NUM _CLIPPING _PLANES
bool clipped = true ;
# pragma unroll _loop _start
for ( int i = UNION _CLIPPING _PLANES ; i < NUM _CLIPPING _PLANES ; i ++ ) {
plane = clippingPlanes [ i ] ;
clipped = ( dot ( vClipPosition , plane . xyz ) > plane . w ) && clipped ;
}
# pragma unroll _loop _end
if ( clipped ) discard ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,Z2t= ` # if NUM _CLIPPING _PLANES > 0
2024-11-04 00:22:50 +00:00
varying vec3 vClipPosition ;
uniform vec4 clippingPlanes [ NUM _CLIPPING _PLANES ] ;
2024-11-05 00:44:58 +00:00
# endif ` ,J2t= ` # if NUM _CLIPPING _PLANES > 0
2024-11-04 00:22:50 +00:00
varying vec3 vClipPosition ;
2024-11-05 00:44:58 +00:00
# endif ` ,ext= ` # if NUM _CLIPPING _PLANES > 0
2024-11-04 00:22:50 +00:00
vClipPosition = - mvPosition . xyz ;
2024-11-05 00:44:58 +00:00
# endif ` ,txt= ` # if defined ( USE _COLOR _ALPHA )
2024-11-04 00:22:50 +00:00
diffuseColor *= vColor ;
# elif defined ( USE _COLOR )
diffuseColor . rgb *= vColor ;
2024-11-05 00:44:58 +00:00
# endif ` ,nxt= ` # if defined ( USE _COLOR _ALPHA )
2024-11-04 00:22:50 +00:00
varying vec4 vColor ;
# elif defined ( USE _COLOR )
varying vec3 vColor ;
2024-11-05 00:44:58 +00:00
# endif ` ,rxt= ` # if defined ( USE _COLOR _ALPHA )
2024-11-04 00:22:50 +00:00
varying vec4 vColor ;
# elif defined ( USE _COLOR ) || defined ( USE _INSTANCING _COLOR )
varying vec3 vColor ;
2024-11-05 00:44:58 +00:00
# endif ` ,ixt= ` # if defined ( USE _COLOR _ALPHA )
2024-11-04 00:22:50 +00:00
vColor = vec4 ( 1.0 ) ;
# elif defined ( USE _COLOR ) || defined ( USE _INSTANCING _COLOR )
vColor = vec3 ( 1.0 ) ;
# endif
# ifdef USE _COLOR
vColor *= color ;
# endif
# ifdef USE _INSTANCING _COLOR
vColor . xyz *= instanceColor . xyz ;
2024-11-05 00:44:58 +00:00
# endif ` ,sxt= ` # define PI 3.141592653589793
2024-11-04 00:22:50 +00:00
# define PI2 6.283185307179586
# define PI _HALF 1.5707963267948966
# define RECIPROCAL _PI 0.3183098861837907
# define RECIPROCAL _PI2 0.15915494309189535
# define EPSILON 1e-6
# ifndef saturate
# define saturate ( a ) clamp ( a , 0.0 , 1.0 )
# endif
# define whiteComplement ( a ) ( 1.0 - saturate ( a ) )
float pow2 ( const in float x ) { return x * x ; }
vec3 pow2 ( const in vec3 x ) { return x * x ; }
float pow3 ( const in float x ) { return x * x * x ; }
float pow4 ( const in float x ) { float x2 = x * x ; return x2 * x2 ; }
float max3 ( const in vec3 v ) { return max ( max ( v . x , v . y ) , v . z ) ; }
float average ( const in vec3 v ) { return dot ( v , vec3 ( 0.3333333 ) ) ; }
highp float rand ( const in vec2 uv ) {
const highp float a = 12.9898 , b = 78.233 , c = 43758.5453 ;
highp float dt = dot ( uv . xy , vec2 ( a , b ) ) , sn = mod ( dt , PI ) ;
return fract ( sin ( sn ) * c ) ;
}
# ifdef HIGH _PRECISION
float precisionSafeLength ( vec3 v ) { return length ( v ) ; }
# else
float precisionSafeLength ( vec3 v ) {
float maxComponent = max3 ( abs ( v ) ) ;
return length ( v / maxComponent ) * maxComponent ;
}
# endif
struct IncidentLight {
vec3 color ;
vec3 direction ;
bool visible ;
} ;
struct ReflectedLight {
vec3 directDiffuse ;
vec3 directSpecular ;
vec3 indirectDiffuse ;
vec3 indirectSpecular ;
} ;
# ifdef USE _ALPHAHASH
varying vec3 vPosition ;
# endif
vec3 transformDirection ( in vec3 dir , in mat4 matrix ) {
return normalize ( ( matrix * vec4 ( dir , 0.0 ) ) . xyz ) ;
}
vec3 inverseTransformDirection ( in vec3 dir , in mat4 matrix ) {
return normalize ( ( vec4 ( dir , 0.0 ) * matrix ) . xyz ) ;
}
mat3 transposeMat3 ( const in mat3 m ) {
mat3 tmp ;
tmp [ 0 ] = vec3 ( m [ 0 ] . x , m [ 1 ] . x , m [ 2 ] . x ) ;
tmp [ 1 ] = vec3 ( m [ 0 ] . y , m [ 1 ] . y , m [ 2 ] . y ) ;
tmp [ 2 ] = vec3 ( m [ 0 ] . z , m [ 1 ] . z , m [ 2 ] . z ) ;
return tmp ;
}
float luminance ( const in vec3 rgb ) {
const vec3 weights = vec3 ( 0.2126729 , 0.7151522 , 0.0721750 ) ;
return dot ( weights , rgb ) ;
}
bool isPerspectiveMatrix ( mat4 m ) {
return m [ 2 ] [ 3 ] == - 1.0 ;
}
vec2 equirectUv ( in vec3 dir ) {
float u = atan ( dir . z , dir . x ) * RECIPROCAL _PI2 + 0.5 ;
float v = asin ( clamp ( dir . y , - 1.0 , 1.0 ) ) * RECIPROCAL _PI + 0.5 ;
return vec2 ( u , v ) ;
}
vec3 BRDF _Lambert ( const in vec3 diffuseColor ) {
return RECIPROCAL _PI * diffuseColor ;
}
vec3 F _Schlick ( const in vec3 f0 , const in float f90 , const in float dotVH ) {
float fresnel = exp2 ( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ) ;
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ) ;
}
float F _Schlick ( const in float f0 , const in float f90 , const in float dotVH ) {
float fresnel = exp2 ( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ) ;
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ) ;
2024-11-05 00:44:58 +00:00
} // validated`,oxt=`#ifdef ENVMAP_TYPE_CUBE_UV
2024-11-04 00:22:50 +00:00
# define cubeUV _minMipLevel 4.0
# define cubeUV _minTileSize 16.0
float getFace ( vec3 direction ) {
vec3 absDirection = abs ( direction ) ;
float face = - 1.0 ;
if ( absDirection . x > absDirection . z ) {
if ( absDirection . x > absDirection . y )
face = direction . x > 0.0 ? 0.0 : 3.0 ;
else
face = direction . y > 0.0 ? 1.0 : 4.0 ;
} else {
if ( absDirection . z > absDirection . y )
face = direction . z > 0.0 ? 2.0 : 5.0 ;
else
face = direction . y > 0.0 ? 1.0 : 4.0 ;
}
return face ;
}
vec2 getUV ( vec3 direction , float face ) {
vec2 uv ;
if ( face == 0.0 ) {
uv = vec2 ( direction . z , direction . y ) / abs ( direction . x ) ;
} else if ( face == 1.0 ) {
uv = vec2 ( - direction . x , - direction . z ) / abs ( direction . y ) ;
} else if ( face == 2.0 ) {
uv = vec2 ( - direction . x , direction . y ) / abs ( direction . z ) ;
} else if ( face == 3.0 ) {
uv = vec2 ( - direction . z , direction . y ) / abs ( direction . x ) ;
} else if ( face == 4.0 ) {
uv = vec2 ( - direction . x , direction . z ) / abs ( direction . y ) ;
} else {
uv = vec2 ( direction . x , direction . y ) / abs ( direction . z ) ;
}
return 0.5 * ( uv + 1.0 ) ;
}
vec3 bilinearCubeUV ( sampler2D envMap , vec3 direction , float mipInt ) {
float face = getFace ( direction ) ;
float filterInt = max ( cubeUV _minMipLevel - mipInt , 0.0 ) ;
mipInt = max ( mipInt , cubeUV _minMipLevel ) ;
float faceSize = exp2 ( mipInt ) ;
highp vec2 uv = getUV ( direction , face ) * ( faceSize - 2.0 ) + 1.0 ;
if ( face > 2.0 ) {
uv . y += faceSize ;
face -= 3.0 ;
}
uv . x += face * faceSize ;
uv . x += filterInt * 3.0 * cubeUV _minTileSize ;
uv . y += 4.0 * ( exp2 ( CUBEUV _MAX _MIP ) - faceSize ) ;
uv . x *= CUBEUV _TEXEL _WIDTH ;
uv . y *= CUBEUV _TEXEL _HEIGHT ;
# ifdef texture2DGradEXT
return texture2DGradEXT ( envMap , uv , vec2 ( 0.0 ) , vec2 ( 0.0 ) ) . rgb ;
# else
return texture2D ( envMap , uv ) . rgb ;
# endif
}
# define cubeUV _r0 1.0
# define cubeUV _v0 0.339
# define cubeUV _m0 - 2.0
# define cubeUV _r1 0.8
# define cubeUV _v1 0.276
# define cubeUV _m1 - 1.0
# define cubeUV _r4 0.4
# define cubeUV _v4 0.046
# define cubeUV _m4 2.0
# define cubeUV _r5 0.305
# define cubeUV _v5 0.016
# define cubeUV _m5 3.0
# define cubeUV _r6 0.21
# define cubeUV _v6 0.0038
# define cubeUV _m6 4.0
float roughnessToMip ( float roughness ) {
float mip = 0.0 ;
if ( roughness >= cubeUV _r1 ) {
mip = ( cubeUV _r0 - roughness ) * ( cubeUV _m1 - cubeUV _m0 ) / ( cubeUV _r0 - cubeUV _r1 ) + cubeUV _m0 ;
} else if ( roughness >= cubeUV _r4 ) {
mip = ( cubeUV _r1 - roughness ) * ( cubeUV _m4 - cubeUV _m1 ) / ( cubeUV _r1 - cubeUV _r4 ) + cubeUV _m1 ;
} else if ( roughness >= cubeUV _r5 ) {
mip = ( cubeUV _r4 - roughness ) * ( cubeUV _m5 - cubeUV _m4 ) / ( cubeUV _r4 - cubeUV _r5 ) + cubeUV _m4 ;
} else if ( roughness >= cubeUV _r6 ) {
mip = ( cubeUV _r5 - roughness ) * ( cubeUV _m6 - cubeUV _m5 ) / ( cubeUV _r5 - cubeUV _r6 ) + cubeUV _m5 ;
} else {
mip = - 2.0 * log2 ( 1.16 * roughness ) ; }
return mip ;
}
vec4 textureCubeUV ( sampler2D envMap , vec3 sampleDir , float roughness ) {
float mip = clamp ( roughnessToMip ( roughness ) , cubeUV _m0 , CUBEUV _MAX _MIP ) ;
float mipF = fract ( mip ) ;
float mipInt = floor ( mip ) ;
vec3 color0 = bilinearCubeUV ( envMap , sampleDir , mipInt ) ;
if ( mipF == 0.0 ) {
return vec4 ( color0 , 1.0 ) ;
} else {
vec3 color1 = bilinearCubeUV ( envMap , sampleDir , mipInt + 1.0 ) ;
return vec4 ( mix ( color0 , color1 , mipF ) , 1.0 ) ;
}
}
2024-11-05 00:44:58 +00:00
# endif ` ,axt= ` vec3 transformedNormal = objectNormal ;
2024-11-04 00:22:50 +00:00
# ifdef USE _TANGENT
vec3 transformedTangent = objectTangent ;
# endif
# ifdef USE _BATCHING
mat3 bm = mat3 ( batchingMatrix ) ;
transformedNormal /= vec3 ( dot ( bm [ 0 ] , bm [ 0 ] ) , dot ( bm [ 1 ] , bm [ 1 ] ) , dot ( bm [ 2 ] , bm [ 2 ] ) ) ;
transformedNormal = bm * transformedNormal ;
# ifdef USE _TANGENT
transformedTangent = bm * transformedTangent ;
# endif
# endif
# ifdef USE _INSTANCING
mat3 im = mat3 ( instanceMatrix ) ;
transformedNormal /= vec3 ( dot ( im [ 0 ] , im [ 0 ] ) , dot ( im [ 1 ] , im [ 1 ] ) , dot ( im [ 2 ] , im [ 2 ] ) ) ;
transformedNormal = im * transformedNormal ;
# ifdef USE _TANGENT
transformedTangent = im * transformedTangent ;
# endif
# endif
transformedNormal = normalMatrix * transformedNormal ;
# ifdef FLIP _SIDED
transformedNormal = - transformedNormal ;
# endif
# ifdef USE _TANGENT
transformedTangent = ( modelViewMatrix * vec4 ( transformedTangent , 0.0 ) ) . xyz ;
# ifdef FLIP _SIDED
transformedTangent = - transformedTangent ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,lxt= ` # ifdef USE _DISPLACEMENTMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D displacementMap ;
uniform float displacementScale ;
uniform float displacementBias ;
2024-11-05 00:44:58 +00:00
# endif ` ,cxt= ` # ifdef USE _DISPLACEMENTMAP
2024-11-04 00:22:50 +00:00
transformed += normalize ( objectNormal ) * ( texture2D ( displacementMap , vDisplacementMapUv ) . x * displacementScale + displacementBias ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,dxt= ` # ifdef USE _EMISSIVEMAP
2024-11-04 00:22:50 +00:00
vec4 emissiveColor = texture2D ( emissiveMap , vEmissiveMapUv ) ;
totalEmissiveRadiance *= emissiveColor . rgb ;
2024-11-05 00:44:58 +00:00
# endif ` ,uxt= ` # ifdef USE _EMISSIVEMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D emissiveMap ;
2024-11-05 00:44:58 +00:00
# endif ` ,pxt="gl_FragColor = linearToOutputTexel( gl_FragColor );",hxt= `
2024-11-04 00:22:50 +00:00
const mat3 LINEAR _SRGB _TO _LINEAR _DISPLAY _P3 = mat3 (
vec3 ( 0.8224621 , 0.177538 , 0.0 ) ,
vec3 ( 0.0331941 , 0.9668058 , 0.0 ) ,
vec3 ( 0.0170827 , 0.0723974 , 0.9105199 )
) ;
const mat3 LINEAR _DISPLAY _P3 _TO _LINEAR _SRGB = mat3 (
vec3 ( 1.2249401 , - 0.2249404 , 0.0 ) ,
vec3 ( - 0.0420569 , 1.0420571 , 0.0 ) ,
vec3 ( - 0.0196376 , - 0.0786361 , 1.0982735 )
) ;
vec4 LinearSRGBToLinearDisplayP3 ( in vec4 value ) {
return vec4 ( value . rgb * LINEAR _SRGB _TO _LINEAR _DISPLAY _P3 , value . a ) ;
}
vec4 LinearDisplayP3ToLinearSRGB ( in vec4 value ) {
return vec4 ( value . rgb * LINEAR _DISPLAY _P3 _TO _LINEAR _SRGB , value . a ) ;
}
vec4 LinearTransferOETF ( in vec4 value ) {
return value ;
}
vec4 sRGBTransferOETF ( in vec4 value ) {
return vec4 ( mix ( pow ( value . rgb , vec3 ( 0.41666 ) ) * 1.055 - vec3 ( 0.055 ) , value . rgb * 12.92 , vec3 ( lessThanEqual ( value . rgb , vec3 ( 0.0031308 ) ) ) ) , value . a ) ;
}
vec4 LinearToLinear ( in vec4 value ) {
return value ;
}
vec4 LinearTosRGB ( in vec4 value ) {
return sRGBTransferOETF ( value ) ;
2024-11-05 00:44:58 +00:00
} ` ,mxt= ` # ifdef USE _ENVMAP
2024-11-04 00:22:50 +00:00
# ifdef ENV _WORLDPOS
vec3 cameraToFrag ;
if ( isOrthographic ) {
cameraToFrag = normalize ( vec3 ( - viewMatrix [ 0 ] [ 2 ] , - viewMatrix [ 1 ] [ 2 ] , - viewMatrix [ 2 ] [ 2 ] ) ) ;
} else {
cameraToFrag = normalize ( vWorldPosition - cameraPosition ) ;
}
vec3 worldNormal = inverseTransformDirection ( normal , viewMatrix ) ;
# ifdef ENVMAP _MODE _REFLECTION
vec3 reflectVec = reflect ( cameraToFrag , worldNormal ) ;
# else
vec3 reflectVec = refract ( cameraToFrag , worldNormal , refractionRatio ) ;
# endif
# else
vec3 reflectVec = vReflect ;
# endif
# ifdef ENVMAP _TYPE _CUBE
vec4 envColor = textureCube ( envMap , vec3 ( flipEnvMap * reflectVec . x , reflectVec . yz ) ) ;
# else
vec4 envColor = vec4 ( 0.0 ) ;
# endif
# ifdef ENVMAP _BLENDING _MULTIPLY
outgoingLight = mix ( outgoingLight , outgoingLight * envColor . xyz , specularStrength * reflectivity ) ;
# elif defined ( ENVMAP _BLENDING _MIX )
outgoingLight = mix ( outgoingLight , envColor . xyz , specularStrength * reflectivity ) ;
# elif defined ( ENVMAP _BLENDING _ADD )
outgoingLight += envColor . xyz * specularStrength * reflectivity ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,fxt= ` # ifdef USE _ENVMAP
2024-11-04 00:22:50 +00:00
uniform float envMapIntensity ;
uniform float flipEnvMap ;
# ifdef ENVMAP _TYPE _CUBE
uniform samplerCube envMap ;
# else
uniform sampler2D envMap ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,gxt= ` # ifdef USE _ENVMAP
2024-11-04 00:22:50 +00:00
uniform float reflectivity ;
# if defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP ) || defined ( PHONG ) || defined ( LAMBERT )
# define ENV _WORLDPOS
# endif
# ifdef ENV _WORLDPOS
varying vec3 vWorldPosition ;
uniform float refractionRatio ;
# else
varying vec3 vReflect ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,_xt= ` # ifdef USE _ENVMAP
2024-11-04 00:22:50 +00:00
# if defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP ) || defined ( PHONG ) || defined ( LAMBERT )
# define ENV _WORLDPOS
# endif
# ifdef ENV _WORLDPOS
varying vec3 vWorldPosition ;
# else
varying vec3 vReflect ;
uniform float refractionRatio ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,bxt= ` # ifdef USE _ENVMAP
2024-11-04 00:22:50 +00:00
# ifdef ENV _WORLDPOS
vWorldPosition = worldPosition . xyz ;
# else
vec3 cameraToVertex ;
if ( isOrthographic ) {
cameraToVertex = normalize ( vec3 ( - viewMatrix [ 0 ] [ 2 ] , - viewMatrix [ 1 ] [ 2 ] , - viewMatrix [ 2 ] [ 2 ] ) ) ;
} else {
cameraToVertex = normalize ( worldPosition . xyz - cameraPosition ) ;
}
vec3 worldNormal = inverseTransformDirection ( transformedNormal , viewMatrix ) ;
# ifdef ENVMAP _MODE _REFLECTION
vReflect = reflect ( cameraToVertex , worldNormal ) ;
# else
vReflect = refract ( cameraToVertex , worldNormal , refractionRatio ) ;
# endif
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,vxt= ` # ifdef USE _FOG
2024-11-04 00:22:50 +00:00
vFogDepth = - mvPosition . z ;
2024-11-05 00:44:58 +00:00
# endif ` ,yxt= ` # ifdef USE _FOG
2024-11-04 00:22:50 +00:00
varying float vFogDepth ;
2024-11-05 00:44:58 +00:00
# endif ` ,Ext= ` # ifdef USE _FOG
2024-11-04 00:22:50 +00:00
# ifdef FOG _EXP2
float fogFactor = 1.0 - exp ( - fogDensity * fogDensity * vFogDepth * vFogDepth ) ;
# else
float fogFactor = smoothstep ( fogNear , fogFar , vFogDepth ) ;
# endif
gl _FragColor . rgb = mix ( gl _FragColor . rgb , fogColor , fogFactor ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,Sxt= ` # ifdef USE _FOG
2024-11-04 00:22:50 +00:00
uniform vec3 fogColor ;
varying float vFogDepth ;
# ifdef FOG _EXP2
uniform float fogDensity ;
# else
uniform float fogNear ;
uniform float fogFar ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,xxt= ` # ifdef USE _GRADIENTMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D gradientMap ;
# endif
vec3 getGradientIrradiance ( vec3 normal , vec3 lightDirection ) {
float dotNL = dot ( normal , lightDirection ) ;
vec2 coord = vec2 ( dotNL * 0.5 + 0.5 , 0.0 ) ;
# ifdef USE _GRADIENTMAP
return vec3 ( texture2D ( gradientMap , coord ) . r ) ;
# else
vec2 fw = fwidth ( coord ) * 0.5 ;
return mix ( vec3 ( 0.7 ) , vec3 ( 1.0 ) , smoothstep ( 0.7 - fw . x , 0.7 + fw . x , coord . x ) ) ;
# endif
2024-11-05 00:44:58 +00:00
} ` ,Txt= ` # ifdef USE _LIGHTMAP
2024-11-04 00:22:50 +00:00
vec4 lightMapTexel = texture2D ( lightMap , vLightMapUv ) ;
vec3 lightMapIrradiance = lightMapTexel . rgb * lightMapIntensity ;
reflectedLight . indirectDiffuse += lightMapIrradiance ;
2024-11-05 00:44:58 +00:00
# endif ` ,wxt= ` # ifdef USE _LIGHTMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D lightMap ;
uniform float lightMapIntensity ;
2024-11-05 00:44:58 +00:00
# endif ` ,Cxt= ` LambertMaterial material ;
2024-11-04 00:22:50 +00:00
material . diffuseColor = diffuseColor . rgb ;
2024-11-05 00:44:58 +00:00
material . specularStrength = specularStrength ; ` ,Axt= ` varying vec3 vViewPosition ;
2024-11-04 00:22:50 +00:00
struct LambertMaterial {
vec3 diffuseColor ;
float specularStrength ;
} ;
void RE _Direct _Lambert ( const in IncidentLight directLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in LambertMaterial material , inout ReflectedLight reflectedLight ) {
float dotNL = saturate ( dot ( geometryNormal , directLight . direction ) ) ;
vec3 irradiance = dotNL * directLight . color ;
reflectedLight . directDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
void RE _IndirectDiffuse _Lambert ( const in vec3 irradiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in LambertMaterial material , inout ReflectedLight reflectedLight ) {
reflectedLight . indirectDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
# define RE _Direct RE _Direct _Lambert
2024-11-05 00:44:58 +00:00
# define RE _IndirectDiffuse RE _IndirectDiffuse _Lambert ` ,Rxt= ` uniform bool receiveShadow ;
2024-11-04 00:22:50 +00:00
uniform vec3 ambientLightColor ;
# if defined ( USE _LIGHT _PROBES )
uniform vec3 lightProbe [ 9 ] ;
# endif
vec3 shGetIrradianceAt ( in vec3 normal , in vec3 shCoefficients [ 9 ] ) {
float x = normal . x , y = normal . y , z = normal . z ;
vec3 result = shCoefficients [ 0 ] * 0.886227 ;
result += shCoefficients [ 1 ] * 2.0 * 0.511664 * y ;
result += shCoefficients [ 2 ] * 2.0 * 0.511664 * z ;
result += shCoefficients [ 3 ] * 2.0 * 0.511664 * x ;
result += shCoefficients [ 4 ] * 2.0 * 0.429043 * x * y ;
result += shCoefficients [ 5 ] * 2.0 * 0.429043 * y * z ;
result += shCoefficients [ 6 ] * ( 0.743125 * z * z - 0.247708 ) ;
result += shCoefficients [ 7 ] * 2.0 * 0.429043 * x * z ;
result += shCoefficients [ 8 ] * 0.429043 * ( x * x - y * y ) ;
return result ;
}
vec3 getLightProbeIrradiance ( const in vec3 lightProbe [ 9 ] , const in vec3 normal ) {
vec3 worldNormal = inverseTransformDirection ( normal , viewMatrix ) ;
vec3 irradiance = shGetIrradianceAt ( worldNormal , lightProbe ) ;
return irradiance ;
}
vec3 getAmbientLightIrradiance ( const in vec3 ambientLightColor ) {
vec3 irradiance = ambientLightColor ;
return irradiance ;
}
float getDistanceAttenuation ( const in float lightDistance , const in float cutoffDistance , const in float decayExponent ) {
# if defined ( LEGACY _LIGHTS )
if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
return pow ( saturate ( - lightDistance / cutoffDistance + 1.0 ) , decayExponent ) ;
}
return 1.0 ;
# else
float distanceFalloff = 1.0 / max ( pow ( lightDistance , decayExponent ) , 0.01 ) ;
if ( cutoffDistance > 0.0 ) {
distanceFalloff *= pow2 ( saturate ( 1.0 - pow4 ( lightDistance / cutoffDistance ) ) ) ;
}
return distanceFalloff ;
# endif
}
float getSpotAttenuation ( const in float coneCosine , const in float penumbraCosine , const in float angleCosine ) {
return smoothstep ( coneCosine , penumbraCosine , angleCosine ) ;
}
# if NUM _DIR _LIGHTS > 0
struct DirectionalLight {
vec3 direction ;
vec3 color ;
} ;
uniform DirectionalLight directionalLights [ NUM _DIR _LIGHTS ] ;
void getDirectionalLightInfo ( const in DirectionalLight directionalLight , out IncidentLight light ) {
light . color = directionalLight . color ;
light . direction = directionalLight . direction ;
light . visible = true ;
}
# endif
# if NUM _POINT _LIGHTS > 0
struct PointLight {
vec3 position ;
vec3 color ;
float distance ;
float decay ;
} ;
uniform PointLight pointLights [ NUM _POINT _LIGHTS ] ;
void getPointLightInfo ( const in PointLight pointLight , const in vec3 geometryPosition , out IncidentLight light ) {
vec3 lVector = pointLight . position - geometryPosition ;
light . direction = normalize ( lVector ) ;
float lightDistance = length ( lVector ) ;
light . color = pointLight . color ;
light . color *= getDistanceAttenuation ( lightDistance , pointLight . distance , pointLight . decay ) ;
light . visible = ( light . color != vec3 ( 0.0 ) ) ;
}
# endif
# if NUM _SPOT _LIGHTS > 0
struct SpotLight {
vec3 position ;
vec3 direction ;
vec3 color ;
float distance ;
float decay ;
float coneCos ;
float penumbraCos ;
} ;
uniform SpotLight spotLights [ NUM _SPOT _LIGHTS ] ;
void getSpotLightInfo ( const in SpotLight spotLight , const in vec3 geometryPosition , out IncidentLight light ) {
vec3 lVector = spotLight . position - geometryPosition ;
light . direction = normalize ( lVector ) ;
float angleCos = dot ( light . direction , spotLight . direction ) ;
float spotAttenuation = getSpotAttenuation ( spotLight . coneCos , spotLight . penumbraCos , angleCos ) ;
if ( spotAttenuation > 0.0 ) {
float lightDistance = length ( lVector ) ;
light . color = spotLight . color * spotAttenuation ;
light . color *= getDistanceAttenuation ( lightDistance , spotLight . distance , spotLight . decay ) ;
light . visible = ( light . color != vec3 ( 0.0 ) ) ;
} else {
light . color = vec3 ( 0.0 ) ;
light . visible = false ;
}
}
# endif
# if NUM _RECT _AREA _LIGHTS > 0
struct RectAreaLight {
vec3 color ;
vec3 position ;
vec3 halfWidth ;
vec3 halfHeight ;
} ;
uniform sampler2D ltc _1 ; uniform sampler2D ltc _2 ;
uniform RectAreaLight rectAreaLights [ NUM _RECT _AREA _LIGHTS ] ;
# endif
# if NUM _HEMI _LIGHTS > 0
struct HemisphereLight {
vec3 direction ;
vec3 skyColor ;
vec3 groundColor ;
} ;
uniform HemisphereLight hemisphereLights [ NUM _HEMI _LIGHTS ] ;
vec3 getHemisphereLightIrradiance ( const in HemisphereLight hemiLight , const in vec3 normal ) {
float dotNL = dot ( normal , hemiLight . direction ) ;
float hemiDiffuseWeight = 0.5 * dotNL + 0.5 ;
vec3 irradiance = mix ( hemiLight . groundColor , hemiLight . skyColor , hemiDiffuseWeight ) ;
return irradiance ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,Mxt= ` # ifdef USE _ENVMAP
2024-11-04 00:22:50 +00:00
vec3 getIBLIrradiance ( const in vec3 normal ) {
# ifdef ENVMAP _TYPE _CUBE _UV
vec3 worldNormal = inverseTransformDirection ( normal , viewMatrix ) ;
vec4 envMapColor = textureCubeUV ( envMap , worldNormal , 1.0 ) ;
return PI * envMapColor . rgb * envMapIntensity ;
# else
return vec3 ( 0.0 ) ;
# endif
}
vec3 getIBLRadiance ( const in vec3 viewDir , const in vec3 normal , const in float roughness ) {
# ifdef ENVMAP _TYPE _CUBE _UV
vec3 reflectVec = reflect ( - viewDir , normal ) ;
reflectVec = normalize ( mix ( reflectVec , normal , roughness * roughness ) ) ;
reflectVec = inverseTransformDirection ( reflectVec , viewMatrix ) ;
vec4 envMapColor = textureCubeUV ( envMap , reflectVec , roughness ) ;
return envMapColor . rgb * envMapIntensity ;
# else
return vec3 ( 0.0 ) ;
# endif
}
# ifdef USE _ANISOTROPY
vec3 getIBLAnisotropyRadiance ( const in vec3 viewDir , const in vec3 normal , const in float roughness , const in vec3 bitangent , const in float anisotropy ) {
# ifdef ENVMAP _TYPE _CUBE _UV
vec3 bentNormal = cross ( bitangent , viewDir ) ;
bentNormal = normalize ( cross ( bentNormal , bitangent ) ) ;
bentNormal = normalize ( mix ( bentNormal , normal , pow2 ( pow2 ( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ) ;
return getIBLRadiance ( viewDir , bentNormal , roughness ) ;
# else
return vec3 ( 0.0 ) ;
# endif
}
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,Nxt= ` ToonMaterial material ;
material . diffuseColor = diffuseColor . rgb ; ` ,kxt= ` varying vec3 vViewPosition ;
2024-11-04 00:22:50 +00:00
struct ToonMaterial {
vec3 diffuseColor ;
} ;
void RE _Direct _Toon ( const in IncidentLight directLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in ToonMaterial material , inout ReflectedLight reflectedLight ) {
vec3 irradiance = getGradientIrradiance ( geometryNormal , directLight . direction ) * directLight . color ;
reflectedLight . directDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
void RE _IndirectDiffuse _Toon ( const in vec3 irradiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in ToonMaterial material , inout ReflectedLight reflectedLight ) {
reflectedLight . indirectDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
# define RE _Direct RE _Direct _Toon
2024-11-05 00:44:58 +00:00
# define RE _IndirectDiffuse RE _IndirectDiffuse _Toon ` ,Ixt= ` BlinnPhongMaterial material ;
2024-11-04 00:22:50 +00:00
material . diffuseColor = diffuseColor . rgb ;
material . specularColor = specular ;
material . specularShininess = shininess ;
2024-11-05 00:44:58 +00:00
material . specularStrength = specularStrength ; ` ,Oxt= ` varying vec3 vViewPosition ;
2024-11-04 00:22:50 +00:00
struct BlinnPhongMaterial {
vec3 diffuseColor ;
vec3 specularColor ;
float specularShininess ;
float specularStrength ;
} ;
void RE _Direct _BlinnPhong ( const in IncidentLight directLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in BlinnPhongMaterial material , inout ReflectedLight reflectedLight ) {
float dotNL = saturate ( dot ( geometryNormal , directLight . direction ) ) ;
vec3 irradiance = dotNL * directLight . color ;
reflectedLight . directDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
reflectedLight . directSpecular += irradiance * BRDF _BlinnPhong ( directLight . direction , geometryViewDir , geometryNormal , material . specularColor , material . specularShininess ) * material . specularStrength ;
}
void RE _IndirectDiffuse _BlinnPhong ( const in vec3 irradiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in BlinnPhongMaterial material , inout ReflectedLight reflectedLight ) {
reflectedLight . indirectDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
# define RE _Direct RE _Direct _BlinnPhong
2024-11-05 00:44:58 +00:00
# define RE _IndirectDiffuse RE _IndirectDiffuse _BlinnPhong ` ,Dxt= ` PhysicalMaterial material ;
2024-11-04 00:22:50 +00:00
material . diffuseColor = diffuseColor . rgb * ( 1.0 - metalnessFactor ) ;
vec3 dxy = max ( abs ( dFdx ( nonPerturbedNormal ) ) , abs ( dFdy ( nonPerturbedNormal ) ) ) ;
float geometryRoughness = max ( max ( dxy . x , dxy . y ) , dxy . z ) ;
material . roughness = max ( roughnessFactor , 0.0525 ) ; material . roughness += geometryRoughness ;
material . roughness = min ( material . roughness , 1.0 ) ;
# ifdef IOR
material . ior = ior ;
# ifdef USE _SPECULAR
float specularIntensityFactor = specularIntensity ;
vec3 specularColorFactor = specularColor ;
# ifdef USE _SPECULAR _COLORMAP
specularColorFactor *= texture2D ( specularColorMap , vSpecularColorMapUv ) . rgb ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
specularIntensityFactor *= texture2D ( specularIntensityMap , vSpecularIntensityMapUv ) . a ;
# endif
material . specularF90 = mix ( specularIntensityFactor , 1.0 , metalnessFactor ) ;
# else
float specularIntensityFactor = 1.0 ;
vec3 specularColorFactor = vec3 ( 1.0 ) ;
material . specularF90 = 1.0 ;
# endif
material . specularColor = mix ( min ( pow2 ( ( material . ior - 1.0 ) / ( material . ior + 1.0 ) ) * specularColorFactor , vec3 ( 1.0 ) ) * specularIntensityFactor , diffuseColor . rgb , metalnessFactor ) ;
# else
material . specularColor = mix ( vec3 ( 0.04 ) , diffuseColor . rgb , metalnessFactor ) ;
material . specularF90 = 1.0 ;
# endif
# ifdef USE _CLEARCOAT
material . clearcoat = clearcoat ;
material . clearcoatRoughness = clearcoatRoughness ;
material . clearcoatF0 = vec3 ( 0.04 ) ;
material . clearcoatF90 = 1.0 ;
# ifdef USE _CLEARCOATMAP
material . clearcoat *= texture2D ( clearcoatMap , vClearcoatMapUv ) . x ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
material . clearcoatRoughness *= texture2D ( clearcoatRoughnessMap , vClearcoatRoughnessMapUv ) . y ;
# endif
material . clearcoat = saturate ( material . clearcoat ) ; material . clearcoatRoughness = max ( material . clearcoatRoughness , 0.0525 ) ;
material . clearcoatRoughness += geometryRoughness ;
material . clearcoatRoughness = min ( material . clearcoatRoughness , 1.0 ) ;
# endif
# ifdef USE _IRIDESCENCE
material . iridescence = iridescence ;
material . iridescenceIOR = iridescenceIOR ;
# ifdef USE _IRIDESCENCEMAP
material . iridescence *= texture2D ( iridescenceMap , vIridescenceMapUv ) . r ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
material . iridescenceThickness = ( iridescenceThicknessMaximum - iridescenceThicknessMinimum ) * texture2D ( iridescenceThicknessMap , vIridescenceThicknessMapUv ) . g + iridescenceThicknessMinimum ;
# else
material . iridescenceThickness = iridescenceThicknessMaximum ;
# endif
# endif
# ifdef USE _SHEEN
material . sheenColor = sheenColor ;
# ifdef USE _SHEEN _COLORMAP
material . sheenColor *= texture2D ( sheenColorMap , vSheenColorMapUv ) . rgb ;
# endif
material . sheenRoughness = clamp ( sheenRoughness , 0.07 , 1.0 ) ;
# ifdef USE _SHEEN _ROUGHNESSMAP
material . sheenRoughness *= texture2D ( sheenRoughnessMap , vSheenRoughnessMapUv ) . a ;
# endif
# endif
# ifdef USE _ANISOTROPY
# ifdef USE _ANISOTROPYMAP
mat2 anisotropyMat = mat2 ( anisotropyVector . x , anisotropyVector . y , - anisotropyVector . y , anisotropyVector . x ) ;
vec3 anisotropyPolar = texture2D ( anisotropyMap , vAnisotropyMapUv ) . rgb ;
vec2 anisotropyV = anisotropyMat * normalize ( 2.0 * anisotropyPolar . rg - vec2 ( 1.0 ) ) * anisotropyPolar . b ;
# else
vec2 anisotropyV = anisotropyVector ;
# endif
material . anisotropy = length ( anisotropyV ) ;
if ( material . anisotropy == 0.0 ) {
anisotropyV = vec2 ( 1.0 , 0.0 ) ;
} else {
anisotropyV /= material . anisotropy ;
material . anisotropy = saturate ( material . anisotropy ) ;
}
material . alphaT = mix ( pow2 ( material . roughness ) , 1.0 , pow2 ( material . anisotropy ) ) ;
material . anisotropyT = tbn [ 0 ] * anisotropyV . x + tbn [ 1 ] * anisotropyV . y ;
material . anisotropyB = tbn [ 1 ] * anisotropyV . x - tbn [ 0 ] * anisotropyV . y ;
2024-11-05 00:44:58 +00:00
# endif ` ,Lxt= ` struct PhysicalMaterial {
2024-11-04 00:22:50 +00:00
vec3 diffuseColor ;
float roughness ;
vec3 specularColor ;
float specularF90 ;
# ifdef USE _CLEARCOAT
float clearcoat ;
float clearcoatRoughness ;
vec3 clearcoatF0 ;
float clearcoatF90 ;
# endif
# ifdef USE _IRIDESCENCE
float iridescence ;
float iridescenceIOR ;
float iridescenceThickness ;
vec3 iridescenceFresnel ;
vec3 iridescenceF0 ;
# endif
# ifdef USE _SHEEN
vec3 sheenColor ;
float sheenRoughness ;
# endif
# ifdef IOR
float ior ;
# endif
# ifdef USE _TRANSMISSION
float transmission ;
float transmissionAlpha ;
float thickness ;
float attenuationDistance ;
vec3 attenuationColor ;
# endif
# ifdef USE _ANISOTROPY
float anisotropy ;
float alphaT ;
vec3 anisotropyT ;
vec3 anisotropyB ;
# endif
} ;
vec3 clearcoatSpecularDirect = vec3 ( 0.0 ) ;
vec3 clearcoatSpecularIndirect = vec3 ( 0.0 ) ;
vec3 sheenSpecularDirect = vec3 ( 0.0 ) ;
vec3 sheenSpecularIndirect = vec3 ( 0.0 ) ;
vec3 Schlick _to _F0 ( const in vec3 f , const in float f90 , const in float dotVH ) {
float x = clamp ( 1.0 - dotVH , 0.0 , 1.0 ) ;
float x2 = x * x ;
float x5 = clamp ( x * x2 * x2 , 0.0 , 0.9999 ) ;
return ( f - vec3 ( f90 ) * x5 ) / ( 1.0 - x5 ) ;
}
float V _GGX _SmithCorrelated ( const in float alpha , const in float dotNL , const in float dotNV ) {
float a2 = pow2 ( alpha ) ;
float gv = dotNL * sqrt ( a2 + ( 1.0 - a2 ) * pow2 ( dotNV ) ) ;
float gl = dotNV * sqrt ( a2 + ( 1.0 - a2 ) * pow2 ( dotNL ) ) ;
return 0.5 / max ( gv + gl , EPSILON ) ;
}
float D _GGX ( const in float alpha , const in float dotNH ) {
float a2 = pow2 ( alpha ) ;
float denom = pow2 ( dotNH ) * ( a2 - 1.0 ) + 1.0 ;
return RECIPROCAL _PI * a2 / pow2 ( denom ) ;
}
# ifdef USE _ANISOTROPY
float V _GGX _SmithCorrelated _Anisotropic ( const in float alphaT , const in float alphaB , const in float dotTV , const in float dotBV , const in float dotTL , const in float dotBL , const in float dotNV , const in float dotNL ) {
float gv = dotNL * length ( vec3 ( alphaT * dotTV , alphaB * dotBV , dotNV ) ) ;
float gl = dotNV * length ( vec3 ( alphaT * dotTL , alphaB * dotBL , dotNL ) ) ;
float v = 0.5 / ( gv + gl ) ;
return saturate ( v ) ;
}
float D _GGX _Anisotropic ( const in float alphaT , const in float alphaB , const in float dotNH , const in float dotTH , const in float dotBH ) {
float a2 = alphaT * alphaB ;
highp vec3 v = vec3 ( alphaB * dotTH , alphaT * dotBH , a2 * dotNH ) ;
highp float v2 = dot ( v , v ) ;
float w2 = a2 / v2 ;
return RECIPROCAL _PI * a2 * pow2 ( w2 ) ;
}
# endif
# ifdef USE _CLEARCOAT
vec3 BRDF _GGX _Clearcoat ( const in vec3 lightDir , const in vec3 viewDir , const in vec3 normal , const in PhysicalMaterial material ) {
vec3 f0 = material . clearcoatF0 ;
float f90 = material . clearcoatF90 ;
float roughness = material . clearcoatRoughness ;
float alpha = pow2 ( roughness ) ;
vec3 halfDir = normalize ( lightDir + viewDir ) ;
float dotNL = saturate ( dot ( normal , lightDir ) ) ;
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
float dotNH = saturate ( dot ( normal , halfDir ) ) ;
float dotVH = saturate ( dot ( viewDir , halfDir ) ) ;
vec3 F = F _Schlick ( f0 , f90 , dotVH ) ;
float V = V _GGX _SmithCorrelated ( alpha , dotNL , dotNV ) ;
float D = D _GGX ( alpha , dotNH ) ;
return F * ( V * D ) ;
}
# endif
vec3 BRDF _GGX ( const in vec3 lightDir , const in vec3 viewDir , const in vec3 normal , const in PhysicalMaterial material ) {
vec3 f0 = material . specularColor ;
float f90 = material . specularF90 ;
float roughness = material . roughness ;
float alpha = pow2 ( roughness ) ;
vec3 halfDir = normalize ( lightDir + viewDir ) ;
float dotNL = saturate ( dot ( normal , lightDir ) ) ;
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
float dotNH = saturate ( dot ( normal , halfDir ) ) ;
float dotVH = saturate ( dot ( viewDir , halfDir ) ) ;
vec3 F = F _Schlick ( f0 , f90 , dotVH ) ;
# ifdef USE _IRIDESCENCE
F = mix ( F , material . iridescenceFresnel , material . iridescence ) ;
# endif
# ifdef USE _ANISOTROPY
float dotTL = dot ( material . anisotropyT , lightDir ) ;
float dotTV = dot ( material . anisotropyT , viewDir ) ;
float dotTH = dot ( material . anisotropyT , halfDir ) ;
float dotBL = dot ( material . anisotropyB , lightDir ) ;
float dotBV = dot ( material . anisotropyB , viewDir ) ;
float dotBH = dot ( material . anisotropyB , halfDir ) ;
float V = V _GGX _SmithCorrelated _Anisotropic ( material . alphaT , alpha , dotTV , dotBV , dotTL , dotBL , dotNV , dotNL ) ;
float D = D _GGX _Anisotropic ( material . alphaT , alpha , dotNH , dotTH , dotBH ) ;
# else
float V = V _GGX _SmithCorrelated ( alpha , dotNL , dotNV ) ;
float D = D _GGX ( alpha , dotNH ) ;
# endif
return F * ( V * D ) ;
}
vec2 LTC _Uv ( const in vec3 N , const in vec3 V , const in float roughness ) {
const float LUT _SIZE = 64.0 ;
const float LUT _SCALE = ( LUT _SIZE - 1.0 ) / LUT _SIZE ;
const float LUT _BIAS = 0.5 / LUT _SIZE ;
float dotNV = saturate ( dot ( N , V ) ) ;
vec2 uv = vec2 ( roughness , sqrt ( 1.0 - dotNV ) ) ;
uv = uv * LUT _SCALE + LUT _BIAS ;
return uv ;
}
float LTC _ClippedSphereFormFactor ( const in vec3 f ) {
float l = length ( f ) ;
return max ( ( l * l + f . z ) / ( l + 1.0 ) , 0.0 ) ;
}
vec3 LTC _EdgeVectorFormFactor ( const in vec3 v1 , const in vec3 v2 ) {
float x = dot ( v1 , v2 ) ;
float y = abs ( x ) ;
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y ;
float b = 3.4175940 + ( 4.1616724 + y ) * y ;
float v = a / b ;
float theta _sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt ( max ( 1.0 - x * x , 1e-7 ) ) - v ;
return cross ( v1 , v2 ) * theta _sintheta ;
}
vec3 LTC _Evaluate ( const in vec3 N , const in vec3 V , const in vec3 P , const in mat3 mInv , const in vec3 rectCoords [ 4 ] ) {
vec3 v1 = rectCoords [ 1 ] - rectCoords [ 0 ] ;
vec3 v2 = rectCoords [ 3 ] - rectCoords [ 0 ] ;
vec3 lightNormal = cross ( v1 , v2 ) ;
if ( dot ( lightNormal , P - rectCoords [ 0 ] ) < 0.0 ) return vec3 ( 0.0 ) ;
vec3 T1 , T2 ;
T1 = normalize ( V - N * dot ( V , N ) ) ;
T2 = - cross ( N , T1 ) ;
mat3 mat = mInv * transposeMat3 ( mat3 ( T1 , T2 , N ) ) ;
vec3 coords [ 4 ] ;
coords [ 0 ] = mat * ( rectCoords [ 0 ] - P ) ;
coords [ 1 ] = mat * ( rectCoords [ 1 ] - P ) ;
coords [ 2 ] = mat * ( rectCoords [ 2 ] - P ) ;
coords [ 3 ] = mat * ( rectCoords [ 3 ] - P ) ;
coords [ 0 ] = normalize ( coords [ 0 ] ) ;
coords [ 1 ] = normalize ( coords [ 1 ] ) ;
coords [ 2 ] = normalize ( coords [ 2 ] ) ;
coords [ 3 ] = normalize ( coords [ 3 ] ) ;
vec3 vectorFormFactor = vec3 ( 0.0 ) ;
vectorFormFactor += LTC _EdgeVectorFormFactor ( coords [ 0 ] , coords [ 1 ] ) ;
vectorFormFactor += LTC _EdgeVectorFormFactor ( coords [ 1 ] , coords [ 2 ] ) ;
vectorFormFactor += LTC _EdgeVectorFormFactor ( coords [ 2 ] , coords [ 3 ] ) ;
vectorFormFactor += LTC _EdgeVectorFormFactor ( coords [ 3 ] , coords [ 0 ] ) ;
float result = LTC _ClippedSphereFormFactor ( vectorFormFactor ) ;
return vec3 ( result ) ;
}
# if defined ( USE _SHEEN )
float D _Charlie ( float roughness , float dotNH ) {
float alpha = pow2 ( roughness ) ;
float invAlpha = 1.0 / alpha ;
float cos2h = dotNH * dotNH ;
float sin2h = max ( 1.0 - cos2h , 0.0078125 ) ;
return ( 2.0 + invAlpha ) * pow ( sin2h , invAlpha * 0.5 ) / ( 2.0 * PI ) ;
}
float V _Neubelt ( float dotNV , float dotNL ) {
return saturate ( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ) ;
}
vec3 BRDF _Sheen ( const in vec3 lightDir , const in vec3 viewDir , const in vec3 normal , vec3 sheenColor , const in float sheenRoughness ) {
vec3 halfDir = normalize ( lightDir + viewDir ) ;
float dotNL = saturate ( dot ( normal , lightDir ) ) ;
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
float dotNH = saturate ( dot ( normal , halfDir ) ) ;
float D = D _Charlie ( sheenRoughness , dotNH ) ;
float V = V _Neubelt ( dotNV , dotNL ) ;
return sheenColor * ( D * V ) ;
}
# endif
float IBLSheenBRDF ( const in vec3 normal , const in vec3 viewDir , const in float roughness ) {
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
float r2 = roughness * roughness ;
float a = roughness < 0.25 ? - 339.2 * r2 + 161.4 * roughness - 25.9 : - 8.48 * r2 + 14.3 * roughness - 9.95 ;
float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72 ;
float DG = exp ( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ) ;
return saturate ( DG * RECIPROCAL _PI ) ;
}
vec2 DFGApprox ( const in vec3 normal , const in vec3 viewDir , const in float roughness ) {
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
const vec4 c0 = vec4 ( - 1 , - 0.0275 , - 0.572 , 0.022 ) ;
const vec4 c1 = vec4 ( 1 , 0.0425 , 1.04 , - 0.04 ) ;
vec4 r = roughness * c0 + c1 ;
float a004 = min ( r . x * r . x , exp2 ( - 9.28 * dotNV ) ) * r . x + r . y ;
vec2 fab = vec2 ( - 1.04 , 1.04 ) * a004 + r . zw ;
return fab ;
}
vec3 EnvironmentBRDF ( const in vec3 normal , const in vec3 viewDir , const in vec3 specularColor , const in float specularF90 , const in float roughness ) {
vec2 fab = DFGApprox ( normal , viewDir , roughness ) ;
return specularColor * fab . x + specularF90 * fab . y ;
}
# ifdef USE _IRIDESCENCE
void computeMultiscatteringIridescence ( const in vec3 normal , const in vec3 viewDir , const in vec3 specularColor , const in float specularF90 , const in float iridescence , const in vec3 iridescenceF0 , const in float roughness , inout vec3 singleScatter , inout vec3 multiScatter ) {
# else
void computeMultiscattering ( const in vec3 normal , const in vec3 viewDir , const in vec3 specularColor , const in float specularF90 , const in float roughness , inout vec3 singleScatter , inout vec3 multiScatter ) {
# endif
vec2 fab = DFGApprox ( normal , viewDir , roughness ) ;
# ifdef USE _IRIDESCENCE
vec3 Fr = mix ( specularColor , iridescenceF0 , iridescence ) ;
# else
vec3 Fr = specularColor ;
# endif
vec3 FssEss = Fr * fab . x + specularF90 * fab . y ;
float Ess = fab . x + fab . y ;
float Ems = 1.0 - Ess ;
vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619 ; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ) ;
singleScatter += FssEss ;
multiScatter += Fms * Ems ;
}
# if NUM _RECT _AREA _LIGHTS > 0
void RE _Direct _RectArea _Physical ( const in RectAreaLight rectAreaLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in PhysicalMaterial material , inout ReflectedLight reflectedLight ) {
vec3 normal = geometryNormal ;
vec3 viewDir = geometryViewDir ;
vec3 position = geometryPosition ;
vec3 lightPos = rectAreaLight . position ;
vec3 halfWidth = rectAreaLight . halfWidth ;
vec3 halfHeight = rectAreaLight . halfHeight ;
vec3 lightColor = rectAreaLight . color ;
float roughness = material . roughness ;
vec3 rectCoords [ 4 ] ;
rectCoords [ 0 ] = lightPos + halfWidth - halfHeight ; rectCoords [ 1 ] = lightPos - halfWidth - halfHeight ;
rectCoords [ 2 ] = lightPos - halfWidth + halfHeight ;
rectCoords [ 3 ] = lightPos + halfWidth + halfHeight ;
vec2 uv = LTC _Uv ( normal , viewDir , roughness ) ;
vec4 t1 = texture2D ( ltc _1 , uv ) ;
vec4 t2 = texture2D ( ltc _2 , uv ) ;
mat3 mInv = mat3 (
vec3 ( t1 . x , 0 , t1 . y ) ,
vec3 ( 0 , 1 , 0 ) ,
vec3 ( t1 . z , 0 , t1 . w )
) ;
vec3 fresnel = ( material . specularColor * t2 . x + ( vec3 ( 1.0 ) - material . specularColor ) * t2 . y ) ;
reflectedLight . directSpecular += lightColor * fresnel * LTC _Evaluate ( normal , viewDir , position , mInv , rectCoords ) ;
reflectedLight . directDiffuse += lightColor * material . diffuseColor * LTC _Evaluate ( normal , viewDir , position , mat3 ( 1.0 ) , rectCoords ) ;
}
# endif
void RE _Direct _Physical ( const in IncidentLight directLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in PhysicalMaterial material , inout ReflectedLight reflectedLight ) {
float dotNL = saturate ( dot ( geometryNormal , directLight . direction ) ) ;
vec3 irradiance = dotNL * directLight . color ;
# ifdef USE _CLEARCOAT
float dotNLcc = saturate ( dot ( geometryClearcoatNormal , directLight . direction ) ) ;
vec3 ccIrradiance = dotNLcc * directLight . color ;
clearcoatSpecularDirect += ccIrradiance * BRDF _GGX _Clearcoat ( directLight . direction , geometryViewDir , geometryClearcoatNormal , material ) ;
# endif
# ifdef USE _SHEEN
sheenSpecularDirect += irradiance * BRDF _Sheen ( directLight . direction , geometryViewDir , geometryNormal , material . sheenColor , material . sheenRoughness ) ;
# endif
reflectedLight . directSpecular += irradiance * BRDF _GGX ( directLight . direction , geometryViewDir , geometryNormal , material ) ;
reflectedLight . directDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
void RE _IndirectDiffuse _Physical ( const in vec3 irradiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in PhysicalMaterial material , inout ReflectedLight reflectedLight ) {
reflectedLight . indirectDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
void RE _IndirectSpecular _Physical ( const in vec3 radiance , const in vec3 irradiance , const in vec3 clearcoatRadiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in PhysicalMaterial material , inout ReflectedLight reflectedLight ) {
# ifdef USE _CLEARCOAT
clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF ( geometryClearcoatNormal , geometryViewDir , material . clearcoatF0 , material . clearcoatF90 , material . clearcoatRoughness ) ;
# endif
# ifdef USE _SHEEN
sheenSpecularIndirect += irradiance * material . sheenColor * IBLSheenBRDF ( geometryNormal , geometryViewDir , material . sheenRoughness ) ;
# endif
vec3 singleScattering = vec3 ( 0.0 ) ;
vec3 multiScattering = vec3 ( 0.0 ) ;
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL _PI ;
# ifdef USE _IRIDESCENCE
computeMultiscatteringIridescence ( geometryNormal , geometryViewDir , material . specularColor , material . specularF90 , material . iridescence , material . iridescenceFresnel , material . roughness , singleScattering , multiScattering ) ;
# else
computeMultiscattering ( geometryNormal , geometryViewDir , material . specularColor , material . specularF90 , material . roughness , singleScattering , multiScattering ) ;
# endif
vec3 totalScattering = singleScattering + multiScattering ;
vec3 diffuse = material . diffuseColor * ( 1.0 - max ( max ( totalScattering . r , totalScattering . g ) , totalScattering . b ) ) ;
reflectedLight . indirectSpecular += radiance * singleScattering ;
reflectedLight . indirectSpecular += multiScattering * cosineWeightedIrradiance ;
reflectedLight . indirectDiffuse += diffuse * cosineWeightedIrradiance ;
}
# define RE _Direct RE _Direct _Physical
# define RE _Direct _RectArea RE _Direct _RectArea _Physical
# define RE _IndirectDiffuse RE _IndirectDiffuse _Physical
# define RE _IndirectSpecular RE _IndirectSpecular _Physical
float computeSpecularOcclusion ( const in float dotNV , const in float ambientOcclusion , const in float roughness ) {
return saturate ( pow ( dotNV + ambientOcclusion , exp2 ( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ) ;
2024-11-05 00:44:58 +00:00
} ` ,Pxt= `
2024-11-04 00:22:50 +00:00
vec3 geometryPosition = - vViewPosition ;
vec3 geometryNormal = normal ;
vec3 geometryViewDir = ( isOrthographic ) ? vec3 ( 0 , 0 , 1 ) : normalize ( vViewPosition ) ;
vec3 geometryClearcoatNormal = vec3 ( 0.0 ) ;
# ifdef USE _CLEARCOAT
geometryClearcoatNormal = clearcoatNormal ;
# endif
# ifdef USE _IRIDESCENCE
float dotNVi = saturate ( dot ( normal , geometryViewDir ) ) ;
if ( material . iridescenceThickness == 0.0 ) {
material . iridescence = 0.0 ;
} else {
material . iridescence = saturate ( material . iridescence ) ;
}
if ( material . iridescence > 0.0 ) {
material . iridescenceFresnel = evalIridescence ( 1.0 , material . iridescenceIOR , dotNVi , material . iridescenceThickness , material . specularColor ) ;
material . iridescenceF0 = Schlick _to _F0 ( material . iridescenceFresnel , 1.0 , dotNVi ) ;
}
# endif
IncidentLight directLight ;
# if ( NUM _POINT _LIGHTS > 0 ) && defined ( RE _Direct )
PointLight pointLight ;
# if defined ( USE _SHADOWMAP ) && NUM _POINT _LIGHT _SHADOWS > 0
PointLightShadow pointLightShadow ;
# endif
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _POINT _LIGHTS ; i ++ ) {
pointLight = pointLights [ i ] ;
getPointLightInfo ( pointLight , geometryPosition , directLight ) ;
# if defined ( USE _SHADOWMAP ) && ( UNROLLED _LOOP _INDEX < NUM _POINT _LIGHT _SHADOWS )
pointLightShadow = pointLightShadows [ i ] ;
directLight . color *= ( directLight . visible && receiveShadow ) ? getPointShadow ( pointShadowMap [ i ] , pointLightShadow . shadowMapSize , pointLightShadow . shadowBias , pointLightShadow . shadowRadius , vPointShadowCoord [ i ] , pointLightShadow . shadowCameraNear , pointLightShadow . shadowCameraFar ) : 1.0 ;
# endif
RE _Direct ( directLight , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
}
# pragma unroll _loop _end
# endif
# if ( NUM _SPOT _LIGHTS > 0 ) && defined ( RE _Direct )
SpotLight spotLight ;
vec4 spotColor ;
vec3 spotLightCoord ;
bool inSpotLightMap ;
# if defined ( USE _SHADOWMAP ) && NUM _SPOT _LIGHT _SHADOWS > 0
SpotLightShadow spotLightShadow ;
# endif
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _SPOT _LIGHTS ; i ++ ) {
spotLight = spotLights [ i ] ;
getSpotLightInfo ( spotLight , geometryPosition , directLight ) ;
# if ( UNROLLED _LOOP _INDEX < NUM _SPOT _LIGHT _SHADOWS _WITH _MAPS )
# define SPOT _LIGHT _MAP _INDEX UNROLLED _LOOP _INDEX
# elif ( UNROLLED _LOOP _INDEX < NUM _SPOT _LIGHT _SHADOWS )
# define SPOT _LIGHT _MAP _INDEX NUM _SPOT _LIGHT _MAPS
# else
# define SPOT _LIGHT _MAP _INDEX ( UNROLLED _LOOP _INDEX - NUM _SPOT _LIGHT _SHADOWS + NUM _SPOT _LIGHT _SHADOWS _WITH _MAPS )
# endif
# if ( SPOT _LIGHT _MAP _INDEX < NUM _SPOT _LIGHT _MAPS )
spotLightCoord = vSpotLightCoord [ i ] . xyz / vSpotLightCoord [ i ] . w ;
inSpotLightMap = all ( lessThan ( abs ( spotLightCoord * 2. - 1. ) , vec3 ( 1.0 ) ) ) ;
spotColor = texture2D ( spotLightMap [ SPOT _LIGHT _MAP _INDEX ] , spotLightCoord . xy ) ;
directLight . color = inSpotLightMap ? directLight . color * spotColor . rgb : directLight . color ;
# endif
# undef SPOT _LIGHT _MAP _INDEX
# if defined ( USE _SHADOWMAP ) && ( UNROLLED _LOOP _INDEX < NUM _SPOT _LIGHT _SHADOWS )
spotLightShadow = spotLightShadows [ i ] ;
directLight . color *= ( directLight . visible && receiveShadow ) ? getShadow ( spotShadowMap [ i ] , spotLightShadow . shadowMapSize , spotLightShadow . shadowBias , spotLightShadow . shadowRadius , vSpotLightCoord [ i ] ) : 1.0 ;
# endif
RE _Direct ( directLight , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
}
# pragma unroll _loop _end
# endif
# if ( NUM _DIR _LIGHTS > 0 ) && defined ( RE _Direct )
DirectionalLight directionalLight ;
# if defined ( USE _SHADOWMAP ) && NUM _DIR _LIGHT _SHADOWS > 0
DirectionalLightShadow directionalLightShadow ;
# endif
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _DIR _LIGHTS ; i ++ ) {
directionalLight = directionalLights [ i ] ;
getDirectionalLightInfo ( directionalLight , directLight ) ;
# if defined ( USE _SHADOWMAP ) && ( UNROLLED _LOOP _INDEX < NUM _DIR _LIGHT _SHADOWS )
directionalLightShadow = directionalLightShadows [ i ] ;
directLight . color *= ( directLight . visible && receiveShadow ) ? getShadow ( directionalShadowMap [ i ] , directionalLightShadow . shadowMapSize , directionalLightShadow . shadowBias , directionalLightShadow . shadowRadius , vDirectionalShadowCoord [ i ] ) : 1.0 ;
# endif
RE _Direct ( directLight , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
}
# pragma unroll _loop _end
# endif
# if ( NUM _RECT _AREA _LIGHTS > 0 ) && defined ( RE _Direct _RectArea )
RectAreaLight rectAreaLight ;
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _RECT _AREA _LIGHTS ; i ++ ) {
rectAreaLight = rectAreaLights [ i ] ;
RE _Direct _RectArea ( rectAreaLight , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
}
# pragma unroll _loop _end
# endif
# if defined ( RE _IndirectDiffuse )
vec3 iblIrradiance = vec3 ( 0.0 ) ;
vec3 irradiance = getAmbientLightIrradiance ( ambientLightColor ) ;
# if defined ( USE _LIGHT _PROBES )
irradiance += getLightProbeIrradiance ( lightProbe , geometryNormal ) ;
# endif
# if ( NUM _HEMI _LIGHTS > 0 )
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _HEMI _LIGHTS ; i ++ ) {
irradiance += getHemisphereLightIrradiance ( hemisphereLights [ i ] , geometryNormal ) ;
}
# pragma unroll _loop _end
# endif
# endif
# if defined ( RE _IndirectSpecular )
vec3 radiance = vec3 ( 0.0 ) ;
vec3 clearcoatRadiance = vec3 ( 0.0 ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,Fxt= ` # if defined ( RE _IndirectDiffuse )
2024-11-04 00:22:50 +00:00
# ifdef USE _LIGHTMAP
vec4 lightMapTexel = texture2D ( lightMap , vLightMapUv ) ;
vec3 lightMapIrradiance = lightMapTexel . rgb * lightMapIntensity ;
irradiance += lightMapIrradiance ;
# endif
# if defined ( USE _ENVMAP ) && defined ( STANDARD ) && defined ( ENVMAP _TYPE _CUBE _UV )
iblIrradiance += getIBLIrradiance ( geometryNormal ) ;
# endif
# endif
# if defined ( USE _ENVMAP ) && defined ( RE _IndirectSpecular )
# ifdef USE _ANISOTROPY
radiance += getIBLAnisotropyRadiance ( geometryViewDir , geometryNormal , material . roughness , material . anisotropyB , material . anisotropy ) ;
# else
radiance += getIBLRadiance ( geometryViewDir , geometryNormal , material . roughness ) ;
# endif
# ifdef USE _CLEARCOAT
clearcoatRadiance += getIBLRadiance ( geometryViewDir , geometryClearcoatNormal , material . clearcoatRoughness ) ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,Uxt= ` # if defined ( RE _IndirectDiffuse )
2024-11-04 00:22:50 +00:00
RE _IndirectDiffuse ( irradiance , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
# endif
# if defined ( RE _IndirectSpecular )
RE _IndirectSpecular ( radiance , iblIrradiance , clearcoatRadiance , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,Bxt= ` # if defined ( USE _LOGDEPTHBUF ) && defined ( USE _LOGDEPTHBUF _EXT )
2024-11-04 00:22:50 +00:00
gl _FragDepthEXT = vIsPerspective == 0.0 ? gl _FragCoord . z : log2 ( vFragDepth ) * logDepthBufFC * 0.5 ;
2024-11-05 00:44:58 +00:00
# endif ` ,Gxt= ` # if defined ( USE _LOGDEPTHBUF ) && defined ( USE _LOGDEPTHBUF _EXT )
2024-11-04 00:22:50 +00:00
uniform float logDepthBufFC ;
varying float vFragDepth ;
varying float vIsPerspective ;
2024-11-05 00:44:58 +00:00
# endif ` ,zxt= ` # ifdef USE _LOGDEPTHBUF
2024-11-04 00:22:50 +00:00
# ifdef USE _LOGDEPTHBUF _EXT
varying float vFragDepth ;
varying float vIsPerspective ;
# else
uniform float logDepthBufFC ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,Vxt= ` # ifdef USE _LOGDEPTHBUF
2024-11-04 00:22:50 +00:00
# ifdef USE _LOGDEPTHBUF _EXT
vFragDepth = 1.0 + gl _Position . w ;
vIsPerspective = float ( isPerspectiveMatrix ( projectionMatrix ) ) ;
# else
if ( isPerspectiveMatrix ( projectionMatrix ) ) {
gl _Position . z = log2 ( max ( EPSILON , gl _Position . w + 1.0 ) ) * logDepthBufFC - 1.0 ;
gl _Position . z *= gl _Position . w ;
}
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,Hxt= ` # ifdef USE _MAP
2024-11-04 00:22:50 +00:00
vec4 sampledDiffuseColor = texture2D ( map , vMapUv ) ;
# ifdef DECODE _VIDEO _TEXTURE
sampledDiffuseColor = vec4 ( mix ( pow ( sampledDiffuseColor . rgb * 0.9478672986 + vec3 ( 0.0521327014 ) , vec3 ( 2.4 ) ) , sampledDiffuseColor . rgb * 0.0773993808 , vec3 ( lessThanEqual ( sampledDiffuseColor . rgb , vec3 ( 0.04045 ) ) ) ) , sampledDiffuseColor . w ) ;
# endif
diffuseColor *= sampledDiffuseColor ;
2024-11-05 00:44:58 +00:00
# endif ` ,qxt= ` # ifdef USE _MAP
2024-11-04 00:22:50 +00:00
uniform sampler2D map ;
2024-11-05 00:44:58 +00:00
# endif ` ,Yxt= ` # if defined ( USE _MAP ) || defined ( USE _ALPHAMAP )
2024-11-04 00:22:50 +00:00
# if defined ( USE _POINTS _UV )
vec2 uv = vUv ;
# else
vec2 uv = ( uvTransform * vec3 ( gl _PointCoord . x , 1.0 - gl _PointCoord . y , 1 ) ) . xy ;
# endif
# endif
# ifdef USE _MAP
diffuseColor *= texture2D ( map , uv ) ;
# endif
# ifdef USE _ALPHAMAP
diffuseColor . a *= texture2D ( alphaMap , uv ) . g ;
2024-11-05 00:44:58 +00:00
# endif ` , $ xt= ` # if defined ( USE _POINTS _UV )
2024-11-04 00:22:50 +00:00
varying vec2 vUv ;
# else
# if defined ( USE _MAP ) || defined ( USE _ALPHAMAP )
uniform mat3 uvTransform ;
# endif
# endif
# ifdef USE _MAP
uniform sampler2D map ;
# endif
# ifdef USE _ALPHAMAP
uniform sampler2D alphaMap ;
2024-11-05 00:44:58 +00:00
# endif ` ,Wxt= ` float metalnessFactor = metalness ;
2024-11-04 00:22:50 +00:00
# ifdef USE _METALNESSMAP
vec4 texelMetalness = texture2D ( metalnessMap , vMetalnessMapUv ) ;
metalnessFactor *= texelMetalness . b ;
2024-11-05 00:44:58 +00:00
# endif ` ,Kxt= ` # ifdef USE _METALNESSMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D metalnessMap ;
2024-11-05 00:44:58 +00:00
# endif ` ,jxt= ` # if defined ( USE _MORPHCOLORS ) && defined ( MORPHTARGETS _TEXTURE )
2024-11-04 00:22:50 +00:00
vColor *= morphTargetBaseInfluence ;
for ( int i = 0 ; i < MORPHTARGETS _COUNT ; i ++ ) {
# if defined ( USE _COLOR _ALPHA )
if ( morphTargetInfluences [ i ] != 0.0 ) vColor += getMorph ( gl _VertexID , i , 2 ) * morphTargetInfluences [ i ] ;
# elif defined ( USE _COLOR )
if ( morphTargetInfluences [ i ] != 0.0 ) vColor += getMorph ( gl _VertexID , i , 2 ) . rgb * morphTargetInfluences [ i ] ;
# endif
}
2024-11-05 00:44:58 +00:00
# endif ` ,Qxt= ` # ifdef USE _MORPHNORMALS
2024-11-04 00:22:50 +00:00
objectNormal *= morphTargetBaseInfluence ;
# ifdef MORPHTARGETS _TEXTURE
for ( int i = 0 ; i < MORPHTARGETS _COUNT ; i ++ ) {
if ( morphTargetInfluences [ i ] != 0.0 ) objectNormal += getMorph ( gl _VertexID , i , 1 ) . xyz * morphTargetInfluences [ i ] ;
}
# else
objectNormal += morphNormal0 * morphTargetInfluences [ 0 ] ;
objectNormal += morphNormal1 * morphTargetInfluences [ 1 ] ;
objectNormal += morphNormal2 * morphTargetInfluences [ 2 ] ;
objectNormal += morphNormal3 * morphTargetInfluences [ 3 ] ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,Xxt= ` # ifdef USE _MORPHTARGETS
2024-11-04 00:22:50 +00:00
uniform float morphTargetBaseInfluence ;
# ifdef MORPHTARGETS _TEXTURE
uniform float morphTargetInfluences [ MORPHTARGETS _COUNT ] ;
uniform sampler2DArray morphTargetsTexture ;
uniform ivec2 morphTargetsTextureSize ;
vec4 getMorph ( const in int vertexIndex , const in int morphTargetIndex , const in int offset ) {
int texelIndex = vertexIndex * MORPHTARGETS _TEXTURE _STRIDE + offset ;
int y = texelIndex / morphTargetsTextureSize . x ;
int x = texelIndex - y * morphTargetsTextureSize . x ;
ivec3 morphUV = ivec3 ( x , y , morphTargetIndex ) ;
return texelFetch ( morphTargetsTexture , morphUV , 0 ) ;
}
# else
# ifndef USE _MORPHNORMALS
uniform float morphTargetInfluences [ 8 ] ;
# else
uniform float morphTargetInfluences [ 4 ] ;
# endif
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,Zxt= ` # ifdef USE _MORPHTARGETS
2024-11-04 00:22:50 +00:00
transformed *= morphTargetBaseInfluence ;
# ifdef MORPHTARGETS _TEXTURE
for ( int i = 0 ; i < MORPHTARGETS _COUNT ; i ++ ) {
if ( morphTargetInfluences [ i ] != 0.0 ) transformed += getMorph ( gl _VertexID , i , 0 ) . xyz * morphTargetInfluences [ i ] ;
}
# else
transformed += morphTarget0 * morphTargetInfluences [ 0 ] ;
transformed += morphTarget1 * morphTargetInfluences [ 1 ] ;
transformed += morphTarget2 * morphTargetInfluences [ 2 ] ;
transformed += morphTarget3 * morphTargetInfluences [ 3 ] ;
# ifndef USE _MORPHNORMALS
transformed += morphTarget4 * morphTargetInfluences [ 4 ] ;
transformed += morphTarget5 * morphTargetInfluences [ 5 ] ;
transformed += morphTarget6 * morphTargetInfluences [ 6 ] ;
transformed += morphTarget7 * morphTargetInfluences [ 7 ] ;
# endif
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,Jxt= ` float faceDirection = gl _FrontFacing ? 1.0 : - 1.0 ;
2024-11-04 00:22:50 +00:00
# ifdef FLAT _SHADED
vec3 fdx = dFdx ( vViewPosition ) ;
vec3 fdy = dFdy ( vViewPosition ) ;
vec3 normal = normalize ( cross ( fdx , fdy ) ) ;
# else
vec3 normal = normalize ( vNormal ) ;
# ifdef DOUBLE _SIDED
normal *= faceDirection ;
# endif
# endif
# if defined ( USE _NORMALMAP _TANGENTSPACE ) || defined ( USE _CLEARCOAT _NORMALMAP ) || defined ( USE _ANISOTROPY )
# ifdef USE _TANGENT
mat3 tbn = mat3 ( normalize ( vTangent ) , normalize ( vBitangent ) , normal ) ;
# else
mat3 tbn = getTangentFrame ( - vViewPosition , normal ,
# if defined ( USE _NORMALMAP )
vNormalMapUv
# elif defined ( USE _CLEARCOAT _NORMALMAP )
vClearcoatNormalMapUv
# else
vUv
# endif
) ;
# endif
# if defined ( DOUBLE _SIDED ) && ! defined ( FLAT _SHADED )
tbn [ 0 ] *= faceDirection ;
tbn [ 1 ] *= faceDirection ;
# endif
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
# ifdef USE _TANGENT
mat3 tbn2 = mat3 ( normalize ( vTangent ) , normalize ( vBitangent ) , normal ) ;
# else
mat3 tbn2 = getTangentFrame ( - vViewPosition , normal , vClearcoatNormalMapUv ) ;
# endif
# if defined ( DOUBLE _SIDED ) && ! defined ( FLAT _SHADED )
tbn2 [ 0 ] *= faceDirection ;
tbn2 [ 1 ] *= faceDirection ;
# endif
# endif
2024-11-05 00:44:58 +00:00
vec3 nonPerturbedNormal = normal ; ` ,eTt= ` # ifdef USE _NORMALMAP _OBJECTSPACE
2024-11-04 00:22:50 +00:00
normal = texture2D ( normalMap , vNormalMapUv ) . xyz * 2.0 - 1.0 ;
# ifdef FLIP _SIDED
normal = - normal ;
# endif
# ifdef DOUBLE _SIDED
normal = normal * faceDirection ;
# endif
normal = normalize ( normalMatrix * normal ) ;
# elif defined ( USE _NORMALMAP _TANGENTSPACE )
vec3 mapN = texture2D ( normalMap , vNormalMapUv ) . xyz * 2.0 - 1.0 ;
mapN . xy *= normalScale ;
normal = normalize ( tbn * mapN ) ;
# elif defined ( USE _BUMPMAP )
normal = perturbNormalArb ( - vViewPosition , normal , dHdxy _fwd ( ) , faceDirection ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,tTt= ` # ifndef FLAT _SHADED
2024-11-04 00:22:50 +00:00
varying vec3 vNormal ;
# ifdef USE _TANGENT
varying vec3 vTangent ;
varying vec3 vBitangent ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,nTt= ` # ifndef FLAT _SHADED
2024-11-04 00:22:50 +00:00
varying vec3 vNormal ;
# ifdef USE _TANGENT
varying vec3 vTangent ;
varying vec3 vBitangent ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,rTt= ` # ifndef FLAT _SHADED
2024-11-04 00:22:50 +00:00
vNormal = normalize ( transformedNormal ) ;
# ifdef USE _TANGENT
vTangent = normalize ( transformedTangent ) ;
vBitangent = normalize ( cross ( vNormal , vTangent ) * tangent . w ) ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,iTt= ` # ifdef USE _NORMALMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D normalMap ;
uniform vec2 normalScale ;
# endif
# ifdef USE _NORMALMAP _OBJECTSPACE
uniform mat3 normalMatrix ;
# endif
# if ! defined ( USE _TANGENT ) && ( defined ( USE _NORMALMAP _TANGENTSPACE ) || defined ( USE _CLEARCOAT _NORMALMAP ) || defined ( USE _ANISOTROPY ) )
mat3 getTangentFrame ( vec3 eye _pos , vec3 surf _norm , vec2 uv ) {
vec3 q0 = dFdx ( eye _pos . xyz ) ;
vec3 q1 = dFdy ( eye _pos . xyz ) ;
vec2 st0 = dFdx ( uv . st ) ;
vec2 st1 = dFdy ( uv . st ) ;
vec3 N = surf _norm ;
vec3 q1perp = cross ( q1 , N ) ;
vec3 q0perp = cross ( N , q0 ) ;
vec3 T = q1perp * st0 . x + q0perp * st1 . x ;
vec3 B = q1perp * st0 . y + q0perp * st1 . y ;
float det = max ( dot ( T , T ) , dot ( B , B ) ) ;
float scale = ( det == 0.0 ) ? 0.0 : inversesqrt ( det ) ;
return mat3 ( T * scale , B * scale , N ) ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,sTt= ` # ifdef USE _CLEARCOAT
2024-11-04 00:22:50 +00:00
vec3 clearcoatNormal = nonPerturbedNormal ;
2024-11-05 00:44:58 +00:00
# endif ` ,oTt= ` # ifdef USE _CLEARCOAT _NORMALMAP
2024-11-04 00:22:50 +00:00
vec3 clearcoatMapN = texture2D ( clearcoatNormalMap , vClearcoatNormalMapUv ) . xyz * 2.0 - 1.0 ;
clearcoatMapN . xy *= clearcoatNormalScale ;
clearcoatNormal = normalize ( tbn2 * clearcoatMapN ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,aTt= ` # ifdef USE _CLEARCOATMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D clearcoatMap ;
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
uniform sampler2D clearcoatNormalMap ;
uniform vec2 clearcoatNormalScale ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
uniform sampler2D clearcoatRoughnessMap ;
2024-11-05 00:44:58 +00:00
# endif ` ,lTt= ` # ifdef USE _IRIDESCENCEMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D iridescenceMap ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
uniform sampler2D iridescenceThicknessMap ;
2024-11-05 00:44:58 +00:00
# endif ` ,cTt= ` # ifdef OPAQUE
2024-11-04 00:22:50 +00:00
diffuseColor . a = 1.0 ;
# endif
# ifdef USE _TRANSMISSION
diffuseColor . a *= material . transmissionAlpha ;
# endif
2024-11-05 00:44:58 +00:00
gl _FragColor = vec4 ( outgoingLight , diffuseColor . a ) ; ` ,dTt= ` vec3 packNormalToRGB ( const in vec3 normal ) {
2024-11-04 00:22:50 +00:00
return normalize ( normal ) * 0.5 + 0.5 ;
}
vec3 unpackRGBToNormal ( const in vec3 rgb ) {
return 2.0 * rgb . xyz - 1.0 ;
}
const float PackUpscale = 256. / 255. ; const float UnpackDownscale = 255. / 256. ;
const vec3 PackFactors = vec3 ( 256. * 256. * 256. , 256. * 256. , 256. ) ;
const vec4 UnpackFactors = UnpackDownscale / vec4 ( PackFactors , 1. ) ;
const float ShiftRight8 = 1. / 256. ;
vec4 packDepthToRGBA ( const in float v ) {
vec4 r = vec4 ( fract ( v * PackFactors ) , v ) ;
r . yzw -= r . xyz * ShiftRight8 ; return r * PackUpscale ;
}
float unpackRGBAToDepth ( const in vec4 v ) {
return dot ( v , UnpackFactors ) ;
}
vec2 packDepthToRG ( in highp float v ) {
return packDepthToRGBA ( v ) . yx ;
}
float unpackRGToDepth ( const in highp vec2 v ) {
return unpackRGBAToDepth ( vec4 ( v . xy , 0.0 , 0.0 ) ) ;
}
vec4 pack2HalfToRGBA ( vec2 v ) {
vec4 r = vec4 ( v . x , fract ( v . x * 255.0 ) , v . y , fract ( v . y * 255.0 ) ) ;
return vec4 ( r . x - r . y / 255.0 , r . y , r . z - r . w / 255.0 , r . w ) ;
}
vec2 unpackRGBATo2Half ( vec4 v ) {
return vec2 ( v . x + ( v . y / 255.0 ) , v . z + ( v . w / 255.0 ) ) ;
}
float viewZToOrthographicDepth ( const in float viewZ , const in float near , const in float far ) {
return ( viewZ + near ) / ( near - far ) ;
}
float orthographicDepthToViewZ ( const in float depth , const in float near , const in float far ) {
return depth * ( near - far ) - near ;
}
float viewZToPerspectiveDepth ( const in float viewZ , const in float near , const in float far ) {
return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ) ;
}
float perspectiveDepthToViewZ ( const in float depth , const in float near , const in float far ) {
return ( near * far ) / ( ( far - near ) * depth - far ) ;
2024-11-05 00:44:58 +00:00
} ` ,uTt= ` # ifdef PREMULTIPLIED _ALPHA
2024-11-04 00:22:50 +00:00
gl _FragColor . rgb *= gl _FragColor . a ;
2024-11-05 00:44:58 +00:00
# endif ` ,pTt= ` vec4 mvPosition = vec4 ( transformed , 1.0 ) ;
2024-11-04 00:22:50 +00:00
# ifdef USE _BATCHING
mvPosition = batchingMatrix * mvPosition ;
# endif
# ifdef USE _INSTANCING
mvPosition = instanceMatrix * mvPosition ;
# endif
mvPosition = modelViewMatrix * mvPosition ;
2024-11-05 00:44:58 +00:00
gl _Position = projectionMatrix * mvPosition ; ` ,hTt= ` # ifdef DITHERING
2024-11-04 00:22:50 +00:00
gl _FragColor . rgb = dithering ( gl _FragColor . rgb ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,mTt= ` # ifdef DITHERING
2024-11-04 00:22:50 +00:00
vec3 dithering ( vec3 color ) {
float grid _position = rand ( gl _FragCoord . xy ) ;
vec3 dither _shift _RGB = vec3 ( 0.25 / 255.0 , - 0.25 / 255.0 , 0.25 / 255.0 ) ;
dither _shift _RGB = mix ( 2.0 * dither _shift _RGB , - 2.0 * dither _shift _RGB , grid _position ) ;
return color + dither _shift _RGB ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,fTt= ` float roughnessFactor = roughness ;
2024-11-04 00:22:50 +00:00
# ifdef USE _ROUGHNESSMAP
vec4 texelRoughness = texture2D ( roughnessMap , vRoughnessMapUv ) ;
roughnessFactor *= texelRoughness . g ;
2024-11-05 00:44:58 +00:00
# endif ` ,gTt= ` # ifdef USE _ROUGHNESSMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D roughnessMap ;
2024-11-05 00:44:58 +00:00
# endif ` ,_Tt= ` # if NUM _SPOT _LIGHT _COORDS > 0
2024-11-04 00:22:50 +00:00
varying vec4 vSpotLightCoord [ NUM _SPOT _LIGHT _COORDS ] ;
# endif
# if NUM _SPOT _LIGHT _MAPS > 0
uniform sampler2D spotLightMap [ NUM _SPOT _LIGHT _MAPS ] ;
# endif
# ifdef USE _SHADOWMAP
# if NUM _DIR _LIGHT _SHADOWS > 0
uniform sampler2D directionalShadowMap [ NUM _DIR _LIGHT _SHADOWS ] ;
varying vec4 vDirectionalShadowCoord [ NUM _DIR _LIGHT _SHADOWS ] ;
struct DirectionalLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
} ;
uniform DirectionalLightShadow directionalLightShadows [ NUM _DIR _LIGHT _SHADOWS ] ;
# endif
# if NUM _SPOT _LIGHT _SHADOWS > 0
uniform sampler2D spotShadowMap [ NUM _SPOT _LIGHT _SHADOWS ] ;
struct SpotLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
} ;
uniform SpotLightShadow spotLightShadows [ NUM _SPOT _LIGHT _SHADOWS ] ;
# endif
# if NUM _POINT _LIGHT _SHADOWS > 0
uniform sampler2D pointShadowMap [ NUM _POINT _LIGHT _SHADOWS ] ;
varying vec4 vPointShadowCoord [ NUM _POINT _LIGHT _SHADOWS ] ;
struct PointLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
float shadowCameraNear ;
float shadowCameraFar ;
} ;
uniform PointLightShadow pointLightShadows [ NUM _POINT _LIGHT _SHADOWS ] ;
# endif
float texture2DCompare ( sampler2D depths , vec2 uv , float compare ) {
return step ( compare , unpackRGBAToDepth ( texture2D ( depths , uv ) ) ) ;
}
vec2 texture2DDistribution ( sampler2D shadow , vec2 uv ) {
return unpackRGBATo2Half ( texture2D ( shadow , uv ) ) ;
}
float VSMShadow ( sampler2D shadow , vec2 uv , float compare ) {
float occlusion = 1.0 ;
vec2 distribution = texture2DDistribution ( shadow , uv ) ;
float hard _shadow = step ( compare , distribution . x ) ;
if ( hard _shadow != 1.0 ) {
float distance = compare - distribution . x ;
float variance = max ( 0.00000 , distribution . y * distribution . y ) ;
float softness _probability = variance / ( variance + distance * distance ) ; softness _probability = clamp ( ( softness _probability - 0.3 ) / ( 0.95 - 0.3 ) , 0.0 , 1.0 ) ; occlusion = clamp ( max ( hard _shadow , softness _probability ) , 0.0 , 1.0 ) ;
}
return occlusion ;
}
float getShadow ( sampler2D shadowMap , vec2 shadowMapSize , float shadowBias , float shadowRadius , vec4 shadowCoord ) {
float shadow = 1.0 ;
shadowCoord . xyz /= shadowCoord . w ;
shadowCoord . z += shadowBias ;
bool inFrustum = shadowCoord . x >= 0.0 && shadowCoord . x <= 1.0 && shadowCoord . y >= 0.0 && shadowCoord . y <= 1.0 ;
bool frustumTest = inFrustum && shadowCoord . z <= 1.0 ;
if ( frustumTest ) {
# if defined ( SHADOWMAP _TYPE _PCF )
vec2 texelSize = vec2 ( 1.0 ) / shadowMapSize ;
float dx0 = - texelSize . x * shadowRadius ;
float dy0 = - texelSize . y * shadowRadius ;
float dx1 = + texelSize . x * shadowRadius ;
float dy1 = + texelSize . y * shadowRadius ;
float dx2 = dx0 / 2.0 ;
float dy2 = dy0 / 2.0 ;
float dx3 = dx1 / 2.0 ;
float dy3 = dy1 / 2.0 ;
shadow = (
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx0 , dy0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( 0.0 , dy0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx1 , dy0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx2 , dy2 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( 0.0 , dy2 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx3 , dy2 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx0 , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx2 , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx3 , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx1 , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx2 , dy3 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( 0.0 , dy3 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx3 , dy3 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx0 , dy1 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( 0.0 , dy1 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx1 , dy1 ) , shadowCoord . z )
) * ( 1.0 / 17.0 ) ;
# elif defined ( SHADOWMAP _TYPE _PCF _SOFT )
vec2 texelSize = vec2 ( 1.0 ) / shadowMapSize ;
float dx = texelSize . x ;
float dy = texelSize . y ;
vec2 uv = shadowCoord . xy ;
vec2 f = fract ( uv * shadowMapSize + 0.5 ) ;
uv -= f * texelSize ;
shadow = (
texture2DCompare ( shadowMap , uv , shadowCoord . z ) +
texture2DCompare ( shadowMap , uv + vec2 ( dx , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , uv + vec2 ( 0.0 , dy ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , uv + texelSize , shadowCoord . z ) +
mix ( texture2DCompare ( shadowMap , uv + vec2 ( - dx , 0.0 ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 2.0 * dx , 0.0 ) , shadowCoord . z ) ,
f . x ) +
mix ( texture2DCompare ( shadowMap , uv + vec2 ( - dx , dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 2.0 * dx , dy ) , shadowCoord . z ) ,
f . x ) +
mix ( texture2DCompare ( shadowMap , uv + vec2 ( 0.0 , - dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 0.0 , 2.0 * dy ) , shadowCoord . z ) ,
f . y ) +
mix ( texture2DCompare ( shadowMap , uv + vec2 ( dx , - dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( dx , 2.0 * dy ) , shadowCoord . z ) ,
f . y ) +
mix ( mix ( texture2DCompare ( shadowMap , uv + vec2 ( - dx , - dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 2.0 * dx , - dy ) , shadowCoord . z ) ,
f . x ) ,
mix ( texture2DCompare ( shadowMap , uv + vec2 ( - dx , 2.0 * dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 2.0 * dx , 2.0 * dy ) , shadowCoord . z ) ,
f . x ) ,
f . y )
) * ( 1.0 / 9.0 ) ;
# elif defined ( SHADOWMAP _TYPE _VSM )
shadow = VSMShadow ( shadowMap , shadowCoord . xy , shadowCoord . z ) ;
# else
shadow = texture2DCompare ( shadowMap , shadowCoord . xy , shadowCoord . z ) ;
# endif
}
return shadow ;
}
vec2 cubeToUV ( vec3 v , float texelSizeY ) {
vec3 absV = abs ( v ) ;
float scaleToCube = 1.0 / max ( absV . x , max ( absV . y , absV . z ) ) ;
absV *= scaleToCube ;
v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ) ;
vec2 planar = v . xy ;
float almostATexel = 1.5 * texelSizeY ;
float almostOne = 1.0 - almostATexel ;
if ( absV . z >= almostOne ) {
if ( v . z > 0.0 )
planar . x = 4.0 - v . x ;
} else if ( absV . x >= almostOne ) {
float signX = sign ( v . x ) ;
planar . x = v . z * signX + 2.0 * signX ;
} else if ( absV . y >= almostOne ) {
float signY = sign ( v . y ) ;
planar . x = v . x + 2.0 * signY + 2.0 ;
planar . y = v . z * signY - 2.0 ;
}
return vec2 ( 0.125 , 0.25 ) * planar + vec2 ( 0.375 , 0.75 ) ;
}
float getPointShadow ( sampler2D shadowMap , vec2 shadowMapSize , float shadowBias , float shadowRadius , vec4 shadowCoord , float shadowCameraNear , float shadowCameraFar ) {
vec2 texelSize = vec2 ( 1.0 ) / ( shadowMapSize * vec2 ( 4.0 , 2.0 ) ) ;
vec3 lightToPosition = shadowCoord . xyz ;
float dp = ( length ( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ) ; dp += shadowBias ;
vec3 bd3D = normalize ( lightToPosition ) ;
# if defined ( SHADOWMAP _TYPE _PCF ) || defined ( SHADOWMAP _TYPE _PCF _SOFT ) || defined ( SHADOWMAP _TYPE _VSM )
vec2 offset = vec2 ( - 1 , 1 ) * shadowRadius * texelSize . y ;
return (
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . xyy , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . yyy , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . xyx , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . yyx , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . xxy , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . yxy , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . xxx , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . yxx , texelSize . y ) , dp )
) * ( 1.0 / 9.0 ) ;
# else
return texture2DCompare ( shadowMap , cubeToUV ( bd3D , texelSize . y ) , dp ) ;
# endif
}
2024-11-05 00:44:58 +00:00
# endif ` ,bTt= ` # if NUM _SPOT _LIGHT _COORDS > 0
2024-11-04 00:22:50 +00:00
uniform mat4 spotLightMatrix [ NUM _SPOT _LIGHT _COORDS ] ;
varying vec4 vSpotLightCoord [ NUM _SPOT _LIGHT _COORDS ] ;
# endif
# ifdef USE _SHADOWMAP
# if NUM _DIR _LIGHT _SHADOWS > 0
uniform mat4 directionalShadowMatrix [ NUM _DIR _LIGHT _SHADOWS ] ;
varying vec4 vDirectionalShadowCoord [ NUM _DIR _LIGHT _SHADOWS ] ;
struct DirectionalLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
} ;
uniform DirectionalLightShadow directionalLightShadows [ NUM _DIR _LIGHT _SHADOWS ] ;
# endif
# if NUM _SPOT _LIGHT _SHADOWS > 0
struct SpotLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
} ;
uniform SpotLightShadow spotLightShadows [ NUM _SPOT _LIGHT _SHADOWS ] ;
# endif
# if NUM _POINT _LIGHT _SHADOWS > 0
uniform mat4 pointShadowMatrix [ NUM _POINT _LIGHT _SHADOWS ] ;
varying vec4 vPointShadowCoord [ NUM _POINT _LIGHT _SHADOWS ] ;
struct PointLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
float shadowCameraNear ;
float shadowCameraFar ;
} ;
uniform PointLightShadow pointLightShadows [ NUM _POINT _LIGHT _SHADOWS ] ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,vTt= ` # if ( defined ( USE _SHADOWMAP ) && ( NUM _DIR _LIGHT _SHADOWS > 0 || NUM _POINT _LIGHT _SHADOWS > 0 ) ) || ( NUM _SPOT _LIGHT _COORDS > 0 )
2024-11-04 00:22:50 +00:00
vec3 shadowWorldNormal = inverseTransformDirection ( transformedNormal , viewMatrix ) ;
vec4 shadowWorldPosition ;
# endif
# if defined ( USE _SHADOWMAP )
# if NUM _DIR _LIGHT _SHADOWS > 0
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _DIR _LIGHT _SHADOWS ; i ++ ) {
shadowWorldPosition = worldPosition + vec4 ( shadowWorldNormal * directionalLightShadows [ i ] . shadowNormalBias , 0 ) ;
vDirectionalShadowCoord [ i ] = directionalShadowMatrix [ i ] * shadowWorldPosition ;
}
# pragma unroll _loop _end
# endif
# if NUM _POINT _LIGHT _SHADOWS > 0
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _POINT _LIGHT _SHADOWS ; i ++ ) {
shadowWorldPosition = worldPosition + vec4 ( shadowWorldNormal * pointLightShadows [ i ] . shadowNormalBias , 0 ) ;
vPointShadowCoord [ i ] = pointShadowMatrix [ i ] * shadowWorldPosition ;
}
# pragma unroll _loop _end
# endif
# endif
# if NUM _SPOT _LIGHT _COORDS > 0
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _SPOT _LIGHT _COORDS ; i ++ ) {
shadowWorldPosition = worldPosition ;
# if ( defined ( USE _SHADOWMAP ) && UNROLLED _LOOP _INDEX < NUM _SPOT _LIGHT _SHADOWS )
shadowWorldPosition . xyz += shadowWorldNormal * spotLightShadows [ i ] . shadowNormalBias ;
# endif
vSpotLightCoord [ i ] = spotLightMatrix [ i ] * shadowWorldPosition ;
}
# pragma unroll _loop _end
2024-11-05 00:44:58 +00:00
# endif ` ,yTt= ` float getShadowMask ( ) {
2024-11-04 00:22:50 +00:00
float shadow = 1.0 ;
# ifdef USE _SHADOWMAP
# if NUM _DIR _LIGHT _SHADOWS > 0
DirectionalLightShadow directionalLight ;
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _DIR _LIGHT _SHADOWS ; i ++ ) {
directionalLight = directionalLightShadows [ i ] ;
shadow *= receiveShadow ? getShadow ( directionalShadowMap [ i ] , directionalLight . shadowMapSize , directionalLight . shadowBias , directionalLight . shadowRadius , vDirectionalShadowCoord [ i ] ) : 1.0 ;
}
# pragma unroll _loop _end
# endif
# if NUM _SPOT _LIGHT _SHADOWS > 0
SpotLightShadow spotLight ;
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _SPOT _LIGHT _SHADOWS ; i ++ ) {
spotLight = spotLightShadows [ i ] ;
shadow *= receiveShadow ? getShadow ( spotShadowMap [ i ] , spotLight . shadowMapSize , spotLight . shadowBias , spotLight . shadowRadius , vSpotLightCoord [ i ] ) : 1.0 ;
}
# pragma unroll _loop _end
# endif
# if NUM _POINT _LIGHT _SHADOWS > 0
PointLightShadow pointLight ;
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _POINT _LIGHT _SHADOWS ; i ++ ) {
pointLight = pointLightShadows [ i ] ;
shadow *= receiveShadow ? getPointShadow ( pointShadowMap [ i ] , pointLight . shadowMapSize , pointLight . shadowBias , pointLight . shadowRadius , vPointShadowCoord [ i ] , pointLight . shadowCameraNear , pointLight . shadowCameraFar ) : 1.0 ;
}
# pragma unroll _loop _end
# endif
# endif
return shadow ;
2024-11-05 00:44:58 +00:00
} ` ,ETt= ` # ifdef USE _SKINNING
2024-11-04 00:22:50 +00:00
mat4 boneMatX = getBoneMatrix ( skinIndex . x ) ;
mat4 boneMatY = getBoneMatrix ( skinIndex . y ) ;
mat4 boneMatZ = getBoneMatrix ( skinIndex . z ) ;
mat4 boneMatW = getBoneMatrix ( skinIndex . w ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,STt= ` # ifdef USE _SKINNING
2024-11-04 00:22:50 +00:00
uniform mat4 bindMatrix ;
uniform mat4 bindMatrixInverse ;
uniform highp sampler2D boneTexture ;
mat4 getBoneMatrix ( const in float i ) {
int size = textureSize ( boneTexture , 0 ) . x ;
int j = int ( i ) * 4 ;
int x = j % size ;
int y = j / size ;
vec4 v1 = texelFetch ( boneTexture , ivec2 ( x , y ) , 0 ) ;
vec4 v2 = texelFetch ( boneTexture , ivec2 ( x + 1 , y ) , 0 ) ;
vec4 v3 = texelFetch ( boneTexture , ivec2 ( x + 2 , y ) , 0 ) ;
vec4 v4 = texelFetch ( boneTexture , ivec2 ( x + 3 , y ) , 0 ) ;
return mat4 ( v1 , v2 , v3 , v4 ) ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,xTt= ` # ifdef USE _SKINNING
2024-11-04 00:22:50 +00:00
vec4 skinVertex = bindMatrix * vec4 ( transformed , 1.0 ) ;
vec4 skinned = vec4 ( 0.0 ) ;
skinned += boneMatX * skinVertex * skinWeight . x ;
skinned += boneMatY * skinVertex * skinWeight . y ;
skinned += boneMatZ * skinVertex * skinWeight . z ;
skinned += boneMatW * skinVertex * skinWeight . w ;
transformed = ( bindMatrixInverse * skinned ) . xyz ;
2024-11-05 00:44:58 +00:00
# endif ` ,TTt= ` # ifdef USE _SKINNING
2024-11-04 00:22:50 +00:00
mat4 skinMatrix = mat4 ( 0.0 ) ;
skinMatrix += skinWeight . x * boneMatX ;
skinMatrix += skinWeight . y * boneMatY ;
skinMatrix += skinWeight . z * boneMatZ ;
skinMatrix += skinWeight . w * boneMatW ;
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix ;
objectNormal = vec4 ( skinMatrix * vec4 ( objectNormal , 0.0 ) ) . xyz ;
# ifdef USE _TANGENT
objectTangent = vec4 ( skinMatrix * vec4 ( objectTangent , 0.0 ) ) . xyz ;
# endif
2024-11-05 00:44:58 +00:00
# endif ` ,wTt= ` float specularStrength ;
2024-11-04 00:22:50 +00:00
# ifdef USE _SPECULARMAP
vec4 texelSpecular = texture2D ( specularMap , vSpecularMapUv ) ;
specularStrength = texelSpecular . r ;
# else
specularStrength = 1.0 ;
2024-11-05 00:44:58 +00:00
# endif ` ,CTt= ` # ifdef USE _SPECULARMAP
2024-11-04 00:22:50 +00:00
uniform sampler2D specularMap ;
2024-11-05 00:44:58 +00:00
# endif ` ,ATt= ` # if defined ( TONE _MAPPING )
2024-11-04 00:22:50 +00:00
gl _FragColor . rgb = toneMapping ( gl _FragColor . rgb ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,RTt= ` # ifndef saturate
2024-11-04 00:22:50 +00:00
# define saturate ( a ) clamp ( a , 0.0 , 1.0 )
# endif
uniform float toneMappingExposure ;
vec3 LinearToneMapping ( vec3 color ) {
return saturate ( toneMappingExposure * color ) ;
}
vec3 ReinhardToneMapping ( vec3 color ) {
color *= toneMappingExposure ;
return saturate ( color / ( vec3 ( 1.0 ) + color ) ) ;
}
vec3 OptimizedCineonToneMapping ( vec3 color ) {
color *= toneMappingExposure ;
color = max ( vec3 ( 0.0 ) , color - 0.004 ) ;
return pow ( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ) , vec3 ( 2.2 ) ) ;
}
vec3 RRTAndODTFit ( vec3 v ) {
vec3 a = v * ( v + 0.0245786 ) - 0.000090537 ;
vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081 ;
return a / b ;
}
vec3 ACESFilmicToneMapping ( vec3 color ) {
const mat3 ACESInputMat = mat3 (
vec3 ( 0.59719 , 0.07600 , 0.02840 ) , vec3 ( 0.35458 , 0.90834 , 0.13383 ) ,
vec3 ( 0.04823 , 0.01566 , 0.83777 )
) ;
const mat3 ACESOutputMat = mat3 (
vec3 ( 1.60475 , - 0.10208 , - 0.00327 ) , vec3 ( - 0.53108 , 1.10813 , - 0.07276 ) ,
vec3 ( - 0.07367 , - 0.00605 , 1.07602 )
) ;
color *= toneMappingExposure / 0.6 ;
color = ACESInputMat * color ;
color = RRTAndODTFit ( color ) ;
color = ACESOutputMat * color ;
return saturate ( color ) ;
}
2024-11-05 00:44:58 +00:00
vec3 CustomToneMapping ( vec3 color ) { return color ; } ` ,MTt= ` # ifdef USE _TRANSMISSION
2024-11-04 00:22:50 +00:00
material . transmission = transmission ;
material . transmissionAlpha = 1.0 ;
material . thickness = thickness ;
material . attenuationDistance = attenuationDistance ;
material . attenuationColor = attenuationColor ;
# ifdef USE _TRANSMISSIONMAP
material . transmission *= texture2D ( transmissionMap , vTransmissionMapUv ) . r ;
# endif
# ifdef USE _THICKNESSMAP
material . thickness *= texture2D ( thicknessMap , vThicknessMapUv ) . g ;
# endif
vec3 pos = vWorldPosition ;
vec3 v = normalize ( cameraPosition - pos ) ;
vec3 n = inverseTransformDirection ( normal , viewMatrix ) ;
vec4 transmitted = getIBLVolumeRefraction (
n , v , material . roughness , material . diffuseColor , material . specularColor , material . specularF90 ,
pos , modelMatrix , viewMatrix , projectionMatrix , material . ior , material . thickness ,
material . attenuationColor , material . attenuationDistance ) ;
material . transmissionAlpha = mix ( material . transmissionAlpha , transmitted . a , material . transmission ) ;
totalDiffuse = mix ( totalDiffuse , transmitted . rgb , material . transmission ) ;
2024-11-05 00:44:58 +00:00
# endif ` ,NTt= ` # ifdef USE _TRANSMISSION
2024-11-04 00:22:50 +00:00
uniform float transmission ;
uniform float thickness ;
uniform float attenuationDistance ;
uniform vec3 attenuationColor ;
# ifdef USE _TRANSMISSIONMAP
uniform sampler2D transmissionMap ;
# endif
# ifdef USE _THICKNESSMAP
uniform sampler2D thicknessMap ;
# endif
uniform vec2 transmissionSamplerSize ;
uniform sampler2D transmissionSamplerMap ;
uniform mat4 modelMatrix ;
uniform mat4 projectionMatrix ;
varying vec3 vWorldPosition ;
float w0 ( float a ) {
return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ) ;
}
float w1 ( float a ) {
return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ) ;
}
float w2 ( float a ) {
return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ) ;
}
float w3 ( float a ) {
return ( 1.0 / 6.0 ) * ( a * a * a ) ;
}
float g0 ( float a ) {
return w0 ( a ) + w1 ( a ) ;
}
float g1 ( float a ) {
return w2 ( a ) + w3 ( a ) ;
}
float h0 ( float a ) {
return - 1.0 + w1 ( a ) / ( w0 ( a ) + w1 ( a ) ) ;
}
float h1 ( float a ) {
return 1.0 + w3 ( a ) / ( w2 ( a ) + w3 ( a ) ) ;
}
vec4 bicubic ( sampler2D tex , vec2 uv , vec4 texelSize , float lod ) {
uv = uv * texelSize . zw + 0.5 ;
vec2 iuv = floor ( uv ) ;
vec2 fuv = fract ( uv ) ;
float g0x = g0 ( fuv . x ) ;
float g1x = g1 ( fuv . x ) ;
float h0x = h0 ( fuv . x ) ;
float h1x = h1 ( fuv . x ) ;
float h0y = h0 ( fuv . y ) ;
float h1y = h1 ( fuv . y ) ;
vec2 p0 = ( vec2 ( iuv . x + h0x , iuv . y + h0y ) - 0.5 ) * texelSize . xy ;
vec2 p1 = ( vec2 ( iuv . x + h1x , iuv . y + h0y ) - 0.5 ) * texelSize . xy ;
vec2 p2 = ( vec2 ( iuv . x + h0x , iuv . y + h1y ) - 0.5 ) * texelSize . xy ;
vec2 p3 = ( vec2 ( iuv . x + h1x , iuv . y + h1y ) - 0.5 ) * texelSize . xy ;
return g0 ( fuv . y ) * ( g0x * textureLod ( tex , p0 , lod ) + g1x * textureLod ( tex , p1 , lod ) ) +
g1 ( fuv . y ) * ( g0x * textureLod ( tex , p2 , lod ) + g1x * textureLod ( tex , p3 , lod ) ) ;
}
vec4 textureBicubic ( sampler2D sampler , vec2 uv , float lod ) {
vec2 fLodSize = vec2 ( textureSize ( sampler , int ( lod ) ) ) ;
vec2 cLodSize = vec2 ( textureSize ( sampler , int ( lod + 1.0 ) ) ) ;
vec2 fLodSizeInv = 1.0 / fLodSize ;
vec2 cLodSizeInv = 1.0 / cLodSize ;
vec4 fSample = bicubic ( sampler , uv , vec4 ( fLodSizeInv , fLodSize ) , floor ( lod ) ) ;
vec4 cSample = bicubic ( sampler , uv , vec4 ( cLodSizeInv , cLodSize ) , ceil ( lod ) ) ;
return mix ( fSample , cSample , fract ( lod ) ) ;
}
vec3 getVolumeTransmissionRay ( const in vec3 n , const in vec3 v , const in float thickness , const in float ior , const in mat4 modelMatrix ) {
vec3 refractionVector = refract ( - v , normalize ( n ) , 1.0 / ior ) ;
vec3 modelScale ;
modelScale . x = length ( vec3 ( modelMatrix [ 0 ] . xyz ) ) ;
modelScale . y = length ( vec3 ( modelMatrix [ 1 ] . xyz ) ) ;
modelScale . z = length ( vec3 ( modelMatrix [ 2 ] . xyz ) ) ;
return normalize ( refractionVector ) * thickness * modelScale ;
}
float applyIorToRoughness ( const in float roughness , const in float ior ) {
return roughness * clamp ( ior * 2.0 - 2.0 , 0.0 , 1.0 ) ;
}
vec4 getTransmissionSample ( const in vec2 fragCoord , const in float roughness , const in float ior ) {
float lod = log2 ( transmissionSamplerSize . x ) * applyIorToRoughness ( roughness , ior ) ;
return textureBicubic ( transmissionSamplerMap , fragCoord . xy , lod ) ;
}
vec3 volumeAttenuation ( const in float transmissionDistance , const in vec3 attenuationColor , const in float attenuationDistance ) {
if ( isinf ( attenuationDistance ) ) {
return vec3 ( 1.0 ) ;
} else {
vec3 attenuationCoefficient = - log ( attenuationColor ) / attenuationDistance ;
vec3 transmittance = exp ( - attenuationCoefficient * transmissionDistance ) ; return transmittance ;
}
}
vec4 getIBLVolumeRefraction ( const in vec3 n , const in vec3 v , const in float roughness , const in vec3 diffuseColor ,
const in vec3 specularColor , const in float specularF90 , const in vec3 position , const in mat4 modelMatrix ,
const in mat4 viewMatrix , const in mat4 projMatrix , const in float ior , const in float thickness ,
const in vec3 attenuationColor , const in float attenuationDistance ) {
vec3 transmissionRay = getVolumeTransmissionRay ( n , v , thickness , ior , modelMatrix ) ;
vec3 refractedRayExit = position + transmissionRay ;
vec4 ndcPos = projMatrix * viewMatrix * vec4 ( refractedRayExit , 1.0 ) ;
vec2 refractionCoords = ndcPos . xy / ndcPos . w ;
refractionCoords += 1.0 ;
refractionCoords /= 2.0 ;
vec4 transmittedLight = getTransmissionSample ( refractionCoords , roughness , ior ) ;
vec3 transmittance = diffuseColor * volumeAttenuation ( length ( transmissionRay ) , attenuationColor , attenuationDistance ) ;
vec3 attenuatedColor = transmittance * transmittedLight . rgb ;
vec3 F = EnvironmentBRDF ( n , v , specularColor , specularF90 , roughness ) ;
float transmittanceFactor = ( transmittance . r + transmittance . g + transmittance . b ) / 3.0 ;
return vec4 ( ( 1.0 - F ) * attenuatedColor , 1.0 - ( 1.0 - transmittedLight . a ) * transmittanceFactor ) ;
}
2024-11-05 00:44:58 +00:00
# endif ` ,kTt= ` # if defined ( USE _UV ) || defined ( USE _ANISOTROPY )
2024-11-04 00:22:50 +00:00
varying vec2 vUv ;
# endif
# ifdef USE _MAP
varying vec2 vMapUv ;
# endif
# ifdef USE _ALPHAMAP
varying vec2 vAlphaMapUv ;
# endif
# ifdef USE _LIGHTMAP
varying vec2 vLightMapUv ;
# endif
# ifdef USE _AOMAP
varying vec2 vAoMapUv ;
# endif
# ifdef USE _BUMPMAP
varying vec2 vBumpMapUv ;
# endif
# ifdef USE _NORMALMAP
varying vec2 vNormalMapUv ;
# endif
# ifdef USE _EMISSIVEMAP
varying vec2 vEmissiveMapUv ;
# endif
# ifdef USE _METALNESSMAP
varying vec2 vMetalnessMapUv ;
# endif
# ifdef USE _ROUGHNESSMAP
varying vec2 vRoughnessMapUv ;
# endif
# ifdef USE _ANISOTROPYMAP
varying vec2 vAnisotropyMapUv ;
# endif
# ifdef USE _CLEARCOATMAP
varying vec2 vClearcoatMapUv ;
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
varying vec2 vClearcoatNormalMapUv ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
varying vec2 vClearcoatRoughnessMapUv ;
# endif
# ifdef USE _IRIDESCENCEMAP
varying vec2 vIridescenceMapUv ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
varying vec2 vIridescenceThicknessMapUv ;
# endif
# ifdef USE _SHEEN _COLORMAP
varying vec2 vSheenColorMapUv ;
# endif
# ifdef USE _SHEEN _ROUGHNESSMAP
varying vec2 vSheenRoughnessMapUv ;
# endif
# ifdef USE _SPECULARMAP
varying vec2 vSpecularMapUv ;
# endif
# ifdef USE _SPECULAR _COLORMAP
varying vec2 vSpecularColorMapUv ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
varying vec2 vSpecularIntensityMapUv ;
# endif
# ifdef USE _TRANSMISSIONMAP
uniform mat3 transmissionMapTransform ;
varying vec2 vTransmissionMapUv ;
# endif
# ifdef USE _THICKNESSMAP
uniform mat3 thicknessMapTransform ;
varying vec2 vThicknessMapUv ;
2024-11-05 00:44:58 +00:00
# endif ` ,ITt= ` # if defined ( USE _UV ) || defined ( USE _ANISOTROPY )
2024-11-04 00:22:50 +00:00
varying vec2 vUv ;
# endif
# ifdef USE _MAP
uniform mat3 mapTransform ;
varying vec2 vMapUv ;
# endif
# ifdef USE _ALPHAMAP
uniform mat3 alphaMapTransform ;
varying vec2 vAlphaMapUv ;
# endif
# ifdef USE _LIGHTMAP
uniform mat3 lightMapTransform ;
varying vec2 vLightMapUv ;
# endif
# ifdef USE _AOMAP
uniform mat3 aoMapTransform ;
varying vec2 vAoMapUv ;
# endif
# ifdef USE _BUMPMAP
uniform mat3 bumpMapTransform ;
varying vec2 vBumpMapUv ;
# endif
# ifdef USE _NORMALMAP
uniform mat3 normalMapTransform ;
varying vec2 vNormalMapUv ;
# endif
# ifdef USE _DISPLACEMENTMAP
uniform mat3 displacementMapTransform ;
varying vec2 vDisplacementMapUv ;
# endif
# ifdef USE _EMISSIVEMAP
uniform mat3 emissiveMapTransform ;
varying vec2 vEmissiveMapUv ;
# endif
# ifdef USE _METALNESSMAP
uniform mat3 metalnessMapTransform ;
varying vec2 vMetalnessMapUv ;
# endif
# ifdef USE _ROUGHNESSMAP
uniform mat3 roughnessMapTransform ;
varying vec2 vRoughnessMapUv ;
# endif
# ifdef USE _ANISOTROPYMAP
uniform mat3 anisotropyMapTransform ;
varying vec2 vAnisotropyMapUv ;
# endif
# ifdef USE _CLEARCOATMAP
uniform mat3 clearcoatMapTransform ;
varying vec2 vClearcoatMapUv ;
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
uniform mat3 clearcoatNormalMapTransform ;
varying vec2 vClearcoatNormalMapUv ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
uniform mat3 clearcoatRoughnessMapTransform ;
varying vec2 vClearcoatRoughnessMapUv ;
# endif
# ifdef USE _SHEEN _COLORMAP
uniform mat3 sheenColorMapTransform ;
varying vec2 vSheenColorMapUv ;
# endif
# ifdef USE _SHEEN _ROUGHNESSMAP
uniform mat3 sheenRoughnessMapTransform ;
varying vec2 vSheenRoughnessMapUv ;
# endif
# ifdef USE _IRIDESCENCEMAP
uniform mat3 iridescenceMapTransform ;
varying vec2 vIridescenceMapUv ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
uniform mat3 iridescenceThicknessMapTransform ;
varying vec2 vIridescenceThicknessMapUv ;
# endif
# ifdef USE _SPECULARMAP
uniform mat3 specularMapTransform ;
varying vec2 vSpecularMapUv ;
# endif
# ifdef USE _SPECULAR _COLORMAP
uniform mat3 specularColorMapTransform ;
varying vec2 vSpecularColorMapUv ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
uniform mat3 specularIntensityMapTransform ;
varying vec2 vSpecularIntensityMapUv ;
# endif
# ifdef USE _TRANSMISSIONMAP
uniform mat3 transmissionMapTransform ;
varying vec2 vTransmissionMapUv ;
# endif
# ifdef USE _THICKNESSMAP
uniform mat3 thicknessMapTransform ;
varying vec2 vThicknessMapUv ;
2024-11-05 00:44:58 +00:00
# endif ` ,OTt= ` # if defined ( USE _UV ) || defined ( USE _ANISOTROPY )
2024-11-04 00:22:50 +00:00
vUv = vec3 ( uv , 1 ) . xy ;
# endif
# ifdef USE _MAP
vMapUv = ( mapTransform * vec3 ( MAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _ALPHAMAP
vAlphaMapUv = ( alphaMapTransform * vec3 ( ALPHAMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _LIGHTMAP
vLightMapUv = ( lightMapTransform * vec3 ( LIGHTMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _AOMAP
vAoMapUv = ( aoMapTransform * vec3 ( AOMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _BUMPMAP
vBumpMapUv = ( bumpMapTransform * vec3 ( BUMPMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _NORMALMAP
vNormalMapUv = ( normalMapTransform * vec3 ( NORMALMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _DISPLACEMENTMAP
vDisplacementMapUv = ( displacementMapTransform * vec3 ( DISPLACEMENTMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _EMISSIVEMAP
vEmissiveMapUv = ( emissiveMapTransform * vec3 ( EMISSIVEMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _METALNESSMAP
vMetalnessMapUv = ( metalnessMapTransform * vec3 ( METALNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _ROUGHNESSMAP
vRoughnessMapUv = ( roughnessMapTransform * vec3 ( ROUGHNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _ANISOTROPYMAP
vAnisotropyMapUv = ( anisotropyMapTransform * vec3 ( ANISOTROPYMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _CLEARCOATMAP
vClearcoatMapUv = ( clearcoatMapTransform * vec3 ( CLEARCOATMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3 ( CLEARCOAT _NORMALMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3 ( CLEARCOAT _ROUGHNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _IRIDESCENCEMAP
vIridescenceMapUv = ( iridescenceMapTransform * vec3 ( IRIDESCENCEMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3 ( IRIDESCENCE _THICKNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SHEEN _COLORMAP
vSheenColorMapUv = ( sheenColorMapTransform * vec3 ( SHEEN _COLORMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SHEEN _ROUGHNESSMAP
vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3 ( SHEEN _ROUGHNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SPECULARMAP
vSpecularMapUv = ( specularMapTransform * vec3 ( SPECULARMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SPECULAR _COLORMAP
vSpecularColorMapUv = ( specularColorMapTransform * vec3 ( SPECULAR _COLORMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3 ( SPECULAR _INTENSITYMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _TRANSMISSIONMAP
vTransmissionMapUv = ( transmissionMapTransform * vec3 ( TRANSMISSIONMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _THICKNESSMAP
vThicknessMapUv = ( thicknessMapTransform * vec3 ( THICKNESSMAP _UV , 1 ) ) . xy ;
2024-11-05 00:44:58 +00:00
# endif ` ,DTt= ` # if defined ( USE _ENVMAP ) || defined ( DISTANCE ) || defined ( USE _SHADOWMAP ) || defined ( USE _TRANSMISSION ) || NUM _SPOT _LIGHT _COORDS > 0
2024-11-04 00:22:50 +00:00
vec4 worldPosition = vec4 ( transformed , 1.0 ) ;
# ifdef USE _BATCHING
worldPosition = batchingMatrix * worldPosition ;
# endif
# ifdef USE _INSTANCING
worldPosition = instanceMatrix * worldPosition ;
# endif
worldPosition = modelMatrix * worldPosition ;
2024-11-05 00:44:58 +00:00
# endif ` ;const LTt= ` varying vec2 vUv ;
2024-11-04 00:22:50 +00:00
uniform mat3 uvTransform ;
void main ( ) {
vUv = ( uvTransform * vec3 ( uv , 1 ) ) . xy ;
gl _Position = vec4 ( position . xy , 1.0 , 1.0 ) ;
2024-11-05 00:44:58 +00:00
} ` ,PTt= ` uniform sampler2D t2D ;
2024-11-04 00:22:50 +00:00
uniform float backgroundIntensity ;
varying vec2 vUv ;
void main ( ) {
vec4 texColor = texture2D ( t2D , vUv ) ;
# ifdef DECODE _VIDEO _TEXTURE
texColor = vec4 ( mix ( pow ( texColor . rgb * 0.9478672986 + vec3 ( 0.0521327014 ) , vec3 ( 2.4 ) ) , texColor . rgb * 0.0773993808 , vec3 ( lessThanEqual ( texColor . rgb , vec3 ( 0.04045 ) ) ) ) , texColor . w ) ;
# endif
texColor . rgb *= backgroundIntensity ;
gl _FragColor = texColor ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
2024-11-05 00:44:58 +00:00
} ` ,FTt= ` varying vec3 vWorldDirection ;
2024-11-04 00:22:50 +00:00
# include < common >
void main ( ) {
vWorldDirection = transformDirection ( position , modelMatrix ) ;
# include < begin _vertex >
# include < project _vertex >
gl _Position . z = gl _Position . w ;
2024-11-05 00:44:58 +00:00
} ` ,UTt= ` # ifdef ENVMAP _TYPE _CUBE
2024-11-04 00:22:50 +00:00
uniform samplerCube envMap ;
# elif defined ( ENVMAP _TYPE _CUBE _UV )
uniform sampler2D envMap ;
# endif
uniform float flipEnvMap ;
uniform float backgroundBlurriness ;
uniform float backgroundIntensity ;
varying vec3 vWorldDirection ;
# include < cube _uv _reflection _fragment >
void main ( ) {
# ifdef ENVMAP _TYPE _CUBE
vec4 texColor = textureCube ( envMap , vec3 ( flipEnvMap * vWorldDirection . x , vWorldDirection . yz ) ) ;
# elif defined ( ENVMAP _TYPE _CUBE _UV )
vec4 texColor = textureCubeUV ( envMap , vWorldDirection , backgroundBlurriness ) ;
# else
vec4 texColor = vec4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ;
# endif
texColor . rgb *= backgroundIntensity ;
gl _FragColor = texColor ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
2024-11-05 00:44:58 +00:00
} ` ,BTt= ` varying vec3 vWorldDirection ;
2024-11-04 00:22:50 +00:00
# include < common >
void main ( ) {
vWorldDirection = transformDirection ( position , modelMatrix ) ;
# include < begin _vertex >
# include < project _vertex >
gl _Position . z = gl _Position . w ;
2024-11-05 00:44:58 +00:00
} ` ,GTt= ` uniform samplerCube tCube ;
2024-11-04 00:22:50 +00:00
uniform float tFlip ;
uniform float opacity ;
varying vec3 vWorldDirection ;
void main ( ) {
vec4 texColor = textureCube ( tCube , vec3 ( tFlip * vWorldDirection . x , vWorldDirection . yz ) ) ;
gl _FragColor = texColor ;
gl _FragColor . a *= opacity ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
2024-11-05 00:44:58 +00:00
} ` ,zTt= ` # include < common >
2024-11-04 00:22:50 +00:00
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
varying vec2 vHighPrecisionZW ;
void main ( ) {
# include < uv _vertex >
# include < batching _vertex >
# include < skinbase _vertex >
# ifdef USE _DISPLACEMENTMAP
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinnormal _vertex >
# endif
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vHighPrecisionZW = gl _Position . zw ;
2024-11-05 00:44:58 +00:00
} ` ,VTt= ` # if DEPTH _PACKING == 3200
2024-11-04 00:22:50 +00:00
uniform float opacity ;
# endif
# include < common >
# include < packing >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
varying vec2 vHighPrecisionZW ;
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( 1.0 ) ;
# if DEPTH _PACKING == 3200
diffuseColor . a = opacity ;
# endif
# include < map _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < logdepthbuf _fragment >
float fragCoordZ = 0.5 * vHighPrecisionZW [ 0 ] / vHighPrecisionZW [ 1 ] + 0.5 ;
# if DEPTH _PACKING == 3200
gl _FragColor = vec4 ( vec3 ( 1.0 - fragCoordZ ) , opacity ) ;
# elif DEPTH _PACKING == 3201
gl _FragColor = packDepthToRGBA ( fragCoordZ ) ;
# endif
2024-11-05 00:44:58 +00:00
} ` ,HTt= ` # define DISTANCE
2024-11-04 00:22:50 +00:00
varying vec3 vWorldPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < batching _vertex >
# include < skinbase _vertex >
# ifdef USE _DISPLACEMENTMAP
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinnormal _vertex >
# endif
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < worldpos _vertex >
# include < clipping _planes _vertex >
vWorldPosition = worldPosition . xyz ;
2024-11-05 00:44:58 +00:00
} ` ,qTt= ` # define DISTANCE
2024-11-04 00:22:50 +00:00
uniform vec3 referencePosition ;
uniform float nearDistance ;
uniform float farDistance ;
varying vec3 vWorldPosition ;
# include < common >
# include < packing >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( 1.0 ) ;
# include < map _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
float dist = length ( vWorldPosition - referencePosition ) ;
dist = ( dist - nearDistance ) / ( farDistance - nearDistance ) ;
dist = saturate ( dist ) ;
gl _FragColor = packDepthToRGBA ( dist ) ;
2024-11-05 00:44:58 +00:00
} ` ,YTt= ` varying vec3 vWorldDirection ;
2024-11-04 00:22:50 +00:00
# include < common >
void main ( ) {
vWorldDirection = transformDirection ( position , modelMatrix ) ;
# include < begin _vertex >
# include < project _vertex >
2024-11-05 00:44:58 +00:00
} ` , $ Tt= ` uniform sampler2D tEquirect ;
2024-11-04 00:22:50 +00:00
varying vec3 vWorldDirection ;
# include < common >
void main ( ) {
vec3 direction = normalize ( vWorldDirection ) ;
vec2 sampleUV = equirectUv ( direction ) ;
gl _FragColor = texture2D ( tEquirect , sampleUV ) ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
2024-11-05 00:44:58 +00:00
} ` ,WTt= ` uniform float scale ;
2024-11-04 00:22:50 +00:00
attribute float lineDistance ;
varying float vLineDistance ;
# include < common >
# include < uv _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < morphtarget _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
vLineDistance = scale * lineDistance ;
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < fog _vertex >
2024-11-05 00:44:58 +00:00
} ` ,KTt= ` uniform vec3 diffuse ;
2024-11-04 00:22:50 +00:00
uniform float opacity ;
uniform float dashSize ;
uniform float totalSize ;
varying float vLineDistance ;
# include < common >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < fog _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
if ( mod ( vLineDistance , totalSize ) > dashSize ) {
discard ;
}
vec3 outgoingLight = vec3 ( 0.0 ) ;
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
outgoingLight = diffuseColor . rgb ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
2024-11-05 00:44:58 +00:00
} ` ,jTt= ` # include < common >
2024-11-04 00:22:50 +00:00
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < envmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# if defined ( USE _ENVMAP ) || defined ( USE _SKINNING )
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# endif
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < worldpos _vertex >
# include < envmap _vertex >
# include < fog _vertex >
2024-11-05 00:44:58 +00:00
} ` ,QTt= ` uniform vec3 diffuse ;
2024-11-04 00:22:50 +00:00
uniform float opacity ;
# ifndef FLAT _SHADED
varying vec3 vNormal ;
# endif
# include < common >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < envmap _common _pars _fragment >
# include < envmap _pars _fragment >
# include < fog _pars _fragment >
# include < specularmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < specularmap _fragment >
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
# ifdef USE _LIGHTMAP
vec4 lightMapTexel = texture2D ( lightMap , vLightMapUv ) ;
reflectedLight . indirectDiffuse += lightMapTexel . rgb * lightMapIntensity * RECIPROCAL _PI ;
# else
reflectedLight . indirectDiffuse += vec3 ( 1.0 ) ;
# endif
# include < aomap _fragment >
reflectedLight . indirectDiffuse *= diffuseColor . rgb ;
vec3 outgoingLight = reflectedLight . indirectDiffuse ;
# include < envmap _fragment >
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-11-05 00:44:58 +00:00
} ` ,XTt= ` # define LAMBERT
2024-11-04 00:22:50 +00:00
varying vec3 vViewPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < envmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < shadowmap _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vViewPosition = - mvPosition . xyz ;
# include < worldpos _vertex >
# include < envmap _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
2024-11-05 00:44:58 +00:00
} ` ,ZTt= ` # define LAMBERT
2024-11-04 00:22:50 +00:00
uniform vec3 diffuse ;
uniform vec3 emissive ;
uniform float opacity ;
# include < common >
# include < packing >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < emissivemap _pars _fragment >
# include < envmap _common _pars _fragment >
# include < envmap _pars _fragment >
# include < fog _pars _fragment >
# include < bsdfs >
# include < lights _pars _begin >
# include < normal _pars _fragment >
# include < lights _lambert _pars _fragment >
# include < shadowmap _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < specularmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
vec3 totalEmissiveRadiance = emissive ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < specularmap _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
# include < emissivemap _fragment >
# include < lights _lambert _fragment >
# include < lights _fragment _begin >
# include < lights _fragment _maps >
# include < lights _fragment _end >
# include < aomap _fragment >
vec3 outgoingLight = reflectedLight . directDiffuse + reflectedLight . indirectDiffuse + totalEmissiveRadiance ;
# include < envmap _fragment >
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-11-05 00:44:58 +00:00
} ` ,JTt= ` # define MATCAP
2024-11-04 00:22:50 +00:00
varying vec3 vViewPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < color _pars _vertex >
# include < displacementmap _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < fog _vertex >
vViewPosition = - mvPosition . xyz ;
2024-11-05 00:44:58 +00:00
} ` ,ewt= ` # define MATCAP
2024-11-04 00:22:50 +00:00
uniform vec3 diffuse ;
uniform float opacity ;
uniform sampler2D matcap ;
varying vec3 vViewPosition ;
# include < common >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < fog _pars _fragment >
# include < normal _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
vec3 viewDir = normalize ( vViewPosition ) ;
vec3 x = normalize ( vec3 ( viewDir . z , 0.0 , - viewDir . x ) ) ;
vec3 y = cross ( viewDir , x ) ;
vec2 uv = vec2 ( dot ( x , normal ) , dot ( y , normal ) ) * 0.495 + 0.5 ;
# ifdef USE _MATCAP
vec4 matcapColor = texture2D ( matcap , uv ) ;
# else
vec4 matcapColor = vec4 ( vec3 ( mix ( 0.2 , 0.8 , uv . y ) ) , 1.0 ) ;
# endif
vec3 outgoingLight = diffuseColor . rgb * matcapColor . rgb ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-11-05 00:44:58 +00:00
} ` ,twt= ` # define NORMAL
2024-11-04 00:22:50 +00:00
# if defined ( FLAT _SHADED ) || defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP _TANGENTSPACE )
varying vec3 vViewPosition ;
# endif
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# if defined ( FLAT _SHADED ) || defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP _TANGENTSPACE )
vViewPosition = - mvPosition . xyz ;
# endif
2024-11-05 00:44:58 +00:00
} ` ,nwt= ` # define NORMAL
2024-11-04 00:22:50 +00:00
uniform float opacity ;
# if defined ( FLAT _SHADED ) || defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP _TANGENTSPACE )
varying vec3 vViewPosition ;
# endif
# include < packing >
# include < uv _pars _fragment >
# include < normal _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
# include < logdepthbuf _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
gl _FragColor = vec4 ( packNormalToRGB ( normal ) , opacity ) ;
# ifdef OPAQUE
gl _FragColor . a = 1.0 ;
# endif
2024-11-05 00:44:58 +00:00
} ` ,rwt= ` # define PHONG
2024-11-04 00:22:50 +00:00
varying vec3 vViewPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < envmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < shadowmap _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vViewPosition = - mvPosition . xyz ;
# include < worldpos _vertex >
# include < envmap _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
2024-11-05 00:44:58 +00:00
} ` ,iwt= ` # define PHONG
2024-11-04 00:22:50 +00:00
uniform vec3 diffuse ;
uniform vec3 emissive ;
uniform vec3 specular ;
uniform float shininess ;
uniform float opacity ;
# include < common >
# include < packing >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < emissivemap _pars _fragment >
# include < envmap _common _pars _fragment >
# include < envmap _pars _fragment >
# include < fog _pars _fragment >
# include < bsdfs >
# include < lights _pars _begin >
# include < normal _pars _fragment >
# include < lights _phong _pars _fragment >
# include < shadowmap _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < specularmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
vec3 totalEmissiveRadiance = emissive ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < specularmap _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
# include < emissivemap _fragment >
# include < lights _phong _fragment >
# include < lights _fragment _begin >
# include < lights _fragment _maps >
# include < lights _fragment _end >
# include < aomap _fragment >
vec3 outgoingLight = reflectedLight . directDiffuse + reflectedLight . indirectDiffuse + reflectedLight . directSpecular + reflectedLight . indirectSpecular + totalEmissiveRadiance ;
# include < envmap _fragment >
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-11-05 00:44:58 +00:00
} ` ,swt= ` # define STANDARD
2024-11-04 00:22:50 +00:00
varying vec3 vViewPosition ;
# ifdef USE _TRANSMISSION
varying vec3 vWorldPosition ;
# endif
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < shadowmap _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vViewPosition = - mvPosition . xyz ;
# include < worldpos _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
# ifdef USE _TRANSMISSION
vWorldPosition = worldPosition . xyz ;
# endif
2024-11-05 00:44:58 +00:00
} ` ,owt= ` # define STANDARD
2024-11-04 00:22:50 +00:00
# ifdef PHYSICAL
# define IOR
# define USE _SPECULAR
# endif
uniform vec3 diffuse ;
uniform vec3 emissive ;
uniform float roughness ;
uniform float metalness ;
uniform float opacity ;
# ifdef IOR
uniform float ior ;
# endif
# ifdef USE _SPECULAR
uniform float specularIntensity ;
uniform vec3 specularColor ;
# ifdef USE _SPECULAR _COLORMAP
uniform sampler2D specularColorMap ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
uniform sampler2D specularIntensityMap ;
# endif
# endif
# ifdef USE _CLEARCOAT
uniform float clearcoat ;
uniform float clearcoatRoughness ;
# endif
# ifdef USE _IRIDESCENCE
uniform float iridescence ;
uniform float iridescenceIOR ;
uniform float iridescenceThicknessMinimum ;
uniform float iridescenceThicknessMaximum ;
# endif
# ifdef USE _SHEEN
uniform vec3 sheenColor ;
uniform float sheenRoughness ;
# ifdef USE _SHEEN _COLORMAP
uniform sampler2D sheenColorMap ;
# endif
# ifdef USE _SHEEN _ROUGHNESSMAP
uniform sampler2D sheenRoughnessMap ;
# endif
# endif
# ifdef USE _ANISOTROPY
uniform vec2 anisotropyVector ;
# ifdef USE _ANISOTROPYMAP
uniform sampler2D anisotropyMap ;
# endif
# endif
varying vec3 vViewPosition ;
# include < common >
# include < packing >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < emissivemap _pars _fragment >
# include < iridescence _fragment >
# include < cube _uv _reflection _fragment >
# include < envmap _common _pars _fragment >
# include < envmap _physical _pars _fragment >
# include < fog _pars _fragment >
# include < lights _pars _begin >
# include < normal _pars _fragment >
# include < lights _physical _pars _fragment >
# include < transmission _pars _fragment >
# include < shadowmap _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < clearcoat _pars _fragment >
# include < iridescence _pars _fragment >
# include < roughnessmap _pars _fragment >
# include < metalnessmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
vec3 totalEmissiveRadiance = emissive ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < roughnessmap _fragment >
# include < metalnessmap _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
# include < clearcoat _normal _fragment _begin >
# include < clearcoat _normal _fragment _maps >
# include < emissivemap _fragment >
# include < lights _physical _fragment >
# include < lights _fragment _begin >
# include < lights _fragment _maps >
# include < lights _fragment _end >
# include < aomap _fragment >
vec3 totalDiffuse = reflectedLight . directDiffuse + reflectedLight . indirectDiffuse ;
vec3 totalSpecular = reflectedLight . directSpecular + reflectedLight . indirectSpecular ;
# include < transmission _fragment >
vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance ;
# ifdef USE _SHEEN
float sheenEnergyComp = 1.0 - 0.157 * max3 ( material . sheenColor ) ;
outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect ;
# endif
# ifdef USE _CLEARCOAT
float dotNVcc = saturate ( dot ( geometryClearcoatNormal , geometryViewDir ) ) ;
vec3 Fcc = F _Schlick ( material . clearcoatF0 , material . clearcoatF90 , dotNVcc ) ;
outgoingLight = outgoingLight * ( 1.0 - material . clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material . clearcoat ;
# endif
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-11-05 00:44:58 +00:00
} ` ,awt= ` # define TOON
2024-11-04 00:22:50 +00:00
varying vec3 vViewPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < shadowmap _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vViewPosition = - mvPosition . xyz ;
# include < worldpos _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
2024-11-05 00:44:58 +00:00
} ` ,lwt= ` # define TOON
2024-11-04 00:22:50 +00:00
uniform vec3 diffuse ;
uniform vec3 emissive ;
uniform float opacity ;
# include < common >
# include < packing >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < emissivemap _pars _fragment >
# include < gradientmap _pars _fragment >
# include < fog _pars _fragment >
# include < bsdfs >
# include < lights _pars _begin >
# include < normal _pars _fragment >
# include < lights _toon _pars _fragment >
# include < shadowmap _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
vec3 totalEmissiveRadiance = emissive ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
# include < emissivemap _fragment >
# include < lights _toon _fragment >
# include < lights _fragment _begin >
# include < lights _fragment _maps >
# include < lights _fragment _end >
# include < aomap _fragment >
vec3 outgoingLight = reflectedLight . directDiffuse + reflectedLight . indirectDiffuse + totalEmissiveRadiance ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-11-05 00:44:58 +00:00
} ` ,cwt= ` uniform float size ;
2024-11-04 00:22:50 +00:00
uniform float scale ;
# include < common >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < morphtarget _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
# ifdef USE _POINTS _UV
varying vec2 vUv ;
uniform mat3 uvTransform ;
# endif
void main ( ) {
# ifdef USE _POINTS _UV
vUv = ( uvTransform * vec3 ( uv , 1 ) ) . xy ;
# endif
# include < color _vertex >
# include < morphcolor _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < project _vertex >
gl _PointSize = size ;
# ifdef USE _SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix ( projectionMatrix ) ;
if ( isPerspective ) gl _PointSize *= ( scale / - mvPosition . z ) ;
# endif
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < worldpos _vertex >
# include < fog _vertex >
2024-11-05 00:44:58 +00:00
} ` ,dwt= ` uniform vec3 diffuse ;
2024-11-04 00:22:50 +00:00
uniform float opacity ;
# include < common >
# include < color _pars _fragment >
# include < map _particle _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < fog _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec3 outgoingLight = vec3 ( 0.0 ) ;
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _particle _fragment >
# include < color _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
outgoingLight = diffuseColor . rgb ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
2024-11-05 00:44:58 +00:00
} ` ,uwt= ` # include < common >
2024-11-04 00:22:50 +00:00
# include < batching _pars _vertex >
# include < fog _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < shadowmap _pars _vertex >
void main ( ) {
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < worldpos _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
2024-11-05 00:44:58 +00:00
} ` ,pwt= ` uniform vec3 color ;
2024-11-04 00:22:50 +00:00
uniform float opacity ;
# include < common >
# include < packing >
# include < fog _pars _fragment >
# include < bsdfs >
# include < lights _pars _begin >
# include < logdepthbuf _pars _fragment >
# include < shadowmap _pars _fragment >
# include < shadowmask _pars _fragment >
void main ( ) {
# include < logdepthbuf _fragment >
gl _FragColor = vec4 ( color , opacity * ( 1.0 - getShadowMask ( ) ) ) ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
2024-11-05 00:44:58 +00:00
} ` ,hwt= ` uniform float rotation ;
2024-11-04 00:22:50 +00:00
uniform vec2 center ;
# include < common >
# include < uv _pars _vertex >
# include < fog _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
vec4 mvPosition = modelViewMatrix * vec4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ;
vec2 scale ;
scale . x = length ( vec3 ( modelMatrix [ 0 ] . x , modelMatrix [ 0 ] . y , modelMatrix [ 0 ] . z ) ) ;
scale . y = length ( vec3 ( modelMatrix [ 1 ] . x , modelMatrix [ 1 ] . y , modelMatrix [ 1 ] . z ) ) ;
# ifndef USE _SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix ( projectionMatrix ) ;
if ( isPerspective ) scale *= - mvPosition . z ;
# endif
vec2 alignedPosition = ( position . xy - ( center - vec2 ( 0.5 ) ) ) * scale ;
vec2 rotatedPosition ;
rotatedPosition . x = cos ( rotation ) * alignedPosition . x - sin ( rotation ) * alignedPosition . y ;
rotatedPosition . y = sin ( rotation ) * alignedPosition . x + cos ( rotation ) * alignedPosition . y ;
mvPosition . xy += rotatedPosition ;
gl _Position = projectionMatrix * mvPosition ;
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < fog _vertex >
2024-11-05 00:44:58 +00:00
} ` ,mwt= ` uniform vec3 diffuse ;
2024-11-04 00:22:50 +00:00
uniform float opacity ;
# include < common >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < fog _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec3 outgoingLight = vec3 ( 0.0 ) ;
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
outgoingLight = diffuseColor . rgb ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
2024-11-11 23:13:41 +00:00
} ` ,Gt={alphahash_fragment:P2t,alphahash_pars_fragment:F2t,alphamap_fragment:U2t,alphamap_pars_fragment:B2t,alphatest_fragment:G2t,alphatest_pars_fragment:z2t,aomap_fragment:V2t,aomap_pars_fragment:H2t,batching_pars_vertex:q2t,batching_vertex:Y2t,begin_vertex: $ 2t,beginnormal_vertex:W2t,bsdfs:K2t,iridescence_fragment:j2t,bumpmap_pars_fragment:Q2t,clipping_planes_fragment:X2t,clipping_planes_pars_fragment:Z2t,clipping_planes_pars_vertex:J2t,clipping_planes_vertex:ext,color_fragment:txt,color_pars_fragment:nxt,color_pars_vertex:rxt,color_vertex:ixt,common:sxt,cube_uv_reflection_fragment:oxt,defaultnormal_vertex:axt,displacementmap_pars_vertex:lxt,displacementmap_vertex:cxt,emissivemap_fragment:dxt,emissivemap_pars_fragment:uxt,colorspace_fragment:pxt,colorspace_pars_fragment:hxt,envmap_fragment:mxt,envmap_common_pars_fragment:fxt,envmap_pars_fragment:gxt,envmap_pars_vertex:_xt,envmap_physical_pars_fragment:Mxt,envmap_vertex:bxt,fog_vertex:vxt,fog_pars_vertex:yxt,fog_fragment:Ext,fog_pars_fragment:Sxt,gradientmap_pars_fragment:xxt,lightmap_fragment:Txt,lightmap_pars_fragment:wxt,lights_lambert_fragment:Cxt,lights_lambert_pars_fragment:Axt,lights_pars_begin:Rxt,lights_toon_fragment:Nxt,lights_toon_pars_fragment:kxt,lights_phong_fragment:Ixt,lights_phong_pars_fragment:Oxt,lights_physical_fragment:Dxt,lights_physical_pars_fragment:Lxt,lights_fragment_begin:Pxt,lights_fragment_maps:Fxt,lights_fragment_end:Uxt,logdepthbuf_fragment:Bxt,logdepthbuf_pars_fragment:Gxt,logdepthbuf_pars_vertex:zxt,logdepthbuf_vertex:Vxt,map_fragment:Hxt,map_pars_fragment:qxt,map_particle_fragment:Yxt,map_particle_pars_fragment: $ xt,metalnessmap_fragment:Wxt,metalnessmap_pars_fragment:Kxt,morphcolor_vertex:jxt,morphnormal_vertex:Qxt,morphtarget_pars_vertex:Xxt,morphtarget_vertex:Zxt,normal_fragment_begin:Jxt,normal_fragment_maps:eTt,normal_pars_fragment:tTt,normal_pars_vertex:nTt,normal_vertex:rTt,normalmap_pars_fragment:iTt,clearcoat_normal_fragment_begin:sTt,clearcoat_normal_fragment_maps:oTt,clearcoat_pars_fragment:aTt,iridescence_pars_fragment:lTt,opaque_fragment:cTt,packing:dTt,premultiplied_alpha_fragment:uTt,project_vertex:pTt,dithering_fragment:hTt,dithering_pars_fragment:mTt,roughnessmap_fragment:fTt,roughnessmap_pars_fragment:gTt,shadowmap_pars_fragment:_Tt,shadowmap_pars_vertex:bTt,shadowmap_vertex:vTt,shadowmask_pars_fragment:yTt,skinbase_vertex:ETt,skinning_pars_vertex:STt,skinning_vertex:xTt,skinnormal_vertex:TTt,specularmap_fragment:wTt,specularmap_pars_fragment:CTt,tonemapping_fragment:ATt,tonemapping_pars_fragment:RTt,transmission_fragment:MTt,transmission_pars_fragment:NTt,uv_pars_fragment:kTt,uv_pars_vertex:ITt,uv_vertex:OTt,worldpos_vertex:DTt,background_vert:LTt,background_frag:PTt,backgroundCube_vert:FTt,backgroundCube_frag:UTt,cube_vert:BTt,cube_frag:GTt,depth_vert:zTt,depth_frag:VTt,distanceRGBA_vert:HTt,distanceRGBA_frag:qTt,equirect_vert:YTt,equirect_frag: $ Tt,linedashed_vert:WTt,linedashed_frag:KTt,meshbasic_vert:jTt,meshbasic_frag:QTt,meshlambert_vert:XTt,meshlambert_frag:ZTt,meshmatcap_vert:JTt,meshmatcap_frag:ewt,meshnormal_vert:twt,meshnormal_frag:nwt,meshphong_vert:rwt,meshphong_frag:iwt,meshphysical_vert:swt,meshphysical_frag:owt,meshtoon_vert:awt,meshtoon_frag:lwt,points_vert:cwt,points_frag:dwt,shadow_vert:uwt,shadow_frag:pwt,sprite_vert:hwt,sprite_frag:mwt},it={common:{diffuse:{value:new Nt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Vt},alphaMap:{value:null},alphaMapTransform:{value:new Vt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Vt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Vt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Vt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Vt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Vt},normalScale:{value:new $ t(1,1)}},displacementmap:{displacementMap:{value:
2024-11-04 00:22:50 +00:00
precision mediump float ;
precision mediump int ;
varying vec3 vOutputDirection ;
uniform sampler2D envMap ;
uniform int samples ;
uniform float weights [ n ] ;
uniform bool latitudinal ;
uniform float dTheta ;
uniform float mipInt ;
uniform vec3 poleAxis ;
# define ENVMAP _TYPE _CUBE _UV
# include < cube _uv _reflection _fragment >
vec3 getSample ( float theta , vec3 axis ) {
float cosTheta = cos ( theta ) ;
// Rodrigues' axis-angle rotation
vec3 sampleDirection = vOutputDirection * cosTheta
+ cross ( axis , vOutputDirection ) * sin ( theta )
+ axis * dot ( axis , vOutputDirection ) * ( 1.0 - cosTheta ) ;
return bilinearCubeUV ( envMap , sampleDirection , mipInt ) ;
}
void main ( ) {
vec3 axis = latitudinal ? poleAxis : cross ( poleAxis , vOutputDirection ) ;
if ( all ( equal ( axis , vec3 ( 0.0 ) ) ) ) {
axis = vec3 ( vOutputDirection . z , 0.0 , - vOutputDirection . x ) ;
}
axis = normalize ( axis ) ;
gl _FragColor = vec4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ;
gl _FragColor . rgb += weights [ 0 ] * getSample ( 0.0 , axis ) ;
for ( int i = 1 ; i < n ; i ++ ) {
if ( i >= samples ) {
break ;
}
float theta = dTheta * float ( i ) ;
gl _FragColor . rgb += weights [ i ] * getSample ( - 1.0 * theta , axis ) ;
gl _FragColor . rgb += weights [ i ] * getSample ( theta , axis ) ;
}
}
2024-11-06 23:05:30 +00:00
` ,blending:So,depthTest:!1,depthWrite:!1})}function CR(){return new wa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Jy(),fragmentShader: `
2024-11-04 00:22:50 +00:00
precision mediump float ;
precision mediump int ;
varying vec3 vOutputDirection ;
uniform sampler2D envMap ;
# include < common >
void main ( ) {
vec3 outputDirection = normalize ( vOutputDirection ) ;
vec2 uv = equirectUv ( outputDirection ) ;
gl _FragColor = vec4 ( texture2D ( envMap , uv ) . rgb , 1.0 ) ;
}
2024-11-06 23:05:30 +00:00
` ,blending:So,depthTest:!1,depthWrite:!1})}function AR(){return new wa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Jy(),fragmentShader: `
2024-11-04 00:22:50 +00:00
precision mediump float ;
precision mediump int ;
uniform float flipEnvMap ;
varying vec3 vOutputDirection ;
uniform samplerCube envMap ;
void main ( ) {
gl _FragColor = textureCube ( envMap , vec3 ( flipEnvMap * vOutputDirection . x , vOutputDirection . yz ) ) ;
}
2024-11-06 23:05:30 +00:00
` ,blending:So,depthTest:!1,depthWrite:!1})}function Jy(){return `
2024-11-04 00:22:50 +00:00
precision mediump float ;
precision mediump int ;
attribute float faceIndex ;
varying vec3 vOutputDirection ;
// RH coordinate system; PMREM face-indexing convention
vec3 getDirection ( vec2 uv , float face ) {
uv = 2.0 * uv - 1.0 ;
vec3 direction = vec3 ( uv , 1.0 ) ;
if ( face == 0.0 ) {
direction = direction . zyx ; // ( 1, v, u ) pos x
} else if ( face == 1.0 ) {
direction = direction . xzy ;
direction . xz *= - 1.0 ; // ( -u, 1, -v ) pos y
} else if ( face == 2.0 ) {
direction . x *= - 1.0 ; // ( -u, v, 1 ) pos z
} else if ( face == 3.0 ) {
direction = direction . zyx ;
direction . xz *= - 1.0 ; // ( -1, v, -u ) neg x
} else if ( face == 4.0 ) {
direction = direction . xzy ;
direction . xy *= - 1.0 ; // ( -u, -1, v ) neg y
} else if ( face == 5.0 ) {
direction . z *= - 1.0 ; // ( u, v, -1 ) neg z
}
return direction ;
}
void main ( ) {
vOutputDirection = getDirection ( uv , faceIndex ) ;
gl _Position = vec4 ( position , 1.0 ) ;
}
2024-11-11 23:13:41 +00:00
` }function xwt(n){let e=new WeakMap,t=null;function r(a){if(a&&a.isTexture){const l=a.mapping,d=l===N1||l===k1,u=l===Ol||l===Dl;if(d||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let m=e.get(a);return t===null&&(t=new TR(n)),m=d?t.fromEquirectangular(a,m):t.fromCubemap(a,m),e.set(a,m),m.texture}else{if(e.has(a))return e.get(a).texture;{const m=a.image;if(d&&m&&m.height>0||u&&m&&i(m)){t===null&&(t=new TR(n));const f=d?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0;const d=6;for(let u=0;u<d;u++)a[u]!==void 0&&l++;return l===d}function s(a){const l=a.target;l.removeEventListener("dispose",s);const d=e.get(l);d!==void 0&&(e.delete(l),d.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:r,dispose:o}}function Twt(n){const e={};function t(r){if(e[r]!==void 0)return e[r];let i;switch(r){case"WEBGL_depth_texture":i=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=n.getExtension(r)}return e[r]=i,i}return{has:function(r){return t(r)!==null},init:function(r){r.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(r){const i=t(r);return i===null&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),i}}}function wwt(n,e,t,r){const i={},s=new WeakMap;function o(m){const f=m.target;f.index!==null&&e.remove(f.index);for(const h in f.attributes)e.remove(f.attributes[h]);for(const h in f.morphAttributes){const v=f.morphAttributes[h];for(let b=0,_=v.length;b<_;b++)e.remove(v[b])}f.removeEventListener("dispose",o),delete i[f.id];const g=s.get(f);g&&(e.remove(g),s.delete(f)),r.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function a(m,f){return i[f.id]===!0||(f.addEventListener("dispose",o),i[f.id]=!0,t.memory.geometries++),f}function l(m){const f=m.attributes;for(const h in f)e.update(f[h],n.ARRAY_BUFFER);const g=m.morphAttributes;for(const h in g){const v=g[h];for(let b=0,_=v.length;b<_;b++)e.update(v[b],n.ARRAY_BUFFER)}}function d(m){const f=[],g=m.index,h=m.attributes.position;let v=0;if(g!==null){const y=g.array;v=g.version;for(let E=0,x=y.length;E<x;E+=3){const A=y[E+0],w=y[E+1],N=y[E+2];f.push(A,w,w,N,N,A)}}else if(h!==void 0){const y=h.array;v=h.version;for(let E=0,x=y.length/3-1;E<x;E+=3){const A=E+0,w=E+1,N=E+2;f.push(A,w,w,N,N,A)}}else return;const b=new(eO(f)?aO:oO)(f,1);b.version=v;const _=s.get(m);_&&e.remove(_),s.set(m,b)}function u(m){const f=s.get(m);if(f){const g=m.index;g!==null&&f.version<g.version&&d(m)}else d(m);return s.get(m)}return{get:a,update:l,getWireframeAttribute:u}}function Cwt(n,e,t,r){const i=r.isWebGL2;let s;function o(g){s=g}let a,l;function d(g){a=g.type,l=g.bytesPerElement}function u(g,h){n.drawElements(s,h,a,g*l),t.update(h,s,1)}function m(g,h,v){if(v===0)return;let b,_;if(i)b=n,_="drawElementsInstanced";else if(b=e.get("ANGLE_instanced_arrays"),_="drawElementsInstancedANGLE",b===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support ex
2024-11-04 00:22:50 +00:00
` ),r=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=i;o<s;o++){const a=o+1;r.push( ` $ { a === e ? ">" : " " } $ { a } : $ { t [ o ] } ` )}return r.join( `
2024-11-06 23:05:30 +00:00
` )}function wCt(n){const e=tn.getPrimaries(tn.workingColorSpace),t=tn.getPrimaries(n);let r;switch(e===t?r="":e===sh&&t===ih?r="LinearDisplayP3ToLinearSRGB":e===ih&&t===sh&&(r="LinearSRGBToLinearDisplayP3"),n){case er:case om:return[r,"LinearTransferOETF"];case Mn:case Ky:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[r,"LinearTransferOETF"]}}function LR(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:( \d +)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+ `
2024-11-04 00:22:50 +00:00
` +i+ `
2024-11-05 00:44:58 +00:00
` +TCt(n.getShaderSource(e),o)}else return i}function CCt(n,e){const t=wCt(e);return ` vec4 $ { n } ( vec4 value ) { return $ { t [ 0 ] } ( $ { t [ 1 ] } ( value ) ) ; } ` }function ACt(n,e){let t;switch(e){case xSt:t="Linear";break;case TSt:t="Reinhard";break;case wSt:t="OptimizedCineon";break;case CSt:t="ACESFilmic";break;case ASt:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function RCt(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Dc).join( `
` )}function MCt(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join( `
2024-11-06 23:05:30 +00:00
` )}function NCt(n,e){const t={},r=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const s=n.getActiveAttrib(e,i),o=s.name;let a=1;s.type===n.FLOAT_MAT2&&(a=2),s.type===n.FLOAT_MAT3&&(a=3),s.type===n.FLOAT_MAT4&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function Dc(n){return n!==""}function PR(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function FR(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const kCt=/^[ \t ]*#include +<([ \w \d ./]+)>/gm;function F1(n){return n.replace(kCt,OCt)}const ICt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function OCt(n,e){let t=Gt[e];if(t===void 0){const r=ICt.get(e);if(r!==void 0)t=Gt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return F1(t)}const DCt=/#pragma unroll_loop_start \s +for \s * \( \s *int \s +i \s *= \s *( \d +) \s *; \s *i \s *< \s *( \d +) \s *; \s *i \s * \+ \+ \s * \) \s *{([ \s \S ]+?)} \s +#pragma unroll_loop_end/g;function UR(n){return n.replace(DCt,LCt)}function LCt(n,e,t,r){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=r.replace(/ \[ \s *i \s * \] /g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function BR(n){let e="precision "+n.precision+ ` float ;
2024-11-04 00:22:50 +00:00
precision ` +n.precision+" int;";return n.precision==="highp"?e+= `
# define HIGH _PRECISION ` :n.precision==="mediump"?e+= `
# define MEDIUM _PRECISION ` :n.precision==="lowp"&&(e+= `
2024-11-11 23:13:41 +00:00
# define LOW _PRECISION ` ),e}function PCt(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===zI?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===XEt?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===vs&&(e="SHADOWMAP_TYPE_VSM"),e}function FCt(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Ol:case Dl:e="ENVMAP_TYPE_CUBE";break;case sm:e="ENVMAP_TYPE_CUBE_UV";break}return e}function UCt(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Dl:e="ENVMAP_MODE_REFRACTION";break}return e}function BCt(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case Yy:e="ENVMAP_BLENDING_MULTIPLY";break;case ESt:e="ENVMAP_BLENDING_MIX";break;case SSt:e="ENVMAP_BLENDING_ADD";break}return e}function GCt(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:r,maxMip:t}}function zCt(n,e,t,r){const i=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=PCt(t),d=FCt(t),u=UCt(t),m=BCt(t),f=GCt(t),g=t.isWebGL2?"":RCt(t),h=MCt(s),v=i.createProgram();let b,_,y=t.glslVersion?"#version "+t.glslVersion+ `
2024-11-04 00:22:50 +00:00
` :"";t.isRawShaderMaterial?(b=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,h].filter(Dc).join( `
` ),b.length>0&&(b+= `
` ),_=[g,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,h].filter(Dc).join( `
` ),_.length>0&&(_+= `
2024-11-06 23:05:30 +00:00
` )):(b=[BR(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,h,t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?
2024-11-04 00:22:50 +00:00
` ].filter(Dc).join( `
2024-11-06 23:05:30 +00:00
` ),_=[g,BR(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,h,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.envMap?"#define "+u:"",t.envMap?"#define "+m:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==xo?"#define TONE_MAPPING":"",t.toneMapping!==xo?Gt.tonemapping_pars_fragment:"",t.toneMapping!==xo?ACt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Gt.colorspace_pars_fragment,CCt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"", `
2024-11-04 00:22:50 +00:00
` ].filter(Dc).join( `
2024-11-06 23:05:30 +00:00
` )),o=F1(o),o=PR(o,t),o=FR(o,t),a=F1(a),a=PR(a,t),a=FR(a,t),o=UR(o),a=UR(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y= ` # version 300 es
2024-11-04 00:22:50 +00:00
` ,b=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join( `
` )+ `
2024-11-06 23:05:30 +00:00
` +b,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===rR?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===rR?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join( `
2024-11-04 00:22:50 +00:00
` )+ `
2024-11-06 23:05:30 +00:00
` +_);const E=y+b+o,x=y+_+a,A=DR(i,i.VERTEX_SHADER,E),w=DR(i,i.FRAGMENT_SHADER,x);i.attachShader(v,A),i.attachShader(v,w),t.index0AttributeName!==void 0?i.bindAttribLocation(v,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function N(H){if(n.debug.checkShaderErrors){const q=i.getProgramInfoLog(v).trim(),ie=i.getShaderInfoLog(A).trim(),D=i.getShaderInfoLog(w).trim();let $ =!0,K=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if( $ =!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,v,A,w);else{const B=LR(i,A,"vertex"),Z=LR(i,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+ `
2024-11-04 00:22:50 +00:00
Program Info Log : ` +q+ `
` +B+ `
2024-11-06 23:05:30 +00:00
` +Z)}else q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",q):(ie===""||D==="")&&(K=!1);K&&(H.diagnostics={runnable: $ ,programLog:q,vertexShader:{log:ie,prefix:b},fragmentShader:{log:D,prefix:_}})}i.deleteShader(A),i.deleteShader(w),L=new fp(i,v),C=NCt(i,v)}let L;this.getUniforms=function(){return L===void 0&&N(this),L};let C;this.getAttributes=function(){return C===void 0&&N(this),C};let k=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return k===!1&&(k=i.getProgramParameter(v,SCt)),k},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=xCt++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=A,this.fragmentShader=w,this}let VCt=0;class HCt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new qCt(e),t.set(e,r)),r}}class qCt{constructor(e){this.id=VCt++,this.code=e,this.usedTimes=0}}function YCt(n,e,t,r,i,s,o){const a=new iO,l=new HCt,d=[],u=i.isWebGL2,m=i.logarithmicDepthBuffer,f=i.vertexTextures;let g=i.precision;const h={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(C){return C===0?"uv": ` uv$ { C } ` }function b(C,k,H,q,ie){const D=q.fog, $ =ie.geometry,K=C.isMeshStandardMaterial?q.environment:null,B=(C.isMeshStandardMaterial?t:e).get(C.envMap||K),Z=B&&B.mapping===sm?B.image.height:null,ce=h[C.type];C.precision!==null&&(g=i.getMaxPrecision(C.precision),g!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",g,"instead."));const ue= $ .morphAttributes.position|| $ .morphAttributes.normal|| $ .morphAttributes.color,xe=ue!==void 0?ue.length:0;let Ce=0; $ .morphAttributes.position!==void 0&&(Ce=1), $ .morphAttributes.normal!==void 0&&(Ce=2), $ .morphAttributes.color!==void 0&&(Ce=3);let me,Ae,Fe,ze;if(ce){const tr=zi[ce];me=tr.vertexShader,Ae=tr.fragmentShader}else me=C.vertexShader,Ae=C.fragmentShader,l.update(C),Fe=l.getVertexShaderID(C),ze=l.getFragmentShaderID(C);const te=n.getRenderTarget(),ye=ie.isInstancedMesh===!0,Se=ie.isBatchedMesh===!0,Oe=!!C.map,Ye=!!C.matcap,le=!!B,V=!!C.aoMap,G=!!C.lightMap,oe=!!C.bumpMap,ge=!!C.normalMap,Ee=!!C.displacementMap,Te=!!C.emissiveMap,fe=!!C.metalnessMap,Ue=!!C.roughnessMap,Pe=C.anisotropy>0,Re=C.clearcoat>0,U=C.iridescence>0,I=C.sheen>0,ee=C.transmission>0,we=Pe&&!!C.anisotropyMap,ne=Re&&!!C.clearcoatMap,pe=Re&&!!C.clearcoatNormalMap,De=Re&&!!C.clearcoatRoughnessMap,Le=U&&!!C.iridescenceMap,Ve=U&&!!C.iridescenceThicknessMap,ot=I&&!!C.sheenColorMap,wt=I&&!!C.sheenRoughnessMap, $ e=!!C.specularMap,Kt=!!C.specularColorMap,ft=!!C.specularIntensityMap,gt=ee&&!!C.transmissionMap,et=ee&&!!C.thicknessMap,lt=!!C.gradientMap,It=!!C.alphaMap,ae=C.alphaTest>0,dt=!!C.alphaHash,Xe=!!C.extensions,Be=!! $ .attributes.uv1,nt=!! $ .attributes.uv2,At=!! $ .attributes.uv3;let jt=xo;return C.toneMapped&&(te===null||te.isXRRenderTarget===!0)&&(jt=n.toneMapping),{
2024-11-04 00:22:50 +00:00
gl _Position = vec4 ( position , 1.0 ) ;
2024-11-05 00:44:58 +00:00
} ` ,iAt= ` uniform sampler2D shadow _pass ;
2024-11-04 00:22:50 +00:00
uniform vec2 resolution ;
uniform float radius ;
# include < packing >
void main ( ) {
const float samples = float ( VSM _SAMPLES ) ;
float mean = 0.0 ;
float squared _mean = 0.0 ;
float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ) ;
float uvStart = samples <= 1.0 ? 0.0 : - 1.0 ;
for ( float i = 0.0 ; i < samples ; i ++ ) {
float uvOffset = uvStart + i * uvStride ;
# ifdef HORIZONTAL _PASS
vec2 distribution = unpackRGBATo2Half ( texture2D ( shadow _pass , ( gl _FragCoord . xy + vec2 ( uvOffset , 0.0 ) * radius ) / resolution ) ) ;
mean += distribution . x ;
squared _mean += distribution . y * distribution . y + distribution . x * distribution . x ;
# else
float depth = unpackRGBAToDepth ( texture2D ( shadow _pass , ( gl _FragCoord . xy + vec2 ( 0.0 , uvOffset ) * radius ) / resolution ) ) ;
mean += depth ;
squared _mean += depth * depth ;
# endif
}
mean = mean / samples ;
squared _mean = squared _mean / samples ;
float std _dev = sqrt ( squared _mean - mean * mean ) ;
gl _FragColor = pack2HalfToRGBA ( vec2 ( mean , std _dev ) ) ;
2024-11-11 23:13:41 +00:00
} ` ;function sAt(n,e,t){let r=new Qy;const i=new $ t,s=new $ t,o=new mn,a=new tAt({depthPacking:GSt}),l=new nAt,d={},u=t.maxTextureSize,m={[Fs]:kr,[kr]:Fs,[Vi]:Vi},f=new wa({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new $ t},radius:{value:4}},vertexShader:rAt,fragmentShader:iAt}),g=f.clone();g.defines.HORIZONTAL_PASS=1;const h=new as;h.setAttribute("position",new vr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new br(h,f),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=zI;let _=this.type;this.render=function(A,w,N){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||A.length===0)return;const L=n.getRenderTarget(),C=n.getActiveCubeFace(),k=n.getActiveMipmapLevel(),H=n.state;H.setBlending(So),H.buffers.color.setClear(1,1,1,1),H.buffers.depth.setTest(!0),H.setScissorTest(!1);const q=_!==vs&&this.type===vs,ie=_===vs&&this.type!==vs;for(let D=0, $ =A.length;D< $ ;D++){const K=A[D],B=K.shadow;if(B===void 0){console.warn("THREE.WebGLShadowMap:",K,"has no shadow.");continue}if(B.autoUpdate===!1&&B.needsUpdate===!1)continue;i.copy(B.mapSize);const Z=B.getFrameExtents();if(i.multiply(Z),s.copy(B.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/Z.x),i.x=s.x*Z.x,B.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/Z.y),i.y=s.y*Z.y,B.mapSize.y=s.y)),B.map===null||q===!0||ie===!0){const ue=this.type!==vs?{minFilter: $ n,magFilter: $ n}:{};B.map!==null&&B.map.dispose(),B.map=new Ta(i.x,i.y,ue),B.map.texture.name=K.name+".shadowMap",B.camera.updateProjectionMatrix()}n.setRenderTarget(B.map),n.clear();const ce=B.getViewportCount();for(let ue=0;ue<ce;ue++){const xe=B.getViewport(ue);o.set(s.x*xe.x,s.y*xe.y,s.x*xe.z,s.y*xe.w),H.viewport(o),B.updateMatrices(K,ue),r=B.getFrustum(),x(w,N,B.camera,K,this.type)}B.isPointLightShadow!==!0&&this.type===vs&&y(B,N),B.needsUpdate=!1}_=this.type,b.needsUpdate=!1,n.setRenderTarget(L,C,k)};function y(A,w){const N=e.update(v);f.defines.VSM_SAMPLES!==A.blurSamples&&(f.defines.VSM_SAMPLES=A.blurSamples,g.defines.VSM_SAMPLES=A.blurSamples,f.needsUpdate=!0,g.needsUpdate=!0),A.mapPass===null&&(A.mapPass=new Ta(i.x,i.y)),f.uniforms.shadow_pass.value=A.map.texture,f.uniforms.resolution.value=A.mapSize,f.uniforms.radius.value=A.radius,n.setRenderTarget(A.mapPass),n.clear(),n.renderBufferDirect(w,null,N,f,v,null),g.uniforms.shadow_pass.value=A.mapPass.texture,g.uniforms.resolution.value=A.mapSize,g.uniforms.radius.value=A.radius,n.setRenderTarget(A.map),n.clear(),n.renderBufferDirect(w,null,N,g,v,null)}function E(A,w,N,L){let C=null;const k=N.isPointLight===!0?A.customDistanceMaterial:A.customDepthMaterial;if(k!==void 0)C=k;else if(C=N.isPointLight===!0?l:a,n.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){const H=C.uuid,q=w.uuid;let ie=d[H];ie===void 0&&(ie={},d[H]=ie);let D=ie[q];D===void 0&&(D=C.clone(),ie[q]=D),C=D}if(C.visible=w.visible,C.wireframe=w.wireframe,L===vs?C.side=w.shadowSide!==null?w.shadowSide:w.side:C.side=w.shadowSide!==null?w.shadowSide:m[w.side],C.alphaMap=w.alphaMap,C.alphaTest=w.alphaTest,C.map=w.map,C.clipShadows=w.clipShadows,C.clippingPlanes=w.clippingPlanes,C.clipIntersection=w.clipIntersection,C.displacementMap=w.displacementMap,C.displacementScale=w.displacementScale,C.displacementBias=w.displacementBias,C.wireframeLinewidth=w.wireframeLinewidth,C.linewidth=w.linewidth,N.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const H=n.properties.get(C);H.light=N}return C}function x(A,w,N,L,C){if(A.visible===!1)return;if(A.layers.test(w.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&C===vs)&&(!A.frustumCulled||r.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,A.matrixWorld);const q=e.update(A),ie=A.material;if(Array.isArray(ie)){const D=q.groups;for(let $ =0,K=D.length; $ <K; $ ++){const B=D[ $ ],Z=ie[B.materialIndex];if(Z&&Z.visible){const ce=E(A,Z,L,C);A.onBeforeShadow(n,A,w,N,q,ce,B),n.renderBufferDirect(N,null,q,ce,A,B),A.onAfterShad
2024-11-04 00:22:50 +00:00
Please check that you don ' t accidentally use the same token twice to register two different handlers for the same event / hook . ` ),this.unsubscribe(e)),this.listenerMap.set(e,t),this._listeners.push(t)}unsubscribe(e){if(this.listenerMap.has(e)){const t=this.listenerMap.get(e);this.listenerMap.delete(e);const r=this._listeners.indexOf(t);r>=0&&this._listeners.splice(r,1)}}registerProxy(e,t){this.proxyMap.has(e)&&(console.warn( ` Already subscribed . Unsubscribing for you .
2024-11-06 23:05:30 +00:00
Please check that you don 't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const r=this.proxies.indexOf(t);r>=0&&this.proxies.splice(r,1)}}class ln extends fa{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class lr extends fa{constructor(e){super(),this.entity=e}emit(e){let t=!1;const r=()=>[t=!0];for(const i of Array.from(this.listeners.values()))if(i(e,r,this.entity),t)return{prevented:!0};return{prevented:!1}}}class MO extends fa{execute(e,t){let r=e;for(const i of this.listeners)r=i(r,t);return r}}class qr extends MO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class oMt extends fa{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const r of this.listeners)t.push(r(e,this.entity));return t}}function Ui(){const n=Symbol(),e=new Map,t=new Set,r=(l,d)=>{d instanceof fa&&d.registerProxy(n,()=>{var u,m;return(m=(u=e.get(l))===null||u===void 0?void 0:u.listeners)!==null&&m!==void 0?m:[]})},i=l=>{const d=new fa;e.set(l,d),t.forEach(u=>r(l,u[l]))},s=l=>{t.add(l);for(const d of e.keys())r(d,l[d])},o=l=>{for(const d of e.keys())l[d]instanceof fa&&l[d].unregisterProxy(n);t.delete(l)},a=()=>{t.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,d){return d==="addTarget"?s:d==="removeTarget"?o:d==="destroy"?a:typeof d!="string"||d.startsWith("_")?l[d]:(e.has(d)||i(d),e.get(d))}})}class fM{constructor(e,t){if(this.destructed=!1,this.events={destruct:new ln(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for ' from ' or ' to ' values");this.id=ks(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class NO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for ' from ' or ' to ' values ");this.id=ks(),this.from=e,this.to=t}}function V1(n,e){return Object.fromEntries(Object.entries(n).map(([t,r])=>[t,e(r)]))}class kO{constructor(){this._title=" ",this.id=ks(),this.events={loaded:new ln(this),beforeAddInput:new lr(this),addInput:new ln(this),beforeRemoveInput:new lr(this),removeInput:new ln(this),beforeAddOutput:new lr(this),addOutput:new ln(this),beforeRemoveOutput:new lr(this),removeOutput:new ln(this),beforeTitleChanged:new lr(this),titleChanged:new ln(this),update:new ln(this)},this.hooks={beforeLoad:new qr(this),afterSave:new qr(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface(" input ",e,t)}addOutput(e,t){return this.addInterface(" output ",e,t)}removeInput(e){return this.removeInterface(" input ",e)}removeOutput(e){return this.removeInterface(" output ",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,r])=>{this.inputs[t]&&(this.inputs[t].load(r),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,r])=>{this.outputs[t]&&(this.outputs[t].load(r),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=V1(this.inputs,i=>i.save()),t=V1(this.outputs,i=>i.save()),r={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(r)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf(" input ",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf(" output ",e,t))}initializeIntf(e,t,r){r.isInput=e===" input ",r.nodeId=this.id,r.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:r}))}addInterface(e,t,r){const i=e===" input " ? this . events . beforeAddInput : this . events . beforeAddOutput , s = e ===
2024-11-04 00:22:50 +00:00
This is likely a Baklava internal issue . Please report it on GitHub . ` );const g=this.hooks.transferData.execute(d[f],u);u.to.allowMultipleConnections?t.has(u.to.id)?t.get(u.to.id).push(g):t.set(u.to.id,[g]):t.set(u.to.id,g)})}return o}async execute(e){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const t=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,t,e)}getInputValues(e){const t=new Map;for(const r of e.nodes)Object.values(r.inputs).forEach(i=>{i.connectionCount===0&&t.set(i.id,i.value)}),r.calculate||Object.values(r.outputs).forEach(i=>{t.set(i.id,i.value)});return t}onChange(e){this.recalculateOrder=e||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(e,t){if(!e.has(t))throw new Error( ` Could not find value for interface $ { t }
2024-11-11 23:13:41 +00:00
This is likely a Baklava internal issue . Please report it on GitHub . ` );return e.get(t)}}const fMt=["INPUT","TEXTAREA","SELECT"];function PO(n){return fMt.includes(n.tagName)}let H1=null;function gMt(n){H1=n}function $ r(){if(!H1)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:H1}}function _i(){const{viewModel:n}= $ r();return{graph:yp(n.value,"displayedGraph"),switchGraph:n.value.switchGraph}}function FO(n){const{graph:e}=_i(),t=yt(null),r=yt(null);return{dragging:mt(()=>!!t.value),onPointerDown:l=>{t.value={x:l.pageX,y:l.pageY},r.value={x:n.value.x,y:n.value.y}},onPointerMove:l=>{if(t.value){const d=l.pageX-t.value.x,u=l.pageY-t.value.y;n.value.x=r.value.x+d/e.value.scaling,n.value.y=r.value.y+u/e.value.scaling}},onPointerUp:()=>{t.value=null,r.value=null}}}function UO(n,e,t){if(!e.template)return!1;if(Yl(e.template)===t)return!0;const r=n.graphTemplates.find(s=>Yl(s)===t);return r?r.nodes.filter(s=>s.type.startsWith(yd)).some(s=>UO(n,e,s.type)):!1}function BO(n){return mt(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,i])=>i.category)),r=[];for(const i of t.values()){let s=e.filter(([,o])=>o.category===i);n.value.displayedGraph.template?s=s.filter(([o])=>!UO(n.value.editor,n.value.displayedGraph,o)):s=s.filter(([o])=>![Hl,ql].includes(o)),s.length>0&&r.push({name:i,nodeTypes:Object.fromEntries(s)})}return r.sort((i,s)=>i.name==="default"?-1:s.name==="default"||i.name>s.name?1:-1),r})}function GO(){const{graph:n}=_i();return{transform:(t,r)=>{const i=t/n.value.scaling-n.value.panning.x,s=r/n.value.scaling-n.value.panning.y;return[i,s]}}}function _Mt(){const{graph:n}=_i();let e=[],t=-1,r={x:0,y:0};const i=mt(()=>n.value.panning),s=FO(i),o=mt(()=>({"transform-origin":"0 0",transform: ` scale ( $ { n . value . scaling } ) translate ( $ { n . value . panning . x } px , $ { n . value . panning . y } px ) ` })),a=(g,h,v)=>{const b=[g/n.value.scaling-n.value.panning.x,h/n.value.scaling-n.value.panning.y],_=[g/v-n.value.panning.x,h/v-n.value.panning.y],y=[_[0]-b[0],_[1]-b[1]];n.value.panning.x+=y[0],n.value.panning.y+=y[1],n.value.scaling=v},l=g=>{g.preventDefault();let h=g.deltaY;g.deltaMode===1&&(h*=32);const v=n.value.scaling*(1-h/3e3);a(g.offsetX,g.offsetY,v)},d=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...s,onPointerDown:g=>{if(e.push(g),s.onPointerDown(g),e.length===2){const{ax:h,ay:v,bx:b,by:_}=d();r={x:h+(b-h)/2,y:v+(_-v)/2}}},onPointerMove:g=>{for(let h=0;h<e.length;h++)if(g.pointerId==e[h].pointerId){e[h]=g;break}if(e.length==2){const{ax:h,ay:v,bx:b,by:_}=d(),y=h-b,E=v-_,x=Math.sqrt(y*y+E*E);if(t>0){const A=n.value.scaling*(1+(x-t)/500);a(r.x,r.y,A)}t=x}else s.onPointerMove(g)},onPointerUp:g=>{e=e.filter(h=>h.pointerId!==g.pointerId),t=-1,s.onPointerUp()},onMouseWheel:l}}var ni=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(ni||{});const zO=Symbol();function bMt(){const{graph:n}=_i(),e=yt(null),t=yt(null),r=a=>{e.value&&(e.value.mx=a.offsetX/n.value.scaling-n.value.panning.x,e.value.my=a.offsetY/n.value.scaling-n.value.panning.y)},i=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(l=>l.to===t.value);t.value.isInput&&a?(e.value={status:ni.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:ni.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},s=()=>{if(e.value&&t.value){if(e.value.from===t.value)return;n.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(t.value=a??null,a&&e.value){e.value.to=a;const l=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?ni.ALLOWED:ni.FORBIDDEN,l.connectionAllowed){const d=l.connectionsInDanger.map(u=>u.id);n.value.connections.forEach(u=>{d.includes(u.id)&&(u.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=ni.NONE,n.value.connections.forEach(l=>{l.isInDanger=!1}))};return ml(zO,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:r,onMouseDown:i,onMouseUp:s,hoveredOver:o}}function vMt(n){const e=yt(!1),t=yt(0),r=yt(0),i=BO(n),{transform:s}=GO(),o=mt(
This may take some time the first time as some libraries need to be installed . ` ),de.post("/apps/start_server",e).then(t=>{this. $ store.state.messageBox.hideMessage(),console.log("Server start initiated:",t.data.message),this. $ notify({type:"success",title:"Server Starting",text:t.data.message})}).catch(t=>{var r,i;this. $ store.state.messageBox.hideMessage(),console.error("Error starting server:",t),this. $ notify({type:"error",title:"Server Start Failed",text:((i=(r=t.response)==null?void 0:r.data)==null?void 0:i.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this. $ refs.fileInput.click()},onFileSelected(n){this.selectedFile=n.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,t;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const n=new FormData;n.append("file",this.selectedFile),n.append("client_id",this. $ store.state.client_id);try{const r=await de.post("/upload_app",n,{headers:{"Content-Type":"multipart/form-data"}});this.message=r.data.message,this. $ refs.fileInput.value="",this.selectedFile=null}catch(r){console.error("Error uploading app:",r),this.error=((t=(e=r.response)==null?void 0:e.data)==null?void 0:t.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async fetchApps(){this.loading=!0;try{const n=await de.get("/apps");this.apps=n.data,this.showMessage("Refresh successful!",!0)}catch{this.showMessage("Failed to refresh apps.",!1)}finally{this.loading=!1}},async openAppsFolder(){this.loading=!0;try{console.log("opening apps folder");const n=await de.post("/show_apps_folder",{client_id:this. $ store.state.client_id})}catch{this.showMessage("Failed to open apps folder.",!1)}finally{this.loading=!1}},async fetchGithubApps(){this.loading=!0;try{const n=await de.get("/github/apps");this.githubApps=n.data.apps,await this.fetchApps()}catch{this.showMessage("Failed to refresh GitHub apps.",!1)}finally{this.loading=!1}},async handleAppClick(n){if(n.installed){this.selectedApp=n;const e=await de.get( ` / apps / $ { n . folder _name } / README . md ` );this.appCode=nn(e.data)}else this.showMessage( ` Please install $ { n . folder _name } to view its code . ` ,!1)},backToZoo(){this.selectedApp=null,this.appCode=""},async installApp(n){this.loading=!0,this. $ store.state.messageBox.showBlockingMessage( ` Installing app $ { n } ` );try{await de.post( ` / install / $ { n } ` ,{client_id:this. $ store.state.client_id}),this.showMessage("Installation succeeded!",!0)}catch{this.showMessage("Installation failed.",!1)}finally{this.loading=!1,this.fetchApps(),this.fetchGithubApps(),this. $ store.state.messageBox.hideMessage()}},async uninstallApp(n){this.loading=!0;try{await de.post( ` / uninstall / $ { n } ` ,{client_id:this. $ store.state.client_id}),this.showMessage("Uninstallation succeeded!",!0)}catch{this.showMessage("Uninstallation failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async deleteApp(n){this.loading=!0;try{await de.post( ` / delete / $ { n } ` , { c l i e n t _ i d : t h i s . $ s t o r e . s t a t e . c l i e n t _ i d } ) , t h i s . s h o w M e s s a g e ( " D e l e t i o n s u c c e e d e d ! " , ! 0 ) } c a t c h { t h i s . s h o w M e s s a g e ( " D e l e t i o n f a i l e d . " , ! 1 ) } f i n a l l y { t h i s . l o a d i n g = ! 1 , t h i s . f e t c h A p p s ( ) } } , a s y n c e d i t A p p ( n ) { t h i s . l o a d i n g = ! 0 ; t r y { c o n s t e = a w a i t d e . p o s t ( " / o p e n _ a p p _ i n _ v s c o d e " , { c l i e n t _ i d : t h i s . $ s t o r e . s t a t e . c l i e n t _ i d , a p p _ n a m e : n . f o l d e r _ n a m e } ) ; t h i s . s h o w M e s s a g e ( e . d a t a . m e s s a g e , ! 0 ) } c a t c h { t h i s . s h o w M e s s a g e ( " F a i l e d t o o p e n f o l d e r i n V S C o d e . " , ! 1 ) } f i n a l l y { t h i s . l o a d i n g = ! 1 } } , a s y n c d o w n l o a d A p p ( n ) { t h i s . i s L o a d i n g = ! 0 , t h i s . e r r o r = n u l l ; t r y { c o n s t e = a w a i t d e . p o s t ( " / d o w n l o a d _ a p p " , { c l i e n t _ i d : t h i s . $ s t o r e . s t a t e . c l i e n t _ i d , a p p _ n a m e : n } , { r e s p o n s e T y p e : " a r r a y b u f f e r " } ) , t = e . h e a d e r s [ " c o n t e n t - d i s p o s i t i o n " ] , r = t & & t . m a t c h ( / f i l e n a m e = " ? ( . + ) " ? / i ) , i = r ? r [ 1 ] : " a p p . z i p " , s = n e w B l o b ( [ e . d a t a ] , { t y p e : " a p p l i c a t i o n / z i p " } ) , o = w i n d o w . U R L . c r e a t e O b j e c t U R L ( s ) , a = d o c u m e n t . c r e a t e E l e m e n t ( " a " ) ; a . s t y l e . d i s p l a y = " n o n e " , a . h r e f = o , a . d o w n l o a d = i , d o c u m e n t . b o d y . a p p e n d C h i l d ( a ) , a . c l i c k ( ) , w i n d o w . U R L . r e v o k e O b j e c t U R L ( o ) , d o c u m e n t . b o d y . r e m o v e C h i l d ( a ) } c a t c h ( e ) { c o n s o l e . e r r o r ( " E r r o r d o w n l o a d i n g a p p : " , e ) , t h i s . e r r o r = " F a i l e d t o d o w n l o a d t h e a p p . P l e a s e t r y a g a i n . " } f i n a l l y { t h i s . i s
2024-11-04 00:22:50 +00:00
` +n.name,4,!0):this. $ store.state.toast.showToast( ` Error on select personality :
` +n.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(n);We(()=>{feather.replace()})}},onModelSelected(n){if(this.isLoading){this. $ store.state.toast.showToast("Loading... please wait",4,!1);return}n&&(n.isInstalled?this.update_model(n.model.name).then(e=>{console.log("update_model",e),this.configFile.model_name=n.model.name,e.status?(this. $ store.state.toast.showToast( ` Selected model :
` +n.name,4,!0),We(()=>{feather.replace(),this.is_loading_zoo=!1}),this.updateModelsZoo(),this.api_get_req("get_model_status").then(t=>{this. $ store.commit("setIsModelOk",t)})):(this. $ store.state.toast.showToast( ` Couldn ' t select model :
` +n.name,4,!1),We(()=>{feather.replace()})),this.settingsChanged=!0,this.isModelSelected=!0}):this. $ store.state.toast.showToast( ` Model :
` +n.model.name+ `
is not installed ` ,4,!1),We(()=>{feather.replace()}))},toggleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc"},toggleFavorite(n){console.log("Toggling favorite");const e=this.favorites.indexOf(n);e===-1?this.favorites.push(n):this.favorites.splice(e,1),this.saveFavoritesToLocalStorage()},saveFavoritesToLocalStorage(){localStorage.setItem("appZooFavorites",JSON.stringify(this.favorites))},loadFavoritesFromLocalStorage(){const n=localStorage.getItem("appZooFavorites");console.log("savedFavorites",n),n&&(this.favorites=JSON.parse(n))},startServer(n){const e={client_id:this. $ store.state.client_id,app_name:n};this. $ store.state.messageBox.showBlockingMessage( ` Loading server .
This may take some time the first time as some libraries need to be installed . ` ),de.post("/personalities/start_server",e).then(t=>{this. $ store.state.messageBox.hideMessage(),console.log("Server start initiated:",t.data.message),this. $ notify({type:"success",title:"Server Starting",text:t.data.message})}).catch(t=>{var r,i;this. $ store.state.messageBox.hideMessage(),console.error("Error starting server:",t),this. $ notify({type:"error",title:"Server Start Failed",text:((i=(r=t.response)==null?void 0:r.data)==null?void 0:i.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this. $ refs.fileInput.click()},onFileSelected(n){this.selectedFile=n.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,t;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const n=new FormData;n.append("file",this.selectedFile),n.append("client_id",this. $ store.state.client_id);try{const r=await de.post("/upload_app",n,{headers:{"Content-Type":"multipart/form-data"}});this.message=r.data.message,this. $ refs.fileInput.value="",this.selectedFile=null}catch(r){console.error("Error uploading app:",r),this.error=((t=(e=r.response)==null?void 0:e.data)==null?void 0:t.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async mount_personality(n){if(this. $ store.state.messageBox.showMessage("Loading personality"),!n)return{status:!1,error:"no personality - mount_personality"};try{const e={client_id:this. $ store.state.client_id,language:n.language?n.language:"",category:n.category?n.category:"",folder:n.folder?n.folder:""},t=await de.post("/mount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(e){console.log(e.message,"mount_personality - settings");return}this. $ store.state.messageBox.hideMessage()},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};let e=n.language==null?n.full_path:n.full_path+":"+n.language;console.log("pth",e);const t=this.configFile.personalities.findIndex(i=>i===e),r={client_id:this. $ store.state.client_id,id:t};try{const i=await de.post("/select_personality",r,{headers:this.posts_headers});if(i)return this. $ store.dispatch("refreshConfig").then(()=>{this. $ store.dispatch("refreshPersonalitiesZoo").then(()=>{this. $ store.dispatch("refreshMountedPersonalities")})}),i.data}catch(i){console.log(i.message,"select_personality - settings");return}},async mountPersonality(n){if(this.isLoading=!0,console.log("mount pers",n),n.personality.disclaimer!=""&&this. $ store.state.messageBox.showMessage(n.personality.disclaimer),!n)return;if(this.configFile.personalities.includes(n.personality.full_path)){this.isLoading=!1,this. $ store.state.toast.showToast("Personality already mounted",4,!1);return}const e=await this.mount_personality(n.personality);console.log("mount_personality res",e),e&&e.status&&e.active_personality_id>-1&&e.personalities.includes(n.personality.full_path)?(this.configFile.personalities=e.personalities,this. $ store.state.toast.showToast("Personality mounted",4,!0),n.isMounted=!0,(await this.select_personality(n.personality)).status&&this. $ store.state.toast.showToast( ` Selected personality :
` +n.personality.name,4,!0),this. $ store.dispatch("refreshMountedPersonalities"),window.location.href.split("/").length>4?window.location.href="/":window.location.reload(!0)):(n.isMounted=!1,this. $ store.state.toast.showToast( ` Could not mount personality
Error : ` +e.error+ `
Response :
` +e,4,!1)),this.isLoading=!1},async unmountAll(){await de.post("/unmount_all_personalities",{client_id:this. $ store.state.client_id},{headers:this.posts_headers}),this. $ store.dispatch("refreshMountedPersonalities"),this. $ store.dispatch("refreshConfig"),this. $ store.state.toast.showToast("All personas unmounted",4,!0)},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this. $ store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await de.post("/unmount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async unmountPersonality(n){if(this.isLoading=!0,!n)return;const e=await this.unmount_personality(n.personality||n);if(e.status){this.configFile.personalities=e.personalities,this. $ store.state.toast.showToast("Personality unmounted",4,!0);const t=this. $ store.state.personalities.findIndex(a=>a.full_path==n.full_path),r=this.personalitiesFiltered.findIndex(a=>a.full_path==n.full_path),i=this. $ refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path);console.log("ppp",this. $ store.state.personalities[t]),this. $ store.state.personalities[t].isMounted=!1,r>-1&&(this.personalitiesFiltered[r].isMounted=!1),i>-1&&(this. $ refs.personalitiesZoo[i].isMounted=!1),this. $ store.dispatch("refreshMountedPersonalities");const s=this.mountedPersArr[this.mountedPersArr.length-1];console.log(s,this.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this. $ store.state.toast.showToast( ` Selected personality :
` +s.name,4,!0)}else this. $ store.state.toast.showToast( ` Could not unmount personality
Error : ` +e.error,4,!1);this.isLoading=!1},editPersonality(n){n=n.personality,de.post("/get_personality_config",{client_id:this. $ store.state.client_id,category:n.category,name:n.folder}).then(e=>{const t=e.data;console.log("Done"),t.status?(this. $ store.state.currentPersonConfig=t.config,this. $ store.state.showPersonalityEditor=!0,this. $ store.state.personality_editor.showPanel(),this. $ store.state.selectedPersonality=n):console.error(t.error)}).catch(e=>{console.error(e)})},copyToCustom(n){n=n.personality,de.post("/copy_to_custom_personas",{category:n.category,name:n.folder}).then(e=>{e.status?(this. $ store.state.messageBox.showMessage( ` Personality copied to the custom personalities folder :
Now it ' s up to you to modify it , enhance it , and maybe even share it .
Feel free to add your name as an author , but please remember to keep the original creator ' s name as well .
You have the freedom to give , sell , or keep the personas you create for yourself .
The possibilities are endless , they are now yours to mold and customize as you see fit . ` ),this. $ store.dispatch("refreshPersonalitiesZoo")):this. $ store.state.toast.showToast( ` Personality couldn ' t be copied to the custom personalities folder :
Verify that the personality is not already copied there . ` ,4,!1)}).catch(e=>{this. $ store.state.toast.showToast( ` Personality couldn ' t be copied to the custom personalities folder :
` ,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),de.post("/reinstall_personality",{client_id:this. $ store.state.client_id,name:n.personality.path},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this. $ store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this. $ store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reinstall personality
2024-11-11 23:13:41 +00:00
` +e.message,4,!1),{status:!1}))},async handleOpenFolder(n){await de.post("/open_personality_folder",{client_id:this. $ store.state.client_id,personality_folder:n.personality.folder})},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)},loadPersonalities(){this.loading=!0,setTimeout(()=>{this.personalities=this. $ store.state.personalities,this.loading=!1},500)}},mounted(){this.loadFavoritesFromLocalStorage(),this.loading=!0,setTimeout(()=>{this.personalities=this. $ store.state.personalities,this.loading=!1},500)}},tIt={class:"app-zoo mb-100 pb-100 pt-12 background-color w-full p-6 overflow-y-auto h-screen scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},nIt={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},rIt={class:"flex flex-wrap items-center justify-between gap-4"},iIt={key:0},sIt={key:1,class:"error"},oIt={class:"relative flex-grow max-w-md"},aIt={class:"flex items-center space-x-4"},lIt=["value"],cIt={class:"flex items-center space-x-4"},dIt={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},uIt={key:1},pIt={class:"container mx-auto px-4 flex flex-column pb-20"},hIt={key:0},mIt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},fIt={class:"container mx-auto px-4 flex flex-column pb-20"},gIt={class:"text-2xl font-bold my-8"},_It={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},bIt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto"},vIt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},yIt={class:"flex justify-between items-center mb-4"},EIt={class:"text-2xl font-bold"},SIt=["srcdoc"],xIt={key:1,class:"text-center text-red-500"};function TIt(n,e,t,r,i,s){const o=ht("personality-entry");return T(),M("div",tIt,[c("nav",nIt,[c("div",rIt,[i.message?(T(),M("p",iIt,X(i.message),1)):Y("",!0),i.error?(T(),M("p",sIt,X(i.error),1)):Y("",!0),c("div",oIt,[F(c("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.searchQuery=a),placeholder:"Search personalities...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search personalities"},null,512),[[_e,i.searchQuery]]),e[5]||(e[5]=c("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),c("div",aIt,[e[7]||(e[7]=c("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),F(c("select",{id:"category-select","onUpdate:modelValue":e[1]||(e[1]=a=>i.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[6]||(e[6]=c("option",{value:"all"},"All Categories",-1)),(T(!0),M(je,null,at(s.categories,a=>(T(),M("option",{key:a,value:a},X(a),9,lIt))),128))],512),[[Qt,i.selectedCategory]])]),c("div",cIt,[e[9]||(e[9]=c("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),F(c("select",{id:"sort-select","onUpdate:modelValue":e[2]||(e[2]=a=>i.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[8]||(e[8]=[c("option",{value:"name"},"Name",-1),c("option",{value:"author"},"Author",-1),c("option",{value:"date"},"Creation Date",-1),c("option",{value:"update"},"Last Update",-1)]),512),[[Qt,i.sortBy]]),c("button",{onClick:e[3]||(e[3]=(...a)=>s.toggleSortOrder&&s.toggleSortOrder(...a)),class:"btn btn-secondary"},X(i.sortOrder==="asc"?"↑":"↓"),1)])])]),i.loading?(T(),M("div",dIt,e[10]||(e[10]=[c("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),c("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),M("div",uIt,[c("div",pIt,[s.fav