PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / trunk
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses vtrunk
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
fluent-community / assets / pinia.js

pinia.js in FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses trunk, at assets/pinia.js

6 lines 6.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import{bb as T}from"./vendor.js?ver=2.10.01";import{an as K,r as tt,a5 as D,au as et,l as nt,d as rt,m as E,av as H,ac as st,aw as ot,n as ct,A as ut,$ as it,a0 as at,c as ft}from"./vue.js?ver=2.10.01";/*!
2 * pinia v2.3.1
3 * (c) 2025 Eduardo San Martin Morote
4 * @license MIT
5 */let k;const w=t=>k=t,q=Symbol();function x(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var A;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(A||(A={}));function $t(){const t=K(!0),r=t.run(()=>tt({}));let n=[],e=[];const s=D({install(o){w(s),s._a=o,o.provide(q,s),o.config.globalProperties.$pinia=s,e.forEach(a=>n.push(a)),e=[]},use(o){return!this._a&&!T?e.push(o):n.push(o),this},_p:n,_a:null,_e:t,_s:new Map,state:r});return s}const Q=()=>{};function O(t,r,n,e=Q){t.push(r);const s=()=>{const o=t.indexOf(r);o>-1&&(t.splice(o,1),e())};return!n&&ot()&&ct(s),s}function R(t,...r){t.slice().forEach(n=>{n(...r)})}const lt=t=>t(),F=Symbol(),I=Symbol();function L(t,r){t instanceof Map&&r instanceof Map?r.forEach((n,e)=>t.set(e,n)):t instanceof Set&&r instanceof Set&&r.forEach(t.add,t);for(const n in r){if(!r.hasOwnProperty(n))continue;const e=r[n],s=t[n];x(s)&&x(e)&&t.hasOwnProperty(n)&&!E(e)&&!H(e)?t[n]=L(s,e):t[n]=e}return t}const ht=Symbol();function dt(t){return!x(t)||!t.hasOwnProperty(ht)}const{assign:S}=Object;function bt(t){return!!(E(t)&&t.effect)}function yt(t,r,n,e){const{state:s,actions:o,getters:a}=r,c=n.state.value[t];let l;function f(){c||(n.state.value[t]=s?s():{});const h=at(n.state.value[t]);return S(h,o,Object.keys(a||{}).reduce((y,m)=>(y[m]=D(ft(()=>{w(n);const _=n._s.get(t);return a[m].call(_,_)})),y),{}))}return l=U(t,f,r,n,e,!0),l}function U(t,r,n={},e,s,o){let a;const c=S({actions:{}},n),l={deep:!0};let f,h,y=[],m=[],_;const g=e.state.value[t];!o&&!g&&(e.state.value[t]={});let N;function z(i){let u;f=h=!1,typeof i=="function"?(i(e.state.value[t]),u={type:A.patchFunction,storeId:t,events:_}):(L(e.state.value[t],i),u={type:A.patchObject,payload:i,storeId:t,events:_});const d=N=Symbol();ut().then(()=>{N===d&&(f=!0)}),h=!0,R(y,u,e.state.value[t])}const X=o?function(){const{state:u}=n,d=u?u():{};this.$patch(p=>{S(p,d)})}:Q;function Y(){a.stop(),y=[],m=[],e._s.delete(t)}const W=(i,u="")=>{if(F in i)return i[I]=u,i;const d=function(){w(e);const p=Array.from(arguments),P=[],C=[];function G(b){P.push(b)}function M(b){C.push(b)}R(m,{args:p,name:d[I],store:v,after:G,onError:M});let $;try{$=i.apply(this&&this.$id===t?this:v,p)}catch(b){throw R(C,b),b}return $ instanceof Promise?$.then(b=>(R(P,b),b)).catch(b=>(R(C,b),Promise.reject(b))):(R(P,$),$)};return d[F]=!0,d[I]=u,d},Z={_p:e,$id:t,$onAction:O.bind(null,m),$patch:z,$reset:X,$subscribe(i,u={}){const d=O(y,i,u.detached,()=>p()),p=a.run(()=>rt(()=>e.state.value[t],P=>{(u.flush==="sync"?h:f)&&i({storeId:t,type:A.direct,events:_},P)},S({},l,u)));return d},$dispose:Y},v=it(Z);e._s.set(t,v);const j=(e._a&&e._a.runWithContext||lt)(()=>e._e.run(()=>(a=K()).run(()=>r({action:W}))));for(const i in j){const u=j[i];if(E(u)&&!bt(u)||H(u))o||(g&&dt(u)&&(E(u)?u.value=g[i]:L(u,g[i])),e.state.value[t][i]=u);else if(typeof u=="function"){const d=W(u,i);j[i]=d,c.actions[i]=u}}return S(v,j),S(st(v),j),Object.defineProperty(v,"$state",{get:()=>e.state.value[t],set:i=>{z(u=>{S(u,i)})}}),e._p.forEach(i=>{S(v,a.run(()=>i({store:v,app:e._a,pinia:e,options:c})))}),g&&o&&n.hydrate&&n.hydrate(v.$state,g),f=!0,h=!0,v}/*! #__NO_SIDE_EFFECTS__ */function At(t,r,n){let e,s;const o=typeof r=="function";typeof t=="string"?(e=t,s=o?n:r):(s=t,e=t.id);function a(c,l){const f=et();return c=c||(f?nt(q,null):null),c&&w(c),c=k,c._s.has(e)||(o?U(e,r,s,c):yt(e,s,c)),c._s.get(e)}return a.$id=e,a}function Et(t,r){return Array.isArray(r)?r.reduce((n,e)=>(n[e]=function(){return t(this.$pinia)[e]},n),{}):Object.keys(r).reduce((n,e)=>(n[e]=function(){const s=t(this.$pinia),o=r[e];return typeof o=="function"?o.call(this,s):s[o]},n),{})}function wt(t,r){return Array.isArray(r)?r.reduce((n,e)=>(n[e]=function(...s){return t(this.$pinia)[e](...s)},n),{}):Object.keys(r).reduce((n,e)=>(n[e]=function(...s){return t(this.$pinia)[r[e]](...s)},n),{})}function vt(t){return typeof t=="object"&&t!==null}function J(t,r){return t=vt(t)?t:Object.create(null),new Proxy(t,{get(n,e,s){return e==="key"?Reflect.get(n,e,s):Reflect.get(n,e,s)||Reflect.get(r,e,s)}})}function St(t,r){return r.reduce((n,e)=>n==null?void 0:n[e],t)}function mt(t,r,n){return r.slice(0,-1).reduce((e,s)=>/^(__proto__)$/.test(s)?{}:e[s]=e[s]||{},t)[r[r.length-1]]=n,t}function _t(t,r){return r.reduce((n,e)=>{const s=e.split(".");return mt(n,s,St(t,s))},{})}function gt(t,r){return n=>{var e;try{const{storage:s=localStorage,beforeRestore:o=void 0,afterRestore:a=void 0,serializer:c={serialize:JSON.stringify,deserialize:JSON.parse},key:l=r.$id,paths:f=null,debug:h=!1}=n;return{storage:s,beforeRestore:o,afterRestore:a,serializer:c,key:((e=t.key)!=null?e:y=>y)(typeof l=="string"?l:l(r.$id)),paths:f,debug:h}}catch(s){return n.debug&&console.error("[pinia-plugin-persistedstate]",s),null}}}function V(t,{storage:r,serializer:n,key:e,debug:s}){try{const o=r==null?void 0:r.getItem(e);o&&t.$patch(n==null?void 0:n.deserialize(o))}catch(o){s&&console.error("[pinia-plugin-persistedstate]",o)}}function B(t,{storage:r,serializer:n,key:e,paths:s,debug:o}){try{const a=Array.isArray(s)?_t(t,s):t;r.setItem(e,n.serialize(a))}catch(a){o&&console.error("[pinia-plugin-persistedstate]",a)}}function pt(t={}){return r=>{const{auto:n=!1}=t,{options:{persist:e=n},store:s,pinia:o}=r;if(!e)return;if(!(s.$id in o.state.value)){const c=o._s.get(s.$id.replace("__hot:",""));c&&Promise.resolve().then(()=>c.$persist());return}const a=(Array.isArray(e)?e.map(c=>J(c,t)):[J(e,t)]).map(gt(t,s)).filter(Boolean);s.$persist=()=>{a.forEach(c=>{B(s.$state,c)})},s.$hydrate=({runHooks:c=!0}={})=>{a.forEach(l=>{const{beforeRestore:f,afterRestore:h}=l;c&&(f==null||f(r)),V(s,l),c&&(h==null||h(r))})},a.forEach(c=>{const{beforeRestore:l,afterRestore:f}=c;l==null||l(r),V(s,c),f==null||f(r),s.$subscribe((h,y)=>{B(y,c)},{detached:!0})})}}var Ct=pt();export{wt as a,$t as c,At as d,Et as m,Ct as s};
6