(()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>G});var l={};e.r(l),e.d(l,{getDownloadableBlocks:()=>k,getErrorNoticeForBlock:()=>h,getErrorNotices:()=>y,getInstalledBlockTypes:()=>g,getNewBlockTypes:()=>_,getUnusedBlockTypes:()=>w,isInstalling:()=>E,isRequestingDownloadableBlocks:()=>b});var n={};e.r(n),e.d(n,{addInstalledBlockType:()=>D,clearErrorNotice:()=>x,fetchDownloadableBlocks:()=>S,installBlockType:()=>O,receiveDownloadableBlocks:()=>C,removeInstalledBlockType:()=>R,setErrorNotice:()=>M,setIsInstalling:()=>P,uninstallBlockType:()=>A});var o={};e.r(o),e.d(o,{getDownloadableBlocks:()=>Y});const r=window.wp.element,a=window.wp.plugins,s=window.wp.hooks,c=window.wp.blocks,i=window.wp.data,d=window.wp.editor,u=(0,i.combineReducers)({downloadableBlocks:(e={},t)=>{switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:(e={installedBlockTypes:[],isInstalling:{}},t)=>{switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter((e=>e.name!==t.item.name))};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:(e={},t)=>{switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":const{[t.blockId]:l,...n}=e;return n}return e}}),m=window.wp.blockEditor;function p(e,t=[]){if(!t.length)return!1;if(t.some((({name:t})=>t===e.name)))return!0;for(let l=0;lt=>{const l=e(m.store).getBlocks();return g(t).filter((e=>p(e,l)))})),w=(0,i.createRegistrySelector)((e=>t=>{const l=e(m.store).getBlocks();return g(t).filter((e=>!p(e,l)))}));function E(e,t){return e.blockManagement.isInstalling[t]||!1}function y(e){return e.errorNotices}function h(e,t){return e.errorNotices[t]}const f=window.wp.i18n,v=window.wp.apiFetch;var B=e.n(v);const I=window.wp.notices,N=window.wp.url,T=e=>new Promise(((t,l)=>{const n=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach((t=>{e[t]&&(n[t]=e[t])})),e.innerHTML&&n.appendChild(document.createTextNode(e.innerHTML)),n.onload=()=>t(!0),n.onerror=()=>l(new Error("Error loading asset.")),document.body.appendChild(n),("link"===n.nodeName.toLowerCase()||"script"===n.nodeName.toLowerCase()&&!n.src)&&t()}));function L(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function S(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function C(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const O=e=>async({registry:t,dispatch:l})=>{const{id:n,name:o}=e;let r=!1;l.clearErrorNotice(n);try{l.setIsInstalling(n,!0);const a=L(e);let s={};a?await B()({method:"PUT",url:a,data:{status:"active"}}):s=(await B()({method:"POST",path:"wp/v2/plugins",data:{slug:n,status:"active"}}))._links,l.addInstalledBlockType({...e,links:{...e.links,...s}});const i=["api_version","title","category","parent","icon","description","keywords","attributes","provides_context","uses_context","supports","styles","example","variations"];if(await B()({path:(0,N.addQueryArgs)(`/wp/v2/block-types/${o}`,{_fields:i})}).catch((()=>{})).then((e=>{e&&(0,c.unstable__bootstrapServerSideBlockDefinitions)({[o]:Object.fromEntries(Object.entries(e).filter((([e])=>i.includes(e))))})})),await async function(){const e=await B()({url:document.location.href,parse:!1}),t=await e.text(),l=(new window.DOMParser).parseFromString(t,"text/html"),n=Array.from(l.querySelectorAll('link[rel="stylesheet"],script')).filter((e=>e.id&&!document.getElementById(e.id)));for(const e of n)await T(e)}(),!t.select(c.store).getBlockTypes().some((e=>e.name===o)))throw new Error((0,f.__)("Error registering block. Try reloading the page."));t.dispatch(I.store).createInfoNotice((0,f.sprintf)(// translators: %s is the block title. (0,f.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),r=!0}catch(e){let o=e.message||(0,f.__)("An error occurred."),r=e instanceof Error;const a={folder_exists:(0,f.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,f.__)("Error installing block. You can reload the page and try again.")};a[e.code]&&(r=!0,o=a[e.code]),l.setErrorNotice(n,o,r),t.dispatch(I.store).createErrorNotice(o,{speak:!0,isDismissible:!0})}return l.setIsInstalling(n,!1),r},A=e=>async({registry:t,dispatch:l})=>{try{const t=L(e);await B()({method:"PUT",url:t,data:{status:"inactive"}}),await B()({method:"DELETE",url:t}),l.removeInstalledBlockType(e)}catch(e){t.dispatch(I.store).createErrorNotice(e.message||(0,f.__)("An error occurred."))}};function D(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function R(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function P(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function M(e,t,l=!1){return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:l}}function x(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var F=function(){return F=Object.assign||function(e){for(var t,l=1,n=arguments.length;l0&&l>="0"&&l<="9"?"_"+l+n:""+l.toUpperCase()+n}function K(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var l=t.splitRegexp,n=void 0===l?H:l,o=t.stripRegexp,r=void 0===o?$:o,a=t.transform,s=void 0===a?V:a,c=t.delimiter,i=void 0===c?" ":c,d=j(j(e,n,"$1\0$2"),r,"\0"),u=0,m=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(m-1);)m--;return d.slice(u,m).split("\0").map(s).join(i)}(e,F({delimiter:"",transform:z},t))}function U(e,t){return 0===t?e.toLowerCase():z(e,t)}const Y=e=>async({dispatch:t})=>{if(e)try{t(S(e));t(C((await B()({path:`wp/v2/block-directory/search?term=${e}`})).map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>{return[(l=e,void 0===n&&(n={}),K(l,F({transform:U},n))),t];var l,n}))))),e))}catch{}},q={reducer:u,selectors:l,actions:n,resolvers:o},G=(0,i.createReduxStore)("core/block-directory",q);function W(){const{uninstallBlockType:e}=(0,i.useDispatch)(G),t=(0,i.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:l}=e(d.store);return l()&&!t()}),[]),l=(0,i.useSelect)((e=>e(G).getUnusedBlockTypes()),[]);return(0,r.useEffect)((()=>{t&&l.length&&l.forEach((t=>{e(t),(0,c.unregisterBlockType)(t.name)}))}),[t]),null}(0,i.register)(G);const Z=window.wp.compose,Q=window.wp.components,J=window.wp.coreData,X=window.wp.htmlEntities,ee=function({icon:e,size:t=24,...l}){return(0,r.cloneElement)(e,{width:t,height:t,...l})},te=window.wp.primitives,le=(0,r.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(te.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})),ne=(0,r.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(te.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})),oe=(0,r.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(te.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),re=function({rating:e}){const t=.5*Math.round(e/.5),l=Math.floor(e),n=Math.ceil(e-l),o=5-(l+n);return(0,r.createElement)("span",{"aria-label":(0,f.sprintf)( /* translators: %s: number of stars. */ (0,f.__)("%s out of 5 stars"),t)},Array.from({length:l}).map(((e,t)=>(0,r.createElement)(ee,{key:`full_stars_${t}`,className:"block-directory-block-ratings__star-full",icon:le,size:16}))),Array.from({length:n}).map(((e,t)=>(0,r.createElement)(ee,{key:`half_stars_${t}`,className:"block-directory-block-ratings__star-half-full",icon:ne,size:16}))),Array.from({length:o}).map(((e,t)=>(0,r.createElement)(ee,{key:`empty_stars_${t}`,className:"block-directory-block-ratings__star-empty",icon:oe,size:16}))))},ae=({rating:e})=>(0,r.createElement)("span",{className:"block-directory-block-ratings"},(0,r.createElement)(re,{rating:e})),se=function({icon:e}){const t="block-directory-downloadable-block-icon";return null!==e.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,r.createElement)("img",{className:t,src:e,alt:""}):(0,r.createElement)(m.BlockIcon,{className:t,icon:e,showColors:!0})},ce=({block:e})=>{const t=(0,i.useSelect)((t=>t(G).getErrorNoticeForBlock(e.id)),[e]);return t?(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice"},(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},t.message,t.isFatal?" "+(0,f.__)("Try reloading the page."):null)):null};function ie({title:e,rating:t,ratingCount:l},{hasNotice:n,isInstalled:o,isInstalling:r}){const a=.5*Math.round(t/.5);return!o&&n?(0,f.sprintf)("Retry installing %s.",(0,X.decodeEntities)(e)):o?(0,f.sprintf)("Add %s.",(0,X.decodeEntities)(e)):r?(0,f.sprintf)("Installing %s.",(0,X.decodeEntities)(e)):l<1?(0,f.sprintf)("Install %s.",(0,X.decodeEntities)(e)):(0,f.sprintf)( /* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */ (0,f._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",l),(0,X.decodeEntities)(e),a,l)}const de=function({composite:e,item:t,onClick:l}){const{author:n,description:o,icon:a,rating:s,title:d}=t,u=!!(0,c.getBlockType)(t.name),{hasNotice:m,isInstalling:p,isInstallable:b}=(0,i.useSelect)((e=>{const{getErrorNoticeForBlock:l,isInstalling:n}=e(G),o=l(t.id),r=o&&o.isFatal;return{hasNotice:!!o,isInstalling:n(t.id),isInstallable:!r}}),[t]);let k="";return u?k=(0,f.__)("Installed!"):p&&(k=(0,f.__)("Installing…")),(0,r.createElement)(Q.__unstableCompositeItem,{__experimentalIsFocusable:!0,role:"option",as:Q.Button,...e,className:"block-directory-downloadable-block-list-item",onClick:e=>{e.preventDefault(),l()},isBusy:p,disabled:p||!b,label:ie(t,{hasNotice:m,isInstalled:u,isInstalling:p}),showTooltip:!0,tooltipPosition:"top center"},(0,r.createElement)("div",{className:"block-directory-downloadable-block-list-item__icon"},(0,r.createElement)(se,{icon:a,title:d}),p?(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__spinner"},(0,r.createElement)(Q.Spinner,null)):(0,r.createElement)(ae,{rating:s})),(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__details"},(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__title"},(0,r.createInterpolateElement)((0,f.sprintf)( /* translators: %1$s: block title, %2$s: author name. */ (0,f.__)("%1$s by %2$s"),(0,X.decodeEntities)(d),n),{span:(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),m?(0,r.createElement)(ce,{block:t}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},k||(0,X.decodeEntities)(o)),b&&!(u||p)&&(0,r.createElement)(Q.VisuallyHidden,null,(0,f.__)("Install block")))))},ue=()=>{},me=function({items:e,onHover:t=ue,onSelect:l}){const n=(0,Q.__unstableUseCompositeState)(),{installBlockType:o}=(0,i.useDispatch)(G);return e.length?(0,r.createElement)(Q.__unstableComposite,{...n,role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,f.__)("Blocks available for install")},e.map((e=>(0,r.createElement)(de,{key:e.id,composite:n,onClick:()=>{(0,c.getBlockType)(e.name)?l(e):o(e).then((t=>{t&&l(e)})),t(null)},onHover:t,item:e})))):null},pe=window.wp.a11y,be=function({children:e,downloadableItems:t,hasLocalBlocks:l}){const n=t.length;return(0,r.useEffect)((()=>{(0,pe.speak)((0,f.sprintf)( /* translators: %d: number of available blocks. */ (0,f._n)("%d additional block is available to install.","%d additional blocks are available to install.",n),n))}),[n]),(0,r.createElement)(r.Fragment,null,!l&&(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,f.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,r.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,f.__)("Available to install")),(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,f.__)("Select a block to install and add it to your post."))),e))},ke=(0,r.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(te.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),ge=function(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"block-editor-inserter__no-results"},(0,r.createElement)(ee,{className:"block-editor-inserter__no-results-icon",icon:ke}),(0,r.createElement)("p",null,(0,f.__)("No results found."))),(0,r.createElement)("div",{className:"block-editor-inserter__tips"},(0,r.createElement)(Q.Tip,null,(0,f.__)("Interested in creating your own block?"),(0,r.createElement)("br",null),(0,r.createElement)(Q.ExternalLink,{href:"https://developer.wordpress.org/block-editor/"},(0,f.__)("Get started here"),"."))))},_e=[],we=(0,Z.compose)([(0,i.withSelect)(((e,{filterValue:t,rootClientId:l=null})=>{const{getDownloadableBlocks:n,isRequestingDownloadableBlocks:o}=e(G),{canInsertBlockType:r}=e(m.store),a=e(J.store).canUser("read","block-directory/search");let s=a?function(e){const t=n(e),o=t.filter((e=>r(e,l,!0)));return t.length===o.length?t:o}(t):[];return 0===s.length&&(s=_e),{downloadableItems:s,hasPermission:a,isLoading:o(t)}}))])((function({downloadableItems:e,onSelect:t,onHover:l,hasLocalBlocks:n,hasPermission:o,isLoading:a,isTyping:s}){return void 0===o||a||s?(0,r.createElement)(r.Fragment,null,o&&!n&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,f.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,r.createElement)(Q.Spinner,null))):!1===o?n?null:(0,r.createElement)(ge,null):e.length?(0,r.createElement)(be,{downloadableItems:e,hasLocalBlocks:n},(0,r.createElement)(me,{items:e,onSelect:t,onHover:l})):!n&&(0,r.createElement)(ge,null)})),Ee=function(){const[e,t]=(0,r.useState)(""),l=(0,Z.debounce)(t,400);return(0,r.createElement)(m.__unstableInserterMenuExtension,null,(({onSelect:t,onHover:n,filterValue:o,hasItems:a,rootClientId:s})=>(e!==o&&l(o),e?(0,r.createElement)(we,{onSelect:t,onHover:n,rootClientId:s,filterValue:e,hasLocalBlocks:a,isTyping:o!==e}):null)))};function ye({items:e}){return e.length?(0,r.createElement)("ul",{className:"block-directory-compact-list"},e.map((({icon:e,id:t,title:l,author:n})=>(0,r.createElement)("li",{key:t,className:"block-directory-compact-list__item"},(0,r.createElement)(se,{icon:e,title:l}),(0,r.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,r.createElement)("div",{className:"block-directory-compact-list__item-title"},l),(0,r.createElement)("div",{className:"block-directory-compact-list__item-author"},(0,f.sprintf)( /* translators: %s: Name of the block author. */ (0,f.__)("By %s"),n))))))):null}var he;const{PluginPrePublishPanel:fe}=null!==(he=window?.wp?.editPost)&&void 0!==he?he:{};function ve(){const e=(0,i.useSelect)((e=>e(G).getNewBlockTypes()),[]);return e.length?(0,r.createElement)(fe,{icon:ke,title:(0,f.sprintf)(// translators: %d: number of blocks (number). (0,f._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},(0,r.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},(0,f._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),(0,r.createElement)(ye,{items:e})):null}function Be({attributes:e,block:t,clientId:l}){const n=(0,i.useSelect)((e=>e(G).isInstalling(t.id)),[t.id]),{installBlockType:o}=(0,i.useDispatch)(G),{replaceBlock:a}=(0,i.useDispatch)(m.store);return(0,r.createElement)(Q.Button,{onClick:()=>o(t).then((n=>{if(n){const n=(0,c.getBlockType)(t.name),[o]=(0,c.parse)(e.originalContent);o&&n&&a(l,(0,c.createBlock)(n.name,o.attributes,o.innerBlocks))}})),disabled:n,isBusy:n,variant:"primary"},(0,f.sprintf)( /* translators: %s: block name */ (0,f.__)("Install %s"),t.title))}const Ie=({originalBlock:e,...t})=>{const{originalName:l,originalUndelimitedContent:n,clientId:o}=t.attributes,{replaceBlock:a}=(0,i.useDispatch)(m.store),s=!!n,d=(0,i.useSelect)((e=>{const{canInsertBlockType:t,getBlockRootClientId:l}=e(m.store);return t("core/html",l(o))}),[o]);let u=(0,f.sprintf)( /* translators: %s: block name */ (0,f.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),e.title||l);const p=[(0,r.createElement)(Be,{key:"install",block:e,attributes:t.attributes,clientId:t.clientId})];return s&&d&&(u=(0,f.sprintf)( /* translators: %s: block name */ (0,f.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),e.title||l),p.push((0,r.createElement)(Q.Button,{key:"convert",onClick:()=>{a(t.clientId,(0,c.createBlock)("core/html",{content:n}))},variant:"tertiary"},(0,f.__)("Keep as HTML")))),(0,r.createElement)("div",{...(0,m.useBlockProps)()},(0,r.createElement)(m.Warning,{actions:p},u),(0,r.createElement)(r.RawHTML,null,n))};(0,a.registerPlugin)("block-directory",{render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(W,null),(0,r.createElement)(Ee,null),(0,r.createElement)(ve,null))}),(0,s.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>{return"core/missing"!==t||(e.edit=(l=e.edit,e=>{const{originalName:t}=e.attributes,{block:n,hasPermission:o}=(0,i.useSelect)((e=>{const{getDownloadableBlocks:l}=e(G),n=l("block:"+t).filter((({name:e})=>t===e));return{hasPermission:e(J.store).canUser("read","block-directory/search"),block:n.length&&n[0]}}),[t]);return o&&n?(0,r.createElement)(Ie,{...e,originalBlock:n}):(0,r.createElement)(l,{...e})})),e;var l})),(window.wp=window.wp||{}).blockDirectory=t})(); //# sourceMappingURL=index.min.js.map Depreciable Property: Meaning, Overview, FAQ – ICIE Fund

Depreciable Property: Meaning, Overview, FAQ

what is a depreciable asset

There are also special rules and limits for depreciation of listed property, including automobiles. Computers and related peripheral equipment are not included as listed property. For more information, refer to Publication 946, How to Depreciate Property. For certain qualified property acquired after September 27, 2017, and placed in service after December 31, 2022, and before January 1, 2024, you can elect to take a special depreciation allowance of 80%. This allowance is taken after any allowable Section 179 deduction and before any other depreciation is allowed.

Which Asset Does Not Depreciate?

These percentage tables are in Appendix A near the end of this publication. Under GDS, property is depreciated over one of the following recovery periods. The recovery period of property is the number of years over which you recover its cost or other basis. It is determined what is a depreciable asset based on the depreciation system (GDS or ADS) used. Qualified rent-to-own property is property held by a rent-to-own dealer for purposes of being subject to a rent-to-own contract. It is tangible personal property generally used in the home for personal use.

what is a depreciable asset

Depreciable Assets Quiz

On April 6, Sue Thorn bought a house to use as residential rental property. At that time, Sue began to advertise it for rent in the local newspaper. The house is considered placed in service in July when it was ready and available for rent.

what is a depreciable asset

Causes of Depreciation

what is a depreciable asset

Computer software is generally a section 197 intangible and cannot be depreciated if you acquired it in connection with the acquisition of assets constituting a business or a substantial part of a business. You may not be able to use MACRS for property you acquired and placed in service after 1986 if any of the situations described below apply. If you cannot use MACRS, the property must be depreciated under the methods discussed in Pub. You cannot depreciate a term interest in property created or acquired after July 27, 1989, for any period during which the remainder interest is held, directly or indirectly, by a person related to you. A term interest in property means a life interest in property, an interest in property for a term of years, or an income interest in a trust. However, if you buy technical books, journals, or information services for use in your business that have a useful life of 1 year or less, you cannot depreciate them.

For example, if a property is ready to rent on July 1, depreciation begins on that date, and the first year’s deduction is prorated based on the number of months the property was in service. It is an accelerated depreciation method in which the asset is allocated a larger percentage of its depreciation in its initial years than later. At this point, the company has all the information it needs to calculate each year’s depreciation. This means that there is no curve to the amount of appreciation, whether that is an immediate 30% depreciation seen when driving new cars off the lot or an increased depreciation when an item is close to needing major repairs. It equals total depreciation ($45,000) divided by the useful life (15 years), or $3,000 per year. This asset’s salvage value is $500 and its useful life is 10 years.

Declining balance

Figure your depreciation deduction for the year you place the property in service by multiplying the depreciation for a full year by the percentage listed below for the quarter you place the property in service. If this convention applies, you deduct a half-year of depreciation for the first year and the last year that you depreciate the property. You deduct a full year of depreciation for any other year during the recovery period. You bought a building and land for $120,000 and placed it in service on March 8. The sales contract showed that the building cost $100,000 and the land cost $20,000. To help you figure your deduction under MACRS, the IRS has established percentage tables that incorporate the applicable convention and depreciation method.

  • You begin to claim depreciation when your property is placed in service for either use in a trade or business or the production of income.
  • Real estate can also experience economic depreciation when the market value of the property decreases.
  • A qualifying disposition is one that does not involve all the property, or the last item of property, remaining in a GAA and that is described by any of the following.
  • It is one of the few assets that cannot be depreciated because of its everlasting factor, meaning that its useful life is considered infinite.
  • Here are four common methods of calculating annual depreciation expenses, along with when it’s best to use them.
  • The numerator of the fraction is the number of months (including partial months) in the year that the property is considered in service.
  • So, if you use an accelerated depreciation method, then sell the property at a profit, the IRS makes an adjustment.
  • You multiply the depreciation for a full year by 4.5/12, or 0.375.
  • You can use this worksheet to help you figure your depreciation deduction using the percentage tables.
  • The following examples are provided to show you how to use the percentage tables.
  • See Depreciation After a Short Tax Year, later, for information on how to figure depreciation in later years.
  • Examples include a change in use resulting in a shorter recovery period and/or a more accelerated depreciation method or a change in use resulting in a longer recovery period and/or a less accelerated depreciation method.
  • The adjusted basis in the house when Nia changed its use was $178,000 ($160,000 + $20,000 − $2,000).

You use the amount you carry over to determine your section 179 deduction in the next year. Enter that amount on line 10 of your Form 4562 for the next year. In April, you bought a patent for $5,100 that is not a section 197 intangible. You depreciate the patent under the straight line method, using a 17-year useful life and no salvage value. You divide the $5,100 basis by 17 years to get your $300 yearly depreciation deduction.

what is a depreciable asset

A measure of an individual’s investment in property for tax purposes. The first section, Specific Depreciable Assets Used in All Business Activities, Except as Noted, generally lists assets used in all business activities. The second section, Depreciable Assets Used in the Following Activities, describes assets used only in certain activities. LITCs represent individuals whose income is below a certain level and who need to resolve tax problems with the IRS. LITCs can represent taxpayers in audits, appeals, and tax collection disputes before the IRS and in court. In addition, LITCs can provide information about taxpayer rights and responsibilities in different languages for individuals who speak English as a second language.

  • You can choose to use the income forecast method instead of the straight line method to depreciate the following depreciable intangibles.
  • You can continue to depreciate the property until one of the following conditions until you have deducted your entire cost or other basis in the property or you retire the property from service.
  • With an online account, you can access a variety of information to help you during the filing season.
  • You must make the election on a timely filed return (including extensions) for the year of replacement.
  • The election, if made, applies to both the acquired property and the exchanged or involuntarily converted property.
  • Enterprises with an economic interest in mineral property or standing timber may recognize depletion expenses against those assets as they are used.

Create a Free Account and Ask Any Financial Question

A life interest in property, an interest in property for a term of years, or an income interest in a trust. It generally refers to a present or future interest in income from property or the right to use property that terminates or fails upon the lapse of time, the occurrence of an event, or the failure of an event to occur. Parts that together form an entire structure, such as a building. It also includes plumbing fixtures such as sinks, bathtubs, electrical wiring and lighting fixtures, and other parts that form the structure. The permanent withdrawal from use in a trade or business or from the production of income. Generally, for the section 179 deduction, a taxpayer is considered to conduct a trade or business actively if they meaningfully participate in the management or operations of the trade or business.

Leave a Comment

Your email address will not be published. Required fields are marked *

WE HAVE BECOME AVODA FUND

X