sprof 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sprof.js CHANGED
@@ -4121,7 +4121,7 @@ var Qn = /* @__PURE__ */ ((t) => (t.ContentType = "Content-Type", t.Token = "tok
4121
4121
  const ae = class ae {
4122
4122
  //SetupV
4123
4123
  static Setup(e = "http://localhost", i = "9000", n = "api") {
4124
- this.baseUrl = ne.BuildSafeUrl(e, i, n), console.log(this.baseUrl), this.host = e, this.apiVersion = n;
4124
+ this.baseUrl = ne.BuildSafeUrl(e, i, n), this.host = e, this.apiVersion = n;
4125
4125
  }
4126
4126
  static newWebSocket(e) {
4127
4127
  const i = this.host.replace("http", "ws") + "/ws/" + e;
@@ -4191,7 +4191,7 @@ const ae = class ae {
4191
4191
  }
4192
4192
  static buildUrl(e = "") {
4193
4193
  try {
4194
- return console.log(this.baseUrl, e), fs(this.baseUrl, e);
4194
+ return fs(this.baseUrl, e);
4195
4195
  } catch {
4196
4196
  throw new Error(`Invalid base URL: ${this.baseUrl}`);
4197
4197
  }
@@ -16,7 +16,7 @@
16
16
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[Yr]=this[Yr]={accessors:{}}).accessors,s=this.prototype;function o(a){const c=qt(a);r[c]||(Tc(s,a),r[c]=!0)}return w.isArray(e)?e.forEach(o):o(e),this}};be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),w.reduceDescriptors(be.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),w.freezeMethods(be);function yi(t,e){const n=this||Ht,r=e||n,s=be.from(r.headers);let o=r.data;return w.forEach(t,function(c){o=c.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function Qr(t){return!!(t&&t.__CANCEL__)}function wt(t,e,n){F.call(this,t??"canceled",F.ERR_CANCELED,e,n),this.name="CanceledError"}w.inherits(wt,F,{__CANCEL__:!0});function Kr(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new F("Request failed with status code "+n.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Fc(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Oc(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,o=0,a;return e=e!==void 0?e:1e3,function(d){const u=Date.now(),h=r[o];a||(a=u),n[s]=d,r[s]=u;let f=o,m=0;for(;f!==s;)m+=n[f++],f=f%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),u-a<e)return;const g=h&&u-h;return g?Math.round(m*1e3/g):void 0}}function Dc(t,e){let n=0,r=1e3/e,s,o;const a=(u,h=Date.now())=>{n=h,s=null,o&&(clearTimeout(o),o=null),t(...u)};return[(...u)=>{const h=Date.now(),f=h-n;f>=r?a(u,h):(s=u,o||(o=setTimeout(()=>{o=null,a(s)},r-f)))},()=>s&&a(s)]}const Cn=(t,e,n=3)=>{let r=0;const s=Oc(50,250);return Dc(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-r,u=s(d),h=a<=c;r=a;const f={loaded:a,total:c,progress:c?a/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&h?(c-a)/u:void 0,event:o,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},n)},es=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},ts=t=>(...e)=>w.asap(()=>t(...e)),Lc=pe.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,pe.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,Hc=pe.hasStandardBrowserEnv?{write(t,e,n,r,s,o){const a=[t+"="+encodeURIComponent(e)];w.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),w.isString(r)&&a.push("path="+r),w.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function qc(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Uc(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ns(t,e,n){let r=!qc(e);return t&&(r||n==!1)?Uc(t,e):e}const is=t=>t instanceof be?{...t}:t;function at(t,e){e=e||{};const n={};function r(u,h,f,m){return w.isPlainObject(u)&&w.isPlainObject(h)?w.merge.call({caseless:m},u,h):w.isPlainObject(h)?w.merge({},h):w.isArray(h)?h.slice():h}function s(u,h,f,m){if(w.isUndefined(h)){if(!w.isUndefined(u))return r(void 0,u,f,m)}else return r(u,h,f,m)}function o(u,h){if(!w.isUndefined(h))return r(void 0,h)}function a(u,h){if(w.isUndefined(h)){if(!w.isUndefined(u))return r(void 0,u)}else return r(void 0,h)}function c(u,h,f){if(f in e)return r(u,h);if(f in t)return r(void 0,u)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(u,h,f)=>s(is(u),is(h),f,!0)};return w.forEach(Object.keys({...t,...e}),function(h){const f=d[h]||s,m=f(t[h],e[h],h);w.isUndefined(m)&&f!==c||(n[h]=m)}),n}const rs=t=>{const e=at({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:c}=e;e.headers=a=be.from(a),e.url=Gr(ns(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(w.isFormData(n)){if(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((d=a.getContentType())!==!1){const[u,...h]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...h].join("; "))}}if(pe.hasStandardBrowserEnv&&(r&&w.isFunction(r)&&(r=r(e)),r||r!==!1&&Lc(e.url))){const u=s&&o&&Hc.read(o);u&&a.set(s,u)}return e},jc=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const s=rs(t);let o=s.data;const a=be.from(s.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:u}=s,h,f,m,g,C;function b(){g&&g(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function I(){if(!S)return;const z=be.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),H={data:!c||c==="text"||c==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:z,config:t,request:S};Kr(function($e){n($e),b()},function($e){r($e),b()},H),S=null}"onloadend"in S?S.onloadend=I:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(I)},S.onabort=function(){S&&(r(new F("Request aborted",F.ECONNABORTED,t,S)),S=null)},S.onerror=function(){r(new F("Network Error",F.ERR_NETWORK,t,S)),S=null},S.ontimeout=function(){let N=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const H=s.transitional||Jr;s.timeoutErrorMessage&&(N=s.timeoutErrorMessage),r(new F(N,H.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,t,S)),S=null},o===void 0&&a.setContentType(null),"setRequestHeader"in S&&w.forEach(a.toJSON(),function(N,H){S.setRequestHeader(H,N)}),w.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),c&&c!=="json"&&(S.responseType=s.responseType),u&&([m,C]=Cn(u,!0),S.addEventListener("progress",m)),d&&S.upload&&([f,g]=Cn(d),S.upload.addEventListener("progress",f),S.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(h=z=>{S&&(r(!z||z.type?new wt(null,t,S):z),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const L=Fc(s.url);if(L&&pe.protocols.indexOf(L)===-1){r(new F("Unsupported protocol "+L+":",F.ERR_BAD_REQUEST,t));return}S.send(o||null)})},Wc=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const h=u instanceof Error?u:this.reason;r.abort(h instanceof F?h:new wt(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,o(new F(`timeout ${e} of ms exceeded`,F.ETIMEDOUT))},e);const c=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>u.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>w.asap(c),d}},_c=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},Gc=async function*(t,e){for await(const n of Zc(t))yield*_c(n,e)},Zc=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},ss=(t,e,n,r)=>{const s=Gc(t,e);let o=0,a,c=d=>{a||(a=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:u,value:h}=await s.next();if(u){c(),d.close();return}let f=h.byteLength;if(n){let m=o+=f;n(m)}d.enqueue(new Uint8Array(h))}catch(u){throw c(u),u}},cancel(d){return c(d),s.return()}},{highWaterMark:2})},Sn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",os=Sn&&typeof ReadableStream=="function",Jc=Sn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),as=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Xc=os&&as(()=>{let t=!1;const e=new Request(pe.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),ls=64*1024,wi=os&&as(()=>w.isReadableStream(new Response("").body)),kn={stream:wi&&(t=>t.body)};Sn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!kn[e]&&(kn[e]=w.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new F(`Response type '${e}' is not supported`,F.ERR_NOT_SUPPORT,r)})})})(new Response);const Yc=async t=>{if(t==null)return 0;if(w.isBlob(t))return t.size;if(w.isSpecCompliantForm(t))return(await new Request(pe.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(w.isArrayBufferView(t)||w.isArrayBuffer(t))return t.byteLength;if(w.isURLSearchParams(t)&&(t=t+""),w.isString(t))return(await Jc(t)).byteLength},Qc=async(t,e)=>{const n=w.toFiniteNumber(t.getContentLength());return n??Yc(e)},bi={http:bc,xhr:jc,fetch:Sn&&(async t=>{let{url:e,method:n,data:r,signal:s,cancelToken:o,timeout:a,onDownloadProgress:c,onUploadProgress:d,responseType:u,headers:h,withCredentials:f="same-origin",fetchOptions:m}=rs(t);u=u?(u+"").toLowerCase():"text";let g=Wc([s,o&&o.toAbortSignal()],a),C;const b=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let S;try{if(d&&Xc&&n!=="get"&&n!=="head"&&(S=await Qc(h,r))!==0){let H=new Request(e,{method:"POST",body:r,duplex:"half"}),Be;if(w.isFormData(r)&&(Be=H.headers.get("content-type"))&&h.setContentType(Be),H.body){const[$e,nt]=es(S,Cn(ts(d)));r=ss(H.body,ls,$e,nt)}}w.isString(f)||(f=f?"include":"omit");const I="credentials"in Request.prototype;C=new Request(e,{...m,signal:g,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:I?f:void 0});let L=await fetch(C,m);const z=wi&&(u==="stream"||u==="response");if(wi&&(c||z&&b)){const H={};["status","statusText","headers"].forEach(At=>{H[At]=L[At]});const Be=w.toFiniteNumber(L.headers.get("content-length")),[$e,nt]=c&&es(Be,Cn(ts(c),!0))||[];L=new Response(ss(L.body,ls,$e,()=>{nt&&nt(),b&&b()}),H)}u=u||"text";let N=await kn[w.findKey(kn,u)||"text"](L,t);return!z&&b&&b(),await new Promise((H,Be)=>{Kr(H,Be,{data:N,headers:be.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:C})})}catch(I){throw b&&b(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,t,C),{cause:I.cause||I}):F.from(I,I&&I.code,t,C)}})};w.forEach(bi,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const cs=t=>`- ${t}`,Kc=t=>w.isFunction(t)||t===null||t===!1,ds={getAdapter:t=>{t=w.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let o=0;o<e;o++){n=t[o];let a;if(r=n,!Kc(n)&&(r=bi[(a=String(n)).toLowerCase()],r===void 0))throw new F(`Unknown adapter '${a}'`);if(r)break;s[a||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=e?o.length>1?`since :
17
17
  `+o.map(cs).join(`
18
18
  `):" "+cs(o[0]):"as no adapter specified";throw new F("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:bi};function Ci(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new wt(null,t)}function us(t){return Ci(t),t.headers=be.from(t.headers),t.data=yi.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ds.getAdapter(t.adapter||Ht.adapter)(t).then(function(r){return Ci(t),r.data=yi.call(t,t.transformResponse,r),r.headers=be.from(r.headers),r},function(r){return Qr(r)||(Ci(t),r&&r.response&&(r.response.data=yi.call(t,t.transformResponse,r.response),r.response.headers=be.from(r.response.headers))),Promise.reject(r)})}const hs="1.11.0",En={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{En[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const fs={};En.transitional=function(e,n,r){function s(o,a){return"[Axios v"+hs+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,c)=>{if(e===!1)throw new F(s(a," has been removed"+(n?" in "+n:"")),F.ERR_DEPRECATED);return n&&!fs[a]&&(fs[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,a,c):!0}},En.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function ed(t,e,n){if(typeof t!="object")throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const o=r[s],a=e[o];if(a){const c=t[o],d=c===void 0||a(c,o,t);if(d!==!0)throw new F("option "+o+" must be "+d,F.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new F("Unknown option "+o,F.ERR_BAD_OPTION)}}const xn={assertOptions:ed,validators:En},Ve=xn.validators;let lt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Zr,response:new Zr}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
19
- `+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=at(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&xn.assertOptions(r,{silentJSONParsing:Ve.transitional(Ve.boolean),forcedJSONParsing:Ve.transitional(Ve.boolean),clarifyTimeoutError:Ve.transitional(Ve.boolean)},!1),s!=null&&(w.isFunction(s)?n.paramsSerializer={serialize:s}:xn.assertOptions(s,{encode:Ve.function,serialize:Ve.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),xn.assertOptions(n,{baseUrl:Ve.spelling("baseURL"),withXsrfToken:Ve.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&w.merge(o.common,o[n.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=be.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(d=d&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const u=[];this.interceptors.response.forEach(function(b){u.push(b.fulfilled,b.rejected)});let h,f=0,m;if(!d){const C=[us.bind(this),void 0];for(C.unshift(...c),C.push(...u),m=C.length,h=Promise.resolve(n);f<m;)h=h.then(C[f++],C[f++]);return h}m=c.length;let g=n;for(f=0;f<m;){const C=c[f++],b=c[f++];try{g=C(g)}catch(S){b.call(this,S);break}}try{h=us.call(this,g)}catch(C){return Promise.reject(C)}for(f=0,m=u.length;f<m;)h=h.then(u[f++],u[f++]);return h}getUri(e){e=at(this.defaults,e);const n=ns(e.baseURL,e.url,e.allowAbsoluteUrls);return Gr(n,e.params,e.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(e){lt.prototype[e]=function(n,r){return this.request(at(r||{},{method:e,url:n,data:(r||{}).data}))}}),w.forEach(["post","put","patch"],function(e){function n(r){return function(o,a,c){return this.request(at(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}lt.prototype[e]=n(),lt.prototype[e+"Form"]=n(!0)});let td=class al{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(c=>{r.subscribe(c),o=c}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},e(function(o,a,c){r.reason||(r.reason=new wt(o,a,c),n(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 n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new al(function(s){e=s}),cancel:e}}};function nd(t){return function(n){return t.apply(null,n)}}function id(t){return w.isObject(t)&&t.isAxiosError===!0}const Si={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,NetworkAuthenticationRequired:511};Object.entries(Si).forEach(([t,e])=>{Si[e]=t});function ms(t){const e=new lt(t),n=Ar(lt.prototype.request,e);return w.extend(n,lt.prototype,e,{allOwnKeys:!0}),w.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return ms(at(t,s))},n}const K=ms(Ht);K.Axios=lt,K.CanceledError=wt,K.CancelToken=td,K.isCancel=Qr,K.VERSION=hs,K.toFormData=wn,K.AxiosError=F,K.Cancel=K.CanceledError,K.all=function(e){return Promise.all(e)},K.spread=nd,K.isAxiosError=id,K.mergeConfig=at,K.AxiosHeaders=be,K.formToJSON=t=>Xr(w.isHTMLForm(t)?new FormData(t):t),K.getAdapter=ds.getAdapter,K.HttpStatusCode=Si,K.default=K;const{Axios:Pg,AxiosError:zg,CanceledError:Vg,isCancel:Tg,CancelToken:Fg,VERSION:Og,all:Dg,Cancel:Lg,isAxiosError:Hg,spread:qg,toFormData:Ug,AxiosHeaders:jg,HttpStatusCode:Wg,formToJSON:_g,getAdapter:Gg,mergeConfig:Zg}=K;var Ut=(t=>(t.GET="get",t.POST="post",t.PUT="put",t.DELETE="delete",t))(Ut||{});const jt=(()=>{function t(){const d=s();return!(!d||d==="undefined")}function e(d){d.accessToken&&localStorage.setItem("access_token",d.accessToken),d.refreshToken&&localStorage.setItem("refresh_token",d.refreshToken)}function n(){const d=localStorage.getItem("user");return d?JSON.parse(d).id:""}function r(){const d=localStorage.getItem("user");if(d)return JSON.parse(d)}function s(){return localStorage.getItem("access_token")}function o(){return localStorage.getItem("refresh_token")}function a(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}function c(d){if(!t())return;const u=jt.getUser();u&&(u.human=d,localStorage.setItem("user",JSON.stringify(u)))}return{isAuth:t,setTokens:e,getAccessToken:s,getRefreshToken:o,getUserId:n,clearTokens:a,getUser:r,updateHuman:c}})();class ki{constructor(e){l(this,"code",400);l(this,"err","");M.BuildClass(this,e)}getErr(){return this.capitalizedErr()}capitalizedErr(){return this.err.charAt(0).toUpperCase()+this.err.slice(1)}static async Handle(e,n){const r=e.config;if(e.response){if(e.response.status===401&&!r._retry)return r._retry=!0,n.defaults.headers.common.token=jt.getAccessToken(),e.config.headers.token=jt.getAccessToken(),e.config.baseURL=void 0,n.request(r);if(e.response.status>=500){if(e.response.data==="неверный логин или пароль"){ye.Error("Неверный логин или пароль");return}ye.Error("Ошибка на сервере, попробуйте позже")}if(e.response.status>=400&&e.response.status<500){const s=new ki(e.response.data).getErr();s&&ye.Error(s)}return Promise.reject(e)}}}const bt=K.create();bt.interceptors.response.use(t=>t,async t=>await ki.Handle(t,bt));class Wt{static async Get(e,n,r){return await bt({method:Ut.GET,url:e,headers:n,responseType:r})}static async Post(e,n,r,s){return n["Content-Type"]="multipart/form-data",await bt({method:Ut.POST,url:e,headers:n,responseType:r,data:s})}static async Put(e,n,r){return n["Content-Type"]="multipart/form-data",await bt({method:Ut.PUT,url:e,headers:n,data:r})}static async Delete(e,n){return await bt({method:Ut.DELETE,url:e,headers:n})}}class vn{constructor(e){l(this,"name","");M.BuildClass(this,e)}static Set(){}static Get(e,n){const r=sessionStorage.getItem(e);if(r){const s=JSON.parse(r),o=new Date,a=new Date(s.time),c=o.getTime()-a.getTime();return Math.round(c/6e4)>(n||10)?null:s.data}else return null}static async TryGet(e,n,r){let s;return s=vn.Get(e,r),s||(s=await n()),s}}var Ei=(t=>(t.ContentType="Content-Type",t.Token="token",t))(Ei||{}),ps=(t=>(t.ApplicationJson="application/json",t.MultipartFormData="multipart/form-data",t))(ps||{});const Z=class Z{static Setup(e="http://localhost",n="9000",r="api"){this.baseUrl=U.BuildSafeUrl(e,n,r),console.log(this.baseUrl),this.host=e,this.apiVersion=r}static newWebSocket(e){const n=this.host.replace("http","ws")+"/ws/"+e;return new WebSocket(n)}static download(e,n){const r=Z.getDownloadFileName(e,n.headers),s=URL.createObjectURL(n.data),o=document.createElement("a");o.href=s,o.setAttribute("download",r),o.setAttribute("target","_blank"),document.body.appendChild(o),o.click()}static getDownloadFileName(e,n){if(e)return e;const r=n["content-disposition"];if(!r)return"file";const s=r.indexOf('"')+1,o=r.lastIndexOf('"'),a=r.substring(s,o);return a||"file"}static getHeaders(e){const n=ze.Get(Re.AccessToken);return e||(e=Z.headers),n&&(e[Ei.Token]=n),e??Z.headers}static returnResponse(e,n){if(n)return e!=null&&e.isBlob?Z.download(e.downloadFileName,n):n.data}static async Get(e){return Z.returnResponse(e,await Wt.Get(Z.buildUrl((e==null?void 0:e.query)??""),Z.getHeaders(e==null?void 0:e.headers),Z.getResponseType(e==null?void 0:e.isBlob)))}static async Post(e){return Z.returnResponse(e,await Wt.Post(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers),Z.getResponseType(e.isBlob),Z.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Put(e){return Z.returnResponse(e,await Wt.Put(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers),Z.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Delete(e){return Z.returnResponse(e,await Wt.Delete(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers)))}static async Subscribe(e){const{query:n}=e;return new EventSource(Z.buildUrl(n))}static buildUrl(e=""){try{return console.log(this.baseUrl,e),si(this.baseUrl,e)}catch{throw new Error(`Invalid base URL: ${this.baseUrl}`)}}static getResponseType(e){return e?"blob":"json"}static createFormDataPayload(e,n){const r=new FormData;if(r.append("form",JSON.stringify(e)),n)for(const s of n)s.file&&r.append(s.id??"files",s.file,s.originalName);return r}};l(Z,"baseUrl",""),l(Z,"apiVersion","api"),l(Z,"host",""),l(Z,"headers",{[Ei.ContentType]:ps.ApplicationJson});let Q=Z;const E=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},rd={},sd={style:{"text-align":"center"}};function od(t,e){return i.openBlock(),i.createElementBlock("div",sd,e[0]||(e[0]=[i.createElementVNode("h1",null,"Страница не найдена",-1)]))}const xi=E(rd,[["render",od]]),ad=[{path:"/:pathMatch(.*)*",name:"NotFound",component:xi}],Me=class Me{static Setup(e,n=""){this.router=e,this.title=n,this.ChangeDocumentTitle(),this.AddRoutes(ad)}static Get(){return this.router}static AddRoutes(e){e.forEach(n=>{this.Get().addRoute(n)})}static async To(e){await this.Get().push(e)}static async ToHome(){}static async Replace(e){await this.Get().replace(e)}static Id(){return Me.GetStringParam("id")}static Slug(){return Me.GetStringParam("slug")}static async Back(){this.Get().go(-1)}static GetQid(){return Me.GetStringQueryParam("qid")}static Route(){var e;return(e=this.Get())==null?void 0:e.currentRoute.value}static RouterPushBlank(e){const n=this.Get().resolve({path:e});window.open(n==null?void 0:n.href,"_blank")}static GetPath(){var n;const e=(n=Me.Route())==null?void 0:n.path.split("/");return!e||e.length<=0?"":e[e.length-1]}static async ToAdmin(e){if(!e){await this.Get().push("/admin");return}let n=e;n[0]==="/"&&(n=e.substring(1)),await Me.To(`/admin/${n}`)}static GetStringQueryParam(e){return String(this.Route().query[e])}static GetNumberQueryParam(e){return Number(this.Route().query[e]??0)}static GetStringParam(e){var n;return(n=this.Route())==null?void 0:n.params[e]}static SetQueryParam(e,n){const r=new URL(window.location);r.searchParams.set(e,String(n)),history.replaceState(null,"",r)}static Resolve(e){return this.Get().resolve(e)}};l(Me,"router"),l(Me,"title",""),l(Me,"ChangeDocumentTitle",(e="")=>{let n=Me.Route().meta.title??e;n&&(n=" | "+n),document.title=Me.title+n});let Te=Me;class X{constructor(e,n){l(this,"items",i.reactive([]));l(this,"item");l(this,"options",i.reactive([]));l(this,"count",i.ref(0));l(this,"classConstructor");l(this,"url","");l(this,"searchStr",i.ref(""));this.classConstructor=e,this.item=i.reactive(new this.classConstructor),this.url=n}Set(e){Object.assign(this.item,new this.classConstructor(e))}getUrl(e){return e?`${this.url}/${e}`:this.url}async GetOptions(e="name",n="id"){const r=`${this.getUrl()}/options/${e}/${n}`,s=await Q.Get({query:r});s&&(this.options.splice(0,this.options.length),this.options.push(...s))}async GetAll(e){let n;const r=Q.Get;e&&e.withCache?n=await vn.TryGet(this.getUrl(),r):n=await r({query:this.getUrl()}),Array.isArray(n)?this.SetAll(n):this.SetAllWithCount(n)}async Get(e){e||(e=Te.Id()),this.Set(await Q.Get({query:this.getUrl(e)}))}async GetBySlug(e){e||(e=Te.Slug()),this.Set(await B.H.HttpClient.Get({query:this.getUrl("by-slug/"+e)}))}async FTSP(e){var a;const r=((e==null?void 0:e.ftsp)??je.Get()).clearForHTTP(),s={payload:{ftsp:r},query:this.getUrl("ftsp")},o=await Q.Post(s);if(!(!o||!o.ftsp))if(Array.isArray(o.data))this.SetAll(o.data);else{if(r.p.append){this.AppendToAll((a=o.data)==null?void 0:a.items);return}this.SetAllWithCount(o.data)}}async Create(e){const n=e??this.item,r={payload:n,query:this.getUrl()};return n.getFileInfos&&(r.fileInfos=n.getFileInfos()),await Q.Post(r)}async CreateAndSet(e){const n=await this.Create(e);this.Set(n)}async CreateMany(e){if(!e)return;const n=[];e.forEach(r=>{n.push(new Promise(()=>this.Create(r)))}),Promise.all(n)}async Update(e){const n=e??this.item,r={query:this.getUrl(`${n.id}`),payload:n};return n.getFileInfos&&(r.fileInfos=n.getFileInfos(),r.fileInfos.forEach(s=>s.url="")),await Q.Put(r)}async UpdateAndSet(e){const n=await this.Update(e);this.Set(n)}async UpdateAndReset(e){await this.Update(e??this.item),this.Set()}async Remove(e){if(!e){console.warn("BaseStore/Remove. id is undefined");return}await Q.Delete({query:this.getUrl(`${e}`)}),this.RemoveItem(e)}async UpdateMany(e){if(e||(e=this.items),!e)return;const n=[];e.forEach(r=>{n.push(new Promise(()=>this.Update(r)))}),Promise.all(n)}SetAll(e){e&&(this.items.splice(0,this.items.length),this.items.push(...e.map(n=>new this.classConstructor(n))))}SetAllWithCount(e){e&&(this.SetAll(e.items),this.count.value=e.count)}RemoveItem(e){const n=this.items.findIndex(r=>r.id===e);this.items.splice(n,1)}AppendToAll(e){if(e){if(Array.isArray(e)){const n=e.map(r=>new this.classConstructor(r));this.items.push(...n);return}this.items.push(new this.classConstructor(e))}}ResetState(){this.ResetItem(),this.ClearItems(),this.count.value=0}ResetItem(){M.BuildClass(this.item,new this.classConstructor)}ClearItems(){this.items.splice(0,this.items.length)}UnshiftToAll(e){if(e){if(Array.isArray(e)){const n=e.map(r=>new this.classConstructor(r));this.items.unshift(...n);return}this.items.unshift(new this.classConstructor(e))}}get Items(){return this.items}get ItemsFiltered(){return this.searchStr.value.trim()?this.Items.filter(e=>B.H.Strings.SearchInFields(this.searchStr.value,e.SearchFields())):this.Items}get Options(){return this.options}get Item(){return this.item}get Count(){return this.count}get SearchStr(){return this.searchStr}}function ld(t,e){t=="left"&&e.next(),t=="right"&&e.prev()}const cd=["#31af5e","#ff4d3b","#006BB5","#f3911c"];class dd{static GetRandColor(e){return Ue.GetRandEL(e??cd)}}function gs(t,e){const n=[],r=e||Ee.Asc,s=r===Ee.Asc?Ee.Desc:Ee.Asc;return Object.values(t).forEach(o=>{n.push(o(r)),n.push(o(s))}),n.length>0&&!n.some(o=>o.default)&&(n[0].default=!0),e&&n.forEach(o=>{o.default&&(o.default=o.order===e)}),n}let ud=class{constructor(){l(this,"startHour",9);l(this,"endHour",19);l(this,"timelinePxHeight",50);l(this,"timelineStep",zt.FiveMinutes);l(this,"activeTime","");l(this,"activeObjectId","");l(this,"dragged",!1);l(this,"draggedStartTime","");l(this,"draggedEndTime","");l(this,"timelines",on[zt.FiveMinutes])}startDrag(e,n){this.draggedStartTime=e,this.draggedEndTime=n,this.dragged=!0}endDrag(){this.activeTime="",this.dragged=!1}setTimelineStep(e){this.timelineStep=e,this.setTimelines()}setTimelines(){this.timelines=on[this.timelineStep]}getScheduleHeight(){return this.getHourHeight()*this.getHoursArr().length}getHourHeight(){return this.timelinePxHeight*this.timelines.length}getHoursArr(){return Ue.GenerateNumsRange(this.startHour,this.endHour)}};const vi=t=>t===8||t===46,hd=t=>t>46&&t<58,fd=t=>t>34&&t<41,md=t=>t+".",pd=(t,e,n)=>{vi(e)||fd(e)||(!hd(e)||n>9)&&t.preventDefault()};function gd(t,e){if(e>8){let n=t.substring(0,2).replace(".","1");Number(n)>31&&(n="31");let r=t.substring(3,5).replace(".","1");Number(r)>12&&(r="12");let s=t.substring(6,10).replace(".","1");Number(s)>2100&&(s="2100"),t=n+"."+r+"."+s}return t}function yd(t){const e=t.keyCode;let n=t.srcElement.value;const r=n.length;pd(t,e,r),!vi(e)&&(r===2||r===5)&&(n=md(n));const s=t.srcElement.value+String.fromCharCode(t.which);if(vi(e)){t.srcElement.value=n;return}n.length===0&&Number(s)>3&&(n="3",t.preventDefault()),n.length===1&&Number(s)>31&&(n="31",t.preventDefault()),s.length===5&&Number(s.substring(3,5))>12&&(n=n.substring(0,3)+"12",t.preventDefault()),n=gd(n,r),t.srcElement.value=n}const wd=["ВС","ПН","ВТ","СР","ЧТ","ПТ","СБ"],bd="ru-RU";class Fe{constructor(){l(this,"locale","ru-RU")}static Format(e,n){if(!e)return"";const r={year:"numeric",month:"2-digit",day:"2-digit",hour:void 0,minute:void 0};return n&&(r.year=n.year||n.year===void 0?n.year:r.year,r.month=n.month||n.month===void 0?n.month:r.month,r.day=n.day||n.day===void 0?n.day:r.day,r.hour=n.hour??r.hour,r.minute=n.minute??r.minute),Intl.DateTimeFormat(bd,r).format(new Date(e))}static FormatWithTime(e){return Fe.Format(e,{month:"2-digit",day:"2-digit",year:"numeric",hour:"numeric",minute:"numeric"})}static FromRuStr(e){const n=e.split(".");return new Date(`${n[2]}-${n[1]}-${n[0]}`)}static GetPeriod(e,n,r){return`${this.Format(e,r)}-${this.Format(n,r)}`}static GetShortDayName(e){return e?wd[e.getDay()]:""}static GetCurrentWeekPeriod(e){const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()-n.getDay()+1),s=new Date(n.getFullYear(),n.getMonth(),r.getDate()+7);return this.GetPeriod(r,s,e||{month:"2-digit",day:"numeric",year:void 0})}static GetDurationInDay(e,n){const r=new Date,s=new Date,o=Fe.SplitHourTime(e),a=Fe.SplitHourTime(n);return r.setHours(o[0],o[1],0,0),s.setHours(a[0],a[1],0,0),(s.getTime()-r.getTime())/1e3/60}static HourTimeinMunutes(e){const n=Fe.SplitHourTime(e);return n[0]*60+n[1]}static SplitHourTime(e){const n=e.split(":");return[Number(n[0]),Number(n[1])]}static AddMinutesToHM(e,n){const r=new Date,s=Fe.SplitHourTime(e);r.setHours(s[0],s[1],0,0);const o=new Date(r.getTime()+n*6e4),a=o.getHours(),c=o.getMinutes();return`${a}:${c}`}static GetMonthsDiff(e,n){return n.getMonth()-e.getMonth()+12*(n.getFullYear()-e.getFullYear())}static StringToDate(e){const n=e.split(".");return new Date(`${n[2]}-${n[1]}-${n[0]}`)}static GetDateOrToday(e){return e?e.date:new Date}static InPeriod(e,n,r){return new Date(e)>=new Date(n)&&new Date(e)<=new Date(r)}static GetDatesFromPeriod(e,n){const r=[new Date(e)];let s=e;for(;s<=n;)s=Fe.AddDays(s,1),r.push(s);return r}static AddDays(e,n){const r=new Date(e);return r.setDate(r.getDate()+n),r}static Eq(e,n){return e.getTime()===n.getTime()}}class Cd{constructor(){l(this,"dragged",!1);l(this,"dragImg",new Image);this.dragImg.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="}start(e){this.dragged=!0,e&&e.dataTransfer&&e.dataTransfer.setDragImage(this.dragImg,0,0)}end(){this.dragged=!1}isDragged(){return this.dragged}}class ys{static Get(e){const n=e.split(".");return n[n.length-1]}}const Sd=(()=>{function t(o,a){localStorage.setItem(`${o}_favourite`,a.toString())}function e(o,a){const c=localStorage.getItem(`${o}_favourite`);return c?c.split(",").includes(a):!1}function n(o,a){const c=localStorage.getItem(`${o}_favourite`);if(!c){t(o,[a]);return}const d=c.split(",");d.push(a),t(o,d)}function r(o,a){const c=localStorage.getItem(`${o}_favourite`);if(!c)return;const d=c.split(",").filter(u=>u!==a);t(o,d)}function s(){for(const o in localStorage)o.includes("_favourite")&&localStorage.removeItem(o)}return{addToFavourite:n,removeFromFavourite:r,setFavourite:t,isFavourite:e,clearFavourite:s}})();/*!
19
+ `+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=at(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&xn.assertOptions(r,{silentJSONParsing:Ve.transitional(Ve.boolean),forcedJSONParsing:Ve.transitional(Ve.boolean),clarifyTimeoutError:Ve.transitional(Ve.boolean)},!1),s!=null&&(w.isFunction(s)?n.paramsSerializer={serialize:s}:xn.assertOptions(s,{encode:Ve.function,serialize:Ve.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),xn.assertOptions(n,{baseUrl:Ve.spelling("baseURL"),withXsrfToken:Ve.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&w.merge(o.common,o[n.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=be.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(d=d&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const u=[];this.interceptors.response.forEach(function(b){u.push(b.fulfilled,b.rejected)});let h,f=0,m;if(!d){const C=[us.bind(this),void 0];for(C.unshift(...c),C.push(...u),m=C.length,h=Promise.resolve(n);f<m;)h=h.then(C[f++],C[f++]);return h}m=c.length;let g=n;for(f=0;f<m;){const C=c[f++],b=c[f++];try{g=C(g)}catch(S){b.call(this,S);break}}try{h=us.call(this,g)}catch(C){return Promise.reject(C)}for(f=0,m=u.length;f<m;)h=h.then(u[f++],u[f++]);return h}getUri(e){e=at(this.defaults,e);const n=ns(e.baseURL,e.url,e.allowAbsoluteUrls);return Gr(n,e.params,e.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(e){lt.prototype[e]=function(n,r){return this.request(at(r||{},{method:e,url:n,data:(r||{}).data}))}}),w.forEach(["post","put","patch"],function(e){function n(r){return function(o,a,c){return this.request(at(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}lt.prototype[e]=n(),lt.prototype[e+"Form"]=n(!0)});let td=class al{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(c=>{r.subscribe(c),o=c}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},e(function(o,a,c){r.reason||(r.reason=new wt(o,a,c),n(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 n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new al(function(s){e=s}),cancel:e}}};function nd(t){return function(n){return t.apply(null,n)}}function id(t){return w.isObject(t)&&t.isAxiosError===!0}const Si={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,NetworkAuthenticationRequired:511};Object.entries(Si).forEach(([t,e])=>{Si[e]=t});function ms(t){const e=new lt(t),n=Ar(lt.prototype.request,e);return w.extend(n,lt.prototype,e,{allOwnKeys:!0}),w.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return ms(at(t,s))},n}const K=ms(Ht);K.Axios=lt,K.CanceledError=wt,K.CancelToken=td,K.isCancel=Qr,K.VERSION=hs,K.toFormData=wn,K.AxiosError=F,K.Cancel=K.CanceledError,K.all=function(e){return Promise.all(e)},K.spread=nd,K.isAxiosError=id,K.mergeConfig=at,K.AxiosHeaders=be,K.formToJSON=t=>Xr(w.isHTMLForm(t)?new FormData(t):t),K.getAdapter=ds.getAdapter,K.HttpStatusCode=Si,K.default=K;const{Axios:Pg,AxiosError:zg,CanceledError:Vg,isCancel:Tg,CancelToken:Fg,VERSION:Og,all:Dg,Cancel:Lg,isAxiosError:Hg,spread:qg,toFormData:Ug,AxiosHeaders:jg,HttpStatusCode:Wg,formToJSON:_g,getAdapter:Gg,mergeConfig:Zg}=K;var Ut=(t=>(t.GET="get",t.POST="post",t.PUT="put",t.DELETE="delete",t))(Ut||{});const jt=(()=>{function t(){const d=s();return!(!d||d==="undefined")}function e(d){d.accessToken&&localStorage.setItem("access_token",d.accessToken),d.refreshToken&&localStorage.setItem("refresh_token",d.refreshToken)}function n(){const d=localStorage.getItem("user");return d?JSON.parse(d).id:""}function r(){const d=localStorage.getItem("user");if(d)return JSON.parse(d)}function s(){return localStorage.getItem("access_token")}function o(){return localStorage.getItem("refresh_token")}function a(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}function c(d){if(!t())return;const u=jt.getUser();u&&(u.human=d,localStorage.setItem("user",JSON.stringify(u)))}return{isAuth:t,setTokens:e,getAccessToken:s,getRefreshToken:o,getUserId:n,clearTokens:a,getUser:r,updateHuman:c}})();class ki{constructor(e){l(this,"code",400);l(this,"err","");M.BuildClass(this,e)}getErr(){return this.capitalizedErr()}capitalizedErr(){return this.err.charAt(0).toUpperCase()+this.err.slice(1)}static async Handle(e,n){const r=e.config;if(e.response){if(e.response.status===401&&!r._retry)return r._retry=!0,n.defaults.headers.common.token=jt.getAccessToken(),e.config.headers.token=jt.getAccessToken(),e.config.baseURL=void 0,n.request(r);if(e.response.status>=500){if(e.response.data==="неверный логин или пароль"){ye.Error("Неверный логин или пароль");return}ye.Error("Ошибка на сервере, попробуйте позже")}if(e.response.status>=400&&e.response.status<500){const s=new ki(e.response.data).getErr();s&&ye.Error(s)}return Promise.reject(e)}}}const bt=K.create();bt.interceptors.response.use(t=>t,async t=>await ki.Handle(t,bt));class Wt{static async Get(e,n,r){return await bt({method:Ut.GET,url:e,headers:n,responseType:r})}static async Post(e,n,r,s){return n["Content-Type"]="multipart/form-data",await bt({method:Ut.POST,url:e,headers:n,responseType:r,data:s})}static async Put(e,n,r){return n["Content-Type"]="multipart/form-data",await bt({method:Ut.PUT,url:e,headers:n,data:r})}static async Delete(e,n){return await bt({method:Ut.DELETE,url:e,headers:n})}}class vn{constructor(e){l(this,"name","");M.BuildClass(this,e)}static Set(){}static Get(e,n){const r=sessionStorage.getItem(e);if(r){const s=JSON.parse(r),o=new Date,a=new Date(s.time),c=o.getTime()-a.getTime();return Math.round(c/6e4)>(n||10)?null:s.data}else return null}static async TryGet(e,n,r){let s;return s=vn.Get(e,r),s||(s=await n()),s}}var Ei=(t=>(t.ContentType="Content-Type",t.Token="token",t))(Ei||{}),ps=(t=>(t.ApplicationJson="application/json",t.MultipartFormData="multipart/form-data",t))(ps||{});const Z=class Z{static Setup(e="http://localhost",n="9000",r="api"){this.baseUrl=U.BuildSafeUrl(e,n,r),this.host=e,this.apiVersion=r}static newWebSocket(e){const n=this.host.replace("http","ws")+"/ws/"+e;return new WebSocket(n)}static download(e,n){const r=Z.getDownloadFileName(e,n.headers),s=URL.createObjectURL(n.data),o=document.createElement("a");o.href=s,o.setAttribute("download",r),o.setAttribute("target","_blank"),document.body.appendChild(o),o.click()}static getDownloadFileName(e,n){if(e)return e;const r=n["content-disposition"];if(!r)return"file";const s=r.indexOf('"')+1,o=r.lastIndexOf('"'),a=r.substring(s,o);return a||"file"}static getHeaders(e){const n=ze.Get(Re.AccessToken);return e||(e=Z.headers),n&&(e[Ei.Token]=n),e??Z.headers}static returnResponse(e,n){if(n)return e!=null&&e.isBlob?Z.download(e.downloadFileName,n):n.data}static async Get(e){return Z.returnResponse(e,await Wt.Get(Z.buildUrl((e==null?void 0:e.query)??""),Z.getHeaders(e==null?void 0:e.headers),Z.getResponseType(e==null?void 0:e.isBlob)))}static async Post(e){return Z.returnResponse(e,await Wt.Post(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers),Z.getResponseType(e.isBlob),Z.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Put(e){return Z.returnResponse(e,await Wt.Put(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers),Z.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Delete(e){return Z.returnResponse(e,await Wt.Delete(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers)))}static async Subscribe(e){const{query:n}=e;return new EventSource(Z.buildUrl(n))}static buildUrl(e=""){try{return si(this.baseUrl,e)}catch{throw new Error(`Invalid base URL: ${this.baseUrl}`)}}static getResponseType(e){return e?"blob":"json"}static createFormDataPayload(e,n){const r=new FormData;if(r.append("form",JSON.stringify(e)),n)for(const s of n)s.file&&r.append(s.id??"files",s.file,s.originalName);return r}};l(Z,"baseUrl",""),l(Z,"apiVersion","api"),l(Z,"host",""),l(Z,"headers",{[Ei.ContentType]:ps.ApplicationJson});let Q=Z;const E=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},rd={},sd={style:{"text-align":"center"}};function od(t,e){return i.openBlock(),i.createElementBlock("div",sd,e[0]||(e[0]=[i.createElementVNode("h1",null,"Страница не найдена",-1)]))}const xi=E(rd,[["render",od]]),ad=[{path:"/:pathMatch(.*)*",name:"NotFound",component:xi}],Me=class Me{static Setup(e,n=""){this.router=e,this.title=n,this.ChangeDocumentTitle(),this.AddRoutes(ad)}static Get(){return this.router}static AddRoutes(e){e.forEach(n=>{this.Get().addRoute(n)})}static async To(e){await this.Get().push(e)}static async ToHome(){}static async Replace(e){await this.Get().replace(e)}static Id(){return Me.GetStringParam("id")}static Slug(){return Me.GetStringParam("slug")}static async Back(){this.Get().go(-1)}static GetQid(){return Me.GetStringQueryParam("qid")}static Route(){var e;return(e=this.Get())==null?void 0:e.currentRoute.value}static RouterPushBlank(e){const n=this.Get().resolve({path:e});window.open(n==null?void 0:n.href,"_blank")}static GetPath(){var n;const e=(n=Me.Route())==null?void 0:n.path.split("/");return!e||e.length<=0?"":e[e.length-1]}static async ToAdmin(e){if(!e){await this.Get().push("/admin");return}let n=e;n[0]==="/"&&(n=e.substring(1)),await Me.To(`/admin/${n}`)}static GetStringQueryParam(e){return String(this.Route().query[e])}static GetNumberQueryParam(e){return Number(this.Route().query[e]??0)}static GetStringParam(e){var n;return(n=this.Route())==null?void 0:n.params[e]}static SetQueryParam(e,n){const r=new URL(window.location);r.searchParams.set(e,String(n)),history.replaceState(null,"",r)}static Resolve(e){return this.Get().resolve(e)}};l(Me,"router"),l(Me,"title",""),l(Me,"ChangeDocumentTitle",(e="")=>{let n=Me.Route().meta.title??e;n&&(n=" | "+n),document.title=Me.title+n});let Te=Me;class X{constructor(e,n){l(this,"items",i.reactive([]));l(this,"item");l(this,"options",i.reactive([]));l(this,"count",i.ref(0));l(this,"classConstructor");l(this,"url","");l(this,"searchStr",i.ref(""));this.classConstructor=e,this.item=i.reactive(new this.classConstructor),this.url=n}Set(e){Object.assign(this.item,new this.classConstructor(e))}getUrl(e){return e?`${this.url}/${e}`:this.url}async GetOptions(e="name",n="id"){const r=`${this.getUrl()}/options/${e}/${n}`,s=await Q.Get({query:r});s&&(this.options.splice(0,this.options.length),this.options.push(...s))}async GetAll(e){let n;const r=Q.Get;e&&e.withCache?n=await vn.TryGet(this.getUrl(),r):n=await r({query:this.getUrl()}),Array.isArray(n)?this.SetAll(n):this.SetAllWithCount(n)}async Get(e){e||(e=Te.Id()),this.Set(await Q.Get({query:this.getUrl(e)}))}async GetBySlug(e){e||(e=Te.Slug()),this.Set(await B.H.HttpClient.Get({query:this.getUrl("by-slug/"+e)}))}async FTSP(e){var a;const r=((e==null?void 0:e.ftsp)??je.Get()).clearForHTTP(),s={payload:{ftsp:r},query:this.getUrl("ftsp")},o=await Q.Post(s);if(!(!o||!o.ftsp))if(Array.isArray(o.data))this.SetAll(o.data);else{if(r.p.append){this.AppendToAll((a=o.data)==null?void 0:a.items);return}this.SetAllWithCount(o.data)}}async Create(e){const n=e??this.item,r={payload:n,query:this.getUrl()};return n.getFileInfos&&(r.fileInfos=n.getFileInfos()),await Q.Post(r)}async CreateAndSet(e){const n=await this.Create(e);this.Set(n)}async CreateMany(e){if(!e)return;const n=[];e.forEach(r=>{n.push(new Promise(()=>this.Create(r)))}),Promise.all(n)}async Update(e){const n=e??this.item,r={query:this.getUrl(`${n.id}`),payload:n};return n.getFileInfos&&(r.fileInfos=n.getFileInfos(),r.fileInfos.forEach(s=>s.url="")),await Q.Put(r)}async UpdateAndSet(e){const n=await this.Update(e);this.Set(n)}async UpdateAndReset(e){await this.Update(e??this.item),this.Set()}async Remove(e){if(!e){console.warn("BaseStore/Remove. id is undefined");return}await Q.Delete({query:this.getUrl(`${e}`)}),this.RemoveItem(e)}async UpdateMany(e){if(e||(e=this.items),!e)return;const n=[];e.forEach(r=>{n.push(new Promise(()=>this.Update(r)))}),Promise.all(n)}SetAll(e){e&&(this.items.splice(0,this.items.length),this.items.push(...e.map(n=>new this.classConstructor(n))))}SetAllWithCount(e){e&&(this.SetAll(e.items),this.count.value=e.count)}RemoveItem(e){const n=this.items.findIndex(r=>r.id===e);this.items.splice(n,1)}AppendToAll(e){if(e){if(Array.isArray(e)){const n=e.map(r=>new this.classConstructor(r));this.items.push(...n);return}this.items.push(new this.classConstructor(e))}}ResetState(){this.ResetItem(),this.ClearItems(),this.count.value=0}ResetItem(){M.BuildClass(this.item,new this.classConstructor)}ClearItems(){this.items.splice(0,this.items.length)}UnshiftToAll(e){if(e){if(Array.isArray(e)){const n=e.map(r=>new this.classConstructor(r));this.items.unshift(...n);return}this.items.unshift(new this.classConstructor(e))}}get Items(){return this.items}get ItemsFiltered(){return this.searchStr.value.trim()?this.Items.filter(e=>B.H.Strings.SearchInFields(this.searchStr.value,e.SearchFields())):this.Items}get Options(){return this.options}get Item(){return this.item}get Count(){return this.count}get SearchStr(){return this.searchStr}}function ld(t,e){t=="left"&&e.next(),t=="right"&&e.prev()}const cd=["#31af5e","#ff4d3b","#006BB5","#f3911c"];class dd{static GetRandColor(e){return Ue.GetRandEL(e??cd)}}function gs(t,e){const n=[],r=e||Ee.Asc,s=r===Ee.Asc?Ee.Desc:Ee.Asc;return Object.values(t).forEach(o=>{n.push(o(r)),n.push(o(s))}),n.length>0&&!n.some(o=>o.default)&&(n[0].default=!0),e&&n.forEach(o=>{o.default&&(o.default=o.order===e)}),n}let ud=class{constructor(){l(this,"startHour",9);l(this,"endHour",19);l(this,"timelinePxHeight",50);l(this,"timelineStep",zt.FiveMinutes);l(this,"activeTime","");l(this,"activeObjectId","");l(this,"dragged",!1);l(this,"draggedStartTime","");l(this,"draggedEndTime","");l(this,"timelines",on[zt.FiveMinutes])}startDrag(e,n){this.draggedStartTime=e,this.draggedEndTime=n,this.dragged=!0}endDrag(){this.activeTime="",this.dragged=!1}setTimelineStep(e){this.timelineStep=e,this.setTimelines()}setTimelines(){this.timelines=on[this.timelineStep]}getScheduleHeight(){return this.getHourHeight()*this.getHoursArr().length}getHourHeight(){return this.timelinePxHeight*this.timelines.length}getHoursArr(){return Ue.GenerateNumsRange(this.startHour,this.endHour)}};const vi=t=>t===8||t===46,hd=t=>t>46&&t<58,fd=t=>t>34&&t<41,md=t=>t+".",pd=(t,e,n)=>{vi(e)||fd(e)||(!hd(e)||n>9)&&t.preventDefault()};function gd(t,e){if(e>8){let n=t.substring(0,2).replace(".","1");Number(n)>31&&(n="31");let r=t.substring(3,5).replace(".","1");Number(r)>12&&(r="12");let s=t.substring(6,10).replace(".","1");Number(s)>2100&&(s="2100"),t=n+"."+r+"."+s}return t}function yd(t){const e=t.keyCode;let n=t.srcElement.value;const r=n.length;pd(t,e,r),!vi(e)&&(r===2||r===5)&&(n=md(n));const s=t.srcElement.value+String.fromCharCode(t.which);if(vi(e)){t.srcElement.value=n;return}n.length===0&&Number(s)>3&&(n="3",t.preventDefault()),n.length===1&&Number(s)>31&&(n="31",t.preventDefault()),s.length===5&&Number(s.substring(3,5))>12&&(n=n.substring(0,3)+"12",t.preventDefault()),n=gd(n,r),t.srcElement.value=n}const wd=["ВС","ПН","ВТ","СР","ЧТ","ПТ","СБ"],bd="ru-RU";class Fe{constructor(){l(this,"locale","ru-RU")}static Format(e,n){if(!e)return"";const r={year:"numeric",month:"2-digit",day:"2-digit",hour:void 0,minute:void 0};return n&&(r.year=n.year||n.year===void 0?n.year:r.year,r.month=n.month||n.month===void 0?n.month:r.month,r.day=n.day||n.day===void 0?n.day:r.day,r.hour=n.hour??r.hour,r.minute=n.minute??r.minute),Intl.DateTimeFormat(bd,r).format(new Date(e))}static FormatWithTime(e){return Fe.Format(e,{month:"2-digit",day:"2-digit",year:"numeric",hour:"numeric",minute:"numeric"})}static FromRuStr(e){const n=e.split(".");return new Date(`${n[2]}-${n[1]}-${n[0]}`)}static GetPeriod(e,n,r){return`${this.Format(e,r)}-${this.Format(n,r)}`}static GetShortDayName(e){return e?wd[e.getDay()]:""}static GetCurrentWeekPeriod(e){const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()-n.getDay()+1),s=new Date(n.getFullYear(),n.getMonth(),r.getDate()+7);return this.GetPeriod(r,s,e||{month:"2-digit",day:"numeric",year:void 0})}static GetDurationInDay(e,n){const r=new Date,s=new Date,o=Fe.SplitHourTime(e),a=Fe.SplitHourTime(n);return r.setHours(o[0],o[1],0,0),s.setHours(a[0],a[1],0,0),(s.getTime()-r.getTime())/1e3/60}static HourTimeinMunutes(e){const n=Fe.SplitHourTime(e);return n[0]*60+n[1]}static SplitHourTime(e){const n=e.split(":");return[Number(n[0]),Number(n[1])]}static AddMinutesToHM(e,n){const r=new Date,s=Fe.SplitHourTime(e);r.setHours(s[0],s[1],0,0);const o=new Date(r.getTime()+n*6e4),a=o.getHours(),c=o.getMinutes();return`${a}:${c}`}static GetMonthsDiff(e,n){return n.getMonth()-e.getMonth()+12*(n.getFullYear()-e.getFullYear())}static StringToDate(e){const n=e.split(".");return new Date(`${n[2]}-${n[1]}-${n[0]}`)}static GetDateOrToday(e){return e?e.date:new Date}static InPeriod(e,n,r){return new Date(e)>=new Date(n)&&new Date(e)<=new Date(r)}static GetDatesFromPeriod(e,n){const r=[new Date(e)];let s=e;for(;s<=n;)s=Fe.AddDays(s,1),r.push(s);return r}static AddDays(e,n){const r=new Date(e);return r.setDate(r.getDate()+n),r}static Eq(e,n){return e.getTime()===n.getTime()}}class Cd{constructor(){l(this,"dragged",!1);l(this,"dragImg",new Image);this.dragImg.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="}start(e){this.dragged=!0,e&&e.dataTransfer&&e.dataTransfer.setDragImage(this.dragImg,0,0)}end(){this.dragged=!1}isDragged(){return this.dragged}}class ys{static Get(e){const n=e.split(".");return n[n.length-1]}}const Sd=(()=>{function t(o,a){localStorage.setItem(`${o}_favourite`,a.toString())}function e(o,a){const c=localStorage.getItem(`${o}_favourite`);return c?c.split(",").includes(a):!1}function n(o,a){const c=localStorage.getItem(`${o}_favourite`);if(!c){t(o,[a]);return}const d=c.split(",");d.push(a),t(o,d)}function r(o,a){const c=localStorage.getItem(`${o}_favourite`);if(!c)return;const d=c.split(",").filter(u=>u!==a);t(o,d)}function s(){for(const o in localStorage)o.includes("_favourite")&&localStorage.removeItem(o)}return{addToFavourite:n,removeFromFavourite:r,setFavourite:t,isFavourite:e,clearFavourite:s}})();/*!
20
20
  * vue-router v4.5.1
21
21
  * (c) 2025 Eduardo San Martin Morote
22
22
  * @license MIT
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "sprof",
3
3
  "description": "components for the designer and uikit.",
4
4
  "author": "Stanislav Lushnikov, Daniil Gaivoronskiy",
5
- "version": "0.1.25",
5
+ "version": "0.1.26",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "./dist/sprof.umd.cjs",