PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.5.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.5.0
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
fluent-booking / assets / admin / fluent-booking-team-management-index.js

fluent-booking-team-management-index.js in Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution 2.5.0, at assets/admin/fluent-booking-team-management-index.js

14 lines 16.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function(){"use strict";function re(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O={exports:{}},s={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var S=Symbol.for("react.element"),le=Symbol.for("react.portal"),oe=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),ce=Symbol.for("react.provider"),ie=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),me=Symbol.for("react.suspense"),pe=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),F=Symbol.iterator;function de(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,B={};function C(e,t,n){this.props=e,this.context=t,this.refs=B,this.updater=n||M}C.prototype.isReactComponent={},C.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},C.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function U(){}U.prototype=C.prototype;function $(e,t,n){this.props=e,this.context=t,this.refs=B,this.updater=n||M}var I=$.prototype=new U;I.constructor=$,T(I,C.prototype),I.isPureReactComponent=!0;var D=Array.isArray,Z=Object.prototype.hasOwnProperty,L={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function G(e,t,n){var r,l={},a=null,u=null;if(t!=null)for(r in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(a=""+t.key),t)Z.call(t,r)&&!q.hasOwnProperty(r)&&(l[r]=t[r]);var m=arguments.length-2;if(m===1)l.children=n;else if(1<m){for(var c=Array(m),v=0;v<m;v++)c[v]=arguments[v+2];l.children=c}if(e&&e.defaultProps)for(r in m=e.defaultProps,m)l[r]===void 0&&(l[r]=m[r]);return{$$typeof:S,type:e,key:a,ref:u,props:l,_owner:L.current}}function we(e,t){return{$$typeof:S,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function P(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function he(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var z=/\/+/g;function j(e,t){return typeof e=="object"&&e!==null&&e.key!=null?he(""+e.key):t.toString(36)}function N(e,t,n,r,l){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var u=!1;if(e===null)u=!0;else switch(a){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case S:case le:u=!0}}if(u)return u=e,l=l(u),e=r===""?"."+j(u,0):r,D(l)?(n="",e!=null&&(n=e.replace(z,"$&/")+"/"),N(l,t,n,"",function(v){return v})):l!=null&&(P(l)&&(l=we(l,n+(!l.key||u&&u.key===l.key?"":(""+l.key).replace(z,"$&/")+"/")+e)),t.push(l)),1;if(u=0,r=r===""?".":r+":",D(e))for(var m=0;m<e.length;m++){a=e[m];var c=r+j(a,m);u+=N(a,t,n,c,l)}else if(c=de(e),typeof c=="function")for(e=c.call(e),m=0;!(a=e.next()).done;)a=a.value,c=r+j(a,m++),u+=N(a,t,n,c,l);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function R(e,t,n){if(e==null)return e;var r=[],l=0;return N(e,r,"","",function(a){return t.call(n,a,l++)}),r}function ve(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var f={current:null},V={transition:null},_e={ReactCurrentDispatcher:f,ReactCurrentBatchConfig:V,ReactCurrentOwner:L};s.Children={map:R,forEach:function(e,t,n){R(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return R(e,function(){t++}),t},toArray:function(e){return R(e,function(t){return t})||[]},only:function(e){if(!P(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},s.Component=C,s.Fragment=oe,s.Profiler=se,s.PureComponent=$,s.StrictMode=ae,s.Suspense=me,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_e,s.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=T({},e.props),l=e.key,a=e.ref,u=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,u=L.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var m=e.type.defaultProps;for(c in t)Z.call(t,c)&&!q.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&m!==void 0?m[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){m=Array(c);for(var v=0;v<c;v++)m[v]=arguments[v+2];r.children=m}return{$$typeof:S,type:e.type,key:l,ref:a,props:r,_owner:u}},s.createContext=function(e){return e={$$typeof:ie,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ce,_context:e},e.Consumer=e},s.createElement=G,s.createFactory=function(e){var t=G.bind(null,e);return t.type=e,t},s.createRef=function(){return{current:null}},s.forwardRef=function(e){return{$$typeof:ue,render:e}},s.isValidElement=P,s.lazy=function(e){return{$$typeof:fe,_payload:{_status:-1,_result:e},_init:ve}},s.memo=function(e,t){return{$$typeof:pe,type:e,compare:t===void 0?null:t}},s.startTransition=function(e){var t=V.transition;V.transition={};try{e()}finally{V.transition=t}},s.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},s.useCallback=function(e,t){return f.current.useCallback(e,t)},s.useContext=function(e){return f.current.useContext(e)},s.useDebugValue=function(){},s.useDeferredValue=function(e){return f.current.useDeferredValue(e)},s.useEffect=function(e,t){return f.current.useEffect(e,t)},s.useId=function(){return f.current.useId()},s.useImperativeHandle=function(e,t,n){return f.current.useImperativeHandle(e,t,n)},s.useInsertionEffect=function(e,t){return f.current.useInsertionEffect(e,t)},s.useLayoutEffect=function(e,t){return f.current.useLayoutEffect(e,t)},s.useMemo=function(e,t){return f.current.useMemo(e,t)},s.useReducer=function(e,t,n){return f.current.useReducer(e,t,n)},s.useRef=function(e){return f.current.useRef(e)},s.useState=function(e){return f.current.useState(e)},s.useSyncExternalStore=function(e,t,n){return f.current.useSyncExternalStore(e,t,n)},s.useTransition=function(){return f.current.useTransition()},s.version="18.2.0",O.exports=s;var H=O.exports,Q={exports:{}};/*!
10 Copyright (c) 2018 Jed Watson.
11 Licensed under the MIT License (MIT), see
12 http://jedwatson.github.io/classnames
13 */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],l=0;l<arguments.length;l++){var a=arguments[l];if(a){var u=typeof a;if(u==="string"||u==="number")r.push(a);else if(Array.isArray(a)){if(a.length){var m=n.apply(null,a);m&&r.push(m)}}else if(u==="object"){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){r.push(a.toString());continue}for(var c in a)t.call(a,c)&&a[c]&&r.push(c)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Q);var ye=Q.exports;const Ee=re(ye),ge=e=>H.createElement("path",e),W=H.forwardRef(({className:e,isPressed:t,...n},r)=>{const l={...n,className:Ee(e,{"is-pressed":t})||void 0,"aria-hidden":!0,focusable:!1};return H.createElement("svg",{...l,ref:r})});W.displayName="SVG";const be=H.createElement(W,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},H.createElement(ge,{d:"M2 12C2 6.44444 6.44444 2 12 2C17.5556 2 22 6.44444 22 12C22 17.5556 17.5556 22 12 22C6.44444 22 2 17.5556 2 12ZM13 11V7H11V11H7V13H11V17H13V13H17V11H13Z"})),{InspectorControls:ke,MediaUpload:Ce}=wp.blockEditor,{__:E}=wp.i18n,{PanelBody:Y,PanelRow:J,DropdownMenu:Se,CheckboxControl:K}=wp.components,g=window.fluent_booking_block.hosts,X=Object.values(g),He=e=>{const{attributes:{headerImage:t,calendarHosts:n},setAttributes:r}=e;let l=[{label:E("Select Host"),value:""}];X.map(o=>{l.push({label:o.title,value:o.id,author:o==null?void 0:o.author})});let a=[];n.length&&n.map(o=>{a.push(o.id),l=l.filter(i=>i.value!=o.id)});const u=(o,i)=>{let d=o.value,p=!1,w=n;for(let h of n)h.id==d&&(p=!0);n.length?p||w.push({id:d,events:["all"]}):w=[{id:d,events:["all"]}],r({selectedHost:d}),r({calendarHosts:w}),i()};function m(o){for(let i=0;i<n.length;i++)if(n[i].id==o.target.value){let p=n;p.splice(i,1),r({calendarHosts:[...p]});break}}const c=(o,i,d)=>{let p=!1;if(o!="all")for(let w of n)w.events&&w.events.forEach(h=>{h==o.id&&(p=!0)});return p},v=(o,i,d)=>{for(let p=0;p<n.length;p++){let w=n[p];if(w.id==i)return w.events=="all"}return!1};function ne(){r({headerImage:{}})}return wp.element.createElement(ke,null,wp.element.createElement(Y,{title:E("Header Settings"),initialOpen:!0},wp.element.createElement(J,null,wp.element.createElement("div",{className:"fcal_block_settings"},wp.element.createElement("div",{className:"fcal_block_inspector_widget fcal_block_media"},wp.element.createElement(Ce,{onSelect:o=>{r({headerImage:{title:o.title,filename:o.filename,url:o.url}})},multiple:!1,render:({open:o})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("button",{onClick:o},t.url?E("Change Image"):E("Upload Image")),wp.element.createElement("p",{className:"fcal-render-image"},t.url?wp.element.createElement("button",{className:"fcal-remove-image",onClick:()=>{ne()}},"+"):"",t===null?"":wp.element.createElement("img",{src:t.url,alt:t.title})))}))))),wp.element.createElement(Y,{title:"General Settings",initialOpen:!0},wp.element.createElement(J,null,wp.element.createElement("div",{className:"fcal_block_settings"},wp.element.createElement("div",{className:"fcal_block_inspector_widget fcal_inspector_host_select"},wp.element.createElement(Se,{className:"fcal-add-host-container",icon:be,text:E("Add Host to Team"),label:E("+ Add Host to Team")},({onClose:o})=>wp.element.createElement("div",{className:"fcal-add-host-content"},X.length?l.map((i,d)=>{var p;return wp.element.createElement("div",{key:d,className:"fcal-host-list"},l.length&&l.length>1?i.value?wp.element.createElement("button",{value:i.value,onClick:()=>{u(i,o)}},wp.element.createElement("img",{src:(p=i==null?void 0:i.author)==null?void 0:p.avatar,alt:i.label}),i.label):wp.element.createElement("span",{className:"select-host"},i.label):wp.element.createElement("div",null,wp.element.createElement("span",{className:"select-host"},i.label),wp.element.createElement("p",null,wp.element.createElement("b",null,E("You have added all hosts!")))))}):wp.element.createElement("span",{className:"select-host"},E("No Hosts Found!")))),wp.element.createElement("ul",{className:"accordion-list"},n.length?n.map((o,i)=>{var d,p,w;return wp.element.createElement("div",{key:i},wp.element.createElement("h3",null,wp.element.createElement("img",{src:(p=(d=g[o.id])==null?void 0:d.author)==null?void 0:p.avatar,alt:g[o.id].title}),g[o.id].title,wp.element.createElement("button",{className:"remove-host",value:g[o.id].id,onClick:m},"+")),wp.element.createElement(K,{className:"all-event-checked",label:E("All Events"),value:"all",checked:v(i,g[o.id].id),onChange:h=>{let b=n,_=null;for(let y=0;y<n.length;y++)if(n[y].id==g[o.id].id){_=y;break}_!=null&&(h?b[_].events=["all"]:b[_].events=[],r({calendarHosts:[...b]}))}}),o.events!="all"?(w=g[o.id])==null?void 0:w.events.map(h=>wp.element.createElement("div",{key:"event-"+h.id,className:"fcal_calendar_event"},wp.element.createElement(K,{label:h.title,value:h.id,checked:c(h),onChange:b=>{let _=n;b?_=n.map(y=>(o.id==y.id&&y.events.push(h.id),y)):_=n.map(y=>({...y,events:y.events.filter(Ae=>Ae!=h.id)})),r({calendarHosts:[..._]})}}))):"")}):""))))),wp.element.createElement("div",{className:"fluent-latest-posts-content-color-settings"}))},{Fragment:Ne,useState:ee}=wp.element,{RichText:te}=wp.blockEditor,{__:A}=wp.i18n,Re=window.fluent_booking_block.assets_url,x=window.fluent_booking_block.hosts,Ve=e=>{let{attributes:{title:t,description:n,headerImage:r,calendarHosts:l},setAttributes:a}=e;const[u,m]=ee(!1),[c,v]=ee(!1);wp.apiFetch;const{addQueryArgs:ne}=wp.url;return[wp.element.createElement(Ne,null,wp.element.createElement("div",{className:"fcal_team_management_block_wrap"},wp.element.createElement("div",{className:"fcal_team_management_block_header"},r.url!=""?wp.element.createElement("img",{src:r.url,alt:r.title}):wp.element.createElement("img",{src:Re+"/images/logo.svg",alt:"Logo"}),wp.element.createElement(te,{className:t?"":"empty-text",tagName:"h1",value:t,allowedFormats:["core/bold","core/italic","core/link","core/text-color"],onChange:o=>a({title:o}),placeholder:A("Enter title here...")}),wp.element.createElement(te,{className:n?"":"empty-text",tagName:"p",value:n,allowedFormats:["core/bold","core/italic","core/link","core/text-color"],onChange:o=>a({description:o}),placeholder:A("Enter description here...")})),l&&l.length?wp.element.createElement("div",{className:"fcal_team_management_block_hosts"},l.map((o,i)=>{var d,p,w,h,b,_;return wp.element.createElement("div",{key:i,className:"fcal_team_management_block_host"},wp.element.createElement("img",{src:(p=(d=x[o.id])==null?void 0:d.author)==null?void 0:p.avatar,alt:""}),wp.element.createElement("h3",null,(h=(w=x[o.id])==null?void 0:w.author)==null?void 0:h.name),((b=x[o.id])==null?void 0:b.description)!=""?wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:(_=x[o.id])==null?void 0:_.description}}):"")})):wp.element.createElement("div",{className:"fcal_team_management_block_hosts"},wp.element.createElement("p",null,A("Please select team member from block settings")))))]},{Fragment:xe}=wp.element,{useBlockProps:$e}=wp.blockEditor,Ie=e=>{const t=$e({className:"fluent-booking-block"});return wp.element.createElement(xe,null,wp.element.createElement("div",{...t},wp.element.createElement(Ve,{attributes:e.attributes,setAttributes:e.setAttributes})),wp.element.createElement(He,{attributes:e.attributes,setAttributes:e.setAttributes}))},{__:Oe}=wp.i18n,Le={title:{type:"string",default:"",role:"content"},description:{type:"string",default:"",role:"content"},headerImage:{type:"object",default:{}},calendarHosts:{type:"array",default:[]}},{__:k}=wp.i18n,{registerBlockType:Pe}=wp.blocks;Pe("fluent-booking/team-management",{apiVersion:3,title:k("FluentBooking Team"),description:k("FluentBooking team"),category:"layout",icon:{src:wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"32",viewBox:"0 0 30 32",fill:"none"},wp.element.createElement("g",{clipPath:"url(#clip0_1688_2013)"},wp.element.createElement("path",{d:"M10.1203 1.01286C10.1203 0.453471 9.66787 0 9.10977 0C8.55167 0 8.09924 0.453471 8.09924 1.01286V4.05141C8.09924 4.6108 8.55167 5.06427 9.10977 5.06427C9.66787 5.06427 10.1203 4.6108 10.1203 4.05141V1.01286Z",fill:"#2653C7"}),wp.element.createElement("path",{d:"M22.2466 1.01286C22.2466 0.453471 21.7942 0 21.2361 0C20.678 0 20.2256 0.453471 20.2256 1.01286V4.05141C20.2256 4.6108 20.678 5.06427 21.2361 5.06427C21.7942 5.06427 22.2466 4.6108 22.2466 4.05141V1.01286Z",fill:"#2653C7"}),wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.3622 16.8131C17.2566 17.6376 16.9154 18.3876 16.4061 18.992C15.8715 19.6303 15.152 20.1068 14.3302 20.3405L14.2947 20.3506L14.2145 20.3718L14.2078 20.3735L7.84399 22.0834V20.6003C7.84399 20.5673 7.84399 20.5343 7.84738 20.5013C7.88455 19.8808 8.27389 19.3543 8.81778 19.1215C8.87942 19.0944 8.94277 19.0716 9.00865 19.0538L9.06861 19.0377L17.3613 16.8105V16.8131H17.3622Z",fill:"#2653C7"}),wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.503 11.3442C22.2868 13.0363 21.0731 14.4161 19.471 14.8716L19.4355 14.8817L19.3562 14.9029H19.3553L19.3486 14.9046L7.84399 17.9943V16.5113C7.84399 15.8476 8.24516 15.2779 8.81778 15.0324L9.00865 14.9647L9.06776 14.9486L22.5021 11.3408V11.3442H22.503Z",fill:"#2653C7"}),wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.33094 3.54525H24.0152C26.3871 3.54525 28.3099 5.4725 28.3099 7.84988V22.1785H30.331V7.84988C30.331 4.35371 27.5033 1.51953 24.0152 1.51953H6.33094C2.84281 1.51953 0.0151367 4.35371 0.0151367 7.84988V25.5748C0.0151367 29.071 2.84281 31.9052 6.33094 31.9052H20.5468V29.8795H6.33094C3.95902 29.8795 2.03619 27.9522 2.03619 25.5748V7.84988C2.03619 5.4725 3.95902 3.54525 6.33094 3.54525Z",fill:"#2653C7"}),wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.346 22.415V22.083H20.5468V31.9048H20.8779L30.346 22.415Z",fill:"#2653C7"})),wp.element.createElement("defs",null,wp.element.createElement("clipPath",{id:"clip0_1688_2013"},wp.element.createElement("rect",{width:"159",height:"32",fill:"white"}))))},keywords:[k("fluent"),k("fluent booking"),k("calendar"),k("booking"),k("team")],supports:{align:["wide","full"],html:!0},attributes:Le,edit:Ie})})();
14